From 2a2ad35e856ec42ae0757c9930a2c0a004769f53 Mon Sep 17 00:00:00 2001 From: aagrawal3 Date: Thu, 7 Jul 2022 20:44:05 +0530 Subject: [PATCH] NSX-T Manager v0.2.0 release Signed-off-by: Ankit Agrawal --- services/nsxt-mp/nsx/AlarmsClient.go | 272 + services/nsxt-mp/nsx/AlarmsTypes.go | 421 + services/nsxt-mp/nsx/AssociationsClient.go | 106 + services/nsxt-mp/nsx/AssociationsTypes.go | 155 + .../nsx/AutomaticHealthCheckToggleClient.go | 130 + .../nsx/AutomaticHealthCheckToggleTypes.go | 110 + .../nsx/AutomaticHealthChecksClient.go | 98 + .../nsxt-mp/nsx/AutomaticHealthChecksTypes.go | 92 + services/nsxt-mp/nsx/BatchClient.go | 92 + services/nsxt-mp/nsx/BatchTypes.go | 73 + .../nsx/BridgeEndpointProfilesClient.go | 269 + .../nsx/BridgeEndpointProfilesTypes.go | 307 + services/nsxt-mp/nsx/BridgeEndpointsClient.go | 273 + services/nsxt-mp/nsx/BridgeEndpointsTypes.go | 319 + services/nsxt-mp/nsx/ClusterClient.go | 449 + services/nsxt-mp/nsx/ClusterProfilesClient.go | 275 + services/nsxt-mp/nsx/ClusterProfilesTypes.go | 313 + services/nsxt-mp/nsx/ClusterTypes.go | 584 + services/nsxt-mp/nsx/EdgeClustersClient.go | 310 + services/nsxt-mp/nsx/EdgeClustersTypes.go | 350 + services/nsxt-mp/nsx/ErrorResolverClient.go | 166 + services/nsxt-mp/nsx/ErrorResolverTypes.go | 160 + services/nsxt-mp/nsx/EventsClient.go | 218 + services/nsxt-mp/nsx/EventsTypes.go | 217 + services/nsxt-mp/nsx/FailureDomainsClient.go | 254 + services/nsxt-mp/nsx/FailureDomainsTypes.go | 265 + services/nsxt-mp/nsx/GlobalConfigsClient.go | 226 + services/nsxt-mp/nsx/GlobalConfigsTypes.go | 222 + .../nsxt-mp/nsx/HostSwitchProfilesClient.go | 281 + .../nsxt-mp/nsx/HostSwitchProfilesTypes.go | 352 + services/nsxt-mp/nsx/IpSetsClient.go | 315 + services/nsxt-mp/nsx/IpSetsTypes.go | 368 + .../nsx/IpfixCollectorProfilesClient.go | 267 + .../nsx/IpfixCollectorProfilesTypes.go | 301 + services/nsxt-mp/nsx/IpfixProfilesClient.go | 277 + services/nsxt-mp/nsx/IpfixProfilesTypes.go | 322 + services/nsxt-mp/nsx/LatencyProfilesClient.go | 265 + services/nsxt-mp/nsx/LatencyProfilesTypes.go | 295 + services/nsxt-mp/nsx/LicensesClient.go | 328 + services/nsxt-mp/nsx/LicensesTypes.go | 349 + services/nsxt-mp/nsx/LivetracesClient.go | 220 + services/nsxt-mp/nsx/LivetracesTypes.go | 240 + services/nsxt-mp/nsx/LogicalPortsClient.go | 287 + services/nsxt-mp/nsx/LogicalPortsTypes.go | 382 + .../nsxt-mp/nsx/LogicalRouterPortsClient.go | 281 + .../nsxt-mp/nsx/LogicalRouterPortsTypes.go | 346 + services/nsxt-mp/nsx/LogicalRoutersClient.go | 354 + services/nsxt-mp/nsx/LogicalRoutersTypes.go | 433 + services/nsxt-mp/nsx/LogicalSwitchesClient.go | 285 + services/nsxt-mp/nsx/LogicalSwitchesTypes.go | 382 + services/nsxt-mp/nsx/MacSetsClient.go | 268 + services/nsxt-mp/nsx/MacSetsTypes.go | 301 + .../nsxt-mp/nsx/ManualHealthChecksClient.go | 220 + .../nsxt-mp/nsx/ManualHealthChecksTypes.go | 240 + services/nsxt-mp/nsx/MdProxiesClient.go | 265 + services/nsxt-mp/nsx/MdProxiesTypes.go | 295 + services/nsxt-mp/nsx/MigrationClient.go | 79 + services/nsxt-mp/nsx/MigrationTypes.go | 61 + services/nsxt-mp/nsx/MirrorSessionsClient.go | 301 + services/nsxt-mp/nsx/MirrorSessionsTypes.go | 345 + services/nsxt-mp/nsx/NodeClient.go | 233 + services/nsxt-mp/nsx/NodeTypes.go | 244 + services/nsxt-mp/nsx/NormalizationsClient.go | 104 + services/nsxt-mp/nsx/NormalizationsTypes.go | 131 + .../nsxt-mp/nsx/NotificationWatchersClient.go | 254 + .../nsxt-mp/nsx/NotificationWatchersTypes.go | 265 + services/nsxt-mp/nsx/NsGroupsClient.go | 320 + services/nsxt-mp/nsx/NsGroupsTypes.go | 386 + services/nsxt-mp/nsx/NsProfilesClient.go | 269 + services/nsxt-mp/nsx/NsProfilesTypes.go | 307 + services/nsxt-mp/nsx/NsServiceGroupsClient.go | 271 + services/nsxt-mp/nsx/NsServiceGroupsTypes.go | 307 + services/nsxt-mp/nsx/NsServicesClient.go | 271 + services/nsxt-mp/nsx/NsServicesTypes.go | 307 + services/nsxt-mp/nsx/NsxPackageTypes.go | 11 + services/nsxt-mp/nsx/NvdsUrtClient.go | 112 + services/nsxt-mp/nsx/NvdsUrtTypes.go | 104 + services/nsxt-mp/nsx/ServiceConfigsClient.go | 267 + services/nsxt-mp/nsx/ServiceConfigsTypes.go | 301 + services/nsxt-mp/nsx/SitesClient.go | 207 + services/nsxt-mp/nsx/SitesTypes.go | 191 + .../nsxt-mp/nsx/SwitchingProfilesClient.go | 277 + .../nsxt-mp/nsx/SwitchingProfilesTypes.go | 313 + services/nsxt-mp/nsx/TasksClient.go | 147 + services/nsxt-mp/nsx/TasksTypes.go | 160 + services/nsxt-mp/nsx/TraceflowsClient.go | 222 + services/nsxt-mp/nsx/TraceflowsTypes.go | 246 + .../nsx/TransportNodeCollectionsClient.go | 299 + .../nsx/TransportNodeCollectionsTypes.go | 339 + .../nsx/TransportNodeProfilesClient.go | 277 + .../nsxt-mp/nsx/TransportNodeProfilesTypes.go | 331 + services/nsxt-mp/nsx/TransportNodesClient.go | 819 + services/nsxt-mp/nsx/TransportNodesTypes.go | 1126 + services/nsxt-mp/nsx/TransportZonesClient.go | 275 + services/nsxt-mp/nsx/TransportZonesTypes.go | 331 + .../nsx/TransportzoneProfilesClient.go | 275 + .../nsxt-mp/nsx/TransportzoneProfilesTypes.go | 307 + services/nsxt-mp/nsx/TrustManagementClient.go | 87 + services/nsxt-mp/nsx/TrustManagementTypes.go | 62 + services/nsxt-mp/nsx/UiViewsClient.go | 261 + services/nsxt-mp/nsx/UiViewsTypes.go | 283 + services/nsxt-mp/nsx/UpgradeClient.go | 194 + services/nsxt-mp/nsx/UpgradeTypes.go | 233 + services/nsxt-mp/nsx/aaa/AaaPackageTypes.go | 11 + .../nsx/aaa/FeaturesWithPropertiesClient.go | 87 + .../nsx/aaa/FeaturesWithPropertiesTypes.go | 62 + .../nsx/aaa/RegistrationTokenClient.go | 166 + .../nsxt-mp/nsx/aaa/RegistrationTokenTypes.go | 162 + .../nsxt-mp/nsx/aaa/RoleBindingsClient.go | 369 + services/nsxt-mp/nsx/aaa/RoleBindingsTypes.go | 632 + services/nsxt-mp/nsx/aaa/RolesClient.go | 299 + services/nsxt-mp/nsx/aaa/RolesTypes.go | 320 + .../aaa/RolesWithFeaturePermissionsClient.go | 98 + .../aaa/RolesWithFeaturePermissionsTypes.go | 92 + services/nsxt-mp/nsx/aaa/UserInfoClient.go | 90 + services/nsxt-mp/nsx/aaa/UserInfoTypes.go | 68 + services/nsxt-mp/nsx/aaa/vidm/GroupsClient.go | 100 + services/nsxt-mp/nsx/aaa/vidm/GroupsTypes.go | 98 + services/nsxt-mp/nsx/aaa/vidm/SearchClient.go | 100 + services/nsxt-mp/nsx/aaa/vidm/SearchTypes.go | 98 + services/nsxt-mp/nsx/aaa/vidm/UsersClient.go | 100 + services/nsxt-mp/nsx/aaa/vidm/UsersTypes.go | 98 + .../nsxt-mp/nsx/aaa/vidm/VidmPackageTypes.go | 11 + .../AdministrationPackageTypes.go | 11 + .../nsx/administration/AuditLogsClient.go | 97 + .../nsx/administration/AuditLogsTypes.go | 85 + .../administration/SupportBundlesClient.go | 129 + .../nsx/administration/SupportBundlesTypes.go | 122 + .../DynamicContentFiltersClient.go | 90 + .../DynamicContentFiltersTypes.go | 71 + .../SupportBundlesPackageTypes.go | 11 + .../AutomaticHealthChecksPackageTypes.go | 11 + .../TransportZonesClient.go | 90 + .../TransportZonesTypes.go | 69 + .../BridgeEndpointsPackageTypes.go | 11 + .../nsx/bridge_endpoints/StatisticsClient.go | 92 + .../nsx/bridge_endpoints/StatisticsTypes.go | 81 + .../nsx/bridge_endpoints/StatusClient.go | 92 + .../nsx/bridge_endpoints/StatusTypes.go | 81 + .../nsx/capacity/CapacityPackageTypes.go | 11 + .../nsxt-mp/nsx/capacity/ThresholdClient.go | 130 + .../nsxt-mp/nsx/capacity/ThresholdTypes.go | 110 + services/nsxt-mp/nsx/capacity/UsageClient.go | 102 + services/nsxt-mp/nsx/capacity/UsageTypes.go | 104 + .../nsx/cluster/ApiCertificateClient.go | 173 + .../nsx/cluster/ApiCertificateTypes.go | 160 + .../nsxt-mp/nsx/cluster/ApiServiceClient.go | 130 + .../nsxt-mp/nsx/cluster/ApiServiceTypes.go | 110 + .../nsxt-mp/nsx/cluster/ApiVirtualIpClient.go | 171 + .../nsxt-mp/nsx/cluster/ApiVirtualIpTypes.go | 154 + services/nsxt-mp/nsx/cluster/BackupsClient.go | 90 + services/nsxt-mp/nsx/cluster/BackupsTypes.go | 67 + .../nsx/cluster/ClusterPackageTypes.go | 11 + services/nsxt-mp/nsx/cluster/NodeClient.go | 79 + services/nsxt-mp/nsx/cluster/NodeTypes.go | 61 + services/nsxt-mp/nsx/cluster/NodesClient.go | 222 + services/nsxt-mp/nsx/cluster/NodesTypes.go | 249 + services/nsxt-mp/nsx/cluster/RestoreClient.go | 258 + services/nsxt-mp/nsx/cluster/RestoreTypes.go | 244 + services/nsxt-mp/nsx/cluster/StatusClient.go | 87 + services/nsxt-mp/nsx/cluster/StatusTypes.go | 62 + .../cluster/backups/BackupsPackageTypes.go | 11 + .../nsx/cluster/backups/ConfigClient.go | 134 + .../nsx/cluster/backups/ConfigTypes.go | 134 + .../nsx/cluster/backups/HistoryClient.go | 87 + .../nsx/cluster/backups/HistoryTypes.go | 62 + .../nsx/cluster/backups/OverviewClient.go | 104 + .../nsx/cluster/backups/OverviewTypes.go | 122 + .../nsx/cluster/backups/StatusClient.go | 87 + .../nsx/cluster/backups/StatusTypes.go | 62 + .../nsx/cluster/backups/UiFramesClient.go | 100 + .../nsx/cluster/backups/UiFramesTypes.go | 104 + .../nsx/cluster/nodes/DeploymentsClient.go | 211 + .../nsx/cluster/nodes/DeploymentsTypes.go | 216 + .../nsx/cluster/nodes/NodesPackageTypes.go | 11 + .../nsxt-mp/nsx/cluster/nodes/StatusClient.go | 132 + .../nsxt-mp/nsx/cluster/nodes/StatusTypes.go | 124 + .../deployments/DeploymentsPackageTypes.go | 11 + .../cluster/nodes/deployments/StatusClient.go | 90 + .../cluster/nodes/deployments/StatusTypes.go | 69 + .../cluster/nodes/network/InterfacesClient.go | 139 + .../cluster/nodes/network/InterfacesTypes.go | 150 + .../nodes/network/NetworkPackageTypes.go | 11 + .../interfaces/InterfacesPackageTypes.go | 11 + .../nodes/network/interfaces/StatsClient.go | 94 + .../nodes/network/interfaces/StatsTypes.go | 88 + .../nodes/repo_sync/RepoSyncPackageTypes.go | 11 + .../cluster/nodes/repo_sync/StatusClient.go | 90 + .../cluster/nodes/repo_sync/StatusTypes.go | 69 + .../cluster/restore/BackuptimestampsClient.go | 98 + .../cluster/restore/BackuptimestampsTypes.go | 92 + .../nsx/cluster/restore/ConfigClient.go | 130 + .../nsx/cluster/restore/ConfigTypes.go | 110 + .../restore/InstructionResourcesClient.go | 100 + .../restore/InstructionResourcesTypes.go | 98 + .../cluster/restore/RestorePackageTypes.go | 11 + .../nsx/cluster/restore/StatusClient.go | 90 + .../nsx/cluster/restore/StatusTypes.go | 74 + .../nsx/configs/ConfigsPackageTypes.go | 11 + .../nsxt-mp/nsx/configs/InventoryClient.go | 87 + .../nsxt-mp/nsx/configs/InventoryTypes.go | 62 + .../nsxt-mp/nsx/configs/ManagementClient.go | 130 + .../nsxt-mp/nsx/configs/ManagementTypes.go | 110 + .../CentralConfigPackageTypes.go | 11 + .../NodeConfigProfilesClient.go | 177 + .../central_config/NodeConfigProfilesTypes.go | 173 + .../nsxt-mp/nsx/configs/node/ModeClient.go | 90 + .../nsxt-mp/nsx/configs/node/ModeTypes.go | 67 + .../nsx/configs/node/NodePackageTypes.go | 11 + services/nsxt-mp/nsx/dhcp/DhcpPackageTypes.go | 11 + .../nsxt-mp/nsx/dhcp/RelayProfilesClient.go | 265 + .../nsxt-mp/nsx/dhcp/RelayProfilesTypes.go | 295 + services/nsxt-mp/nsx/dhcp/RelaysClient.go | 265 + services/nsxt-mp/nsx/dhcp/RelaysTypes.go | 295 + .../nsxt-mp/nsx/dhcp/ServerProfilesClient.go | 310 + .../nsxt-mp/nsx/dhcp/ServerProfilesTypes.go | 350 + services/nsxt-mp/nsx/dhcp/ServersClient.go | 265 + services/nsxt-mp/nsx/dhcp/ServersTypes.go | 295 + .../nsxt-mp/nsx/dhcp/servers/IpPoolsClient.go | 275 + .../nsxt-mp/nsx/dhcp/servers/IpPoolsTypes.go | 330 + .../nsx/dhcp/servers/Ipv6IpPoolsClient.go | 275 + .../nsx/dhcp/servers/Ipv6IpPoolsTypes.go | 330 + .../dhcp/servers/Ipv6StaticBindingsClient.go | 275 + .../dhcp/servers/Ipv6StaticBindingsTypes.go | 330 + .../nsxt-mp/nsx/dhcp/servers/LeasesClient.go | 136 + .../nsxt-mp/nsx/dhcp/servers/LeasesTypes.go | 155 + .../nsx/dhcp/servers/ServersPackageTypes.go | 11 + .../nsxt-mp/nsx/dhcp/servers/StateClient.go | 94 + .../nsxt-mp/nsx/dhcp/servers/StateTypes.go | 81 + .../nsx/dhcp/servers/StaticBindingsClient.go | 275 + .../nsx/dhcp/servers/StaticBindingsTypes.go | 330 + .../nsx/dhcp/servers/StatisticsClient.go | 90 + .../nsx/dhcp/servers/StatisticsTypes.go | 69 + .../nsxt-mp/nsx/dhcp/servers/StatusClient.go | 90 + .../nsxt-mp/nsx/dhcp/servers/StatusTypes.go | 69 + .../servers/ip_pools/IpPoolsPackageTypes.go | 11 + .../nsx/dhcp/servers/ip_pools/StateClient.go | 96 + .../nsx/dhcp/servers/ip_pools/StateTypes.go | 88 + .../servers/static_bindings/StateClient.go | 96 + .../servers/static_bindings/StateTypes.go | 88 + .../StaticBindingsPackageTypes.go | 11 + .../nsx/directory/DirectoryPackageTypes.go | 11 + .../nsxt-mp/nsx/directory/DomainSizeClient.go | 92 + .../nsxt-mp/nsx/directory/DomainSizeTypes.go | 67 + .../nsxt-mp/nsx/directory/DomainsClient.go | 313 + .../nsxt-mp/nsx/directory/DomainsTypes.go | 372 + .../nsxt-mp/nsx/directory/LdapServerClient.go | 92 + .../nsxt-mp/nsx/directory/LdapServerTypes.go | 76 + .../nsxt-mp/nsx/directory/OrgUnitsClient.go | 90 + .../nsxt-mp/nsx/directory/OrgUnitsTypes.go | 67 + .../directory/domains/DomainsPackageTypes.go | 11 + .../nsx/directory/domains/GroupsClient.go | 102 + .../nsx/directory/domains/GroupsTypes.go | 105 + .../directory/domains/LdapServersClient.go | 315 + .../nsx/directory/domains/LdapServersTypes.go | 396 + .../nsx/directory/domains/OrgUnitsClient.go | 90 + .../nsx/directory/domains/OrgUnitsTypes.go | 69 + .../nsx/directory/domains/SyncStatsClient.go | 90 + .../nsx/directory/domains/SyncStatsTypes.go | 69 + .../domains/groups/GroupsPackageTypes.go | 11 + .../domains/groups/MemberGroupsClient.go | 102 + .../domains/groups/MemberGroupsTypes.go | 106 + services/nsxt-mp/nsx/dns/DnsPackageTypes.go | 11 + services/nsxt-mp/nsx/dns/ForwardersClient.go | 373 + services/nsxt-mp/nsx/dns/ForwardersTypes.go | 445 + .../nsx/dns/forwarders/FailedQueriesClient.go | 92 + .../nsx/dns/forwarders/FailedQueriesTypes.go | 75 + .../dns/forwarders/ForwardersPackageTypes.go | 11 + .../nsx/dns/forwarders/NslookupClient.go | 96 + .../nsx/dns/forwarders/NslookupTypes.go | 87 + .../nsxt-mp/nsx/dns/forwarders/StateClient.go | 94 + .../nsxt-mp/nsx/dns/forwarders/StateTypes.go | 81 + .../nsx/dns/forwarders/StatisticsClient.go | 90 + .../nsx/dns/forwarders/StatisticsTypes.go | 69 + .../nsx/dns/forwarders/StatusClient.go | 90 + .../nsxt-mp/nsx/dns/forwarders/StatusTypes.go | 69 + .../edge_clusters/AllocationStatusClient.go | 90 + .../edge_clusters/AllocationStatusTypes.go | 69 + .../edge_clusters/EdgeClustersPackageTypes.go | 11 + .../nsxt-mp/nsx/edge_clusters/StateClient.go | 94 + .../nsxt-mp/nsx/edge_clusters/StateTypes.go | 81 + .../nsxt-mp/nsx/edge_clusters/StatusClient.go | 92 + .../nsxt-mp/nsx/edge_clusters/StatusTypes.go | 81 + .../inter_site/InterSitePackageTypes.go | 11 + .../edge_clusters/inter_site/StatusClient.go | 90 + .../edge_clusters/inter_site/StatusTypes.go | 69 + services/nsxt-mp/nsx/eula/AcceptClient.go | 79 + services/nsxt-mp/nsx/eula/AcceptTypes.go | 61 + services/nsxt-mp/nsx/eula/AcceptanceClient.go | 87 + services/nsxt-mp/nsx/eula/AcceptanceTypes.go | 62 + services/nsxt-mp/nsx/eula/ContentClient.go | 100 + services/nsxt-mp/nsx/eula/ContentTypes.go | 98 + services/nsxt-mp/nsx/eula/EulaPackageTypes.go | 11 + .../CloudNativeServiceInstancesClient.go | 147 + .../CloudNativeServiceInstancesTypes.go | 160 + .../nsx/fabric/ComputeCollectionsClient.go | 195 + .../nsx/fabric/ComputeCollectionsTypes.go | 249 + .../nsx/fabric/ComputeManagersClient.go | 269 + .../nsx/fabric/ComputeManagersTypes.go | 307 + .../ContainerApplicationInstancesClient.go | 149 + .../ContainerApplicationInstancesTypes.go | 166 + .../nsx/fabric/ContainerApplicationsClient.go | 147 + .../nsx/fabric/ContainerApplicationsTypes.go | 160 + .../nsx/fabric/ContainerClusterNodesClient.go | 145 + .../nsx/fabric/ContainerClusterNodesTypes.go | 154 + .../nsx/fabric/ContainerClustersClient.go | 147 + .../nsx/fabric/ContainerClustersTypes.go | 226 + .../fabric/ContainerIngressPoliciesClient.go | 147 + .../fabric/ContainerIngressPoliciesTypes.go | 160 + .../fabric/ContainerNetworkPoliciesClient.go | 147 + .../fabric/ContainerNetworkPoliciesTypes.go | 160 + .../nsx/fabric/ContainerProjectsClient.go | 145 + .../nsx/fabric/ContainerProjectsTypes.go | 154 + .../nsx/fabric/DiscoveredNodesClient.go | 247 + .../nsx/fabric/DiscoveredNodesTypes.go | 307 + .../nsxt-mp/nsx/fabric/FabricPackageTypes.go | 11 + services/nsxt-mp/nsx/fabric/OstypesClient.go | 87 + services/nsxt-mp/nsx/fabric/OstypesTypes.go | 62 + .../nsx/fabric/PhysicalServersClient.go | 145 + .../nsx/fabric/PhysicalServersTypes.go | 172 + services/nsxt-mp/nsx/fabric/VifsClient.go | 106 + services/nsxt-mp/nsx/fabric/VifsTypes.go | 116 + .../nsx/fabric/VirtualMachinesClient.go | 214 + .../nsx/fabric/VirtualMachinesTypes.go | 260 + .../nsx/fabric/VirtualSwitchesClient.go | 110 + .../nsx/fabric/VirtualSwitchesTypes.go | 128 + .../ComputeCollectionsPackageTypes.go | 11 + .../compute_collections/MemberStatusClient.go | 90 + .../compute_collections/MemberStatusTypes.go | 69 + .../network/NetworkPackageTypes.go | 11 + .../network/PhysicalInterfacesClient.go | 90 + .../network/PhysicalInterfacesTypes.go | 69 + .../ComputeManagersPackageTypes.go | 11 + .../fabric/compute_managers/StateClient.go | 90 + .../nsx/fabric/compute_managers/StateTypes.go | 69 + .../fabric/compute_managers/StatusClient.go | 90 + .../fabric/compute_managers/StatusTypes.go | 69 + .../fabric/nodes/network/InterfacesClient.go | 94 + .../fabric/nodes/network/InterfacesTypes.go | 93 + .../nodes/network/NetworkPackageTypes.go | 11 + .../virtual_machines/ToolsInfoClient.go | 98 + .../fabric/virtual_machines/ToolsInfoTypes.go | 92 + .../VirtualMachinesPackageTypes.go | 11 + .../nsxt-mp/nsx/firewall/ExcludelistClient.go | 267 + .../nsxt-mp/nsx/firewall/ExcludelistTypes.go | 298 + .../nsx/firewall/FirewallPackageTypes.go | 11 + .../nsxt-mp/nsx/firewall/ProfilesClient.go | 273 + .../nsxt-mp/nsx/firewall/ProfilesTypes.go | 301 + services/nsxt-mp/nsx/firewall/RulesClient.go | 90 + services/nsxt-mp/nsx/firewall/RulesTypes.go | 69 + .../nsxt-mp/nsx/firewall/SectionsClient.go | 626 + .../nsxt-mp/nsx/firewall/SectionsTypes.go | 917 + services/nsxt-mp/nsx/firewall/StatsClient.go | 82 + services/nsxt-mp/nsx/firewall/StatsTypes.go | 76 + services/nsxt-mp/nsx/firewall/StatusClient.go | 310 + services/nsxt-mp/nsx/firewall/StatusTypes.go | 338 + .../nsx/firewall/rules/RulesPackageTypes.go | 11 + .../nsxt-mp/nsx/firewall/rules/StateClient.go | 94 + .../nsxt-mp/nsx/firewall/rules/StateTypes.go | 81 + .../nsx/firewall/sections/RulesClient.go | 397 + .../nsx/firewall/sections/RulesTypes.go | 579 + .../firewall/sections/SectionsPackageTypes.go | 11 + .../nsx/firewall/sections/StateClient.go | 94 + .../nsx/firewall/sections/StateTypes.go | 81 + .../nsx/firewall/sections/SummaryClient.go | 90 + .../nsx/firewall/sections/SummaryTypes.go | 74 + .../sections/rules/RulesPackageTypes.go | 11 + .../firewall/sections/rules/StatsClient.go | 139 + .../nsx/firewall/sections/rules/StatsTypes.go | 150 + .../nsx/idfw/IdfwComputeCollectionsClient.go | 222 + .../nsx/idfw/IdfwComputeCollectionsTypes.go | 247 + services/nsxt-mp/nsx/idfw/IdfwPackageTypes.go | 11 + .../nsx/idfw/MasterSwitchSettingClient.go | 130 + .../nsx/idfw/MasterSwitchSettingTypes.go | 110 + .../nsx/idfw/NsgroupVmDetailsClient.go | 90 + .../nsxt-mp/nsx/idfw/NsgroupVmDetailsTypes.go | 69 + .../idfw/StandaloneHostSwitchSettingClient.go | 130 + .../idfw/StandaloneHostSwitchSettingTypes.go | 110 + .../nsxt-mp/nsx/idfw/SystemStatsClient.go | 87 + services/nsxt-mp/nsx/idfw/SystemStatsTypes.go | 62 + .../nsxt-mp/nsx/idfw/UserSessionDataClient.go | 87 + .../nsxt-mp/nsx/idfw/UserSessionDataTypes.go | 62 + services/nsxt-mp/nsx/idfw/UserStatsClient.go | 90 + services/nsxt-mp/nsx/idfw/UserStatsTypes.go | 69 + services/nsxt-mp/nsx/idfw/VmStatsClient.go | 90 + services/nsxt-mp/nsx/idfw/VmStatsTypes.go | 69 + .../ComputeCollectionsPackageTypes.go | 11 + .../idfw/compute_collections/StatusClient.go | 130 + .../idfw/compute_collections/StatusTypes.go | 112 + .../transport_nodes/StatusClient.go | 90 + .../transport_nodes/StatusTypes.go | 69 + .../TransportNodesPackageTypes.go | 11 + .../idfw/transport_nodes/vms/StatusClient.go | 90 + .../idfw/transport_nodes/vms/StatusTypes.go | 69 + .../transport_nodes/vms/VmsPackageTypes.go | 11 + .../nsx/intelligence/HostConfigClient.go | 170 + .../nsx/intelligence/HostConfigTypes.go | 153 + .../intelligence/IntelligencePackageTypes.go | 11 + .../intelligence/nodes/DeploymentsClient.go | 211 + .../intelligence/nodes/DeploymentsTypes.go | 216 + .../intelligence/nodes/NodesPackageTypes.go | 11 + .../deployments/DeploymentsPackageTypes.go | 11 + .../nodes/deployments/StatusClient.go | 90 + .../nodes/deployments/StatusTypes.go | 69 + .../intrusion_services/AffectedUsersClient.go | 100 + .../intrusion_services/AffectedUsersTypes.go | 97 + .../intrusion_services/AffectedVmsClient.go | 100 + .../intrusion_services/AffectedVmsTypes.go | 97 + .../nsx/intrusion_services/IdsEventsClient.go | 90 + .../nsx/intrusion_services/IdsEventsTypes.go | 67 + .../intrusion_services/IdsSummaryClient.go | 100 + .../nsx/intrusion_services/IdsSummaryTypes.go | 97 + .../IntrusionServicesPackageTypes.go | 11 + .../nsx/intrusion_services/ProfilesClient.go | 90 + .../nsx/intrusion_services/ProfilesTypes.go | 69 + .../nsxt-mp/nsx/ip_sets/IpSetsPackageTypes.go | 11 + services/nsxt-mp/nsx/ip_sets/MembersClient.go | 90 + services/nsxt-mp/nsx/ip_sets/MembersTypes.go | 69 + .../nsx/ipfix/CollectorconfigsClient.go | 265 + .../nsx/ipfix/CollectorconfigsTypes.go | 295 + services/nsxt-mp/nsx/ipfix/ConfigsClient.go | 275 + services/nsxt-mp/nsx/ipfix/ConfigsTypes.go | 310 + .../nsxt-mp/nsx/ipfix/IpfixPackageTypes.go | 11 + .../nsxt-mp/nsx/ipv6/DadProfilesClient.go | 265 + services/nsxt-mp/nsx/ipv6/DadProfilesTypes.go | 295 + services/nsxt-mp/nsx/ipv6/Ipv6PackageTypes.go | 11 + .../nsxt-mp/nsx/ipv6/NdRaProfilesClient.go | 265 + .../nsxt-mp/nsx/ipv6/NdRaProfilesTypes.go | 295 + .../nsx/licenses/LicensesPackageTypes.go | 11 + .../nsx/licenses/LicensesUsageClient.go | 87 + .../nsx/licenses/LicensesUsageTypes.go | 62 + .../nsx/livetraces/LivetracesPackageTypes.go | 11 + .../nsxt-mp/nsx/livetraces/ResultsClient.go | 102 + .../nsxt-mp/nsx/livetraces/ResultsTypes.go | 114 + .../fabric_nodes/FabricNodesPackageTypes.go | 11 + .../nsx/lldp/fabric_nodes/InterfacesClient.go | 135 + .../nsx/lldp/fabric_nodes/InterfacesTypes.go | 126 + .../lldp/transport_nodes/InterfacesClient.go | 135 + .../lldp/transport_nodes/InterfacesTypes.go | 126 + .../TransportNodesPackageTypes.go | 11 + .../loadbalancer/ApplicationProfilesClient.go | 273 + .../loadbalancer/ApplicationProfilesTypes.go | 310 + .../loadbalancer/ClientSslProfilesClient.go | 265 + .../loadbalancer/ClientSslProfilesTypes.go | 295 + .../loadbalancer/LoadbalancerPackageTypes.go | 11 + .../nsx/loadbalancer/MonitorsClient.go | 273 + .../nsxt-mp/nsx/loadbalancer/MonitorsTypes.go | 322 + .../loadbalancer/NodeUsageSummaryClient.go | 90 + .../nsx/loadbalancer/NodeUsageSummaryTypes.go | 68 + .../loadbalancer/PersistenceProfilesClient.go | 273 + .../loadbalancer/PersistenceProfilesTypes.go | 310 + .../nsxt-mp/nsx/loadbalancer/PoolsClient.go | 312 + .../nsxt-mp/nsx/loadbalancer/PoolsTypes.go | 365 + .../nsxt-mp/nsx/loadbalancer/RulesClient.go | 265 + .../nsxt-mp/nsx/loadbalancer/RulesTypes.go | 295 + .../loadbalancer/ServerSslProfilesClient.go | 265 + .../loadbalancer/ServerSslProfilesTypes.go | 295 + .../nsx/loadbalancer/ServicesClient.go | 267 + .../nsxt-mp/nsx/loadbalancer/ServicesTypes.go | 301 + .../nsx/loadbalancer/UsagePerNodeClient.go | 91 + .../nsx/loadbalancer/UsagePerNodeTypes.go | 69 + .../nsx/loadbalancer/VirtualServersClient.go | 355 + .../nsx/loadbalancer/VirtualServersTypes.go | 404 + .../loadbalancer/services/DebugInfoClient.go | 90 + .../loadbalancer/services/DebugInfoTypes.go | 69 + .../services/ServicesPackageTypes.go | 11 + .../loadbalancer/services/StatisticsClient.go | 92 + .../loadbalancer/services/StatisticsTypes.go | 81 + .../nsx/loadbalancer/services/StatusClient.go | 96 + .../nsx/loadbalancer/services/StatusTypes.go | 93 + .../nsx/loadbalancer/services/UsageClient.go | 90 + .../nsx/loadbalancer/services/UsageTypes.go | 69 + .../services/pools/PoolsPackageTypes.go | 11 + .../services/pools/StatisticsClient.go | 139 + .../services/pools/StatisticsTypes.go | 150 + .../services/pools/StatusClient.go | 139 + .../services/pools/StatusTypes.go | 150 + .../virtual_servers/StatisticsClient.go | 139 + .../virtual_servers/StatisticsTypes.go | 150 + .../services/virtual_servers/StatusClient.go | 139 + .../services/virtual_servers/StatusTypes.go | 150 + .../VirtualServersPackageTypes.go | 11 + .../ssl/CiphersAndProtocolsClient.go | 98 + .../ssl/CiphersAndProtocolsTypes.go | 92 + .../nsx/loadbalancer/ssl/SslPackageTypes.go | 11 + .../nsx/logical_ports/ForwardingPathClient.go | 92 + .../nsx/logical_ports/ForwardingPathTypes.go | 75 + .../logical_ports/LogicalPortsPackageTypes.go | 11 + .../nsx/logical_ports/MacTableClient.go | 104 + .../nsx/logical_ports/MacTableTypes.go | 117 + .../nsxt-mp/nsx/logical_ports/StateClient.go | 90 + .../nsxt-mp/nsx/logical_ports/StateTypes.go | 69 + .../nsx/logical_ports/StatisticsClient.go | 92 + .../nsx/logical_ports/StatisticsTypes.go | 81 + .../nsxt-mp/nsx/logical_ports/StatusClient.go | 165 + .../nsxt-mp/nsx/logical_ports/StatusTypes.go | 247 + .../logical_router_ports/ArpTableClient.go | 104 + .../nsx/logical_router_ports/ArpTableTypes.go | 117 + .../LogicalRouterPortsPackageTypes.go | 11 + .../nsx/logical_router_ports/StateClient.go | 94 + .../nsx/logical_router_ports/StateTypes.go | 81 + .../logical_router_ports/StatisticsClient.go | 94 + .../logical_router_ports/StatisticsTypes.go | 87 + .../statistics/StatisticsPackageTypes.go | 11 + .../statistics/SummaryClient.go | 92 + .../statistics/SummaryTypes.go | 81 + .../LogicalRoutersPackageTypes.go | 11 + .../nsx/logical_routers/RoutingClient.go | 135 + .../nsx/logical_routers/RoutingTypes.go | 124 + .../nsx/logical_routers/StateClient.go | 94 + .../nsxt-mp/nsx/logical_routers/StateTypes.go | 81 + .../nsx/logical_routers/StatusClient.go | 92 + .../nsx/logical_routers/StatusTypes.go | 81 + .../logical_routers/nat/NatPackageTypes.go | 11 + .../nsx/logical_routers/nat/RulesClient.go | 322 + .../nsx/logical_routers/nat/RulesTypes.go | 400 + .../nat/rules/RulesPackageTypes.go | 11 + .../nat/rules/StatisticsClient.go | 139 + .../nat/rules/StatisticsTypes.go | 150 + .../routing/AdvertisementClient.go | 135 + .../routing/AdvertisementTypes.go | 124 + .../routing/BfdConfigClient.go | 135 + .../logical_routers/routing/BfdConfigTypes.go | 124 + .../nsx/logical_routers/routing/BgpClient.go | 135 + .../nsx/logical_routers/routing/BgpTypes.go | 124 + .../routing/ForwardingTableClient.go | 106 + .../routing/ForwardingTableTypes.go | 123 + .../routing/IpPrefixListsClient.go | 275 + .../routing/IpPrefixListsTypes.go | 330 + .../routing/RedistributionClient.go | 135 + .../routing/RedistributionTypes.go | 124 + .../routing/RouteMapsClient.go | 275 + .../logical_routers/routing/RouteMapsTypes.go | 330 + .../routing/RouteTableClient.go | 104 + .../routing/RouteTableTypes.go | 117 + .../routing/RoutingPackageTypes.go | 11 + .../routing/RoutingTableClient.go | 110 + .../routing/RoutingTableTypes.go | 153 + .../routing/StaticRoutesClient.go | 275 + .../routing/StaticRoutesTypes.go | 330 + .../AdvertisementPackageTypes.go | 11 + .../routing/advertisement/RulesClient.go | 135 + .../routing/advertisement/RulesTypes.go | 124 + .../routing/bgp/BgpPackageTypes.go | 11 + .../routing/bgp/CommunityListsClient.go | 275 + .../routing/bgp/CommunityListsTypes.go | 330 + .../routing/bgp/CommuntyListsClient.go | 94 + .../routing/bgp/CommuntyListsTypes.go | 81 + .../routing/bgp/NeighborsClient.go | 367 + .../routing/bgp/NeighborsTypes.go | 453 + .../bgp/neighbors/AdvertisedRoutesClient.go | 92 + .../bgp/neighbors/AdvertisedRoutesTypes.go | 76 + .../bgp/neighbors/NeighborsPackageTypes.go | 11 + .../routing/bgp/neighbors/RoutesClient.go | 92 + .../routing/bgp/neighbors/RoutesTypes.go | 76 + .../routing/bgp/neighbors/StatusClient.go | 104 + .../routing/bgp/neighbors/StatusTypes.go | 117 + .../RedistributionPackageTypes.go | 11 + .../routing/redistribution/RulesClient.go | 135 + .../routing/redistribution/RulesTypes.go | 124 + .../routing/static_routes/BfdPeersClient.go | 277 + .../routing/static_routes/BfdPeersTypes.go | 336 + .../static_routes/StaticRoutesPackageTypes.go | 11 + .../ServiceClusterPackageTypes.go | 11 + .../service_cluster/StateClient.go | 94 + .../service_cluster/StateTypes.go | 81 + .../LogicalSwitchesPackageTypes.go | 11 + .../nsx/logical_switches/MacTableClient.go | 104 + .../nsx/logical_switches/MacTableTypes.go | 117 + .../nsx/logical_switches/StateClient.go | 133 + .../nsx/logical_switches/StateTypes.go | 130 + .../nsx/logical_switches/StatisticsClient.go | 92 + .../nsx/logical_switches/StatisticsTypes.go | 81 + .../nsx/logical_switches/StatusClient.go | 116 + .../nsx/logical_switches/StatusTypes.go | 179 + .../nsx/logical_switches/SummaryClient.go | 90 + .../nsx/logical_switches/SummaryTypes.go | 69 + .../nsx/logical_switches/VtepTableClient.go | 104 + .../nsx/logical_switches/VtepTableTypes.go | 117 + .../InterSiteForwarderPackageTypes.go | 11 + .../SiteSpanInfoClient.go | 90 + .../inter_site_forwarder/SiteSpanInfoTypes.go | 69 + .../inter_site_forwarder/StatisticsClient.go | 90 + .../inter_site_forwarder/StatisticsTypes.go | 69 + .../inter_site_forwarder/StatusClient.go | 92 + .../inter_site_forwarder/StatusTypes.go | 81 + .../nsx/mac_sets/MacSetsPackageTypes.go | 11 + .../nsxt-mp/nsx/mac_sets/MembersClient.go | 173 + services/nsxt-mp/nsx/mac_sets/MembersTypes.go | 181 + .../nsx/md_proxies/MdProxiesPackageTypes.go | 11 + .../nsx/md_proxies/StatisticsClient.go | 94 + .../nsxt-mp/nsx/md_proxies/StatisticsTypes.go | 87 + .../nsxt-mp/nsx/md_proxies/StatusClient.go | 92 + .../nsxt-mp/nsx/md_proxies/StatusTypes.go | 76 + services/nsxt-mp/nsx/migration/DataClient.go | 130 + services/nsxt-mp/nsx/migration/DataTypes.go | 156 + .../nsx/migration/DiscoveredSwitchesClient.go | 99 + .../nsx/migration/DiscoveredSwitchesTypes.go | 94 + .../nsx/migration/FeedbackRequestsClient.go | 111 + .../nsx/migration/FeedbackRequestsTypes.go | 145 + .../nsx/migration/FeedbackResponseClient.go | 123 + .../nsx/migration/FeedbackResponseTypes.go | 138 + .../nsx/migration/FeedbackSummaryClient.go | 101 + .../nsx/migration/FeedbackSummaryTypes.go | 106 + .../GroupedFeedbackRequestsClient.go | 111 + .../migration/GroupedFeedbackRequestsTypes.go | 145 + .../nsx/migration/MigratedResourcesClient.go | 102 + .../nsx/migration/MigratedResourcesTypes.go | 179 + .../nsx/migration/MigratedSwitchesClient.go | 99 + .../nsx/migration/MigratedSwitchesTypes.go | 94 + .../nsx/migration/MigrationPackageTypes.go | 11 + .../migration/MigrationUnitGroupsClient.go | 356 + .../MigrationUnitGroupsStatusClient.go | 100 + .../MigrationUnitGroupsStatusTypes.go | 98 + .../nsx/migration/MigrationUnitGroupsTypes.go | 429 + .../nsx/migration/MigrationUnitsClient.go | 153 + .../migration/MigrationUnitsStatsClient.go | 100 + .../nsx/migration/MigrationUnitsStatsTypes.go | 98 + .../nsx/migration/MigrationUnitsTypes.go | 178 + .../nsxt-mp/nsx/migration/MpToPolicyClient.go | 83 + .../nsxt-mp/nsx/migration/MpToPolicyTypes.go | 67 + services/nsxt-mp/nsx/migration/NodesClient.go | 102 + .../nsx/migration/NodesSummaryClient.go | 87 + .../nsx/migration/NodesSummaryTypes.go | 62 + services/nsxt-mp/nsx/migration/NodesTypes.go | 104 + services/nsxt-mp/nsx/migration/PlanClient.go | 323 + services/nsxt-mp/nsx/migration/PlanTypes.go | 380 + services/nsxt-mp/nsx/migration/SetupClient.go | 243 + services/nsxt-mp/nsx/migration/SetupTypes.go | 274 + .../nsx/migration/StatusSummaryClient.go | 90 + .../nsx/migration/StatusSummaryTypes.go | 68 + .../nsxt-mp/nsx/migration/SummaryClient.go | 87 + .../nsxt-mp/nsx/migration/SummaryTypes.go | 62 + .../nsxt-mp/nsx/migration/SwitchClient.go | 132 + services/nsxt-mp/nsx/migration/SwitchTypes.go | 114 + .../nsxt-mp/nsx/migration/VmgroupClient.go | 119 + .../nsxt-mp/nsx/migration/VmgroupTypes.go | 115 + .../LogicalConstructsPackageTypes.go | 11 + .../logical_constructs/StatsClient.go | 98 + .../logical_constructs/StatsTypes.go | 92 + .../AggregateInfoClient.go | 104 + .../AggregateInfoTypes.go | 110 + .../MigrationUnitClient.go | 87 + .../MigrationUnitGroupsPackageTypes.go | 11 + .../MigrationUnitTypes.go | 81 + .../migration_unit_groups/StatusClient.go | 102 + .../migration_unit_groups/StatusTypes.go | 105 + .../migration_units/AggregateInfoClient.go | 108 + .../migration_units/AggregateInfoTypes.go | 131 + .../MigrationUnitsPackageTypes.go | 11 + .../mp_policy_promotion/HistoryClient.go | 87 + .../mp_policy_promotion/HistoryTypes.go | 62 + .../MpPolicyPromotionPackageTypes.go | 11 + .../mp_policy_promotion/StateClient.go | 87 + .../mp_policy_promotion/StateTypes.go | 62 + .../migration/mp_to_policy/CancelClient.go | 79 + .../nsx/migration/mp_to_policy/CancelTypes.go | 61 + .../migration/mp_to_policy/FeedbackClient.go | 106 + .../migration/mp_to_policy/FeedbackTypes.go | 122 + .../mp_to_policy/MpToPolicyPackageTypes.go | 11 + .../nsx/migration/mp_to_policy/StatsClient.go | 92 + .../nsx/migration/mp_to_policy/StatsTypes.go | 80 + .../nsx/migration/plan/PlanPackageTypes.go | 11 + .../nsx/migration/plan/SettingsClient.go | 135 + .../nsx/migration/plan/SettingsTypes.go | 124 + .../plan/SiteMigrationStateClient.go | 87 + .../migration/plan/SiteMigrationStateTypes.go | 62 + .../MirrorSessionsPackageTypes.go | 11 + .../MirrorStackStatusClient.go | 100 + .../mirror_sessions/MirrorStackStatusTypes.go | 99 + .../nsxt-mp/nsx/model/ModelPackageTypes.go | 100187 +++++++++++++++ .../nsxt-mp/nsx/node/CentralConfigClient.go | 130 + .../nsxt-mp/nsx/node/CentralConfigTypes.go | 110 + services/nsxt-mp/nsx/node/CoreDumpsClient.go | 126 + services/nsxt-mp/nsx/node/CoreDumpsTypes.go | 117 + services/nsxt-mp/nsx/node/FileStoreClient.go | 289 + services/nsxt-mp/nsx/node/FileStoreTypes.go | 320 + services/nsxt-mp/nsx/node/LogsClient.go | 130 + services/nsxt-mp/nsx/node/LogsTypes.go | 112 + .../nsxt-mp/nsx/node/ManagementPlaneClient.go | 163 + .../nsxt-mp/nsx/node/ManagementPlaneTypes.go | 153 + services/nsxt-mp/nsx/node/ModeClient.go | 87 + services/nsxt-mp/nsx/node/ModeTypes.go | 62 + services/nsxt-mp/nsx/node/MpaConfigClient.go | 163 + services/nsxt-mp/nsx/node/MpaConfigTypes.go | 153 + services/nsxt-mp/nsx/node/NetworkClient.go | 87 + services/nsxt-mp/nsx/node/NetworkTypes.go | 62 + services/nsxt-mp/nsx/node/NodePackageTypes.go | 11 + services/nsxt-mp/nsx/node/ProcessesClient.go | 130 + services/nsxt-mp/nsx/node/ProcessesTypes.go | 112 + services/nsxt-mp/nsx/node/ServicesClient.go | 87 + services/nsxt-mp/nsx/node/ServicesTypes.go | 62 + services/nsxt-mp/nsx/node/StatusClient.go | 127 + services/nsxt-mp/nsx/node/StatusTypes.go | 105 + services/nsxt-mp/nsx/node/TasksClient.go | 218 + services/nsxt-mp/nsx/node/TasksTypes.go | 254 + services/nsxt-mp/nsx/node/UpgradeClient.go | 92 + services/nsxt-mp/nsx/node/UpgradeTypes.go | 74 + services/nsxt-mp/nsx/node/UsersClient.go | 342 + services/nsxt-mp/nsx/node/UsersTypes.go | 375 + services/nsxt-mp/nsx/node/VersionClient.go | 87 + services/nsxt-mp/nsx/node/VersionTypes.go | 62 + .../nsxt-mp/nsx/node/aaa/AaaPackageTypes.go | 11 + .../nsxt-mp/nsx/node/aaa/AuthPolicyClient.go | 130 + .../nsxt-mp/nsx/node/aaa/AuthPolicyTypes.go | 110 + .../aaa/providers/ProvidersPackageTypes.go | 11 + .../nsx/node/aaa/providers/VidmClient.go | 130 + .../nsx/node/aaa/providers/VidmTypes.go | 110 + .../node/aaa/providers/vidm/StatusClient.go | 87 + .../node/aaa/providers/vidm/StatusTypes.go | 62 + .../aaa/providers/vidm/VidmPackageTypes.go | 11 + .../node/file_store/FileStorePackageTypes.go | 11 + .../nsx/node/file_store/ThumbprintClient.go | 90 + .../nsx/node/file_store/ThumbprintTypes.go | 69 + .../HardeningPolicyPackageTypes.go | 11 + .../MandatoryAccessControlClient.go | 130 + .../MandatoryAccessControlTypes.go | 110 + .../node/intelligence/FormFactorsClient.go | 87 + .../nsx/node/intelligence/FormFactorsTypes.go | 62 + .../intelligence/IntelligencePackageTypes.go | 11 + .../nsx/node/network/InterfacesClient.go | 175 + .../nsx/node/network/InterfacesTypes.go | 167 + .../nsx/node/network/NameServersClient.go | 131 + .../nsx/node/network/NameServersTypes.go | 110 + .../nsx/node/network/NetworkPackageTypes.go | 11 + .../nsxt-mp/nsx/node/network/RoutesClient.go | 210 + .../nsxt-mp/nsx/node/network/RoutesTypes.go | 210 + .../nsx/node/network/SearchDomainsClient.go | 131 + .../nsx/node/network/SearchDomainsTypes.go | 110 + .../interfaces/InterfacesPackageTypes.go | 11 + .../node/network/interfaces/StatsClient.go | 90 + .../nsx/node/network/interfaces/StatsTypes.go | 69 + .../nsx/node/services/ApplianceproxyClient.go | 207 + .../nsx/node/services/ApplianceproxyTypes.go | 191 + .../node/services/AsyncReplicatorClient.go | 250 + .../nsx/node/services/AsyncReplicatorTypes.go | 239 + .../nsx/node/services/ClusterManagerClient.go | 207 + .../nsx/node/services/ClusterManagerTypes.go | 191 + .../nsx/node/services/CmInventoryClient.go | 207 + .../nsx/node/services/CmInventoryTypes.go | 191 + .../nsx/node/services/ControllerClient.go | 207 + .../nsx/node/services/ControllerTypes.go | 191 + .../nsxt-mp/nsx/node/services/HttpClient.go | 272 + .../nsxt-mp/nsx/node/services/HttpTypes.go | 288 + .../nsx/node/services/IdpsReportingClient.go | 207 + .../nsx/node/services/IdpsReportingTypes.go | 191 + .../nsx/node/services/InstallUpgradeClient.go | 254 + .../nsx/node/services/InstallUpgradeTypes.go | 239 + .../nsx/node/services/LiagentClient.go | 207 + .../nsxt-mp/nsx/node/services/LiagentTypes.go | 191 + .../nsx/node/services/ManagerClient.go | 283 + .../nsxt-mp/nsx/node/services/ManagerTypes.go | 282 + .../node/services/MessagingManagerClient.go | 207 + .../node/services/MessagingManagerTypes.go | 191 + .../services/MigrationCoordinatorClient.go | 207 + .../services/MigrationCoordinatorTypes.go | 191 + .../nsx/node/services/NodeMgmtClient.go | 120 + .../nsx/node/services/NodeMgmtTypes.go | 105 + .../nsx/node/services/NodeStatsClient.go | 207 + .../nsx/node/services/NodeStatsTypes.go | 191 + .../nsx/node/services/NsxMessageBusClient.go | 207 + .../nsx/node/services/NsxMessageBusTypes.go | 191 + .../node/services/NsxPlatformClientClient.go | 207 + .../node/services/NsxPlatformClientTypes.go | 191 + .../node/services/NsxUpgradeAgentClient.go | 207 + .../nsx/node/services/NsxUpgradeAgentTypes.go | 191 + .../nsxt-mp/nsx/node/services/NtpClient.go | 250 + .../nsxt-mp/nsx/node/services/NtpTypes.go | 239 + .../nsxt-mp/nsx/node/services/PolicyClient.go | 283 + .../nsxt-mp/nsx/node/services/PolicyTypes.go | 282 + .../nsxt-mp/nsx/node/services/SearchClient.go | 207 + .../nsxt-mp/nsx/node/services/SearchTypes.go | 191 + .../nsx/node/services/ServicesPackageTypes.go | 11 + .../nsxt-mp/nsx/node/services/SnmpClient.go | 254 + .../nsxt-mp/nsx/node/services/SnmpTypes.go | 245 + .../nsxt-mp/nsx/node/services/SshClient.go | 286 + .../nsxt-mp/nsx/node/services/SshTypes.go | 287 + .../nsxt-mp/nsx/node/services/SyslogClient.go | 207 + .../nsxt-mp/nsx/node/services/SyslogTypes.go | 191 + .../nsx/node/services/TelemetryClient.go | 207 + .../nsx/node/services/TelemetryTypes.go | 191 + .../nsx/node/services/UiServiceClient.go | 207 + .../nsx/node/services/UiServiceTypes.go | 191 + .../ApplianceproxyPackageTypes.go | 11 + .../services/applianceproxy/StatusClient.go | 87 + .../services/applianceproxy/StatusTypes.go | 62 + .../AsyncReplicatorPackageTypes.go | 11 + .../services/async_replicator/StatusClient.go | 87 + .../services/async_replicator/StatusTypes.go | 62 + .../ClusterManagerPackageTypes.go | 11 + .../services/cluster_manager/StatusClient.go | 87 + .../services/cluster_manager/StatusTypes.go | 62 + .../cm_inventory/CmInventoryPackageTypes.go | 11 + .../services/cm_inventory/StatusClient.go | 87 + .../node/services/cm_inventory/StatusTypes.go | 62 + .../controller/ControllerCertificateClient.go | 87 + .../controller/ControllerCertificateTypes.go | 62 + .../controller/ControllerPackageTypes.go | 11 + .../services/controller/ProfilerClient.go | 123 + .../node/services/controller/ProfilerTypes.go | 110 + .../node/services/controller/StatusClient.go | 87 + .../node/services/controller/StatusTypes.go | 62 + .../node/services/http/HttpPackageTypes.go | 11 + .../nsx/node/services/http/StatusClient.go | 87 + .../nsx/node/services/http/StatusTypes.go | 62 + .../IdpsReportingPackageTypes.go | 11 + .../services/idps_reporting/StatusClient.go | 87 + .../services/idps_reporting/StatusTypes.go | 62 + .../InstallUpgradePackageTypes.go | 11 + .../services/install_upgrade/StatusClient.go | 87 + .../services/install_upgrade/StatusTypes.go | 62 + .../services/install_upgrade/UcStateClient.go | 84 + .../services/install_upgrade/UcStateTypes.go | 67 + .../services/liagent/LiagentPackageTypes.go | 11 + .../nsx/node/services/liagent/StatusClient.go | 87 + .../nsx/node/services/liagent/StatusTypes.go | 62 + .../services/manager/ManagerPackageTypes.go | 11 + .../nsx/node/services/manager/StatusClient.go | 87 + .../nsx/node/services/manager/StatusTypes.go | 62 + .../MessagingManagerPackageTypes.go | 11 + .../messaging_manager/StatusClient.go | 87 + .../services/messaging_manager/StatusTypes.go | 62 + .../MigrationCoordinatorPackageTypes.go | 11 + .../migration_coordinator/StatusClient.go | 87 + .../migration_coordinator/StatusTypes.go | 62 + .../node_mgmt/NodeMgmtPackageTypes.go | 11 + .../node/services/node_mgmt/StatusClient.go | 87 + .../node/services/node_mgmt/StatusTypes.go | 62 + .../node_stats/NodeStatsPackageTypes.go | 11 + .../node/services/node_stats/StatusClient.go | 87 + .../node/services/node_stats/StatusTypes.go | 62 + .../NsxMessageBusPackageTypes.go | 11 + .../services/nsx_message_bus/StatusClient.go | 87 + .../services/nsx_message_bus/StatusTypes.go | 62 + .../NsxPlatformClientPackageTypes.go | 11 + .../nsx_platform_client/StatusClient.go | 87 + .../nsx_platform_client/StatusTypes.go | 62 + .../NsxUpgradeAgentPackageTypes.go | 11 + .../nsx_upgrade_agent/StatusClient.go | 87 + .../services/nsx_upgrade_agent/StatusTypes.go | 62 + .../nsx/node/services/ntp/NtpPackageTypes.go | 11 + .../nsx/node/services/ntp/StatusClient.go | 87 + .../nsx/node/services/ntp/StatusTypes.go | 62 + .../services/policy/PolicyPackageTypes.go | 11 + .../nsx/node/services/policy/StatusClient.go | 87 + .../nsx/node/services/policy/StatusTypes.go | 62 + .../services/search/SearchPackageTypes.go | 11 + .../nsx/node/services/search/StatusClient.go | 87 + .../nsx/node/services/search/StatusTypes.go | 62 + .../node/services/snmp/SnmpPackageTypes.go | 11 + .../nsx/node/services/snmp/StatusClient.go | 87 + .../nsx/node/services/snmp/StatusTypes.go | 62 + .../node/services/snmp/V3EngineIdClient.go | 130 + .../nsx/node/services/snmp/V3EngineIdTypes.go | 110 + .../nsx/node/services/ssh/NotifyMpaClient.go | 167 + .../nsx/node/services/ssh/NotifyMpaTypes.go | 148 + .../nsx/node/services/ssh/SshPackageTypes.go | 11 + .../nsx/node/services/ssh/StatusClient.go | 87 + .../nsx/node/services/ssh/StatusTypes.go | 62 + .../node/services/syslog/ExportersClient.go | 276 + .../node/services/syslog/ExportersTypes.go | 296 + .../nsx/node/services/syslog/StatusClient.go | 87 + .../nsx/node/services/syslog/StatusTypes.go | 62 + .../services/syslog/SyslogPackageTypes.go | 11 + .../node/services/telemetry/StatusClient.go | 87 + .../node/services/telemetry/StatusTypes.go | 62 + .../telemetry/TelemetryPackageTypes.go | 11 + .../node/services/ui_service/StatusClient.go | 87 + .../node/services/ui_service/StatusTypes.go | 62 + .../ui_service/UiServicePackageTypes.go | 11 + .../nsxt-mp/nsx/node/tasks/ResponseClient.go | 83 + .../nsxt-mp/nsx/node/tasks/ResponseTypes.go | 68 + .../nsx/node/tasks/TasksPackageTypes.go | 11 + .../nsx/node/upgrade/PerformtaskClient.go | 92 + .../nsx/node/upgrade/PerformtaskTypes.go | 73 + .../nsx/node/upgrade/ProgressStatusClient.go | 87 + .../nsx/node/upgrade/ProgressStatusTypes.go | 62 + .../nsx/node/upgrade/StatusSummaryClient.go | 87 + .../nsx/node/upgrade/StatusSummaryTypes.go | 62 + services/nsxt-mp/nsx/node/upgrade/UcClient.go | 83 + services/nsxt-mp/nsx/node/upgrade/UcTypes.go | 67 + .../nsx/node/upgrade/UpgradePackageTypes.go | 11 + .../nsxt-mp/nsx/node/users/SshKeysClient.go | 166 + .../nsxt-mp/nsx/node/users/SshKeysTypes.go | 179 + .../nsx/node/users/UsersPackageTypes.go | 11 + .../NotificationWatchersPackageTypes.go | 11 + .../NotificationsClient.go | 225 + .../NotificationsTypes.go | 234 + ...olidatedEffectiveIpAddressMembersClient.go | 104 + ...solidatedEffectiveIpAddressMembersTypes.go | 111 + ...CloudNativeServiceInstanceMembersClient.go | 100 + ...eCloudNativeServiceInstanceMembersTypes.go | 99 + .../EffectiveDirectoryGroupMembersClient.go | 100 + .../EffectiveDirectoryGroupMembersTypes.go | 99 + .../EffectiveIpAddressMembersClient.go | 100 + .../EffectiveIpAddressMembersTypes.go | 99 + .../ns_groups/EffectiveIpsetMembersClient.go | 100 + .../ns_groups/EffectiveIpsetMembersTypes.go | 99 + .../EffectiveLogicalPortMembersClient.go | 100 + .../EffectiveLogicalPortMembersTypes.go | 99 + .../EffectiveLogicalSwitchMembersClient.go | 100 + .../EffectiveLogicalSwitchMembersTypes.go | 99 + .../EffectivePhysicalServerMembersClient.go | 100 + .../EffectivePhysicalServerMembersTypes.go | 99 + .../EffectiveTransportNodeMembersClient.go | 100 + .../EffectiveTransportNodeMembersTypes.go | 99 + .../ns_groups/EffectiveVifMembersClient.go | 100 + .../nsx/ns_groups/EffectiveVifMembersTypes.go | 99 + .../EffectiveVirtualMachineMembersClient.go | 100 + .../EffectiveVirtualMachineMembersTypes.go | 99 + .../nsx/ns_groups/MemberTypesClient.go | 100 + .../nsxt-mp/nsx/ns_groups/MemberTypesTypes.go | 99 + .../nsx/ns_groups/NsGroupsPackageTypes.go | 11 + .../ns_groups/ServiceAssociationsClient.go | 105 + .../nsx/ns_groups/ServiceAssociationsTypes.go | 117 + .../UnassociatedVirtualMachinesClient.go | 106 + .../UnassociatedVirtualMachinesTypes.go | 116 + .../nsx/ns_profiles/AttributeTypesClient.go | 87 + .../nsx/ns_profiles/AttributeTypesTypes.go | 62 + .../nsx/ns_profiles/AttributesClient.go | 102 + .../nsx/ns_profiles/AttributesTypes.go | 113 + .../nsx/ns_profiles/NsProfilesPackageTypes.go | 11 + .../nsx/nvds_urt/NvdsUrtPackageTypes.go | 11 + .../nsx/nvds_urt/PrecheckByClustersClient.go | 92 + .../nsx/nvds_urt/PrecheckByClustersTypes.go | 73 + .../nsxt-mp/nsx/nvds_urt/PrecheckClient.go | 130 + .../nsxt-mp/nsx/nvds_urt/PrecheckTypes.go | 111 + .../nsx/nvds_urt/StatusSummaryClient.go | 92 + .../nsx/nvds_urt/StatusSummaryTypes.go | 75 + .../nsxt-mp/nsx/nvds_urt/TopologyClient.go | 143 + .../nsxt-mp/nsx/nvds_urt/TopologyTypes.go | 147 + .../nsxt-mp/nsx/pktcap/PktcapPackageTypes.go | 11 + services/nsxt-mp/nsx/pktcap/SessionClient.go | 262 + services/nsxt-mp/nsx/pktcap/SessionTypes.go | 267 + services/nsxt-mp/nsx/pktcap/SessionsClient.go | 127 + services/nsxt-mp/nsx/pktcap/SessionsTypes.go | 105 + services/nsxt-mp/nsx/pools/IpBlocksClient.go | 266 + services/nsxt-mp/nsx/pools/IpBlocksTypes.go | 295 + services/nsxt-mp/nsx/pools/IpPoolsClient.go | 315 + services/nsxt-mp/nsx/pools/IpPoolsTypes.go | 368 + services/nsxt-mp/nsx/pools/IpSubnetsClient.go | 271 + services/nsxt-mp/nsx/pools/IpSubnetsTypes.go | 313 + services/nsxt-mp/nsx/pools/MacPoolsClient.go | 141 + services/nsxt-mp/nsx/pools/MacPoolsTypes.go | 142 + .../nsxt-mp/nsx/pools/PoolsPackageTypes.go | 11 + services/nsxt-mp/nsx/pools/VniPoolsClient.go | 267 + services/nsxt-mp/nsx/pools/VniPoolsTypes.go | 301 + .../nsxt-mp/nsx/pools/VtepLabelPoolsClient.go | 141 + .../nsxt-mp/nsx/pools/VtepLabelPoolsTypes.go | 142 + .../nsx/pools/ip_pools/AllocationsClient.go | 90 + .../nsx/pools/ip_pools/AllocationsTypes.go | 69 + .../nsx/pools/ip_pools/IpPoolsPackageTypes.go | 11 + services/nsxt-mp/nsx/proxy/ConfigClient.go | 130 + services/nsxt-mp/nsx/proxy/ConfigTypes.go | 110 + .../nsxt-mp/nsx/proxy/ProxyPackageTypes.go | 11 + .../realization_state_barrier/ConfigClient.go | 130 + .../realization_state_barrier/ConfigTypes.go | 110 + .../CurrentClient.go | 127 + .../realization_state_barrier/CurrentTypes.go | 105 + .../RealizationStateBarrierPackageTypes.go | 11 + .../nsxt-mp/nsx/repository/BundlesClient.go | 178 + .../nsxt-mp/nsx/repository/BundlesTypes.go | 225 + .../nsx/repository/RepositoryPackageTypes.go | 11 + .../repository/bundles/BundlesPackageTypes.go | 11 + .../repository/bundles/OvfDeployInfoClient.go | 90 + .../repository/bundles/OvfDeployInfoTypes.go | 77 + .../repository/bundles/UploadAllowedClient.go | 90 + .../repository/bundles/UploadAllowedTypes.go | 77 + .../repository/bundles/UploadStatusClient.go | 92 + .../repository/bundles/UploadStatusTypes.go | 84 + services/nsxt-mp/nsx/search/DslClient.go | 100 + services/nsxt-mp/nsx/search/DslTypes.go | 98 + services/nsxt-mp/nsx/search/QueryClient.go | 100 + services/nsxt-mp/nsx/search/QueryTypes.go | 98 + .../nsxt-mp/nsx/search/SearchPackageTypes.go | 11 + .../nsx/service_configs/BatchClient.go | 90 + .../nsxt-mp/nsx/service_configs/BatchTypes.go | 67 + .../EffectiveProfilesClient.go | 104 + .../service_configs/EffectiveProfilesTypes.go | 128 + .../ServiceConfigsPackageTypes.go | 11 + .../nsx/serviceinsertion/ExcludelistClient.go | 216 + .../nsx/serviceinsertion/ExcludelistTypes.go | 207 + .../nsx/serviceinsertion/SectionsClient.go | 520 + .../nsx/serviceinsertion/SectionsTypes.go | 741 + .../ServiceAttachmentsClient.go | 254 + .../ServiceAttachmentsTypes.go | 265 + .../serviceinsertion/ServiceChainsClient.go | 209 + .../serviceinsertion/ServiceChainsTypes.go | 210 + .../ServiceInstancesClient.go | 92 + .../serviceinsertion/ServiceInstancesTypes.go | 74 + .../serviceinsertion/ServiceManagersClient.go | 254 + .../serviceinsertion/ServiceManagersTypes.go | 265 + .../ServiceinsertionPackageTypes.go | 11 + .../nsx/serviceinsertion/ServicesClient.go | 256 + .../nsx/serviceinsertion/ServicesTypes.go | 271 + .../serviceinsertion/SourceEntitiesClient.go | 90 + .../serviceinsertion/SourceEntitiesTypes.go | 68 + .../nsx/serviceinsertion/StatusClient.go | 175 + .../nsx/serviceinsertion/StatusTypes.go | 167 + .../serviceinsertion/sections/RulesClient.go | 389 + .../serviceinsertion/sections/RulesTypes.go | 555 + .../sections/SectionsPackageTypes.go | 11 + .../ServiceChainsPackageTypes.go | 11 + .../service_chains/ServicePathsClient.go | 100 + .../service_chains/ServicePathsTypes.go | 99 + .../services/ServiceDeploymentsClient.go | 307 + .../services/ServiceDeploymentsTypes.go | 368 + .../services/ServiceInstancesClient.go | 271 + .../services/ServiceInstancesTypes.go | 300 + .../services/ServiceProfilesClient.go | 222 + .../services/ServiceProfilesTypes.go | 238 + .../services/ServicesPackageTypes.go | 11 + .../services/SolutionConfigsClient.go | 265 + .../services/SolutionConfigsTypes.go | 300 + .../services/VendorTemplatesClient.go | 220 + .../services/VendorTemplatesTypes.go | 244 + .../ServiceDeploymentsPackageTypes.go | 11 + .../service_deployments/StateClient.go | 92 + .../service_deployments/StateTypes.go | 76 + .../service_deployments/StatusClient.go | 94 + .../service_deployments/StatusTypes.go | 88 + .../GroupAssociationsClient.go | 92 + .../GroupAssociationsTypes.go | 76 + .../InstanceEndpointsClient.go | 226 + .../InstanceEndpointsTypes.go | 266 + .../InstanceRuntimesClient.go | 250 + .../InstanceRuntimesTypes.go | 338 + .../ServiceInstancesPackageTypes.go | 11 + .../services/service_instances/StateClient.go | 92 + .../services/service_instances/StateTypes.go | 76 + .../service_instances/StatusClient.go | 94 + .../services/service_instances/StatusTypes.go | 88 + .../interfaces/InterfacesPackageTypes.go | 11 + .../interfaces/StatisticsClient.go | 98 + .../interfaces/StatisticsTypes.go | 102 + .../interfaces/StatusClient.go | 98 + .../interfaces/StatusTypes.go | 102 + .../service_profiles/NsgroupsClient.go | 92 + .../service_profiles/NsgroupsTypes.go | 76 + .../ServiceChainMappingsClient.go | 92 + .../ServiceChainMappingsTypes.go | 76 + .../ServiceProfilesPackageTypes.go | 11 + .../ExtendedSolutionConfigClient.go | 224 + .../ExtendedSolutionConfigTypes.go | 257 + .../SolutionConfigsPackageTypes.go | 11 + .../nsxt-mp/nsx/sites/CompatibilityClient.go | 87 + .../nsxt-mp/nsx/sites/CompatibilityTypes.go | 62 + services/nsxt-mp/nsx/sites/SelfClient.go | 87 + services/nsxt-mp/nsx/sites/SelfTypes.go | 62 + .../nsxt-mp/nsx/sites/SitesPackageTypes.go | 11 + services/nsxt-mp/nsx/sites/StatusClient.go | 87 + services/nsxt-mp/nsx/sites/StatusTypes.go | 62 + .../nsx/sites/SwitchoverStatusClient.go | 87 + .../nsx/sites/SwitchoverStatusTypes.go | 62 + .../CompatibilityPackageTypes.go | 11 + .../nsx/sites/compatibility/RemoteClient.go | 90 + .../nsx/sites/compatibility/RemoteTypes.go | 67 + .../nsx/switching_profiles/SummaryClient.go | 90 + .../nsx/switching_profiles/SummaryTypes.go | 69 + .../SwitchingProfilesPackageTypes.go | 11 + .../nsxt-mp/nsx/systemhealth/PluginsClient.go | 220 + .../nsxt-mp/nsx/systemhealth/PluginsTypes.go | 240 + .../nsx/systemhealth/ProfilesClient.go | 254 + .../nsxt-mp/nsx/systemhealth/ProfilesTypes.go | 265 + .../systemhealth/SystemhealthPackageTypes.go | 11 + .../appliances/latency/LatencyPackageTypes.go | 11 + .../appliances/latency/StatusClient.go | 141 + .../appliances/latency/StatusTypes.go | 142 + .../appliances/process/ProcessPackageTypes.go | 11 + .../appliances/process/StatusClient.go | 141 + .../appliances/process/StatusTypes.go | 142 + .../container_cluster/ncp/NcpPackageTypes.go | 11 + .../container_cluster/ncp/StatusClient.go | 222 + .../container_cluster/ncp/StatusTypes.go | 258 + .../plugins/PluginsPackageTypes.go | 11 + .../nsx/systemhealth/plugins/StatusClient.go | 90 + .../nsx/systemhealth/plugins/StatusTypes.go | 69 + .../container/agent/AgentPackageTypes.go | 11 + .../container/agent/StatusClient.go | 100 + .../container/agent/StatusTypes.go | 99 + .../hyperbus/HyperbusPackageTypes.go | 11 + .../container/hyperbus/StatusClient.go | 90 + .../container/hyperbus/StatusTypes.go | 69 + services/nsxt-mp/nsx/tasks/ResponseClient.go | 90 + services/nsxt-mp/nsx/tasks/ResponseTypes.go | 68 + .../nsxt-mp/nsx/tasks/TasksPackageTypes.go | 11 + .../nsxt-mp/nsx/telemetry/AgreementClient.go | 130 + .../nsxt-mp/nsx/telemetry/AgreementTypes.go | 110 + .../nsxt-mp/nsx/telemetry/ConfigClient.go | 130 + services/nsxt-mp/nsx/telemetry/ConfigTypes.go | 110 + .../nsx/telemetry/TelemetryPackageTypes.go | 11 + .../nsx/traceflows/ObservationsClient.go | 108 + .../nsx/traceflows/ObservationsTypes.go | 222 + .../nsx/traceflows/TraceflowsPackageTypes.go | 11 + .../transport_node_collections/StateClient.go | 90 + .../transport_node_collections/StateTypes.go | 69 + .../TransportNodeCollectionsPackageTypes.go | 11 + .../nsx/transport_nodes/CapabilitiesClient.go | 90 + .../nsx/transport_nodes/CapabilitiesTypes.go | 69 + .../nsx/transport_nodes/ModulesClient.go | 90 + .../nsx/transport_nodes/ModulesTypes.go | 69 + .../transport_nodes/PnicBondStatusClient.go | 92 + .../transport_nodes/PnicBondStatusTypes.go | 87 + .../RemoteTransportNodeStatusClient.go | 106 + .../RemoteTransportNodeStatusTypes.go | 183 + .../nsx/transport_nodes/StateClient.go | 137 + .../nsxt-mp/nsx/transport_nodes/StateTypes.go | 160 + .../nsx/transport_nodes/StatusClient.go | 135 + .../nsx/transport_nodes/StatusTypes.go | 136 + .../TransportNodesPackageTypes.go | 11 + .../nsx/transport_nodes/TunnelsClient.go | 155 + .../nsx/transport_nodes/TunnelsTypes.go | 258 + .../inter_site/InterSitePackageTypes.go | 11 + .../inter_site/StatisticsClient.go | 90 + .../inter_site/StatisticsTypes.go | 69 + .../inter_site/bgp/BgpPackageTypes.go | 11 + .../inter_site/bgp/NeighborsClient.go | 100 + .../inter_site/bgp/NeighborsTypes.go | 99 + .../inter_site/bgp/SummaryClient.go | 90 + .../inter_site/bgp/SummaryTypes.go | 69 + .../bgp/neighbors/AdvertisedRoutesClient.go | 92 + .../bgp/neighbors/AdvertisedRoutesTypes.go | 76 + .../bgp/neighbors/NeighborsPackageTypes.go | 11 + .../inter_site/bgp/neighbors/RoutesClient.go | 92 + .../inter_site/bgp/neighbors/RoutesTypes.go | 76 + .../network/InterfacesClient.go | 141 + .../network/InterfacesTypes.go | 162 + .../network/NetworkPackageTypes.go | 11 + .../interfaces/InterfacesPackageTypes.go | 11 + .../network/interfaces/StatsClient.go | 94 + .../network/interfaces/StatsTypes.go | 88 + .../statistics/NatRulesClient.go | 92 + .../statistics/NatRulesTypes.go | 81 + .../statistics/StatisticsPackageTypes.go | 11 + .../nsx/transport_zones/StatusClient.go | 132 + .../nsx/transport_zones/StatusTypes.go | 124 + .../nsx/transport_zones/SummaryClient.go | 90 + .../nsx/transport_zones/SummaryTypes.go | 69 + .../TransportNodeStatusClient.go | 159 + .../TransportNodeStatusTypes.go | 232 + .../TransportZonesPackageTypes.go | 11 + .../CertificateProfileClient.go | 90 + .../CertificateProfileTypes.go | 69 + .../CertificateProfilesClient.go | 87 + .../CertificateProfilesTypes.go | 62 + .../trust_management/CertificatesClient.go | 383 + .../nsx/trust_management/CertificatesTypes.go | 520 + .../CrlDistributionPointsClient.go | 265 + .../CrlDistributionPointsTypes.go | 295 + .../nsx/trust_management/CrlsClient.go | 271 + .../nsxt-mp/nsx/trust_management/CrlsTypes.go | 316 + .../nsx/trust_management/CsrsClient.go | 353 + .../trust_management/CsrsExtendedClient.go | 90 + .../nsx/trust_management/CsrsExtendedTypes.go | 67 + .../nsxt-mp/nsx/trust_management/CsrsTypes.go | 399 + .../nsx/trust_management/OidcUrisClient.go | 218 + .../nsx/trust_management/OidcUrisTypes.go | 214 + .../PrincipalIdentitiesClient.go | 252 + .../PrincipalIdentitiesTypes.go | 258 + .../TokenPrincipalIdentitiesClient.go | 209 + .../TokenPrincipalIdentitiesTypes.go | 210 + .../TrustManagementPackageTypes.go | 11 + .../CrlDistributionPointsPackageTypes.go | 11 + .../crl_distribution_points/StatusClient.go | 90 + .../crl_distribution_points/StatusTypes.go | 69 + .../PrincipalIdentitiesPackageTypes.go | 11 + .../WithCertificateClient.go | 90 + .../WithCertificateTypes.go | 67 + .../nsx/ui_views/UiViewsPackageTypes.go | 11 + .../ui_views/WidgetconfigurationsClient.go | 275 + .../nsx/ui_views/WidgetconfigurationsTypes.go | 312 + services/nsxt-mp/nsx/upgrade/BundlesClient.go | 170 + services/nsxt-mp/nsx/upgrade/BundlesTypes.go | 169 + .../nsx/upgrade/FunctionalStateClient.go | 87 + .../nsx/upgrade/FunctionalStateTypes.go | 62 + services/nsxt-mp/nsx/upgrade/HistoryClient.go | 87 + services/nsxt-mp/nsx/upgrade/HistoryTypes.go | 62 + services/nsxt-mp/nsx/upgrade/NodesClient.go | 102 + .../nsxt-mp/nsx/upgrade/NodesSummaryClient.go | 87 + .../nsxt-mp/nsx/upgrade/NodesSummaryTypes.go | 62 + services/nsxt-mp/nsx/upgrade/NodesTypes.go | 104 + services/nsxt-mp/nsx/upgrade/PlanClient.go | 262 + services/nsxt-mp/nsx/upgrade/PlanTypes.go | 306 + .../nsx/upgrade/StatusSummaryClient.go | 94 + .../nsxt-mp/nsx/upgrade/StatusSummaryTypes.go | 89 + services/nsxt-mp/nsx/upgrade/SummaryClient.go | 87 + services/nsxt-mp/nsx/upgrade/SummaryTypes.go | 62 + .../nsx/upgrade/UcUpgradeStatusClient.go | 87 + .../nsx/upgrade/UcUpgradeStatusTypes.go | 62 + .../nsx/upgrade/UpgradeChecksInfoClient.go | 100 + .../nsx/upgrade/UpgradeChecksInfoTypes.go | 98 + .../nsx/upgrade/UpgradePackageTypes.go | 11 + .../nsx/upgrade/UpgradeUnitGroupsClient.go | 356 + .../upgrade/UpgradeUnitGroupsStatusClient.go | 100 + .../upgrade/UpgradeUnitGroupsStatusTypes.go | 98 + .../nsx/upgrade/UpgradeUnitGroupsTypes.go | 429 + .../nsxt-mp/nsx/upgrade/UpgradeUnitsClient.go | 153 + .../nsx/upgrade/UpgradeUnitsStatsClient.go | 100 + .../nsx/upgrade/UpgradeUnitsStatsTypes.go | 98 + .../nsxt-mp/nsx/upgrade/UpgradeUnitsTypes.go | 178 + .../nsx/upgrade/VersionWhitelistClient.go | 168 + .../nsx/upgrade/VersionWhitelistTypes.go | 167 + .../upgrade/bundles/BundlesPackageTypes.go | 11 + .../nsx/upgrade/bundles/UploadStatusClient.go | 90 + .../nsx/upgrade/bundles/UploadStatusTypes.go | 69 + .../nsxt-mp/nsx/upgrade/eula/AcceptClient.go | 79 + .../nsxt-mp/nsx/upgrade/eula/AcceptTypes.go | 61 + .../nsx/upgrade/eula/AcceptanceClient.go | 87 + .../nsx/upgrade/eula/AcceptanceTypes.go | 62 + .../nsxt-mp/nsx/upgrade/eula/ContentClient.go | 100 + .../nsxt-mp/nsx/upgrade/eula/ContentTypes.go | 98 + .../nsx/upgrade/eula/EulaPackageTypes.go | 11 + .../nsx/upgrade/plan/PlanPackageTypes.go | 11 + .../nsx/upgrade/plan/SettingsClient.go | 135 + .../nsxt-mp/nsx/upgrade/plan/SettingsTypes.go | 124 + .../pre_upgrade_checks/FailuresClient.go | 106 + .../pre_upgrade_checks/FailuresTypes.go | 128 + .../PreUpgradeChecksPackageTypes.go | 11 + .../AggregateInfoClient.go | 104 + .../upgrade_unit_groups/AggregateInfoTypes.go | 110 + .../upgrade_unit_groups/StatusClient.go | 102 + .../upgrade_unit_groups/StatusTypes.go | 105 + .../upgrade_unit_groups/UpgradeUnitClient.go | 87 + .../UpgradeUnitGroupsPackageTypes.go | 11 + .../upgrade_unit_groups/UpgradeUnitTypes.go | 81 + .../upgrade_units/AggregateInfoClient.go | 110 + .../upgrade_units/AggregateInfoTypes.go | 137 + .../upgrade_units/UpgradeUnitsPackageTypes.go | 11 + .../nsx/vpn/ipsec/DpdProfilesClient.go | 267 + .../nsxt-mp/nsx/vpn/ipsec/DpdProfilesTypes.go | 301 + .../nsx/vpn/ipsec/IkeProfilesClient.go | 267 + .../nsxt-mp/nsx/vpn/ipsec/IkeProfilesTypes.go | 301 + .../nsx/vpn/ipsec/IpsecPackageTypes.go | 11 + .../nsx/vpn/ipsec/LocalEndpointsClient.go | 271 + .../nsx/vpn/ipsec/LocalEndpointsTypes.go | 313 + .../nsx/vpn/ipsec/PeerEndpointsClient.go | 310 + .../nsx/vpn/ipsec/PeerEndpointsTypes.go | 351 + .../nsxt-mp/nsx/vpn/ipsec/ServicesClient.go | 267 + .../nsxt-mp/nsx/vpn/ipsec/ServicesTypes.go | 301 + .../nsxt-mp/nsx/vpn/ipsec/SessionsClient.go | 279 + .../nsxt-mp/nsx/vpn/ipsec/SessionsTypes.go | 325 + .../nsx/vpn/ipsec/TunnelProfilesClient.go | 267 + .../nsx/vpn/ipsec/TunnelProfilesTypes.go | 301 + .../ipsec/sessions/SessionsPackageTypes.go | 11 + .../nsx/vpn/ipsec/sessions/StateClient.go | 94 + .../nsx/vpn/ipsec/sessions/StateTypes.go | 81 + .../vpn/ipsec/sessions/StatisticsClient.go | 128 + .../nsx/vpn/ipsec/sessions/StatisticsTypes.go | 131 + .../nsx/vpn/ipsec/sessions/StatusClient.go | 92 + .../nsx/vpn/ipsec/sessions/StatusTypes.go | 81 + .../nsx/vpn/ipsec/sessions/SummaryClient.go | 92 + .../nsx/vpn/ipsec/sessions/SummaryTypes.go | 80 + .../nsx/vpn/l2vpn/L2vpnPackageTypes.go | 11 + .../nsxt-mp/nsx/vpn/l2vpn/ServicesClient.go | 267 + .../nsxt-mp/nsx/vpn/l2vpn/ServicesTypes.go | 301 + .../nsxt-mp/nsx/vpn/l2vpn/SessionsClient.go | 267 + .../nsxt-mp/nsx/vpn/l2vpn/SessionsTypes.go | 301 + .../nsx/vpn/l2vpn/sessions/PeerCodesClient.go | 90 + .../nsx/vpn/l2vpn/sessions/PeerCodesTypes.go | 69 + .../nsx/vpn/l2vpn/sessions/RemoteMacClient.go | 92 + .../nsx/vpn/l2vpn/sessions/RemoteMacTypes.go | 75 + .../l2vpn/sessions/SessionsPackageTypes.go | 11 + .../vpn/l2vpn/sessions/StatisticsClient.go | 92 + .../nsx/vpn/l2vpn/sessions/StatisticsTypes.go | 81 + .../nsx/vpn/l2vpn/sessions/StatusClient.go | 92 + .../nsx/vpn/l2vpn/sessions/StatusTypes.go | 81 + .../nsx/vpn/l2vpn/sessions/SummaryClient.go | 90 + .../nsx/vpn/l2vpn/sessions/SummaryTypes.go | 74 + .../nsx/vpn/services/ServicesPackageTypes.go | 11 + .../nsxt-mp/nsx/vpn/services/SummaryClient.go | 92 + .../nsxt-mp/nsx/vpn/services/SummaryTypes.go | 81 + 1271 files changed, 274749 insertions(+) create mode 100644 services/nsxt-mp/nsx/AlarmsClient.go create mode 100644 services/nsxt-mp/nsx/AlarmsTypes.go create mode 100644 services/nsxt-mp/nsx/AssociationsClient.go create mode 100644 services/nsxt-mp/nsx/AssociationsTypes.go create mode 100644 services/nsxt-mp/nsx/AutomaticHealthCheckToggleClient.go create mode 100644 services/nsxt-mp/nsx/AutomaticHealthCheckToggleTypes.go create mode 100644 services/nsxt-mp/nsx/AutomaticHealthChecksClient.go create mode 100644 services/nsxt-mp/nsx/AutomaticHealthChecksTypes.go create mode 100644 services/nsxt-mp/nsx/BatchClient.go create mode 100644 services/nsxt-mp/nsx/BatchTypes.go create mode 100644 services/nsxt-mp/nsx/BridgeEndpointProfilesClient.go create mode 100644 services/nsxt-mp/nsx/BridgeEndpointProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/BridgeEndpointsClient.go create mode 100644 services/nsxt-mp/nsx/BridgeEndpointsTypes.go create mode 100644 services/nsxt-mp/nsx/ClusterClient.go create mode 100644 services/nsxt-mp/nsx/ClusterProfilesClient.go create mode 100644 services/nsxt-mp/nsx/ClusterProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/ClusterTypes.go create mode 100644 services/nsxt-mp/nsx/EdgeClustersClient.go create mode 100644 services/nsxt-mp/nsx/EdgeClustersTypes.go create mode 100644 services/nsxt-mp/nsx/ErrorResolverClient.go create mode 100644 services/nsxt-mp/nsx/ErrorResolverTypes.go create mode 100644 services/nsxt-mp/nsx/EventsClient.go create mode 100644 services/nsxt-mp/nsx/EventsTypes.go create mode 100644 services/nsxt-mp/nsx/FailureDomainsClient.go create mode 100644 services/nsxt-mp/nsx/FailureDomainsTypes.go create mode 100644 services/nsxt-mp/nsx/GlobalConfigsClient.go create mode 100644 services/nsxt-mp/nsx/GlobalConfigsTypes.go create mode 100644 services/nsxt-mp/nsx/HostSwitchProfilesClient.go create mode 100644 services/nsxt-mp/nsx/HostSwitchProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/IpSetsClient.go create mode 100644 services/nsxt-mp/nsx/IpSetsTypes.go create mode 100644 services/nsxt-mp/nsx/IpfixCollectorProfilesClient.go create mode 100644 services/nsxt-mp/nsx/IpfixCollectorProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/IpfixProfilesClient.go create mode 100644 services/nsxt-mp/nsx/IpfixProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/LatencyProfilesClient.go create mode 100644 services/nsxt-mp/nsx/LatencyProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/LicensesClient.go create mode 100644 services/nsxt-mp/nsx/LicensesTypes.go create mode 100644 services/nsxt-mp/nsx/LivetracesClient.go create mode 100644 services/nsxt-mp/nsx/LivetracesTypes.go create mode 100644 services/nsxt-mp/nsx/LogicalPortsClient.go create mode 100644 services/nsxt-mp/nsx/LogicalPortsTypes.go create mode 100644 services/nsxt-mp/nsx/LogicalRouterPortsClient.go create mode 100644 services/nsxt-mp/nsx/LogicalRouterPortsTypes.go create mode 100644 services/nsxt-mp/nsx/LogicalRoutersClient.go create mode 100644 services/nsxt-mp/nsx/LogicalRoutersTypes.go create mode 100644 services/nsxt-mp/nsx/LogicalSwitchesClient.go create mode 100644 services/nsxt-mp/nsx/LogicalSwitchesTypes.go create mode 100644 services/nsxt-mp/nsx/MacSetsClient.go create mode 100644 services/nsxt-mp/nsx/MacSetsTypes.go create mode 100644 services/nsxt-mp/nsx/ManualHealthChecksClient.go create mode 100644 services/nsxt-mp/nsx/ManualHealthChecksTypes.go create mode 100644 services/nsxt-mp/nsx/MdProxiesClient.go create mode 100644 services/nsxt-mp/nsx/MdProxiesTypes.go create mode 100644 services/nsxt-mp/nsx/MigrationClient.go create mode 100644 services/nsxt-mp/nsx/MigrationTypes.go create mode 100644 services/nsxt-mp/nsx/MirrorSessionsClient.go create mode 100644 services/nsxt-mp/nsx/MirrorSessionsTypes.go create mode 100644 services/nsxt-mp/nsx/NodeClient.go create mode 100644 services/nsxt-mp/nsx/NodeTypes.go create mode 100644 services/nsxt-mp/nsx/NormalizationsClient.go create mode 100644 services/nsxt-mp/nsx/NormalizationsTypes.go create mode 100644 services/nsxt-mp/nsx/NotificationWatchersClient.go create mode 100644 services/nsxt-mp/nsx/NotificationWatchersTypes.go create mode 100644 services/nsxt-mp/nsx/NsGroupsClient.go create mode 100644 services/nsxt-mp/nsx/NsGroupsTypes.go create mode 100644 services/nsxt-mp/nsx/NsProfilesClient.go create mode 100644 services/nsxt-mp/nsx/NsProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/NsServiceGroupsClient.go create mode 100644 services/nsxt-mp/nsx/NsServiceGroupsTypes.go create mode 100644 services/nsxt-mp/nsx/NsServicesClient.go create mode 100644 services/nsxt-mp/nsx/NsServicesTypes.go create mode 100644 services/nsxt-mp/nsx/NsxPackageTypes.go create mode 100644 services/nsxt-mp/nsx/NvdsUrtClient.go create mode 100644 services/nsxt-mp/nsx/NvdsUrtTypes.go create mode 100644 services/nsxt-mp/nsx/ServiceConfigsClient.go create mode 100644 services/nsxt-mp/nsx/ServiceConfigsTypes.go create mode 100644 services/nsxt-mp/nsx/SitesClient.go create mode 100644 services/nsxt-mp/nsx/SitesTypes.go create mode 100644 services/nsxt-mp/nsx/SwitchingProfilesClient.go create mode 100644 services/nsxt-mp/nsx/SwitchingProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/TasksClient.go create mode 100644 services/nsxt-mp/nsx/TasksTypes.go create mode 100644 services/nsxt-mp/nsx/TraceflowsClient.go create mode 100644 services/nsxt-mp/nsx/TraceflowsTypes.go create mode 100644 services/nsxt-mp/nsx/TransportNodeCollectionsClient.go create mode 100644 services/nsxt-mp/nsx/TransportNodeCollectionsTypes.go create mode 100644 services/nsxt-mp/nsx/TransportNodeProfilesClient.go create mode 100644 services/nsxt-mp/nsx/TransportNodeProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/TransportNodesClient.go create mode 100644 services/nsxt-mp/nsx/TransportNodesTypes.go create mode 100644 services/nsxt-mp/nsx/TransportZonesClient.go create mode 100644 services/nsxt-mp/nsx/TransportZonesTypes.go create mode 100644 services/nsxt-mp/nsx/TransportzoneProfilesClient.go create mode 100644 services/nsxt-mp/nsx/TransportzoneProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/TrustManagementClient.go create mode 100644 services/nsxt-mp/nsx/TrustManagementTypes.go create mode 100644 services/nsxt-mp/nsx/UiViewsClient.go create mode 100644 services/nsxt-mp/nsx/UiViewsTypes.go create mode 100644 services/nsxt-mp/nsx/UpgradeClient.go create mode 100644 services/nsxt-mp/nsx/UpgradeTypes.go create mode 100644 services/nsxt-mp/nsx/aaa/AaaPackageTypes.go create mode 100644 services/nsxt-mp/nsx/aaa/FeaturesWithPropertiesClient.go create mode 100644 services/nsxt-mp/nsx/aaa/FeaturesWithPropertiesTypes.go create mode 100644 services/nsxt-mp/nsx/aaa/RegistrationTokenClient.go create mode 100644 services/nsxt-mp/nsx/aaa/RegistrationTokenTypes.go create mode 100644 services/nsxt-mp/nsx/aaa/RoleBindingsClient.go create mode 100644 services/nsxt-mp/nsx/aaa/RoleBindingsTypes.go create mode 100644 services/nsxt-mp/nsx/aaa/RolesClient.go create mode 100644 services/nsxt-mp/nsx/aaa/RolesTypes.go create mode 100644 services/nsxt-mp/nsx/aaa/RolesWithFeaturePermissionsClient.go create mode 100644 services/nsxt-mp/nsx/aaa/RolesWithFeaturePermissionsTypes.go create mode 100644 services/nsxt-mp/nsx/aaa/UserInfoClient.go create mode 100644 services/nsxt-mp/nsx/aaa/UserInfoTypes.go create mode 100644 services/nsxt-mp/nsx/aaa/vidm/GroupsClient.go create mode 100644 services/nsxt-mp/nsx/aaa/vidm/GroupsTypes.go create mode 100644 services/nsxt-mp/nsx/aaa/vidm/SearchClient.go create mode 100644 services/nsxt-mp/nsx/aaa/vidm/SearchTypes.go create mode 100644 services/nsxt-mp/nsx/aaa/vidm/UsersClient.go create mode 100644 services/nsxt-mp/nsx/aaa/vidm/UsersTypes.go create mode 100644 services/nsxt-mp/nsx/aaa/vidm/VidmPackageTypes.go create mode 100644 services/nsxt-mp/nsx/administration/AdministrationPackageTypes.go create mode 100644 services/nsxt-mp/nsx/administration/AuditLogsClient.go create mode 100644 services/nsxt-mp/nsx/administration/AuditLogsTypes.go create mode 100644 services/nsxt-mp/nsx/administration/SupportBundlesClient.go create mode 100644 services/nsxt-mp/nsx/administration/SupportBundlesTypes.go create mode 100644 services/nsxt-mp/nsx/administration/support_bundles/DynamicContentFiltersClient.go create mode 100644 services/nsxt-mp/nsx/administration/support_bundles/DynamicContentFiltersTypes.go create mode 100644 services/nsxt-mp/nsx/administration/support_bundles/SupportBundlesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/automatic_health_checks/AutomaticHealthChecksPackageTypes.go create mode 100644 services/nsxt-mp/nsx/automatic_health_checks/TransportZonesClient.go create mode 100644 services/nsxt-mp/nsx/automatic_health_checks/TransportZonesTypes.go create mode 100644 services/nsxt-mp/nsx/bridge_endpoints/BridgeEndpointsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/bridge_endpoints/StatisticsClient.go create mode 100644 services/nsxt-mp/nsx/bridge_endpoints/StatisticsTypes.go create mode 100644 services/nsxt-mp/nsx/bridge_endpoints/StatusClient.go create mode 100644 services/nsxt-mp/nsx/bridge_endpoints/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/capacity/CapacityPackageTypes.go create mode 100644 services/nsxt-mp/nsx/capacity/ThresholdClient.go create mode 100644 services/nsxt-mp/nsx/capacity/ThresholdTypes.go create mode 100644 services/nsxt-mp/nsx/capacity/UsageClient.go create mode 100644 services/nsxt-mp/nsx/capacity/UsageTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/ApiCertificateClient.go create mode 100644 services/nsxt-mp/nsx/cluster/ApiCertificateTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/ApiServiceClient.go create mode 100644 services/nsxt-mp/nsx/cluster/ApiServiceTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/ApiVirtualIpClient.go create mode 100644 services/nsxt-mp/nsx/cluster/ApiVirtualIpTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/BackupsClient.go create mode 100644 services/nsxt-mp/nsx/cluster/BackupsTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/ClusterPackageTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/NodeClient.go create mode 100644 services/nsxt-mp/nsx/cluster/NodeTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/NodesClient.go create mode 100644 services/nsxt-mp/nsx/cluster/NodesTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/RestoreClient.go create mode 100644 services/nsxt-mp/nsx/cluster/RestoreTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/StatusClient.go create mode 100644 services/nsxt-mp/nsx/cluster/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/backups/BackupsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/backups/ConfigClient.go create mode 100644 services/nsxt-mp/nsx/cluster/backups/ConfigTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/backups/HistoryClient.go create mode 100644 services/nsxt-mp/nsx/cluster/backups/HistoryTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/backups/OverviewClient.go create mode 100644 services/nsxt-mp/nsx/cluster/backups/OverviewTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/backups/StatusClient.go create mode 100644 services/nsxt-mp/nsx/cluster/backups/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/backups/UiFramesClient.go create mode 100644 services/nsxt-mp/nsx/cluster/backups/UiFramesTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/nodes/DeploymentsClient.go create mode 100644 services/nsxt-mp/nsx/cluster/nodes/DeploymentsTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/nodes/NodesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/nodes/StatusClient.go create mode 100644 services/nsxt-mp/nsx/cluster/nodes/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/nodes/deployments/DeploymentsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/nodes/deployments/StatusClient.go create mode 100644 services/nsxt-mp/nsx/cluster/nodes/deployments/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/nodes/network/InterfacesClient.go create mode 100644 services/nsxt-mp/nsx/cluster/nodes/network/InterfacesTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/nodes/network/NetworkPackageTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/nodes/network/interfaces/InterfacesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/nodes/network/interfaces/StatsClient.go create mode 100644 services/nsxt-mp/nsx/cluster/nodes/network/interfaces/StatsTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/nodes/repo_sync/RepoSyncPackageTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/nodes/repo_sync/StatusClient.go create mode 100644 services/nsxt-mp/nsx/cluster/nodes/repo_sync/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/restore/BackuptimestampsClient.go create mode 100644 services/nsxt-mp/nsx/cluster/restore/BackuptimestampsTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/restore/ConfigClient.go create mode 100644 services/nsxt-mp/nsx/cluster/restore/ConfigTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/restore/InstructionResourcesClient.go create mode 100644 services/nsxt-mp/nsx/cluster/restore/InstructionResourcesTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/restore/RestorePackageTypes.go create mode 100644 services/nsxt-mp/nsx/cluster/restore/StatusClient.go create mode 100644 services/nsxt-mp/nsx/cluster/restore/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/configs/ConfigsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/configs/InventoryClient.go create mode 100644 services/nsxt-mp/nsx/configs/InventoryTypes.go create mode 100644 services/nsxt-mp/nsx/configs/ManagementClient.go create mode 100644 services/nsxt-mp/nsx/configs/ManagementTypes.go create mode 100644 services/nsxt-mp/nsx/configs/central_config/CentralConfigPackageTypes.go create mode 100644 services/nsxt-mp/nsx/configs/central_config/NodeConfigProfilesClient.go create mode 100644 services/nsxt-mp/nsx/configs/central_config/NodeConfigProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/configs/node/ModeClient.go create mode 100644 services/nsxt-mp/nsx/configs/node/ModeTypes.go create mode 100644 services/nsxt-mp/nsx/configs/node/NodePackageTypes.go create mode 100644 services/nsxt-mp/nsx/dhcp/DhcpPackageTypes.go create mode 100644 services/nsxt-mp/nsx/dhcp/RelayProfilesClient.go create mode 100644 services/nsxt-mp/nsx/dhcp/RelayProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/dhcp/RelaysClient.go create mode 100644 services/nsxt-mp/nsx/dhcp/RelaysTypes.go create mode 100644 services/nsxt-mp/nsx/dhcp/ServerProfilesClient.go create mode 100644 services/nsxt-mp/nsx/dhcp/ServerProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/dhcp/ServersClient.go create mode 100644 services/nsxt-mp/nsx/dhcp/ServersTypes.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/IpPoolsClient.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/IpPoolsTypes.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/Ipv6IpPoolsClient.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/Ipv6IpPoolsTypes.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/Ipv6StaticBindingsClient.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/Ipv6StaticBindingsTypes.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/LeasesClient.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/LeasesTypes.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/ServersPackageTypes.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/StateClient.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/StateTypes.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/StaticBindingsClient.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/StaticBindingsTypes.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/StatisticsClient.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/StatisticsTypes.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/StatusClient.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/ip_pools/IpPoolsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/ip_pools/StateClient.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/ip_pools/StateTypes.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/static_bindings/StateClient.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/static_bindings/StateTypes.go create mode 100644 services/nsxt-mp/nsx/dhcp/servers/static_bindings/StaticBindingsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/directory/DirectoryPackageTypes.go create mode 100644 services/nsxt-mp/nsx/directory/DomainSizeClient.go create mode 100644 services/nsxt-mp/nsx/directory/DomainSizeTypes.go create mode 100644 services/nsxt-mp/nsx/directory/DomainsClient.go create mode 100644 services/nsxt-mp/nsx/directory/DomainsTypes.go create mode 100644 services/nsxt-mp/nsx/directory/LdapServerClient.go create mode 100644 services/nsxt-mp/nsx/directory/LdapServerTypes.go create mode 100644 services/nsxt-mp/nsx/directory/OrgUnitsClient.go create mode 100644 services/nsxt-mp/nsx/directory/OrgUnitsTypes.go create mode 100644 services/nsxt-mp/nsx/directory/domains/DomainsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/directory/domains/GroupsClient.go create mode 100644 services/nsxt-mp/nsx/directory/domains/GroupsTypes.go create mode 100644 services/nsxt-mp/nsx/directory/domains/LdapServersClient.go create mode 100644 services/nsxt-mp/nsx/directory/domains/LdapServersTypes.go create mode 100644 services/nsxt-mp/nsx/directory/domains/OrgUnitsClient.go create mode 100644 services/nsxt-mp/nsx/directory/domains/OrgUnitsTypes.go create mode 100644 services/nsxt-mp/nsx/directory/domains/SyncStatsClient.go create mode 100644 services/nsxt-mp/nsx/directory/domains/SyncStatsTypes.go create mode 100644 services/nsxt-mp/nsx/directory/domains/groups/GroupsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/directory/domains/groups/MemberGroupsClient.go create mode 100644 services/nsxt-mp/nsx/directory/domains/groups/MemberGroupsTypes.go create mode 100644 services/nsxt-mp/nsx/dns/DnsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/dns/ForwardersClient.go create mode 100644 services/nsxt-mp/nsx/dns/ForwardersTypes.go create mode 100644 services/nsxt-mp/nsx/dns/forwarders/FailedQueriesClient.go create mode 100644 services/nsxt-mp/nsx/dns/forwarders/FailedQueriesTypes.go create mode 100644 services/nsxt-mp/nsx/dns/forwarders/ForwardersPackageTypes.go create mode 100644 services/nsxt-mp/nsx/dns/forwarders/NslookupClient.go create mode 100644 services/nsxt-mp/nsx/dns/forwarders/NslookupTypes.go create mode 100644 services/nsxt-mp/nsx/dns/forwarders/StateClient.go create mode 100644 services/nsxt-mp/nsx/dns/forwarders/StateTypes.go create mode 100644 services/nsxt-mp/nsx/dns/forwarders/StatisticsClient.go create mode 100644 services/nsxt-mp/nsx/dns/forwarders/StatisticsTypes.go create mode 100644 services/nsxt-mp/nsx/dns/forwarders/StatusClient.go create mode 100644 services/nsxt-mp/nsx/dns/forwarders/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/edge_clusters/AllocationStatusClient.go create mode 100644 services/nsxt-mp/nsx/edge_clusters/AllocationStatusTypes.go create mode 100644 services/nsxt-mp/nsx/edge_clusters/EdgeClustersPackageTypes.go create mode 100644 services/nsxt-mp/nsx/edge_clusters/StateClient.go create mode 100644 services/nsxt-mp/nsx/edge_clusters/StateTypes.go create mode 100644 services/nsxt-mp/nsx/edge_clusters/StatusClient.go create mode 100644 services/nsxt-mp/nsx/edge_clusters/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/edge_clusters/inter_site/InterSitePackageTypes.go create mode 100644 services/nsxt-mp/nsx/edge_clusters/inter_site/StatusClient.go create mode 100644 services/nsxt-mp/nsx/edge_clusters/inter_site/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/eula/AcceptClient.go create mode 100644 services/nsxt-mp/nsx/eula/AcceptTypes.go create mode 100644 services/nsxt-mp/nsx/eula/AcceptanceClient.go create mode 100644 services/nsxt-mp/nsx/eula/AcceptanceTypes.go create mode 100644 services/nsxt-mp/nsx/eula/ContentClient.go create mode 100644 services/nsxt-mp/nsx/eula/ContentTypes.go create mode 100644 services/nsxt-mp/nsx/eula/EulaPackageTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/CloudNativeServiceInstancesClient.go create mode 100644 services/nsxt-mp/nsx/fabric/CloudNativeServiceInstancesTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/ComputeCollectionsClient.go create mode 100644 services/nsxt-mp/nsx/fabric/ComputeCollectionsTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/ComputeManagersClient.go create mode 100644 services/nsxt-mp/nsx/fabric/ComputeManagersTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/ContainerApplicationInstancesClient.go create mode 100644 services/nsxt-mp/nsx/fabric/ContainerApplicationInstancesTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/ContainerApplicationsClient.go create mode 100644 services/nsxt-mp/nsx/fabric/ContainerApplicationsTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/ContainerClusterNodesClient.go create mode 100644 services/nsxt-mp/nsx/fabric/ContainerClusterNodesTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/ContainerClustersClient.go create mode 100644 services/nsxt-mp/nsx/fabric/ContainerClustersTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/ContainerIngressPoliciesClient.go create mode 100644 services/nsxt-mp/nsx/fabric/ContainerIngressPoliciesTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/ContainerNetworkPoliciesClient.go create mode 100644 services/nsxt-mp/nsx/fabric/ContainerNetworkPoliciesTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/ContainerProjectsClient.go create mode 100644 services/nsxt-mp/nsx/fabric/ContainerProjectsTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/DiscoveredNodesClient.go create mode 100644 services/nsxt-mp/nsx/fabric/DiscoveredNodesTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/FabricPackageTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/OstypesClient.go create mode 100644 services/nsxt-mp/nsx/fabric/OstypesTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/PhysicalServersClient.go create mode 100644 services/nsxt-mp/nsx/fabric/PhysicalServersTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/VifsClient.go create mode 100644 services/nsxt-mp/nsx/fabric/VifsTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/VirtualMachinesClient.go create mode 100644 services/nsxt-mp/nsx/fabric/VirtualMachinesTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/VirtualSwitchesClient.go create mode 100644 services/nsxt-mp/nsx/fabric/VirtualSwitchesTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/compute_collections/ComputeCollectionsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/compute_collections/MemberStatusClient.go create mode 100644 services/nsxt-mp/nsx/fabric/compute_collections/MemberStatusTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/compute_collections/network/NetworkPackageTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/compute_collections/network/PhysicalInterfacesClient.go create mode 100644 services/nsxt-mp/nsx/fabric/compute_collections/network/PhysicalInterfacesTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/compute_managers/ComputeManagersPackageTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/compute_managers/StateClient.go create mode 100644 services/nsxt-mp/nsx/fabric/compute_managers/StateTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/compute_managers/StatusClient.go create mode 100644 services/nsxt-mp/nsx/fabric/compute_managers/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/nodes/network/InterfacesClient.go create mode 100644 services/nsxt-mp/nsx/fabric/nodes/network/InterfacesTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/nodes/network/NetworkPackageTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/virtual_machines/ToolsInfoClient.go create mode 100644 services/nsxt-mp/nsx/fabric/virtual_machines/ToolsInfoTypes.go create mode 100644 services/nsxt-mp/nsx/fabric/virtual_machines/VirtualMachinesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/firewall/ExcludelistClient.go create mode 100644 services/nsxt-mp/nsx/firewall/ExcludelistTypes.go create mode 100644 services/nsxt-mp/nsx/firewall/FirewallPackageTypes.go create mode 100644 services/nsxt-mp/nsx/firewall/ProfilesClient.go create mode 100644 services/nsxt-mp/nsx/firewall/ProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/firewall/RulesClient.go create mode 100644 services/nsxt-mp/nsx/firewall/RulesTypes.go create mode 100644 services/nsxt-mp/nsx/firewall/SectionsClient.go create mode 100644 services/nsxt-mp/nsx/firewall/SectionsTypes.go create mode 100644 services/nsxt-mp/nsx/firewall/StatsClient.go create mode 100644 services/nsxt-mp/nsx/firewall/StatsTypes.go create mode 100644 services/nsxt-mp/nsx/firewall/StatusClient.go create mode 100644 services/nsxt-mp/nsx/firewall/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/firewall/rules/RulesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/firewall/rules/StateClient.go create mode 100644 services/nsxt-mp/nsx/firewall/rules/StateTypes.go create mode 100644 services/nsxt-mp/nsx/firewall/sections/RulesClient.go create mode 100644 services/nsxt-mp/nsx/firewall/sections/RulesTypes.go create mode 100644 services/nsxt-mp/nsx/firewall/sections/SectionsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/firewall/sections/StateClient.go create mode 100644 services/nsxt-mp/nsx/firewall/sections/StateTypes.go create mode 100644 services/nsxt-mp/nsx/firewall/sections/SummaryClient.go create mode 100644 services/nsxt-mp/nsx/firewall/sections/SummaryTypes.go create mode 100644 services/nsxt-mp/nsx/firewall/sections/rules/RulesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/firewall/sections/rules/StatsClient.go create mode 100644 services/nsxt-mp/nsx/firewall/sections/rules/StatsTypes.go create mode 100644 services/nsxt-mp/nsx/idfw/IdfwComputeCollectionsClient.go create mode 100644 services/nsxt-mp/nsx/idfw/IdfwComputeCollectionsTypes.go create mode 100644 services/nsxt-mp/nsx/idfw/IdfwPackageTypes.go create mode 100644 services/nsxt-mp/nsx/idfw/MasterSwitchSettingClient.go create mode 100644 services/nsxt-mp/nsx/idfw/MasterSwitchSettingTypes.go create mode 100644 services/nsxt-mp/nsx/idfw/NsgroupVmDetailsClient.go create mode 100644 services/nsxt-mp/nsx/idfw/NsgroupVmDetailsTypes.go create mode 100644 services/nsxt-mp/nsx/idfw/StandaloneHostSwitchSettingClient.go create mode 100644 services/nsxt-mp/nsx/idfw/StandaloneHostSwitchSettingTypes.go create mode 100644 services/nsxt-mp/nsx/idfw/SystemStatsClient.go create mode 100644 services/nsxt-mp/nsx/idfw/SystemStatsTypes.go create mode 100644 services/nsxt-mp/nsx/idfw/UserSessionDataClient.go create mode 100644 services/nsxt-mp/nsx/idfw/UserSessionDataTypes.go create mode 100644 services/nsxt-mp/nsx/idfw/UserStatsClient.go create mode 100644 services/nsxt-mp/nsx/idfw/UserStatsTypes.go create mode 100644 services/nsxt-mp/nsx/idfw/VmStatsClient.go create mode 100644 services/nsxt-mp/nsx/idfw/VmStatsTypes.go create mode 100644 services/nsxt-mp/nsx/idfw/compute_collections/ComputeCollectionsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/idfw/compute_collections/StatusClient.go create mode 100644 services/nsxt-mp/nsx/idfw/compute_collections/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/idfw/compute_collections/transport_nodes/StatusClient.go create mode 100644 services/nsxt-mp/nsx/idfw/compute_collections/transport_nodes/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/idfw/compute_collections/transport_nodes/TransportNodesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/idfw/transport_nodes/vms/StatusClient.go create mode 100644 services/nsxt-mp/nsx/idfw/transport_nodes/vms/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/idfw/transport_nodes/vms/VmsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/intelligence/HostConfigClient.go create mode 100644 services/nsxt-mp/nsx/intelligence/HostConfigTypes.go create mode 100644 services/nsxt-mp/nsx/intelligence/IntelligencePackageTypes.go create mode 100644 services/nsxt-mp/nsx/intelligence/nodes/DeploymentsClient.go create mode 100644 services/nsxt-mp/nsx/intelligence/nodes/DeploymentsTypes.go create mode 100644 services/nsxt-mp/nsx/intelligence/nodes/NodesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/intelligence/nodes/deployments/DeploymentsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/intelligence/nodes/deployments/StatusClient.go create mode 100644 services/nsxt-mp/nsx/intelligence/nodes/deployments/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/intrusion_services/AffectedUsersClient.go create mode 100644 services/nsxt-mp/nsx/intrusion_services/AffectedUsersTypes.go create mode 100644 services/nsxt-mp/nsx/intrusion_services/AffectedVmsClient.go create mode 100644 services/nsxt-mp/nsx/intrusion_services/AffectedVmsTypes.go create mode 100644 services/nsxt-mp/nsx/intrusion_services/IdsEventsClient.go create mode 100644 services/nsxt-mp/nsx/intrusion_services/IdsEventsTypes.go create mode 100644 services/nsxt-mp/nsx/intrusion_services/IdsSummaryClient.go create mode 100644 services/nsxt-mp/nsx/intrusion_services/IdsSummaryTypes.go create mode 100644 services/nsxt-mp/nsx/intrusion_services/IntrusionServicesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/intrusion_services/ProfilesClient.go create mode 100644 services/nsxt-mp/nsx/intrusion_services/ProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/ip_sets/IpSetsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/ip_sets/MembersClient.go create mode 100644 services/nsxt-mp/nsx/ip_sets/MembersTypes.go create mode 100644 services/nsxt-mp/nsx/ipfix/CollectorconfigsClient.go create mode 100644 services/nsxt-mp/nsx/ipfix/CollectorconfigsTypes.go create mode 100644 services/nsxt-mp/nsx/ipfix/ConfigsClient.go create mode 100644 services/nsxt-mp/nsx/ipfix/ConfigsTypes.go create mode 100644 services/nsxt-mp/nsx/ipfix/IpfixPackageTypes.go create mode 100644 services/nsxt-mp/nsx/ipv6/DadProfilesClient.go create mode 100644 services/nsxt-mp/nsx/ipv6/DadProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/ipv6/Ipv6PackageTypes.go create mode 100644 services/nsxt-mp/nsx/ipv6/NdRaProfilesClient.go create mode 100644 services/nsxt-mp/nsx/ipv6/NdRaProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/licenses/LicensesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/licenses/LicensesUsageClient.go create mode 100644 services/nsxt-mp/nsx/licenses/LicensesUsageTypes.go create mode 100644 services/nsxt-mp/nsx/livetraces/LivetracesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/livetraces/ResultsClient.go create mode 100644 services/nsxt-mp/nsx/livetraces/ResultsTypes.go create mode 100644 services/nsxt-mp/nsx/lldp/fabric_nodes/FabricNodesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/lldp/fabric_nodes/InterfacesClient.go create mode 100644 services/nsxt-mp/nsx/lldp/fabric_nodes/InterfacesTypes.go create mode 100644 services/nsxt-mp/nsx/lldp/transport_nodes/InterfacesClient.go create mode 100644 services/nsxt-mp/nsx/lldp/transport_nodes/InterfacesTypes.go create mode 100644 services/nsxt-mp/nsx/lldp/transport_nodes/TransportNodesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/ApplicationProfilesClient.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/ApplicationProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/ClientSslProfilesClient.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/ClientSslProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/LoadbalancerPackageTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/MonitorsClient.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/MonitorsTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/NodeUsageSummaryClient.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/NodeUsageSummaryTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/PersistenceProfilesClient.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/PersistenceProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/PoolsClient.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/PoolsTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/RulesClient.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/RulesTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/ServerSslProfilesClient.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/ServerSslProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/ServicesClient.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/ServicesTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/UsagePerNodeClient.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/UsagePerNodeTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/VirtualServersClient.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/VirtualServersTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/services/DebugInfoClient.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/services/DebugInfoTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/services/ServicesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/services/StatisticsClient.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/services/StatisticsTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/services/StatusClient.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/services/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/services/UsageClient.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/services/UsageTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/services/pools/PoolsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/services/pools/StatisticsClient.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/services/pools/StatisticsTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/services/pools/StatusClient.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/services/pools/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/services/virtual_servers/StatisticsClient.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/services/virtual_servers/StatisticsTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/services/virtual_servers/StatusClient.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/services/virtual_servers/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/services/virtual_servers/VirtualServersPackageTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/ssl/CiphersAndProtocolsClient.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/ssl/CiphersAndProtocolsTypes.go create mode 100644 services/nsxt-mp/nsx/loadbalancer/ssl/SslPackageTypes.go create mode 100644 services/nsxt-mp/nsx/logical_ports/ForwardingPathClient.go create mode 100644 services/nsxt-mp/nsx/logical_ports/ForwardingPathTypes.go create mode 100644 services/nsxt-mp/nsx/logical_ports/LogicalPortsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/logical_ports/MacTableClient.go create mode 100644 services/nsxt-mp/nsx/logical_ports/MacTableTypes.go create mode 100644 services/nsxt-mp/nsx/logical_ports/StateClient.go create mode 100644 services/nsxt-mp/nsx/logical_ports/StateTypes.go create mode 100644 services/nsxt-mp/nsx/logical_ports/StatisticsClient.go create mode 100644 services/nsxt-mp/nsx/logical_ports/StatisticsTypes.go create mode 100644 services/nsxt-mp/nsx/logical_ports/StatusClient.go create mode 100644 services/nsxt-mp/nsx/logical_ports/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/logical_router_ports/ArpTableClient.go create mode 100644 services/nsxt-mp/nsx/logical_router_ports/ArpTableTypes.go create mode 100644 services/nsxt-mp/nsx/logical_router_ports/LogicalRouterPortsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/logical_router_ports/StateClient.go create mode 100644 services/nsxt-mp/nsx/logical_router_ports/StateTypes.go create mode 100644 services/nsxt-mp/nsx/logical_router_ports/StatisticsClient.go create mode 100644 services/nsxt-mp/nsx/logical_router_ports/StatisticsTypes.go create mode 100644 services/nsxt-mp/nsx/logical_router_ports/statistics/StatisticsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/logical_router_ports/statistics/SummaryClient.go create mode 100644 services/nsxt-mp/nsx/logical_router_ports/statistics/SummaryTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/LogicalRoutersPackageTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/RoutingClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/RoutingTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/StateClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/StateTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/StatusClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/nat/NatPackageTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/nat/RulesClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/nat/RulesTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/nat/rules/RulesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/nat/rules/StatisticsClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/nat/rules/StatisticsTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/AdvertisementClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/AdvertisementTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/BfdConfigClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/BfdConfigTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/BgpClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/BgpTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/ForwardingTableClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/ForwardingTableTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/IpPrefixListsClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/IpPrefixListsTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/RedistributionClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/RedistributionTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/RouteMapsClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/RouteMapsTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/RouteTableClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/RouteTableTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/RoutingPackageTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/RoutingTableClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/RoutingTableTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/StaticRoutesClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/StaticRoutesTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/advertisement/AdvertisementPackageTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/advertisement/RulesClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/advertisement/RulesTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/bgp/BgpPackageTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/bgp/CommunityListsClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/bgp/CommunityListsTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/bgp/CommuntyListsClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/bgp/CommuntyListsTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/bgp/NeighborsClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/bgp/NeighborsTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/AdvertisedRoutesClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/AdvertisedRoutesTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/NeighborsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/RoutesClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/RoutesTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/StatusClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/redistribution/RedistributionPackageTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/redistribution/RulesClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/redistribution/RulesTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/static_routes/BfdPeersClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/static_routes/BfdPeersTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/routing/static_routes/StaticRoutesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/service_cluster/ServiceClusterPackageTypes.go create mode 100644 services/nsxt-mp/nsx/logical_routers/service_cluster/StateClient.go create mode 100644 services/nsxt-mp/nsx/logical_routers/service_cluster/StateTypes.go create mode 100644 services/nsxt-mp/nsx/logical_switches/LogicalSwitchesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/logical_switches/MacTableClient.go create mode 100644 services/nsxt-mp/nsx/logical_switches/MacTableTypes.go create mode 100644 services/nsxt-mp/nsx/logical_switches/StateClient.go create mode 100644 services/nsxt-mp/nsx/logical_switches/StateTypes.go create mode 100644 services/nsxt-mp/nsx/logical_switches/StatisticsClient.go create mode 100644 services/nsxt-mp/nsx/logical_switches/StatisticsTypes.go create mode 100644 services/nsxt-mp/nsx/logical_switches/StatusClient.go create mode 100644 services/nsxt-mp/nsx/logical_switches/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/logical_switches/SummaryClient.go create mode 100644 services/nsxt-mp/nsx/logical_switches/SummaryTypes.go create mode 100644 services/nsxt-mp/nsx/logical_switches/VtepTableClient.go create mode 100644 services/nsxt-mp/nsx/logical_switches/VtepTableTypes.go create mode 100644 services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/InterSiteForwarderPackageTypes.go create mode 100644 services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/SiteSpanInfoClient.go create mode 100644 services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/SiteSpanInfoTypes.go create mode 100644 services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/StatisticsClient.go create mode 100644 services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/StatisticsTypes.go create mode 100644 services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/StatusClient.go create mode 100644 services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/mac_sets/MacSetsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/mac_sets/MembersClient.go create mode 100644 services/nsxt-mp/nsx/mac_sets/MembersTypes.go create mode 100644 services/nsxt-mp/nsx/md_proxies/MdProxiesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/md_proxies/StatisticsClient.go create mode 100644 services/nsxt-mp/nsx/md_proxies/StatisticsTypes.go create mode 100644 services/nsxt-mp/nsx/md_proxies/StatusClient.go create mode 100644 services/nsxt-mp/nsx/md_proxies/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/migration/DataClient.go create mode 100644 services/nsxt-mp/nsx/migration/DataTypes.go create mode 100644 services/nsxt-mp/nsx/migration/DiscoveredSwitchesClient.go create mode 100644 services/nsxt-mp/nsx/migration/DiscoveredSwitchesTypes.go create mode 100644 services/nsxt-mp/nsx/migration/FeedbackRequestsClient.go create mode 100644 services/nsxt-mp/nsx/migration/FeedbackRequestsTypes.go create mode 100644 services/nsxt-mp/nsx/migration/FeedbackResponseClient.go create mode 100644 services/nsxt-mp/nsx/migration/FeedbackResponseTypes.go create mode 100644 services/nsxt-mp/nsx/migration/FeedbackSummaryClient.go create mode 100644 services/nsxt-mp/nsx/migration/FeedbackSummaryTypes.go create mode 100644 services/nsxt-mp/nsx/migration/GroupedFeedbackRequestsClient.go create mode 100644 services/nsxt-mp/nsx/migration/GroupedFeedbackRequestsTypes.go create mode 100644 services/nsxt-mp/nsx/migration/MigratedResourcesClient.go create mode 100644 services/nsxt-mp/nsx/migration/MigratedResourcesTypes.go create mode 100644 services/nsxt-mp/nsx/migration/MigratedSwitchesClient.go create mode 100644 services/nsxt-mp/nsx/migration/MigratedSwitchesTypes.go create mode 100644 services/nsxt-mp/nsx/migration/MigrationPackageTypes.go create mode 100644 services/nsxt-mp/nsx/migration/MigrationUnitGroupsClient.go create mode 100644 services/nsxt-mp/nsx/migration/MigrationUnitGroupsStatusClient.go create mode 100644 services/nsxt-mp/nsx/migration/MigrationUnitGroupsStatusTypes.go create mode 100644 services/nsxt-mp/nsx/migration/MigrationUnitGroupsTypes.go create mode 100644 services/nsxt-mp/nsx/migration/MigrationUnitsClient.go create mode 100644 services/nsxt-mp/nsx/migration/MigrationUnitsStatsClient.go create mode 100644 services/nsxt-mp/nsx/migration/MigrationUnitsStatsTypes.go create mode 100644 services/nsxt-mp/nsx/migration/MigrationUnitsTypes.go create mode 100644 services/nsxt-mp/nsx/migration/MpToPolicyClient.go create mode 100644 services/nsxt-mp/nsx/migration/MpToPolicyTypes.go create mode 100644 services/nsxt-mp/nsx/migration/NodesClient.go create mode 100644 services/nsxt-mp/nsx/migration/NodesSummaryClient.go create mode 100644 services/nsxt-mp/nsx/migration/NodesSummaryTypes.go create mode 100644 services/nsxt-mp/nsx/migration/NodesTypes.go create mode 100644 services/nsxt-mp/nsx/migration/PlanClient.go create mode 100644 services/nsxt-mp/nsx/migration/PlanTypes.go create mode 100644 services/nsxt-mp/nsx/migration/SetupClient.go create mode 100644 services/nsxt-mp/nsx/migration/SetupTypes.go create mode 100644 services/nsxt-mp/nsx/migration/StatusSummaryClient.go create mode 100644 services/nsxt-mp/nsx/migration/StatusSummaryTypes.go create mode 100644 services/nsxt-mp/nsx/migration/SummaryClient.go create mode 100644 services/nsxt-mp/nsx/migration/SummaryTypes.go create mode 100644 services/nsxt-mp/nsx/migration/SwitchClient.go create mode 100644 services/nsxt-mp/nsx/migration/SwitchTypes.go create mode 100644 services/nsxt-mp/nsx/migration/VmgroupClient.go create mode 100644 services/nsxt-mp/nsx/migration/VmgroupTypes.go create mode 100644 services/nsxt-mp/nsx/migration/logical_constructs/LogicalConstructsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/migration/logical_constructs/StatsClient.go create mode 100644 services/nsxt-mp/nsx/migration/logical_constructs/StatsTypes.go create mode 100644 services/nsxt-mp/nsx/migration/migration_unit_groups/AggregateInfoClient.go create mode 100644 services/nsxt-mp/nsx/migration/migration_unit_groups/AggregateInfoTypes.go create mode 100644 services/nsxt-mp/nsx/migration/migration_unit_groups/MigrationUnitClient.go create mode 100644 services/nsxt-mp/nsx/migration/migration_unit_groups/MigrationUnitGroupsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/migration/migration_unit_groups/MigrationUnitTypes.go create mode 100644 services/nsxt-mp/nsx/migration/migration_unit_groups/StatusClient.go create mode 100644 services/nsxt-mp/nsx/migration/migration_unit_groups/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/migration/migration_units/AggregateInfoClient.go create mode 100644 services/nsxt-mp/nsx/migration/migration_units/AggregateInfoTypes.go create mode 100644 services/nsxt-mp/nsx/migration/migration_units/MigrationUnitsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/migration/mp_policy_promotion/HistoryClient.go create mode 100644 services/nsxt-mp/nsx/migration/mp_policy_promotion/HistoryTypes.go create mode 100644 services/nsxt-mp/nsx/migration/mp_policy_promotion/MpPolicyPromotionPackageTypes.go create mode 100644 services/nsxt-mp/nsx/migration/mp_policy_promotion/StateClient.go create mode 100644 services/nsxt-mp/nsx/migration/mp_policy_promotion/StateTypes.go create mode 100644 services/nsxt-mp/nsx/migration/mp_to_policy/CancelClient.go create mode 100644 services/nsxt-mp/nsx/migration/mp_to_policy/CancelTypes.go create mode 100644 services/nsxt-mp/nsx/migration/mp_to_policy/FeedbackClient.go create mode 100644 services/nsxt-mp/nsx/migration/mp_to_policy/FeedbackTypes.go create mode 100644 services/nsxt-mp/nsx/migration/mp_to_policy/MpToPolicyPackageTypes.go create mode 100644 services/nsxt-mp/nsx/migration/mp_to_policy/StatsClient.go create mode 100644 services/nsxt-mp/nsx/migration/mp_to_policy/StatsTypes.go create mode 100644 services/nsxt-mp/nsx/migration/plan/PlanPackageTypes.go create mode 100644 services/nsxt-mp/nsx/migration/plan/SettingsClient.go create mode 100644 services/nsxt-mp/nsx/migration/plan/SettingsTypes.go create mode 100644 services/nsxt-mp/nsx/migration/plan/SiteMigrationStateClient.go create mode 100644 services/nsxt-mp/nsx/migration/plan/SiteMigrationStateTypes.go create mode 100644 services/nsxt-mp/nsx/mirror_sessions/MirrorSessionsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/mirror_sessions/MirrorStackStatusClient.go create mode 100644 services/nsxt-mp/nsx/mirror_sessions/MirrorStackStatusTypes.go create mode 100644 services/nsxt-mp/nsx/model/ModelPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/CentralConfigClient.go create mode 100644 services/nsxt-mp/nsx/node/CentralConfigTypes.go create mode 100644 services/nsxt-mp/nsx/node/CoreDumpsClient.go create mode 100644 services/nsxt-mp/nsx/node/CoreDumpsTypes.go create mode 100644 services/nsxt-mp/nsx/node/FileStoreClient.go create mode 100644 services/nsxt-mp/nsx/node/FileStoreTypes.go create mode 100644 services/nsxt-mp/nsx/node/LogsClient.go create mode 100644 services/nsxt-mp/nsx/node/LogsTypes.go create mode 100644 services/nsxt-mp/nsx/node/ManagementPlaneClient.go create mode 100644 services/nsxt-mp/nsx/node/ManagementPlaneTypes.go create mode 100644 services/nsxt-mp/nsx/node/ModeClient.go create mode 100644 services/nsxt-mp/nsx/node/ModeTypes.go create mode 100644 services/nsxt-mp/nsx/node/MpaConfigClient.go create mode 100644 services/nsxt-mp/nsx/node/MpaConfigTypes.go create mode 100644 services/nsxt-mp/nsx/node/NetworkClient.go create mode 100644 services/nsxt-mp/nsx/node/NetworkTypes.go create mode 100644 services/nsxt-mp/nsx/node/NodePackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/ProcessesClient.go create mode 100644 services/nsxt-mp/nsx/node/ProcessesTypes.go create mode 100644 services/nsxt-mp/nsx/node/ServicesClient.go create mode 100644 services/nsxt-mp/nsx/node/ServicesTypes.go create mode 100644 services/nsxt-mp/nsx/node/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/TasksClient.go create mode 100644 services/nsxt-mp/nsx/node/TasksTypes.go create mode 100644 services/nsxt-mp/nsx/node/UpgradeClient.go create mode 100644 services/nsxt-mp/nsx/node/UpgradeTypes.go create mode 100644 services/nsxt-mp/nsx/node/UsersClient.go create mode 100644 services/nsxt-mp/nsx/node/UsersTypes.go create mode 100644 services/nsxt-mp/nsx/node/VersionClient.go create mode 100644 services/nsxt-mp/nsx/node/VersionTypes.go create mode 100644 services/nsxt-mp/nsx/node/aaa/AaaPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/aaa/AuthPolicyClient.go create mode 100644 services/nsxt-mp/nsx/node/aaa/AuthPolicyTypes.go create mode 100644 services/nsxt-mp/nsx/node/aaa/providers/ProvidersPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/aaa/providers/VidmClient.go create mode 100644 services/nsxt-mp/nsx/node/aaa/providers/VidmTypes.go create mode 100644 services/nsxt-mp/nsx/node/aaa/providers/vidm/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/aaa/providers/vidm/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/aaa/providers/vidm/VidmPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/file_store/FileStorePackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/file_store/ThumbprintClient.go create mode 100644 services/nsxt-mp/nsx/node/file_store/ThumbprintTypes.go create mode 100644 services/nsxt-mp/nsx/node/hardening_policy/HardeningPolicyPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/hardening_policy/MandatoryAccessControlClient.go create mode 100644 services/nsxt-mp/nsx/node/hardening_policy/MandatoryAccessControlTypes.go create mode 100644 services/nsxt-mp/nsx/node/intelligence/FormFactorsClient.go create mode 100644 services/nsxt-mp/nsx/node/intelligence/FormFactorsTypes.go create mode 100644 services/nsxt-mp/nsx/node/intelligence/IntelligencePackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/network/InterfacesClient.go create mode 100644 services/nsxt-mp/nsx/node/network/InterfacesTypes.go create mode 100644 services/nsxt-mp/nsx/node/network/NameServersClient.go create mode 100644 services/nsxt-mp/nsx/node/network/NameServersTypes.go create mode 100644 services/nsxt-mp/nsx/node/network/NetworkPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/network/RoutesClient.go create mode 100644 services/nsxt-mp/nsx/node/network/RoutesTypes.go create mode 100644 services/nsxt-mp/nsx/node/network/SearchDomainsClient.go create mode 100644 services/nsxt-mp/nsx/node/network/SearchDomainsTypes.go create mode 100644 services/nsxt-mp/nsx/node/network/interfaces/InterfacesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/network/interfaces/StatsClient.go create mode 100644 services/nsxt-mp/nsx/node/network/interfaces/StatsTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/ApplianceproxyClient.go create mode 100644 services/nsxt-mp/nsx/node/services/ApplianceproxyTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/AsyncReplicatorClient.go create mode 100644 services/nsxt-mp/nsx/node/services/AsyncReplicatorTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/ClusterManagerClient.go create mode 100644 services/nsxt-mp/nsx/node/services/ClusterManagerTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/CmInventoryClient.go create mode 100644 services/nsxt-mp/nsx/node/services/CmInventoryTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/ControllerClient.go create mode 100644 services/nsxt-mp/nsx/node/services/ControllerTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/HttpClient.go create mode 100644 services/nsxt-mp/nsx/node/services/HttpTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/IdpsReportingClient.go create mode 100644 services/nsxt-mp/nsx/node/services/IdpsReportingTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/InstallUpgradeClient.go create mode 100644 services/nsxt-mp/nsx/node/services/InstallUpgradeTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/LiagentClient.go create mode 100644 services/nsxt-mp/nsx/node/services/LiagentTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/ManagerClient.go create mode 100644 services/nsxt-mp/nsx/node/services/ManagerTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/MessagingManagerClient.go create mode 100644 services/nsxt-mp/nsx/node/services/MessagingManagerTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/MigrationCoordinatorClient.go create mode 100644 services/nsxt-mp/nsx/node/services/MigrationCoordinatorTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/NodeMgmtClient.go create mode 100644 services/nsxt-mp/nsx/node/services/NodeMgmtTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/NodeStatsClient.go create mode 100644 services/nsxt-mp/nsx/node/services/NodeStatsTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/NsxMessageBusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/NsxMessageBusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/NsxPlatformClientClient.go create mode 100644 services/nsxt-mp/nsx/node/services/NsxPlatformClientTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/NsxUpgradeAgentClient.go create mode 100644 services/nsxt-mp/nsx/node/services/NsxUpgradeAgentTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/NtpClient.go create mode 100644 services/nsxt-mp/nsx/node/services/NtpTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/PolicyClient.go create mode 100644 services/nsxt-mp/nsx/node/services/PolicyTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/SearchClient.go create mode 100644 services/nsxt-mp/nsx/node/services/SearchTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/ServicesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/SnmpClient.go create mode 100644 services/nsxt-mp/nsx/node/services/SnmpTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/SshClient.go create mode 100644 services/nsxt-mp/nsx/node/services/SshTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/SyslogClient.go create mode 100644 services/nsxt-mp/nsx/node/services/SyslogTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/TelemetryClient.go create mode 100644 services/nsxt-mp/nsx/node/services/TelemetryTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/UiServiceClient.go create mode 100644 services/nsxt-mp/nsx/node/services/UiServiceTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/applianceproxy/ApplianceproxyPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/applianceproxy/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/applianceproxy/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/async_replicator/AsyncReplicatorPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/async_replicator/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/async_replicator/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/cluster_manager/ClusterManagerPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/cluster_manager/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/cluster_manager/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/cm_inventory/CmInventoryPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/cm_inventory/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/cm_inventory/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/controller/ControllerCertificateClient.go create mode 100644 services/nsxt-mp/nsx/node/services/controller/ControllerCertificateTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/controller/ControllerPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/controller/ProfilerClient.go create mode 100644 services/nsxt-mp/nsx/node/services/controller/ProfilerTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/controller/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/controller/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/http/HttpPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/http/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/http/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/idps_reporting/IdpsReportingPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/idps_reporting/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/idps_reporting/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/install_upgrade/InstallUpgradePackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/install_upgrade/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/install_upgrade/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/install_upgrade/UcStateClient.go create mode 100644 services/nsxt-mp/nsx/node/services/install_upgrade/UcStateTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/liagent/LiagentPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/liagent/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/liagent/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/manager/ManagerPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/manager/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/manager/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/messaging_manager/MessagingManagerPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/messaging_manager/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/messaging_manager/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/migration_coordinator/MigrationCoordinatorPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/migration_coordinator/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/migration_coordinator/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/node_mgmt/NodeMgmtPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/node_mgmt/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/node_mgmt/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/node_stats/NodeStatsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/node_stats/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/node_stats/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/nsx_message_bus/NsxMessageBusPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/nsx_message_bus/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/nsx_message_bus/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/nsx_platform_client/NsxPlatformClientPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/nsx_platform_client/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/nsx_platform_client/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/nsx_upgrade_agent/NsxUpgradeAgentPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/nsx_upgrade_agent/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/nsx_upgrade_agent/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/ntp/NtpPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/ntp/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/ntp/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/policy/PolicyPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/policy/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/policy/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/search/SearchPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/search/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/search/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/snmp/SnmpPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/snmp/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/snmp/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/snmp/V3EngineIdClient.go create mode 100644 services/nsxt-mp/nsx/node/services/snmp/V3EngineIdTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/ssh/NotifyMpaClient.go create mode 100644 services/nsxt-mp/nsx/node/services/ssh/NotifyMpaTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/ssh/SshPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/ssh/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/ssh/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/syslog/ExportersClient.go create mode 100644 services/nsxt-mp/nsx/node/services/syslog/ExportersTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/syslog/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/syslog/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/syslog/SyslogPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/telemetry/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/telemetry/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/telemetry/TelemetryPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/ui_service/StatusClient.go create mode 100644 services/nsxt-mp/nsx/node/services/ui_service/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/services/ui_service/UiServicePackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/tasks/ResponseClient.go create mode 100644 services/nsxt-mp/nsx/node/tasks/ResponseTypes.go create mode 100644 services/nsxt-mp/nsx/node/tasks/TasksPackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/upgrade/PerformtaskClient.go create mode 100644 services/nsxt-mp/nsx/node/upgrade/PerformtaskTypes.go create mode 100644 services/nsxt-mp/nsx/node/upgrade/ProgressStatusClient.go create mode 100644 services/nsxt-mp/nsx/node/upgrade/ProgressStatusTypes.go create mode 100644 services/nsxt-mp/nsx/node/upgrade/StatusSummaryClient.go create mode 100644 services/nsxt-mp/nsx/node/upgrade/StatusSummaryTypes.go create mode 100644 services/nsxt-mp/nsx/node/upgrade/UcClient.go create mode 100644 services/nsxt-mp/nsx/node/upgrade/UcTypes.go create mode 100644 services/nsxt-mp/nsx/node/upgrade/UpgradePackageTypes.go create mode 100644 services/nsxt-mp/nsx/node/users/SshKeysClient.go create mode 100644 services/nsxt-mp/nsx/node/users/SshKeysTypes.go create mode 100644 services/nsxt-mp/nsx/node/users/UsersPackageTypes.go create mode 100644 services/nsxt-mp/nsx/notification_watchers/NotificationWatchersPackageTypes.go create mode 100644 services/nsxt-mp/nsx/notification_watchers/NotificationsClient.go create mode 100644 services/nsxt-mp/nsx/notification_watchers/NotificationsTypes.go create mode 100644 services/nsxt-mp/nsx/ns_groups/ConsolidatedEffectiveIpAddressMembersClient.go create mode 100644 services/nsxt-mp/nsx/ns_groups/ConsolidatedEffectiveIpAddressMembersTypes.go create mode 100644 services/nsxt-mp/nsx/ns_groups/EffectiveCloudNativeServiceInstanceMembersClient.go create mode 100644 services/nsxt-mp/nsx/ns_groups/EffectiveCloudNativeServiceInstanceMembersTypes.go create mode 100644 services/nsxt-mp/nsx/ns_groups/EffectiveDirectoryGroupMembersClient.go create mode 100644 services/nsxt-mp/nsx/ns_groups/EffectiveDirectoryGroupMembersTypes.go create mode 100644 services/nsxt-mp/nsx/ns_groups/EffectiveIpAddressMembersClient.go create mode 100644 services/nsxt-mp/nsx/ns_groups/EffectiveIpAddressMembersTypes.go create mode 100644 services/nsxt-mp/nsx/ns_groups/EffectiveIpsetMembersClient.go create mode 100644 services/nsxt-mp/nsx/ns_groups/EffectiveIpsetMembersTypes.go create mode 100644 services/nsxt-mp/nsx/ns_groups/EffectiveLogicalPortMembersClient.go create mode 100644 services/nsxt-mp/nsx/ns_groups/EffectiveLogicalPortMembersTypes.go create mode 100644 services/nsxt-mp/nsx/ns_groups/EffectiveLogicalSwitchMembersClient.go create mode 100644 services/nsxt-mp/nsx/ns_groups/EffectiveLogicalSwitchMembersTypes.go create mode 100644 services/nsxt-mp/nsx/ns_groups/EffectivePhysicalServerMembersClient.go create mode 100644 services/nsxt-mp/nsx/ns_groups/EffectivePhysicalServerMembersTypes.go create mode 100644 services/nsxt-mp/nsx/ns_groups/EffectiveTransportNodeMembersClient.go create mode 100644 services/nsxt-mp/nsx/ns_groups/EffectiveTransportNodeMembersTypes.go create mode 100644 services/nsxt-mp/nsx/ns_groups/EffectiveVifMembersClient.go create mode 100644 services/nsxt-mp/nsx/ns_groups/EffectiveVifMembersTypes.go create mode 100644 services/nsxt-mp/nsx/ns_groups/EffectiveVirtualMachineMembersClient.go create mode 100644 services/nsxt-mp/nsx/ns_groups/EffectiveVirtualMachineMembersTypes.go create mode 100644 services/nsxt-mp/nsx/ns_groups/MemberTypesClient.go create mode 100644 services/nsxt-mp/nsx/ns_groups/MemberTypesTypes.go create mode 100644 services/nsxt-mp/nsx/ns_groups/NsGroupsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/ns_groups/ServiceAssociationsClient.go create mode 100644 services/nsxt-mp/nsx/ns_groups/ServiceAssociationsTypes.go create mode 100644 services/nsxt-mp/nsx/ns_groups/UnassociatedVirtualMachinesClient.go create mode 100644 services/nsxt-mp/nsx/ns_groups/UnassociatedVirtualMachinesTypes.go create mode 100644 services/nsxt-mp/nsx/ns_profiles/AttributeTypesClient.go create mode 100644 services/nsxt-mp/nsx/ns_profiles/AttributeTypesTypes.go create mode 100644 services/nsxt-mp/nsx/ns_profiles/AttributesClient.go create mode 100644 services/nsxt-mp/nsx/ns_profiles/AttributesTypes.go create mode 100644 services/nsxt-mp/nsx/ns_profiles/NsProfilesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/nvds_urt/NvdsUrtPackageTypes.go create mode 100644 services/nsxt-mp/nsx/nvds_urt/PrecheckByClustersClient.go create mode 100644 services/nsxt-mp/nsx/nvds_urt/PrecheckByClustersTypes.go create mode 100644 services/nsxt-mp/nsx/nvds_urt/PrecheckClient.go create mode 100644 services/nsxt-mp/nsx/nvds_urt/PrecheckTypes.go create mode 100644 services/nsxt-mp/nsx/nvds_urt/StatusSummaryClient.go create mode 100644 services/nsxt-mp/nsx/nvds_urt/StatusSummaryTypes.go create mode 100644 services/nsxt-mp/nsx/nvds_urt/TopologyClient.go create mode 100644 services/nsxt-mp/nsx/nvds_urt/TopologyTypes.go create mode 100644 services/nsxt-mp/nsx/pktcap/PktcapPackageTypes.go create mode 100644 services/nsxt-mp/nsx/pktcap/SessionClient.go create mode 100644 services/nsxt-mp/nsx/pktcap/SessionTypes.go create mode 100644 services/nsxt-mp/nsx/pktcap/SessionsClient.go create mode 100644 services/nsxt-mp/nsx/pktcap/SessionsTypes.go create mode 100644 services/nsxt-mp/nsx/pools/IpBlocksClient.go create mode 100644 services/nsxt-mp/nsx/pools/IpBlocksTypes.go create mode 100644 services/nsxt-mp/nsx/pools/IpPoolsClient.go create mode 100644 services/nsxt-mp/nsx/pools/IpPoolsTypes.go create mode 100644 services/nsxt-mp/nsx/pools/IpSubnetsClient.go create mode 100644 services/nsxt-mp/nsx/pools/IpSubnetsTypes.go create mode 100644 services/nsxt-mp/nsx/pools/MacPoolsClient.go create mode 100644 services/nsxt-mp/nsx/pools/MacPoolsTypes.go create mode 100644 services/nsxt-mp/nsx/pools/PoolsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/pools/VniPoolsClient.go create mode 100644 services/nsxt-mp/nsx/pools/VniPoolsTypes.go create mode 100644 services/nsxt-mp/nsx/pools/VtepLabelPoolsClient.go create mode 100644 services/nsxt-mp/nsx/pools/VtepLabelPoolsTypes.go create mode 100644 services/nsxt-mp/nsx/pools/ip_pools/AllocationsClient.go create mode 100644 services/nsxt-mp/nsx/pools/ip_pools/AllocationsTypes.go create mode 100644 services/nsxt-mp/nsx/pools/ip_pools/IpPoolsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/proxy/ConfigClient.go create mode 100644 services/nsxt-mp/nsx/proxy/ConfigTypes.go create mode 100644 services/nsxt-mp/nsx/proxy/ProxyPackageTypes.go create mode 100644 services/nsxt-mp/nsx/realization_state_barrier/ConfigClient.go create mode 100644 services/nsxt-mp/nsx/realization_state_barrier/ConfigTypes.go create mode 100644 services/nsxt-mp/nsx/realization_state_barrier/CurrentClient.go create mode 100644 services/nsxt-mp/nsx/realization_state_barrier/CurrentTypes.go create mode 100644 services/nsxt-mp/nsx/realization_state_barrier/RealizationStateBarrierPackageTypes.go create mode 100644 services/nsxt-mp/nsx/repository/BundlesClient.go create mode 100644 services/nsxt-mp/nsx/repository/BundlesTypes.go create mode 100644 services/nsxt-mp/nsx/repository/RepositoryPackageTypes.go create mode 100644 services/nsxt-mp/nsx/repository/bundles/BundlesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/repository/bundles/OvfDeployInfoClient.go create mode 100644 services/nsxt-mp/nsx/repository/bundles/OvfDeployInfoTypes.go create mode 100644 services/nsxt-mp/nsx/repository/bundles/UploadAllowedClient.go create mode 100644 services/nsxt-mp/nsx/repository/bundles/UploadAllowedTypes.go create mode 100644 services/nsxt-mp/nsx/repository/bundles/UploadStatusClient.go create mode 100644 services/nsxt-mp/nsx/repository/bundles/UploadStatusTypes.go create mode 100644 services/nsxt-mp/nsx/search/DslClient.go create mode 100644 services/nsxt-mp/nsx/search/DslTypes.go create mode 100644 services/nsxt-mp/nsx/search/QueryClient.go create mode 100644 services/nsxt-mp/nsx/search/QueryTypes.go create mode 100644 services/nsxt-mp/nsx/search/SearchPackageTypes.go create mode 100644 services/nsxt-mp/nsx/service_configs/BatchClient.go create mode 100644 services/nsxt-mp/nsx/service_configs/BatchTypes.go create mode 100644 services/nsxt-mp/nsx/service_configs/EffectiveProfilesClient.go create mode 100644 services/nsxt-mp/nsx/service_configs/EffectiveProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/service_configs/ServiceConfigsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/ExcludelistClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/ExcludelistTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/SectionsClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/SectionsTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/ServiceAttachmentsClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/ServiceAttachmentsTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/ServiceChainsClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/ServiceChainsTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/ServiceInstancesClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/ServiceInstancesTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/ServiceManagersClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/ServiceManagersTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/ServiceinsertionPackageTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/ServicesClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/ServicesTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/SourceEntitiesClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/SourceEntitiesTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/StatusClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/sections/RulesClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/sections/RulesTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/sections/SectionsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/service_chains/ServiceChainsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/service_chains/ServicePathsClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/service_chains/ServicePathsTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/ServiceDeploymentsClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/ServiceDeploymentsTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/ServiceInstancesClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/ServiceInstancesTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/ServiceProfilesClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/ServiceProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/ServicesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/SolutionConfigsClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/SolutionConfigsTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/VendorTemplatesClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/VendorTemplatesTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_deployments/ServiceDeploymentsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_deployments/StateClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_deployments/StateTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_deployments/StatusClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_deployments/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_instances/GroupAssociationsClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_instances/GroupAssociationsTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_instances/InstanceEndpointsClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_instances/InstanceEndpointsTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_instances/InstanceRuntimesClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_instances/InstanceRuntimesTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_instances/ServiceInstancesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_instances/StateClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_instances/StateTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_instances/StatusClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_instances/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_instances/instance_runtimes/interfaces/InterfacesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_instances/instance_runtimes/interfaces/StatisticsClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_instances/instance_runtimes/interfaces/StatisticsTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_instances/instance_runtimes/interfaces/StatusClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_instances/instance_runtimes/interfaces/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_profiles/NsgroupsClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_profiles/NsgroupsTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_profiles/ServiceChainMappingsClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_profiles/ServiceChainMappingsTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/service_profiles/ServiceProfilesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/solution_configs/ExtendedSolutionConfigClient.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/solution_configs/ExtendedSolutionConfigTypes.go create mode 100644 services/nsxt-mp/nsx/serviceinsertion/services/solution_configs/SolutionConfigsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/sites/CompatibilityClient.go create mode 100644 services/nsxt-mp/nsx/sites/CompatibilityTypes.go create mode 100644 services/nsxt-mp/nsx/sites/SelfClient.go create mode 100644 services/nsxt-mp/nsx/sites/SelfTypes.go create mode 100644 services/nsxt-mp/nsx/sites/SitesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/sites/StatusClient.go create mode 100644 services/nsxt-mp/nsx/sites/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/sites/SwitchoverStatusClient.go create mode 100644 services/nsxt-mp/nsx/sites/SwitchoverStatusTypes.go create mode 100644 services/nsxt-mp/nsx/sites/compatibility/CompatibilityPackageTypes.go create mode 100644 services/nsxt-mp/nsx/sites/compatibility/RemoteClient.go create mode 100644 services/nsxt-mp/nsx/sites/compatibility/RemoteTypes.go create mode 100644 services/nsxt-mp/nsx/switching_profiles/SummaryClient.go create mode 100644 services/nsxt-mp/nsx/switching_profiles/SummaryTypes.go create mode 100644 services/nsxt-mp/nsx/switching_profiles/SwitchingProfilesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/systemhealth/PluginsClient.go create mode 100644 services/nsxt-mp/nsx/systemhealth/PluginsTypes.go create mode 100644 services/nsxt-mp/nsx/systemhealth/ProfilesClient.go create mode 100644 services/nsxt-mp/nsx/systemhealth/ProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/systemhealth/SystemhealthPackageTypes.go create mode 100644 services/nsxt-mp/nsx/systemhealth/appliances/latency/LatencyPackageTypes.go create mode 100644 services/nsxt-mp/nsx/systemhealth/appliances/latency/StatusClient.go create mode 100644 services/nsxt-mp/nsx/systemhealth/appliances/latency/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/systemhealth/appliances/process/ProcessPackageTypes.go create mode 100644 services/nsxt-mp/nsx/systemhealth/appliances/process/StatusClient.go create mode 100644 services/nsxt-mp/nsx/systemhealth/appliances/process/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/systemhealth/container_cluster/ncp/NcpPackageTypes.go create mode 100644 services/nsxt-mp/nsx/systemhealth/container_cluster/ncp/StatusClient.go create mode 100644 services/nsxt-mp/nsx/systemhealth/container_cluster/ncp/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/systemhealth/plugins/PluginsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/systemhealth/plugins/StatusClient.go create mode 100644 services/nsxt-mp/nsx/systemhealth/plugins/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/systemhealth/transport_nodes/container/agent/AgentPackageTypes.go create mode 100644 services/nsxt-mp/nsx/systemhealth/transport_nodes/container/agent/StatusClient.go create mode 100644 services/nsxt-mp/nsx/systemhealth/transport_nodes/container/agent/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/systemhealth/transport_nodes/container/hyperbus/HyperbusPackageTypes.go create mode 100644 services/nsxt-mp/nsx/systemhealth/transport_nodes/container/hyperbus/StatusClient.go create mode 100644 services/nsxt-mp/nsx/systemhealth/transport_nodes/container/hyperbus/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/tasks/ResponseClient.go create mode 100644 services/nsxt-mp/nsx/tasks/ResponseTypes.go create mode 100644 services/nsxt-mp/nsx/tasks/TasksPackageTypes.go create mode 100644 services/nsxt-mp/nsx/telemetry/AgreementClient.go create mode 100644 services/nsxt-mp/nsx/telemetry/AgreementTypes.go create mode 100644 services/nsxt-mp/nsx/telemetry/ConfigClient.go create mode 100644 services/nsxt-mp/nsx/telemetry/ConfigTypes.go create mode 100644 services/nsxt-mp/nsx/telemetry/TelemetryPackageTypes.go create mode 100644 services/nsxt-mp/nsx/traceflows/ObservationsClient.go create mode 100644 services/nsxt-mp/nsx/traceflows/ObservationsTypes.go create mode 100644 services/nsxt-mp/nsx/traceflows/TraceflowsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/transport_node_collections/StateClient.go create mode 100644 services/nsxt-mp/nsx/transport_node_collections/StateTypes.go create mode 100644 services/nsxt-mp/nsx/transport_node_collections/TransportNodeCollectionsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/CapabilitiesClient.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/CapabilitiesTypes.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/ModulesClient.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/ModulesTypes.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/PnicBondStatusClient.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/PnicBondStatusTypes.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/RemoteTransportNodeStatusClient.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/RemoteTransportNodeStatusTypes.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/StateClient.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/StateTypes.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/StatusClient.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/TransportNodesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/TunnelsClient.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/TunnelsTypes.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/inter_site/InterSitePackageTypes.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/inter_site/StatisticsClient.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/inter_site/StatisticsTypes.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/BgpPackageTypes.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/NeighborsClient.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/NeighborsTypes.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/SummaryClient.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/SummaryTypes.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/neighbors/AdvertisedRoutesClient.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/neighbors/AdvertisedRoutesTypes.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/neighbors/NeighborsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/neighbors/RoutesClient.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/neighbors/RoutesTypes.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/network/InterfacesClient.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/network/InterfacesTypes.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/network/NetworkPackageTypes.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/network/interfaces/InterfacesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/network/interfaces/StatsClient.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/network/interfaces/StatsTypes.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/statistics/NatRulesClient.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/statistics/NatRulesTypes.go create mode 100644 services/nsxt-mp/nsx/transport_nodes/statistics/StatisticsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/transport_zones/StatusClient.go create mode 100644 services/nsxt-mp/nsx/transport_zones/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/transport_zones/SummaryClient.go create mode 100644 services/nsxt-mp/nsx/transport_zones/SummaryTypes.go create mode 100644 services/nsxt-mp/nsx/transport_zones/TransportNodeStatusClient.go create mode 100644 services/nsxt-mp/nsx/transport_zones/TransportNodeStatusTypes.go create mode 100644 services/nsxt-mp/nsx/transport_zones/TransportZonesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/trust_management/CertificateProfileClient.go create mode 100644 services/nsxt-mp/nsx/trust_management/CertificateProfileTypes.go create mode 100644 services/nsxt-mp/nsx/trust_management/CertificateProfilesClient.go create mode 100644 services/nsxt-mp/nsx/trust_management/CertificateProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/trust_management/CertificatesClient.go create mode 100644 services/nsxt-mp/nsx/trust_management/CertificatesTypes.go create mode 100644 services/nsxt-mp/nsx/trust_management/CrlDistributionPointsClient.go create mode 100644 services/nsxt-mp/nsx/trust_management/CrlDistributionPointsTypes.go create mode 100644 services/nsxt-mp/nsx/trust_management/CrlsClient.go create mode 100644 services/nsxt-mp/nsx/trust_management/CrlsTypes.go create mode 100644 services/nsxt-mp/nsx/trust_management/CsrsClient.go create mode 100644 services/nsxt-mp/nsx/trust_management/CsrsExtendedClient.go create mode 100644 services/nsxt-mp/nsx/trust_management/CsrsExtendedTypes.go create mode 100644 services/nsxt-mp/nsx/trust_management/CsrsTypes.go create mode 100644 services/nsxt-mp/nsx/trust_management/OidcUrisClient.go create mode 100644 services/nsxt-mp/nsx/trust_management/OidcUrisTypes.go create mode 100644 services/nsxt-mp/nsx/trust_management/PrincipalIdentitiesClient.go create mode 100644 services/nsxt-mp/nsx/trust_management/PrincipalIdentitiesTypes.go create mode 100644 services/nsxt-mp/nsx/trust_management/TokenPrincipalIdentitiesClient.go create mode 100644 services/nsxt-mp/nsx/trust_management/TokenPrincipalIdentitiesTypes.go create mode 100644 services/nsxt-mp/nsx/trust_management/TrustManagementPackageTypes.go create mode 100644 services/nsxt-mp/nsx/trust_management/crl_distribution_points/CrlDistributionPointsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/trust_management/crl_distribution_points/StatusClient.go create mode 100644 services/nsxt-mp/nsx/trust_management/crl_distribution_points/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/trust_management/principal_identities/PrincipalIdentitiesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/trust_management/principal_identities/WithCertificateClient.go create mode 100644 services/nsxt-mp/nsx/trust_management/principal_identities/WithCertificateTypes.go create mode 100644 services/nsxt-mp/nsx/ui_views/UiViewsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/ui_views/WidgetconfigurationsClient.go create mode 100644 services/nsxt-mp/nsx/ui_views/WidgetconfigurationsTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/BundlesClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/BundlesTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/FunctionalStateClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/FunctionalStateTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/HistoryClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/HistoryTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/NodesClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/NodesSummaryClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/NodesSummaryTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/NodesTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/PlanClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/PlanTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/StatusSummaryClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/StatusSummaryTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/SummaryClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/SummaryTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/UcUpgradeStatusClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/UcUpgradeStatusTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/UpgradeChecksInfoClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/UpgradeChecksInfoTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/UpgradePackageTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/UpgradeUnitGroupsClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/UpgradeUnitGroupsStatusClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/UpgradeUnitGroupsStatusTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/UpgradeUnitGroupsTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/UpgradeUnitsClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/UpgradeUnitsStatsClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/UpgradeUnitsStatsTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/UpgradeUnitsTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/VersionWhitelistClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/VersionWhitelistTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/bundles/BundlesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/bundles/UploadStatusClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/bundles/UploadStatusTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/eula/AcceptClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/eula/AcceptTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/eula/AcceptanceClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/eula/AcceptanceTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/eula/ContentClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/eula/ContentTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/eula/EulaPackageTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/plan/PlanPackageTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/plan/SettingsClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/plan/SettingsTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/pre_upgrade_checks/FailuresClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/pre_upgrade_checks/FailuresTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/pre_upgrade_checks/PreUpgradeChecksPackageTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/AggregateInfoClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/AggregateInfoTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/StatusClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/UpgradeUnitClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/UpgradeUnitGroupsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/UpgradeUnitTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/upgrade_units/AggregateInfoClient.go create mode 100644 services/nsxt-mp/nsx/upgrade/upgrade_units/AggregateInfoTypes.go create mode 100644 services/nsxt-mp/nsx/upgrade/upgrade_units/UpgradeUnitsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/DpdProfilesClient.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/DpdProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/IkeProfilesClient.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/IkeProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/IpsecPackageTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/LocalEndpointsClient.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/LocalEndpointsTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/PeerEndpointsClient.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/PeerEndpointsTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/ServicesClient.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/ServicesTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/SessionsClient.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/SessionsTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/TunnelProfilesClient.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/TunnelProfilesTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/sessions/SessionsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/sessions/StateClient.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/sessions/StateTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/sessions/StatisticsClient.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/sessions/StatisticsTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/sessions/StatusClient.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/sessions/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/sessions/SummaryClient.go create mode 100644 services/nsxt-mp/nsx/vpn/ipsec/sessions/SummaryTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/l2vpn/L2vpnPackageTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/l2vpn/ServicesClient.go create mode 100644 services/nsxt-mp/nsx/vpn/l2vpn/ServicesTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/l2vpn/SessionsClient.go create mode 100644 services/nsxt-mp/nsx/vpn/l2vpn/SessionsTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/l2vpn/sessions/PeerCodesClient.go create mode 100644 services/nsxt-mp/nsx/vpn/l2vpn/sessions/PeerCodesTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/l2vpn/sessions/RemoteMacClient.go create mode 100644 services/nsxt-mp/nsx/vpn/l2vpn/sessions/RemoteMacTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/l2vpn/sessions/SessionsPackageTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/l2vpn/sessions/StatisticsClient.go create mode 100644 services/nsxt-mp/nsx/vpn/l2vpn/sessions/StatisticsTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/l2vpn/sessions/StatusClient.go create mode 100644 services/nsxt-mp/nsx/vpn/l2vpn/sessions/StatusTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/l2vpn/sessions/SummaryClient.go create mode 100644 services/nsxt-mp/nsx/vpn/l2vpn/sessions/SummaryTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/services/ServicesPackageTypes.go create mode 100644 services/nsxt-mp/nsx/vpn/services/SummaryClient.go create mode 100644 services/nsxt-mp/nsx/vpn/services/SummaryTypes.go diff --git a/services/nsxt-mp/nsx/AlarmsClient.go b/services/nsxt-mp/nsx/AlarmsClient.go new file mode 100644 index 000000000..c5dc2563b --- /dev/null +++ b/services/nsxt-mp/nsx/AlarmsClient.go @@ -0,0 +1,272 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Alarms +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AlarmsClient interface { + + // Returns alarm associated with alarm-id. If HTTP status 404 is returned, this means the specified alarm-id is invalid or the alarm with alarm-id has been deleted. An alarm is deleted by the system if it is RESOLVED and older than eight days. The system can also delete the remaining RESOLVED alarms sooner to free system resources when too many alarms are being generated. When this happens the oldest day's RESOLVED alarms are deleted first. + // + // @param alarmIdParam (required) + // @return com.vmware.nsx.model.Alarm + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(alarmIdParam string) (model.Alarm, error) + + // Returns a list of all Alarms currently known to the system. + // + // @param afterParam Timestamp in milliseconds since epoch (optional) + // @param beforeParam Timestamp in milliseconds since epoch (optional) + // @param cursorParam Cursor for pagination (optional) + // @param eventTypeParam Event Type Filter (optional) + // @param featureNameParam Feature Name (optional) + // @param idParam Alarm ID (optional) + // @param intentPathParam Intent Path for entity ID (optional) + // @param nodeIdParam Node ID (optional) + // @param nodeResourceTypeParam Node Resource Type (optional) + // @param pageSizeParam Page Size for pagination (optional) + // @param severityParam Severity (optional) + // @param sortAscendingParam Represents order of sorting the values (optional, default to true) + // @param sortByParam Key for sorting on this column (optional) + // @param statusParam Status (optional) + // @return com.vmware.nsx.model.AlarmsListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(afterParam *int64, beforeParam *int64, cursorParam *string, eventTypeParam *string, featureNameParam *string, idParam *string, intentPathParam *string, nodeIdParam *string, nodeResourceTypeParam *string, pageSizeParam *int64, severityParam *string, sortAscendingParam *bool, sortByParam *string, statusParam *string) (model.AlarmsListResult, error) + + // Update status of an Alarm. The new_status value can be OPEN, ACKNOWLEDGED, SUPPRESSED, or RESOLVED. If new_status is SUPPRESSED, the suppress_duration query parameter must also be specified. + // + // @param alarmIdParam (required) + // @param newStatusParam Status (required) + // @param suppressDurationParam Duration in hours for which Alarm should be suppressed (optional) + // @return com.vmware.nsx.model.Alarm + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Setstatus(alarmIdParam string, newStatusParam string, suppressDurationParam *int64) (model.Alarm, error) + + // Bulk update the status of zero or more Alarms that match the specified filters. The new_status value can be OPEN, ACKNOWLEDGED, SUPPRESSED, or RESOLVED. If new_status is SUPPRESSED, the suppress_duration query parameter must also be specified. + // + // @param newStatusParam Status (required) + // @param afterParam Timestamp in milliseconds since epoch (optional) + // @param beforeParam Timestamp in milliseconds since epoch (optional) + // @param cursorParam Cursor for pagination (optional) + // @param eventTypeParam Event Type Filter (optional) + // @param featureNameParam Feature Name (optional) + // @param idParam Alarm ID (optional) + // @param intentPathParam Intent Path for entity ID (optional) + // @param nodeIdParam Node ID (optional) + // @param nodeResourceTypeParam Node Resource Type (optional) + // @param pageSizeParam Page Size for pagination (optional) + // @param severityParam Severity (optional) + // @param sortAscendingParam Represents order of sorting the values (optional, default to true) + // @param sortByParam Key for sorting on this column (optional) + // @param statusParam Status (optional) + // @param suppressDurationParam Duration in hours for which Alarm should be suppressed (optional) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Setstatus0(newStatusParam string, afterParam *int64, beforeParam *int64, cursorParam *string, eventTypeParam *string, featureNameParam *string, idParam *string, intentPathParam *string, nodeIdParam *string, nodeResourceTypeParam *string, pageSizeParam *int64, severityParam *string, sortAscendingParam *bool, sortByParam *string, statusParam *string, suppressDurationParam *int64) error +} + +type alarmsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAlarmsClient(connector client.Connector) *alarmsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.alarms") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "setstatus": core.NewMethodIdentifier(interfaceIdentifier, "setstatus"), + "setstatus_0": core.NewMethodIdentifier(interfaceIdentifier, "setstatus_0"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := alarmsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *alarmsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *alarmsClient) Get(alarmIdParam string) (model.Alarm, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(alarmsGetInputType(), typeConverter) + sv.AddStructField("AlarmId", alarmIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Alarm + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := alarmsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.alarms", "get", inputDataValue, executionContext) + var emptyOutput model.Alarm + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), alarmsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Alarm), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (aIface *alarmsClient) List(afterParam *int64, beforeParam *int64, cursorParam *string, eventTypeParam *string, featureNameParam *string, idParam *string, intentPathParam *string, nodeIdParam *string, nodeResourceTypeParam *string, pageSizeParam *int64, severityParam *string, sortAscendingParam *bool, sortByParam *string, statusParam *string) (model.AlarmsListResult, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(alarmsListInputType(), typeConverter) + sv.AddStructField("After", afterParam) + sv.AddStructField("Before", beforeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("EventType", eventTypeParam) + sv.AddStructField("FeatureName", featureNameParam) + sv.AddStructField("Id", idParam) + sv.AddStructField("IntentPath", intentPathParam) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("NodeResourceType", nodeResourceTypeParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("Severity", severityParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Status", statusParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.AlarmsListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := alarmsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.alarms", "list", inputDataValue, executionContext) + var emptyOutput model.AlarmsListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), alarmsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.AlarmsListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (aIface *alarmsClient) Setstatus(alarmIdParam string, newStatusParam string, suppressDurationParam *int64) (model.Alarm, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(alarmsSetstatusInputType(), typeConverter) + sv.AddStructField("AlarmId", alarmIdParam) + sv.AddStructField("NewStatus", newStatusParam) + sv.AddStructField("SuppressDuration", suppressDurationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Alarm + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := alarmsSetstatusRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.alarms", "setstatus", inputDataValue, executionContext) + var emptyOutput model.Alarm + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), alarmsSetstatusOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Alarm), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (aIface *alarmsClient) Setstatus0(newStatusParam string, afterParam *int64, beforeParam *int64, cursorParam *string, eventTypeParam *string, featureNameParam *string, idParam *string, intentPathParam *string, nodeIdParam *string, nodeResourceTypeParam *string, pageSizeParam *int64, severityParam *string, sortAscendingParam *bool, sortByParam *string, statusParam *string, suppressDurationParam *int64) error { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(alarmsSetstatus0InputType(), typeConverter) + sv.AddStructField("NewStatus", newStatusParam) + sv.AddStructField("After", afterParam) + sv.AddStructField("Before", beforeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("EventType", eventTypeParam) + sv.AddStructField("FeatureName", featureNameParam) + sv.AddStructField("Id", idParam) + sv.AddStructField("IntentPath", intentPathParam) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("NodeResourceType", nodeResourceTypeParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("Severity", severityParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Status", statusParam) + sv.AddStructField("SuppressDuration", suppressDurationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := alarmsSetstatus0RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.alarms", "setstatus_0", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/AlarmsTypes.go b/services/nsxt-mp/nsx/AlarmsTypes.go new file mode 100644 index 000000000..808343868 --- /dev/null +++ b/services/nsxt-mp/nsx/AlarmsTypes.go @@ -0,0 +1,421 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Alarms. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``newStatus`` of method Alarms#setstatus. +const Alarms_SETSTATUS_NEW_STATUS_OPEN = "OPEN" + +// Possible value for ``newStatus`` of method Alarms#setstatus. +const Alarms_SETSTATUS_NEW_STATUS_ACKNOWLEDGED = "ACKNOWLEDGED" + +// Possible value for ``newStatus`` of method Alarms#setstatus. +const Alarms_SETSTATUS_NEW_STATUS_SUPPRESSED = "SUPPRESSED" + +// Possible value for ``newStatus`` of method Alarms#setstatus. +const Alarms_SETSTATUS_NEW_STATUS_RESOLVED = "RESOLVED" + +// Possible value for ``newStatus`` of method Alarms#setstatus0. +const Alarms_SETSTATUS_0_NEW_STATUS_OPEN = "OPEN" + +// Possible value for ``newStatus`` of method Alarms#setstatus0. +const Alarms_SETSTATUS_0_NEW_STATUS_ACKNOWLEDGED = "ACKNOWLEDGED" + +// Possible value for ``newStatus`` of method Alarms#setstatus0. +const Alarms_SETSTATUS_0_NEW_STATUS_SUPPRESSED = "SUPPRESSED" + +// Possible value for ``newStatus`` of method Alarms#setstatus0. +const Alarms_SETSTATUS_0_NEW_STATUS_RESOLVED = "RESOLVED" + +func alarmsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["alarm_id"] = bindings.NewStringType() + fieldNameMap["alarm_id"] = "AlarmId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func alarmsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.AlarmBindingType) +} + +func alarmsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["alarm_id"] = bindings.NewStringType() + fieldNameMap["alarm_id"] = "AlarmId" + paramsTypeMap["alarm_id"] = bindings.NewStringType() + paramsTypeMap["alarmId"] = bindings.NewStringType() + pathParams["alarm_id"] = "alarmId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/alarms/{alarmId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func alarmsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["after"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["before"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["event_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["feature_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["intent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["node_resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["severity"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["after"] = "After" + fieldNameMap["before"] = "Before" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["event_type"] = "EventType" + fieldNameMap["feature_name"] = "FeatureName" + fieldNameMap["id"] = "Id" + fieldNameMap["intent_path"] = "IntentPath" + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["node_resource_type"] = "NodeResourceType" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["severity"] = "Severity" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func alarmsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.AlarmsListResultBindingType) +} + +func alarmsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["after"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["before"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["event_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["feature_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["intent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["node_resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["severity"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["after"] = "After" + fieldNameMap["before"] = "Before" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["event_type"] = "EventType" + fieldNameMap["feature_name"] = "FeatureName" + fieldNameMap["id"] = "Id" + fieldNameMap["intent_path"] = "IntentPath" + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["node_resource_type"] = "NodeResourceType" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["severity"] = "Severity" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["status"] = "Status" + paramsTypeMap["id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["node_resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["after"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["event_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["feature_name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["intent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["status"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["before"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["severity"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["severity"] = "severity" + queryParams["feature_name"] = "feature_name" + queryParams["before"] = "before" + queryParams["intent_path"] = "intent_path" + queryParams["sort_by"] = "sort_by" + queryParams["event_type"] = "event_type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["after"] = "after" + queryParams["id"] = "id" + queryParams["node_resource_type"] = "node_resource_type" + queryParams["node_id"] = "node_id" + queryParams["page_size"] = "page_size" + queryParams["status"] = "status" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/alarms", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func alarmsSetstatusInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["alarm_id"] = bindings.NewStringType() + fields["new_status"] = bindings.NewStringType() + fields["suppress_duration"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["alarm_id"] = "AlarmId" + fieldNameMap["new_status"] = "NewStatus" + fieldNameMap["suppress_duration"] = "SuppressDuration" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func alarmsSetstatusOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.AlarmBindingType) +} + +func alarmsSetstatusRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["alarm_id"] = bindings.NewStringType() + fields["new_status"] = bindings.NewStringType() + fields["suppress_duration"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["alarm_id"] = "AlarmId" + fieldNameMap["new_status"] = "NewStatus" + fieldNameMap["suppress_duration"] = "SuppressDuration" + paramsTypeMap["suppress_duration"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["alarm_id"] = bindings.NewStringType() + paramsTypeMap["new_status"] = bindings.NewStringType() + paramsTypeMap["alarmId"] = bindings.NewStringType() + pathParams["alarm_id"] = "alarmId" + queryParams["new_status"] = "new_status" + queryParams["suppress_duration"] = "suppress_duration" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=set_status", + "", + "POST", + "/api/v1/alarms/{alarmId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func alarmsSetstatus0InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["new_status"] = bindings.NewStringType() + fields["after"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["before"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["event_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["feature_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["intent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["node_resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["severity"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["suppress_duration"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["new_status"] = "NewStatus" + fieldNameMap["after"] = "After" + fieldNameMap["before"] = "Before" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["event_type"] = "EventType" + fieldNameMap["feature_name"] = "FeatureName" + fieldNameMap["id"] = "Id" + fieldNameMap["intent_path"] = "IntentPath" + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["node_resource_type"] = "NodeResourceType" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["severity"] = "Severity" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["status"] = "Status" + fieldNameMap["suppress_duration"] = "SuppressDuration" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func alarmsSetstatus0OutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func alarmsSetstatus0RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["new_status"] = bindings.NewStringType() + fields["after"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["before"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["event_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["feature_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["intent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["node_resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["severity"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["suppress_duration"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["new_status"] = "NewStatus" + fieldNameMap["after"] = "After" + fieldNameMap["before"] = "Before" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["event_type"] = "EventType" + fieldNameMap["feature_name"] = "FeatureName" + fieldNameMap["id"] = "Id" + fieldNameMap["intent_path"] = "IntentPath" + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["node_resource_type"] = "NodeResourceType" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["severity"] = "Severity" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["status"] = "Status" + fieldNameMap["suppress_duration"] = "SuppressDuration" + paramsTypeMap["id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["node_resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["after"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["event_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["feature_name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["new_status"] = bindings.NewStringType() + paramsTypeMap["intent_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["suppress_duration"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["status"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["before"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["severity"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["severity"] = "severity" + queryParams["feature_name"] = "feature_name" + queryParams["before"] = "before" + queryParams["new_status"] = "new_status" + queryParams["intent_path"] = "intent_path" + queryParams["sort_by"] = "sort_by" + queryParams["suppress_duration"] = "suppress_duration" + queryParams["event_type"] = "event_type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["after"] = "after" + queryParams["id"] = "id" + queryParams["node_resource_type"] = "node_resource_type" + queryParams["node_id"] = "node_id" + queryParams["page_size"] = "page_size" + queryParams["status"] = "status" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=set_status", + "", + "POST", + "/api/v1/alarms", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/AssociationsClient.go b/services/nsxt-mp/nsx/AssociationsClient.go new file mode 100644 index 000000000..de74510e5 --- /dev/null +++ b/services/nsxt-mp/nsx/AssociationsClient.go @@ -0,0 +1,106 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Associations +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AssociationsClient interface { + + // Returns information about resources that are associated with the given resource. Id and type of the resource for which associated resources are to be fetched are to be specified as query parameter in the URI. Resource type of the associated resources must be specified as query parameter. + // + // @param associatedResourceTypeParam Resource type valid for use as target in association API (required) + // @param resourceIdParam The resource for which associated resources are to be fetched (required) + // @param resourceTypeParam Resource type valid for use as source in association API (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param fetchAncestorsParam Fetch complete list of associated resources considering containment and nesting (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.AssociationListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(associatedResourceTypeParam string, resourceIdParam string, resourceTypeParam string, cursorParam *string, fetchAncestorsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.AssociationListResult, error) +} + +type associationsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAssociationsClient(connector client.Connector) *associationsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.associations") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := associationsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *associationsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *associationsClient) List(associatedResourceTypeParam string, resourceIdParam string, resourceTypeParam string, cursorParam *string, fetchAncestorsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.AssociationListResult, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(associationsListInputType(), typeConverter) + sv.AddStructField("AssociatedResourceType", associatedResourceTypeParam) + sv.AddStructField("ResourceId", resourceIdParam) + sv.AddStructField("ResourceType", resourceTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("FetchAncestors", fetchAncestorsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.AssociationListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := associationsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.associations", "list", inputDataValue, executionContext) + var emptyOutput model.AssociationListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), associationsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.AssociationListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/AssociationsTypes.go b/services/nsxt-mp/nsx/AssociationsTypes.go new file mode 100644 index 000000000..6fc358879 --- /dev/null +++ b/services/nsxt-mp/nsx/AssociationsTypes.go @@ -0,0 +1,155 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Associations. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``associatedResourceType`` of method Associations#list. +const Associations_LIST_ASSOCIATED_RESOURCE_TYPE_NSGROUP = "NSGroup" + +// Possible value for ``resourceType`` of method Associations#list. +const Associations_LIST_RESOURCE_TYPE_NSGROUP = "NSGroup" + +// Possible value for ``resourceType`` of method Associations#list. +const Associations_LIST_RESOURCE_TYPE_IPSET = "IPSet" + +// Possible value for ``resourceType`` of method Associations#list. +const Associations_LIST_RESOURCE_TYPE_MACSET = "MACSet" + +// Possible value for ``resourceType`` of method Associations#list. +const Associations_LIST_RESOURCE_TYPE_LOGICALSWITCH = "LogicalSwitch" + +// Possible value for ``resourceType`` of method Associations#list. +const Associations_LIST_RESOURCE_TYPE_LOGICALPORT = "LogicalPort" + +// Possible value for ``resourceType`` of method Associations#list. +const Associations_LIST_RESOURCE_TYPE_VIRTUALMACHINE = "VirtualMachine" + +// Possible value for ``resourceType`` of method Associations#list. +const Associations_LIST_RESOURCE_TYPE_DIRECTORYGROUP = "DirectoryGroup" + +// Possible value for ``resourceType`` of method Associations#list. +const Associations_LIST_RESOURCE_TYPE_VIRTUALNETWORKINTERFACE = "VirtualNetworkInterface" + +// Possible value for ``resourceType`` of method Associations#list. +const Associations_LIST_RESOURCE_TYPE_TRANSPORTNODE = "TransportNode" + +// Possible value for ``resourceType`` of method Associations#list. +const Associations_LIST_RESOURCE_TYPE_IPADDRESS = "IPAddress" + +// Possible value for ``resourceType`` of method Associations#list. +const Associations_LIST_RESOURCE_TYPE_CLOUDNATIVESERVICEINSTANCE = "CloudNativeServiceInstance" + +// Possible value for ``resourceType`` of method Associations#list. +const Associations_LIST_RESOURCE_TYPE_PHYSICALSERVER = "PhysicalServer" + +func associationsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["associated_resource_type"] = bindings.NewStringType() + fields["resource_id"] = bindings.NewStringType() + fields["resource_type"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["fetch_ancestors"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["associated_resource_type"] = "AssociatedResourceType" + fieldNameMap["resource_id"] = "ResourceId" + fieldNameMap["resource_type"] = "ResourceType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["fetch_ancestors"] = "FetchAncestors" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func associationsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.AssociationListResultBindingType) +} + +func associationsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["associated_resource_type"] = bindings.NewStringType() + fields["resource_id"] = bindings.NewStringType() + fields["resource_type"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["fetch_ancestors"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["associated_resource_type"] = "AssociatedResourceType" + fieldNameMap["resource_id"] = "ResourceId" + fieldNameMap["resource_type"] = "ResourceType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["fetch_ancestors"] = "FetchAncestors" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["resource_type"] = bindings.NewStringType() + paramsTypeMap["resource_id"] = bindings.NewStringType() + paramsTypeMap["fetch_ancestors"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["associated_resource_type"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["resource_type"] = "resource_type" + queryParams["resource_id"] = "resource_id" + queryParams["sort_by"] = "sort_by" + queryParams["associated_resource_type"] = "associated_resource_type" + queryParams["fetch_ancestors"] = "fetch_ancestors" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/associations", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/AutomaticHealthCheckToggleClient.go b/services/nsxt-mp/nsx/AutomaticHealthCheckToggleClient.go new file mode 100644 index 000000000..15450c8c0 --- /dev/null +++ b/services/nsxt-mp/nsx/AutomaticHealthCheckToggleClient.go @@ -0,0 +1,130 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: AutomaticHealthCheckToggle +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AutomaticHealthCheckToggleClient interface { + + // Get detailed info for automatic health check toggle. + // @return com.vmware.nsx.model.AutomaticHealthCheckToggle + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.AutomaticHealthCheckToggle, error) + + // Change status of automatic health check toggle to enabled/disabled. + // + // @param automaticHealthCheckToggleParam (required) + // @return com.vmware.nsx.model.AutomaticHealthCheckToggle + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(automaticHealthCheckToggleParam model.AutomaticHealthCheckToggle) (model.AutomaticHealthCheckToggle, error) +} + +type automaticHealthCheckToggleClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAutomaticHealthCheckToggleClient(connector client.Connector) *automaticHealthCheckToggleClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.automatic_health_check_toggle") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := automaticHealthCheckToggleClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *automaticHealthCheckToggleClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *automaticHealthCheckToggleClient) Get() (model.AutomaticHealthCheckToggle, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(automaticHealthCheckToggleGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.AutomaticHealthCheckToggle + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := automaticHealthCheckToggleGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.automatic_health_check_toggle", "get", inputDataValue, executionContext) + var emptyOutput model.AutomaticHealthCheckToggle + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), automaticHealthCheckToggleGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.AutomaticHealthCheckToggle), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (aIface *automaticHealthCheckToggleClient) Update(automaticHealthCheckToggleParam model.AutomaticHealthCheckToggle) (model.AutomaticHealthCheckToggle, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(automaticHealthCheckToggleUpdateInputType(), typeConverter) + sv.AddStructField("AutomaticHealthCheckToggle", automaticHealthCheckToggleParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.AutomaticHealthCheckToggle + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := automaticHealthCheckToggleUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.automatic_health_check_toggle", "update", inputDataValue, executionContext) + var emptyOutput model.AutomaticHealthCheckToggle + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), automaticHealthCheckToggleUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.AutomaticHealthCheckToggle), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/AutomaticHealthCheckToggleTypes.go b/services/nsxt-mp/nsx/AutomaticHealthCheckToggleTypes.go new file mode 100644 index 000000000..384d03895 --- /dev/null +++ b/services/nsxt-mp/nsx/AutomaticHealthCheckToggleTypes.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: AutomaticHealthCheckToggle. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func automaticHealthCheckToggleGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func automaticHealthCheckToggleGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.AutomaticHealthCheckToggleBindingType) +} + +func automaticHealthCheckToggleGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/automatic-health-check-toggle", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func automaticHealthCheckToggleUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["automatic_health_check_toggle"] = bindings.NewReferenceType(model.AutomaticHealthCheckToggleBindingType) + fieldNameMap["automatic_health_check_toggle"] = "AutomaticHealthCheckToggle" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func automaticHealthCheckToggleUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.AutomaticHealthCheckToggleBindingType) +} + +func automaticHealthCheckToggleUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["automatic_health_check_toggle"] = bindings.NewReferenceType(model.AutomaticHealthCheckToggleBindingType) + fieldNameMap["automatic_health_check_toggle"] = "AutomaticHealthCheckToggle" + paramsTypeMap["automatic_health_check_toggle"] = bindings.NewReferenceType(model.AutomaticHealthCheckToggleBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "automatic_health_check_toggle", + "PUT", + "/api/v1/automatic-health-check-toggle", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/AutomaticHealthChecksClient.go b/services/nsxt-mp/nsx/AutomaticHealthChecksClient.go new file mode 100644 index 000000000..4a01cf938 --- /dev/null +++ b/services/nsxt-mp/nsx/AutomaticHealthChecksClient.go @@ -0,0 +1,98 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: AutomaticHealthChecks +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AutomaticHealthChecksClient interface { + + // Query automatic health checks with list parameters. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.AutomaticHealthCheckListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.AutomaticHealthCheckListResult, error) +} + +type automaticHealthChecksClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAutomaticHealthChecksClient(connector client.Connector) *automaticHealthChecksClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.automatic_health_checks") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := automaticHealthChecksClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *automaticHealthChecksClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *automaticHealthChecksClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.AutomaticHealthCheckListResult, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(automaticHealthChecksListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.AutomaticHealthCheckListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := automaticHealthChecksListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.automatic_health_checks", "list", inputDataValue, executionContext) + var emptyOutput model.AutomaticHealthCheckListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), automaticHealthChecksListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.AutomaticHealthCheckListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/AutomaticHealthChecksTypes.go b/services/nsxt-mp/nsx/AutomaticHealthChecksTypes.go new file mode 100644 index 000000000..e6a6f83a0 --- /dev/null +++ b/services/nsxt-mp/nsx/AutomaticHealthChecksTypes.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: AutomaticHealthChecks. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func automaticHealthChecksListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func automaticHealthChecksListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.AutomaticHealthCheckListResultBindingType) +} + +func automaticHealthChecksListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/automatic-health-checks", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/BatchClient.go b/services/nsxt-mp/nsx/BatchClient.go new file mode 100644 index 000000000..ef11c54fe --- /dev/null +++ b/services/nsxt-mp/nsx/BatchClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Batch +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type BatchClient interface { + + // Enables you to make multiple API requests using a single request. The batch API takes in an array of logical HTTP requests represented as JSON arrays. Each request has a method (GET, PUT, POST, or DELETE), a relative_url (the portion of the URL after https:///api/), optional headers array (corresponding to HTTP headers) and an optional body (for POST and PUT requests). The batch API returns an array of logical HTTP responses represented as JSON arrays. Each response has a status code, an optional headers array and an optional body (which is a JSON-encoded string). + // + // @param batchRequestParam (required) + // @param atomicParam Ignored (transactional atomicity flag) (optional, default to false) + // @return com.vmware.nsx.model.BatchResponse + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(batchRequestParam model.BatchRequest, atomicParam *bool) (model.BatchResponse, error) +} + +type batchClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewBatchClient(connector client.Connector) *batchClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.batch") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + bIface := batchClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &bIface +} + +func (bIface *batchClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := bIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (bIface *batchClient) Create(batchRequestParam model.BatchRequest, atomicParam *bool) (model.BatchResponse, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(batchCreateInputType(), typeConverter) + sv.AddStructField("BatchRequest", batchRequestParam) + sv.AddStructField("Atomic", atomicParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BatchResponse + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := batchCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.batch", "create", inputDataValue, executionContext) + var emptyOutput model.BatchResponse + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), batchCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BatchResponse), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/BatchTypes.go b/services/nsxt-mp/nsx/BatchTypes.go new file mode 100644 index 000000000..8a1146249 --- /dev/null +++ b/services/nsxt-mp/nsx/BatchTypes.go @@ -0,0 +1,73 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Batch. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func batchCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["batch_request"] = bindings.NewReferenceType(model.BatchRequestBindingType) + fields["atomic"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["batch_request"] = "BatchRequest" + fieldNameMap["atomic"] = "Atomic" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func batchCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BatchResponseBindingType) +} + +func batchCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["batch_request"] = bindings.NewReferenceType(model.BatchRequestBindingType) + fields["atomic"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["batch_request"] = "BatchRequest" + fieldNameMap["atomic"] = "Atomic" + paramsTypeMap["batch_request"] = bindings.NewReferenceType(model.BatchRequestBindingType) + paramsTypeMap["atomic"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["atomic"] = "atomic" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "batch_request", + "POST", + "/api/v1/batch", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/BridgeEndpointProfilesClient.go b/services/nsxt-mp/nsx/BridgeEndpointProfilesClient.go new file mode 100644 index 000000000..a270d8d19 --- /dev/null +++ b/services/nsxt-mp/nsx/BridgeEndpointProfilesClient.go @@ -0,0 +1,269 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: BridgeEndpointProfiles +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type BridgeEndpointProfilesClient interface { + + // Creates a Bridge Endpoint Profile. Profile contains edge cluster id, indexes of the member nodes, fialover mode and high availability mode for a Bridge EndPoint + // + // @param bridgeEndpointProfileParam (required) + // @return com.vmware.nsx.model.BridgeEndpointProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(bridgeEndpointProfileParam model.BridgeEndpointProfile) (model.BridgeEndpointProfile, error) + + // Deletes the specified Bridge Endpoint Profile. + // + // @param bridgeendpointprofileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(bridgeendpointprofileIdParam string) error + + // Returns information about a specified bridge endpoint profile. + // + // @param bridgeendpointprofileIdParam (required) + // @return com.vmware.nsx.model.BridgeEndpointProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(bridgeendpointprofileIdParam string) (model.BridgeEndpointProfile, error) + + // Returns information about all configured bridge endoint profiles + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param edgeClusterIdParam Edge Cluster Identifier (optional) + // @param failoverModeParam (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.BridgeEndpointProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, edgeClusterIdParam *string, failoverModeParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.BridgeEndpointProfileListResult, error) + + // Modifies a existing bridge endpoint profile. + // + // @param bridgeendpointprofileIdParam (required) + // @param bridgeEndpointProfileParam (required) + // @return com.vmware.nsx.model.BridgeEndpointProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(bridgeendpointprofileIdParam string, bridgeEndpointProfileParam model.BridgeEndpointProfile) (model.BridgeEndpointProfile, error) +} + +type bridgeEndpointProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewBridgeEndpointProfilesClient(connector client.Connector) *bridgeEndpointProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.bridge_endpoint_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + bIface := bridgeEndpointProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &bIface +} + +func (bIface *bridgeEndpointProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := bIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (bIface *bridgeEndpointProfilesClient) Create(bridgeEndpointProfileParam model.BridgeEndpointProfile) (model.BridgeEndpointProfile, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bridgeEndpointProfilesCreateInputType(), typeConverter) + sv.AddStructField("BridgeEndpointProfile", bridgeEndpointProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BridgeEndpointProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bridgeEndpointProfilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.bridge_endpoint_profiles", "create", inputDataValue, executionContext) + var emptyOutput model.BridgeEndpointProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bridgeEndpointProfilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BridgeEndpointProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (bIface *bridgeEndpointProfilesClient) Delete(bridgeendpointprofileIdParam string) error { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bridgeEndpointProfilesDeleteInputType(), typeConverter) + sv.AddStructField("BridgeendpointprofileId", bridgeendpointprofileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bridgeEndpointProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.bridge_endpoint_profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (bIface *bridgeEndpointProfilesClient) Get(bridgeendpointprofileIdParam string) (model.BridgeEndpointProfile, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bridgeEndpointProfilesGetInputType(), typeConverter) + sv.AddStructField("BridgeendpointprofileId", bridgeendpointprofileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BridgeEndpointProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bridgeEndpointProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.bridge_endpoint_profiles", "get", inputDataValue, executionContext) + var emptyOutput model.BridgeEndpointProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bridgeEndpointProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BridgeEndpointProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (bIface *bridgeEndpointProfilesClient) List(cursorParam *string, edgeClusterIdParam *string, failoverModeParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.BridgeEndpointProfileListResult, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bridgeEndpointProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("EdgeClusterId", edgeClusterIdParam) + sv.AddStructField("FailoverMode", failoverModeParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BridgeEndpointProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bridgeEndpointProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.bridge_endpoint_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.BridgeEndpointProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bridgeEndpointProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BridgeEndpointProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (bIface *bridgeEndpointProfilesClient) Update(bridgeendpointprofileIdParam string, bridgeEndpointProfileParam model.BridgeEndpointProfile) (model.BridgeEndpointProfile, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bridgeEndpointProfilesUpdateInputType(), typeConverter) + sv.AddStructField("BridgeendpointprofileId", bridgeendpointprofileIdParam) + sv.AddStructField("BridgeEndpointProfile", bridgeEndpointProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BridgeEndpointProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bridgeEndpointProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.bridge_endpoint_profiles", "update", inputDataValue, executionContext) + var emptyOutput model.BridgeEndpointProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bridgeEndpointProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BridgeEndpointProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/BridgeEndpointProfilesTypes.go b/services/nsxt-mp/nsx/BridgeEndpointProfilesTypes.go new file mode 100644 index 000000000..a0e7417c1 --- /dev/null +++ b/services/nsxt-mp/nsx/BridgeEndpointProfilesTypes.go @@ -0,0 +1,307 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: BridgeEndpointProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func bridgeEndpointProfilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bridge_endpoint_profile"] = bindings.NewReferenceType(model.BridgeEndpointProfileBindingType) + fieldNameMap["bridge_endpoint_profile"] = "BridgeEndpointProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bridgeEndpointProfilesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BridgeEndpointProfileBindingType) +} + +func bridgeEndpointProfilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["bridge_endpoint_profile"] = bindings.NewReferenceType(model.BridgeEndpointProfileBindingType) + fieldNameMap["bridge_endpoint_profile"] = "BridgeEndpointProfile" + paramsTypeMap["bridge_endpoint_profile"] = bindings.NewReferenceType(model.BridgeEndpointProfileBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "bridge_endpoint_profile", + "POST", + "/api/v1/bridge-endpoint-profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func bridgeEndpointProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bridgeendpointprofile_id"] = bindings.NewStringType() + fieldNameMap["bridgeendpointprofile_id"] = "BridgeendpointprofileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bridgeEndpointProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func bridgeEndpointProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["bridgeendpointprofile_id"] = bindings.NewStringType() + fieldNameMap["bridgeendpointprofile_id"] = "BridgeendpointprofileId" + paramsTypeMap["bridgeendpointprofile_id"] = bindings.NewStringType() + paramsTypeMap["bridgeendpointprofileId"] = bindings.NewStringType() + pathParams["bridgeendpointprofile_id"] = "bridgeendpointprofileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/bridge-endpoint-profiles/{bridgeendpointprofileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func bridgeEndpointProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bridgeendpointprofile_id"] = bindings.NewStringType() + fieldNameMap["bridgeendpointprofile_id"] = "BridgeendpointprofileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bridgeEndpointProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BridgeEndpointProfileBindingType) +} + +func bridgeEndpointProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["bridgeendpointprofile_id"] = bindings.NewStringType() + fieldNameMap["bridgeendpointprofile_id"] = "BridgeendpointprofileId" + paramsTypeMap["bridgeendpointprofile_id"] = bindings.NewStringType() + paramsTypeMap["bridgeendpointprofileId"] = bindings.NewStringType() + pathParams["bridgeendpointprofile_id"] = "bridgeendpointprofileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/bridge-endpoint-profiles/{bridgeendpointprofileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func bridgeEndpointProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["edge_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["failover_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + fieldNameMap["failover_mode"] = "FailoverMode" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bridgeEndpointProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BridgeEndpointProfileListResultBindingType) +} + +func bridgeEndpointProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["edge_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["failover_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + fieldNameMap["failover_mode"] = "FailoverMode" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["edge_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["failover_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["edge_cluster_id"] = "edge_cluster_id" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["failover_mode"] = "failover_mode" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/bridge-endpoint-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func bridgeEndpointProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bridgeendpointprofile_id"] = bindings.NewStringType() + fields["bridge_endpoint_profile"] = bindings.NewReferenceType(model.BridgeEndpointProfileBindingType) + fieldNameMap["bridgeendpointprofile_id"] = "BridgeendpointprofileId" + fieldNameMap["bridge_endpoint_profile"] = "BridgeEndpointProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bridgeEndpointProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BridgeEndpointProfileBindingType) +} + +func bridgeEndpointProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["bridgeendpointprofile_id"] = bindings.NewStringType() + fields["bridge_endpoint_profile"] = bindings.NewReferenceType(model.BridgeEndpointProfileBindingType) + fieldNameMap["bridgeendpointprofile_id"] = "BridgeendpointprofileId" + fieldNameMap["bridge_endpoint_profile"] = "BridgeEndpointProfile" + paramsTypeMap["bridgeendpointprofile_id"] = bindings.NewStringType() + paramsTypeMap["bridge_endpoint_profile"] = bindings.NewReferenceType(model.BridgeEndpointProfileBindingType) + paramsTypeMap["bridgeendpointprofileId"] = bindings.NewStringType() + pathParams["bridgeendpointprofile_id"] = "bridgeendpointprofileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "bridge_endpoint_profile", + "PUT", + "/api/v1/bridge-endpoint-profiles/{bridgeendpointprofileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/BridgeEndpointsClient.go b/services/nsxt-mp/nsx/BridgeEndpointsClient.go new file mode 100644 index 000000000..2a1967c6c --- /dev/null +++ b/services/nsxt-mp/nsx/BridgeEndpointsClient.go @@ -0,0 +1,273 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: BridgeEndpoints +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type BridgeEndpointsClient interface { + + // Creates a Bridge Endpoint. It describes the physical attributes of the bridge like vlan. A logical port can be attached to a vif providing bridging functionality from the logical overlay network to the physical vlan network + // + // @param bridgeEndpointParam (required) + // @return com.vmware.nsx.model.BridgeEndpoint + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(bridgeEndpointParam model.BridgeEndpoint) (model.BridgeEndpoint, error) + + // Deletes the specified Bridge Endpoint. + // + // @param bridgeendpointIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(bridgeendpointIdParam string) error + + // Returns information about a specified bridge endpoint. + // + // @param bridgeendpointIdParam (required) + // @return com.vmware.nsx.model.BridgeEndpoint + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(bridgeendpointIdParam string) (model.BridgeEndpoint, error) + + // Returns information about all configured bridge endoints + // + // @param bridgeClusterIdParam Bridge Cluster Identifier (optional) + // @param bridgeEndpointProfileIdParam Bridge endpoint profile used by the edge cluster (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param logicalSwitchIdParam Logical Switch Identifier (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param vlanTransportZoneIdParam VLAN transport zone id used by the edge cluster (optional) + // @return com.vmware.nsx.model.BridgeEndpointListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(bridgeClusterIdParam *string, bridgeEndpointProfileIdParam *string, cursorParam *string, includedFieldsParam *string, logicalSwitchIdParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, vlanTransportZoneIdParam *string) (model.BridgeEndpointListResult, error) + + // Modifies a existing bridge endpoint. + // + // @param bridgeendpointIdParam (required) + // @param bridgeEndpointParam (required) + // @return com.vmware.nsx.model.BridgeEndpoint + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(bridgeendpointIdParam string, bridgeEndpointParam model.BridgeEndpoint) (model.BridgeEndpoint, error) +} + +type bridgeEndpointsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewBridgeEndpointsClient(connector client.Connector) *bridgeEndpointsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.bridge_endpoints") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + bIface := bridgeEndpointsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &bIface +} + +func (bIface *bridgeEndpointsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := bIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (bIface *bridgeEndpointsClient) Create(bridgeEndpointParam model.BridgeEndpoint) (model.BridgeEndpoint, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bridgeEndpointsCreateInputType(), typeConverter) + sv.AddStructField("BridgeEndpoint", bridgeEndpointParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BridgeEndpoint + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bridgeEndpointsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.bridge_endpoints", "create", inputDataValue, executionContext) + var emptyOutput model.BridgeEndpoint + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bridgeEndpointsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BridgeEndpoint), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (bIface *bridgeEndpointsClient) Delete(bridgeendpointIdParam string) error { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bridgeEndpointsDeleteInputType(), typeConverter) + sv.AddStructField("BridgeendpointId", bridgeendpointIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bridgeEndpointsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.bridge_endpoints", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (bIface *bridgeEndpointsClient) Get(bridgeendpointIdParam string) (model.BridgeEndpoint, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bridgeEndpointsGetInputType(), typeConverter) + sv.AddStructField("BridgeendpointId", bridgeendpointIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BridgeEndpoint + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bridgeEndpointsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.bridge_endpoints", "get", inputDataValue, executionContext) + var emptyOutput model.BridgeEndpoint + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bridgeEndpointsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BridgeEndpoint), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (bIface *bridgeEndpointsClient) List(bridgeClusterIdParam *string, bridgeEndpointProfileIdParam *string, cursorParam *string, includedFieldsParam *string, logicalSwitchIdParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, vlanTransportZoneIdParam *string) (model.BridgeEndpointListResult, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bridgeEndpointsListInputType(), typeConverter) + sv.AddStructField("BridgeClusterId", bridgeClusterIdParam) + sv.AddStructField("BridgeEndpointProfileId", bridgeEndpointProfileIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("LogicalSwitchId", logicalSwitchIdParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("VlanTransportZoneId", vlanTransportZoneIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BridgeEndpointListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bridgeEndpointsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.bridge_endpoints", "list", inputDataValue, executionContext) + var emptyOutput model.BridgeEndpointListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bridgeEndpointsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BridgeEndpointListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (bIface *bridgeEndpointsClient) Update(bridgeendpointIdParam string, bridgeEndpointParam model.BridgeEndpoint) (model.BridgeEndpoint, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bridgeEndpointsUpdateInputType(), typeConverter) + sv.AddStructField("BridgeendpointId", bridgeendpointIdParam) + sv.AddStructField("BridgeEndpoint", bridgeEndpointParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BridgeEndpoint + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bridgeEndpointsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.bridge_endpoints", "update", inputDataValue, executionContext) + var emptyOutput model.BridgeEndpoint + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bridgeEndpointsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BridgeEndpoint), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/BridgeEndpointsTypes.go b/services/nsxt-mp/nsx/BridgeEndpointsTypes.go new file mode 100644 index 000000000..b339712b1 --- /dev/null +++ b/services/nsxt-mp/nsx/BridgeEndpointsTypes.go @@ -0,0 +1,319 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: BridgeEndpoints. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func bridgeEndpointsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bridge_endpoint"] = bindings.NewReferenceType(model.BridgeEndpointBindingType) + fieldNameMap["bridge_endpoint"] = "BridgeEndpoint" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bridgeEndpointsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BridgeEndpointBindingType) +} + +func bridgeEndpointsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["bridge_endpoint"] = bindings.NewReferenceType(model.BridgeEndpointBindingType) + fieldNameMap["bridge_endpoint"] = "BridgeEndpoint" + paramsTypeMap["bridge_endpoint"] = bindings.NewReferenceType(model.BridgeEndpointBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "bridge_endpoint", + "POST", + "/api/v1/bridge-endpoints", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func bridgeEndpointsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bridgeendpoint_id"] = bindings.NewStringType() + fieldNameMap["bridgeendpoint_id"] = "BridgeendpointId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bridgeEndpointsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func bridgeEndpointsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["bridgeendpoint_id"] = bindings.NewStringType() + fieldNameMap["bridgeendpoint_id"] = "BridgeendpointId" + paramsTypeMap["bridgeendpoint_id"] = bindings.NewStringType() + paramsTypeMap["bridgeendpointId"] = bindings.NewStringType() + pathParams["bridgeendpoint_id"] = "bridgeendpointId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/bridge-endpoints/{bridgeendpointId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func bridgeEndpointsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bridgeendpoint_id"] = bindings.NewStringType() + fieldNameMap["bridgeendpoint_id"] = "BridgeendpointId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bridgeEndpointsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BridgeEndpointBindingType) +} + +func bridgeEndpointsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["bridgeendpoint_id"] = bindings.NewStringType() + fieldNameMap["bridgeendpoint_id"] = "BridgeendpointId" + paramsTypeMap["bridgeendpoint_id"] = bindings.NewStringType() + paramsTypeMap["bridgeendpointId"] = bindings.NewStringType() + pathParams["bridgeendpoint_id"] = "bridgeendpointId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/bridge-endpoints/{bridgeendpointId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func bridgeEndpointsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bridge_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["bridge_endpoint_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["vlan_transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["bridge_cluster_id"] = "BridgeClusterId" + fieldNameMap["bridge_endpoint_profile_id"] = "BridgeEndpointProfileId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["vlan_transport_zone_id"] = "VlanTransportZoneId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bridgeEndpointsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BridgeEndpointListResultBindingType) +} + +func bridgeEndpointsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["bridge_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["bridge_endpoint_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["vlan_transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["bridge_cluster_id"] = "BridgeClusterId" + fieldNameMap["bridge_endpoint_profile_id"] = "BridgeEndpointProfileId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["vlan_transport_zone_id"] = "VlanTransportZoneId" + paramsTypeMap["bridge_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["bridge_endpoint_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["vlan_transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["bridge_endpoint_profile_id"] = "bridge_endpoint_profile_id" + queryParams["sort_by"] = "sort_by" + queryParams["vlan_transport_zone_id"] = "vlan_transport_zone_id" + queryParams["bridge_cluster_id"] = "bridge_cluster_id" + queryParams["logical_switch_id"] = "logical_switch_id" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/bridge-endpoints", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func bridgeEndpointsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bridgeendpoint_id"] = bindings.NewStringType() + fields["bridge_endpoint"] = bindings.NewReferenceType(model.BridgeEndpointBindingType) + fieldNameMap["bridgeendpoint_id"] = "BridgeendpointId" + fieldNameMap["bridge_endpoint"] = "BridgeEndpoint" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bridgeEndpointsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BridgeEndpointBindingType) +} + +func bridgeEndpointsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["bridgeendpoint_id"] = bindings.NewStringType() + fields["bridge_endpoint"] = bindings.NewReferenceType(model.BridgeEndpointBindingType) + fieldNameMap["bridgeendpoint_id"] = "BridgeendpointId" + fieldNameMap["bridge_endpoint"] = "BridgeEndpoint" + paramsTypeMap["bridgeendpoint_id"] = bindings.NewStringType() + paramsTypeMap["bridge_endpoint"] = bindings.NewReferenceType(model.BridgeEndpointBindingType) + paramsTypeMap["bridgeendpointId"] = bindings.NewStringType() + pathParams["bridgeendpoint_id"] = "bridgeendpointId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "bridge_endpoint", + "PUT", + "/api/v1/bridge-endpoints/{bridgeendpointId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ClusterClient.go b/services/nsxt-mp/nsx/ClusterClient.go new file mode 100644 index 000000000..61ffa809d --- /dev/null +++ b/services/nsxt-mp/nsx/ClusterClient.go @@ -0,0 +1,449 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Cluster +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ClusterClient interface { + + // Request one-time backup. The backup will be uploaded using the same server configuration as for automatic backup. + // + // @param frameTypeParam Frame type (optional, default to LOCAL_LOCAL_MANAGER) + // @param siteIdParam Site ID (optional, default to localhost) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Backuptoremote(frameTypeParam *string, siteIdParam *string) error + + // Invoke POST request on target cluster node + // + // @param targetNodeIdParam Target node UUID or keyword self (required) + // @param targetUriParam URI of API to invoke on target node (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws TimedOut Gateway Timeout + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(targetNodeIdParam string, targetUriParam string) error + + // Invoke DELETE request on target cluster node + // + // @param targetNodeIdParam Target node UUID or keyword self (required) + // @param targetUriParam URI of API to invoke on target node (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws TimedOut Gateway Timeout + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(targetNodeIdParam string, targetUriParam string) error + + // Returns information about the NSX cluster configuration. An NSX cluster has two functions or purposes, commonly referred to as \"roles.\" These two roles are control and management. Each NSX installation has a single cluster. Separate NSX clusters do not share data. In other words, a given data-plane node is attached to only one cluster, not to multiple clusters. + // @return com.vmware.nsx.model.ClusterConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.ClusterConfig, error) + + // Returns information about the specified NSX cluster node. + // + // @param nodeIdParam (required) + // @return com.vmware.nsx.model.ClusterNodeInfo + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get0(nodeIdParam string) (model.ClusterNodeInfo, error) + + // Invoke GET request on target cluster node + // + // @param targetNodeIdParam Target node UUID or keyword self (required) + // @param targetUriParam URI of API to invoke on target node (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws TimedOut Gateway Timeout + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get1(targetNodeIdParam string, targetUriParam string) error + + // Join this node to a NSX Cluster + // + // @param joinClusterParametersParam (required) + // @return com.vmware.nsx.model.ClusterConfiguration + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Joincluster(joinClusterParametersParam model.JoinClusterParameters) (model.ClusterConfiguration, error) + + // Detach a node from the Cluster + // + // @param nodeIdParam UUID of the node (required) + // @param forceParam (optional) + // @param gracefulShutdownParam (optional, default to false) + // @param ignoreRepositoryIpCheckParam (optional, default to false) + // @return com.vmware.nsx.model.ClusterConfiguration + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Removenode(nodeIdParam string, forceParam *string, gracefulShutdownParam *string, ignoreRepositoryIpCheckParam *string) (model.ClusterConfiguration, error) + + // Request one-time inventory summary. The backup will be uploaded using the same server configuration as for an automatic backup. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Summarizeinventorytoremote() error + + // Invoke PUT request on target cluster node + // + // @param targetNodeIdParam Target node UUID or keyword self (required) + // @param targetUriParam URI of API to invoke on target node (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws TimedOut Gateway Timeout + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(targetNodeIdParam string, targetUriParam string) error +} + +type clusterClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewClusterClient(connector client.Connector) *clusterClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster") + methodIdentifiers := map[string]core.MethodIdentifier{ + "backuptoremote": core.NewMethodIdentifier(interfaceIdentifier, "backuptoremote"), + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "get_0": core.NewMethodIdentifier(interfaceIdentifier, "get_0"), + "get_1": core.NewMethodIdentifier(interfaceIdentifier, "get_1"), + "joincluster": core.NewMethodIdentifier(interfaceIdentifier, "joincluster"), + "removenode": core.NewMethodIdentifier(interfaceIdentifier, "removenode"), + "summarizeinventorytoremote": core.NewMethodIdentifier(interfaceIdentifier, "summarizeinventorytoremote"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := clusterClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *clusterClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *clusterClient) Backuptoremote(frameTypeParam *string, siteIdParam *string) error { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clusterBackuptoremoteInputType(), typeConverter) + sv.AddStructField("FrameType", frameTypeParam) + sv.AddStructField("SiteId", siteIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clusterBackuptoremoteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster", "backuptoremote", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *clusterClient) Create(targetNodeIdParam string, targetUriParam string) error { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clusterCreateInputType(), typeConverter) + sv.AddStructField("TargetNodeId", targetNodeIdParam) + sv.AddStructField("TargetUri", targetUriParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clusterCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster", "create", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *clusterClient) Delete(targetNodeIdParam string, targetUriParam string) error { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clusterDeleteInputType(), typeConverter) + sv.AddStructField("TargetNodeId", targetNodeIdParam) + sv.AddStructField("TargetUri", targetUriParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clusterDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *clusterClient) Get() (model.ClusterConfig, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clusterGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clusterGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster", "get", inputDataValue, executionContext) + var emptyOutput model.ClusterConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), clusterGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *clusterClient) Get0(nodeIdParam string) (model.ClusterNodeInfo, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clusterGet0InputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterNodeInfo + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clusterGet0RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster", "get_0", inputDataValue, executionContext) + var emptyOutput model.ClusterNodeInfo + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), clusterGet0OutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterNodeInfo), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *clusterClient) Get1(targetNodeIdParam string, targetUriParam string) error { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clusterGet1InputType(), typeConverter) + sv.AddStructField("TargetNodeId", targetNodeIdParam) + sv.AddStructField("TargetUri", targetUriParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clusterGet1RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster", "get_1", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *clusterClient) Joincluster(joinClusterParametersParam model.JoinClusterParameters) (model.ClusterConfiguration, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clusterJoinclusterInputType(), typeConverter) + sv.AddStructField("JoinClusterParameters", joinClusterParametersParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterConfiguration + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clusterJoinclusterRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster", "joincluster", inputDataValue, executionContext) + var emptyOutput model.ClusterConfiguration + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), clusterJoinclusterOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterConfiguration), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *clusterClient) Removenode(nodeIdParam string, forceParam *string, gracefulShutdownParam *string, ignoreRepositoryIpCheckParam *string) (model.ClusterConfiguration, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clusterRemovenodeInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("Force", forceParam) + sv.AddStructField("GracefulShutdown", gracefulShutdownParam) + sv.AddStructField("IgnoreRepositoryIpCheck", ignoreRepositoryIpCheckParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterConfiguration + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clusterRemovenodeRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster", "removenode", inputDataValue, executionContext) + var emptyOutput model.ClusterConfiguration + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), clusterRemovenodeOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterConfiguration), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *clusterClient) Summarizeinventorytoremote() error { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clusterSummarizeinventorytoremoteInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clusterSummarizeinventorytoremoteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster", "summarizeinventorytoremote", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *clusterClient) Update(targetNodeIdParam string, targetUriParam string) error { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clusterUpdateInputType(), typeConverter) + sv.AddStructField("TargetNodeId", targetNodeIdParam) + sv.AddStructField("TargetUri", targetUriParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clusterUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster", "update", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ClusterProfilesClient.go b/services/nsxt-mp/nsx/ClusterProfilesClient.go new file mode 100644 index 000000000..3239341e1 --- /dev/null +++ b/services/nsxt-mp/nsx/ClusterProfilesClient.go @@ -0,0 +1,275 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ClusterProfiles +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ClusterProfilesClient interface { + + // Create a cluster profile. The resource_type is required. + // + // @param clusterProfileParam (required) + // The parameter must contain all the properties defined in model.ClusterProfile. + // @return com.vmware.nsx.model.ClusterProfile + // The return value will contain all the properties defined in model.ClusterProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(clusterProfileParam *data.StructValue) (*data.StructValue, error) + + // Delete a specified cluster profile. + // + // @param clusterProfileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(clusterProfileIdParam string) error + + // Returns information about a specified cluster profile. + // + // @param clusterProfileIdParam (required) + // @return com.vmware.nsx.model.ClusterProfile + // The return value will contain all the properties defined in model.ClusterProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(clusterProfileIdParam string) (*data.StructValue, error) + + // Returns paginated list of cluster profiles Cluster profiles define policies for edge cluster and bridge cluster. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeSystemOwnedParam Whether the list result contains system resources (optional, default to true) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param resourceTypeParam Supported cluster profiles. (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.ClusterProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeSystemOwnedParam *bool, includedFieldsParam *string, pageSizeParam *int64, resourceTypeParam *string, sortAscendingParam *bool, sortByParam *string) (model.ClusterProfileListResult, error) + + // Modifie a specified cluster profile. The body of the PUT request must include the resource_type. + // + // @param clusterProfileIdParam (required) + // @param clusterProfileParam (required) + // The parameter must contain all the properties defined in model.ClusterProfile. + // @return com.vmware.nsx.model.ClusterProfile + // The return value will contain all the properties defined in model.ClusterProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(clusterProfileIdParam string, clusterProfileParam *data.StructValue) (*data.StructValue, error) +} + +type clusterProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewClusterProfilesClient(connector client.Connector) *clusterProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := clusterProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *clusterProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *clusterProfilesClient) Create(clusterProfileParam *data.StructValue) (*data.StructValue, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clusterProfilesCreateInputType(), typeConverter) + sv.AddStructField("ClusterProfile", clusterProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clusterProfilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster_profiles", "create", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), clusterProfilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *clusterProfilesClient) Delete(clusterProfileIdParam string) error { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clusterProfilesDeleteInputType(), typeConverter) + sv.AddStructField("ClusterProfileId", clusterProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clusterProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster_profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *clusterProfilesClient) Get(clusterProfileIdParam string) (*data.StructValue, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clusterProfilesGetInputType(), typeConverter) + sv.AddStructField("ClusterProfileId", clusterProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clusterProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster_profiles", "get", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), clusterProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *clusterProfilesClient) List(cursorParam *string, includeSystemOwnedParam *bool, includedFieldsParam *string, pageSizeParam *int64, resourceTypeParam *string, sortAscendingParam *bool, sortByParam *string) (model.ClusterProfileListResult, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clusterProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeSystemOwned", includeSystemOwnedParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("ResourceType", resourceTypeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clusterProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.ClusterProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), clusterProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *clusterProfilesClient) Update(clusterProfileIdParam string, clusterProfileParam *data.StructValue) (*data.StructValue, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clusterProfilesUpdateInputType(), typeConverter) + sv.AddStructField("ClusterProfileId", clusterProfileIdParam) + sv.AddStructField("ClusterProfile", clusterProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clusterProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster_profiles", "update", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), clusterProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ClusterProfilesTypes.go b/services/nsxt-mp/nsx/ClusterProfilesTypes.go new file mode 100644 index 000000000..23e12324c --- /dev/null +++ b/services/nsxt-mp/nsx/ClusterProfilesTypes.go @@ -0,0 +1,313 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ClusterProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``resourceType`` of method ClusterProfiles#list. +const ClusterProfiles_LIST_RESOURCE_TYPE_EDGEHIGHAVAILABILITYPROFILE = "EdgeHighAvailabilityProfile" + +// Possible value for ``resourceType`` of method ClusterProfiles#list. +const ClusterProfiles_LIST_RESOURCE_TYPE_BRIDGEHIGHAVAILABILITYCLUSTERPROFILE = "BridgeHighAvailabilityClusterProfile" + +func clusterProfilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cluster_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.ClusterProfileBindingType)}, bindings.REST) + fieldNameMap["cluster_profile"] = "ClusterProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clusterProfilesCreateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.ClusterProfileBindingType)}, bindings.REST) +} + +func clusterProfilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cluster_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.ClusterProfileBindingType)}, bindings.REST) + fieldNameMap["cluster_profile"] = "ClusterProfile" + paramsTypeMap["cluster_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.ClusterProfileBindingType)}, bindings.REST) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "cluster_profile", + "POST", + "/api/v1/cluster-profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func clusterProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cluster_profile_id"] = bindings.NewStringType() + fieldNameMap["cluster_profile_id"] = "ClusterProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clusterProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func clusterProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cluster_profile_id"] = bindings.NewStringType() + fieldNameMap["cluster_profile_id"] = "ClusterProfileId" + paramsTypeMap["cluster_profile_id"] = bindings.NewStringType() + paramsTypeMap["clusterProfileId"] = bindings.NewStringType() + pathParams["cluster_profile_id"] = "clusterProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/cluster-profiles/{clusterProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func clusterProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cluster_profile_id"] = bindings.NewStringType() + fieldNameMap["cluster_profile_id"] = "ClusterProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clusterProfilesGetOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.ClusterProfileBindingType)}, bindings.REST) +} + +func clusterProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cluster_profile_id"] = bindings.NewStringType() + fieldNameMap["cluster_profile_id"] = "ClusterProfileId" + paramsTypeMap["cluster_profile_id"] = bindings.NewStringType() + paramsTypeMap["clusterProfileId"] = bindings.NewStringType() + pathParams["cluster_profile_id"] = "clusterProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster-profiles/{clusterProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func clusterProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_system_owned"] = "IncludeSystemOwned" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["resource_type"] = "ResourceType" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clusterProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterProfileListResultBindingType) +} + +func clusterProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_system_owned"] = "IncludeSystemOwned" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["resource_type"] = "ResourceType" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["include_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["include_system_owned"] = "include_system_owned" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["resource_type"] = "resource_type" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func clusterProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cluster_profile_id"] = bindings.NewStringType() + fields["cluster_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.ClusterProfileBindingType)}, bindings.REST) + fieldNameMap["cluster_profile_id"] = "ClusterProfileId" + fieldNameMap["cluster_profile"] = "ClusterProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clusterProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.ClusterProfileBindingType)}, bindings.REST) +} + +func clusterProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cluster_profile_id"] = bindings.NewStringType() + fields["cluster_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.ClusterProfileBindingType)}, bindings.REST) + fieldNameMap["cluster_profile_id"] = "ClusterProfileId" + fieldNameMap["cluster_profile"] = "ClusterProfile" + paramsTypeMap["cluster_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.ClusterProfileBindingType)}, bindings.REST) + paramsTypeMap["cluster_profile_id"] = bindings.NewStringType() + paramsTypeMap["clusterProfileId"] = bindings.NewStringType() + pathParams["cluster_profile_id"] = "clusterProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "cluster_profile", + "PUT", + "/api/v1/cluster-profiles/{clusterProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ClusterTypes.go b/services/nsxt-mp/nsx/ClusterTypes.go new file mode 100644 index 000000000..81c453d03 --- /dev/null +++ b/services/nsxt-mp/nsx/ClusterTypes.go @@ -0,0 +1,584 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Cluster. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``frameType`` of method Cluster#backuptoremote. +const Cluster_BACKUPTOREMOTE_FRAME_TYPE_GLOBAL_MANAGER = "GLOBAL_MANAGER" + +// Possible value for ``frameType`` of method Cluster#backuptoremote. +const Cluster_BACKUPTOREMOTE_FRAME_TYPE_LOCAL_MANAGER = "LOCAL_MANAGER" + +// Possible value for ``frameType`` of method Cluster#backuptoremote. +const Cluster_BACKUPTOREMOTE_FRAME_TYPE_LOCAL_LOCAL_MANAGER = "LOCAL_LOCAL_MANAGER" + +// Possible value for ``frameType`` of method Cluster#backuptoremote. +const Cluster_BACKUPTOREMOTE_FRAME_TYPE_NSX_INTELLIGENCE = "NSX_INTELLIGENCE" + +// Possible value for ``force`` of method Cluster#removenode. +const Cluster_REMOVENODE_FORCE_TRUE = "true" + +// Possible value for ``force`` of method Cluster#removenode. +const Cluster_REMOVENODE_FORCE_FALSE = "false" + +// Possible value for ``gracefulShutdown`` of method Cluster#removenode. +const Cluster_REMOVENODE_GRACEFUL_SHUTDOWN_TRUE = "true" + +// Possible value for ``gracefulShutdown`` of method Cluster#removenode. +const Cluster_REMOVENODE_GRACEFUL_SHUTDOWN_FALSE = "false" + +// Possible value for ``ignoreRepositoryIpCheck`` of method Cluster#removenode. +const Cluster_REMOVENODE_IGNORE_REPOSITORY_IP_CHECK_TRUE = "true" + +// Possible value for ``ignoreRepositoryIpCheck`` of method Cluster#removenode. +const Cluster_REMOVENODE_IGNORE_REPOSITORY_IP_CHECK_FALSE = "false" + +func clusterBackuptoremoteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["frame_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["frame_type"] = "FrameType" + fieldNameMap["site_id"] = "SiteId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clusterBackuptoremoteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func clusterBackuptoremoteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["frame_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["frame_type"] = "FrameType" + fieldNameMap["site_id"] = "SiteId" + paramsTypeMap["frame_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["site_id"] = "site_id" + queryParams["frame_type"] = "frame_type" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=backup_to_remote", + "", + "POST", + "/api/v1/cluster", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func clusterCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["target_node_id"] = bindings.NewStringType() + fields["target_uri"] = bindings.NewStringType() + fieldNameMap["target_node_id"] = "TargetNodeId" + fieldNameMap["target_uri"] = "TargetUri" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clusterCreateOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func clusterCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["target_node_id"] = bindings.NewStringType() + fields["target_uri"] = bindings.NewStringType() + fieldNameMap["target_node_id"] = "TargetNodeId" + fieldNameMap["target_uri"] = "TargetUri" + paramsTypeMap["target_uri"] = bindings.NewStringType() + paramsTypeMap["target_node_id"] = bindings.NewStringType() + paramsTypeMap["targetNodeId"] = bindings.NewStringType() + paramsTypeMap["targetUri"] = bindings.NewStringType() + pathParams["target_uri"] = "targetUri" + pathParams["target_node_id"] = "targetNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "POST", + "/api/v1/cluster/{targetNodeId}/{targetUri}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.timed_out": 500, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func clusterDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["target_node_id"] = bindings.NewStringType() + fields["target_uri"] = bindings.NewStringType() + fieldNameMap["target_node_id"] = "TargetNodeId" + fieldNameMap["target_uri"] = "TargetUri" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clusterDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func clusterDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["target_node_id"] = bindings.NewStringType() + fields["target_uri"] = bindings.NewStringType() + fieldNameMap["target_node_id"] = "TargetNodeId" + fieldNameMap["target_uri"] = "TargetUri" + paramsTypeMap["target_uri"] = bindings.NewStringType() + paramsTypeMap["target_node_id"] = bindings.NewStringType() + paramsTypeMap["targetNodeId"] = bindings.NewStringType() + paramsTypeMap["targetUri"] = bindings.NewStringType() + pathParams["target_uri"] = "targetUri" + pathParams["target_node_id"] = "targetNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/cluster/{targetNodeId}/{targetUri}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.timed_out": 500, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func clusterGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clusterGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterConfigBindingType) +} + +func clusterGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func clusterGet0InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clusterGet0OutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterNodeInfoBindingType) +} + +func clusterGet0RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/{nodeId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func clusterGet1InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["target_node_id"] = bindings.NewStringType() + fields["target_uri"] = bindings.NewStringType() + fieldNameMap["target_node_id"] = "TargetNodeId" + fieldNameMap["target_uri"] = "TargetUri" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clusterGet1OutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func clusterGet1RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["target_node_id"] = bindings.NewStringType() + fields["target_uri"] = bindings.NewStringType() + fieldNameMap["target_node_id"] = "TargetNodeId" + fieldNameMap["target_uri"] = "TargetUri" + paramsTypeMap["target_uri"] = bindings.NewStringType() + paramsTypeMap["target_node_id"] = bindings.NewStringType() + paramsTypeMap["targetNodeId"] = bindings.NewStringType() + paramsTypeMap["targetUri"] = bindings.NewStringType() + pathParams["target_uri"] = "targetUri" + pathParams["target_node_id"] = "targetNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/{targetNodeId}/{targetUri}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.timed_out": 500, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func clusterJoinclusterInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["join_cluster_parameters"] = bindings.NewReferenceType(model.JoinClusterParametersBindingType) + fieldNameMap["join_cluster_parameters"] = "JoinClusterParameters" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clusterJoinclusterOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterConfigurationBindingType) +} + +func clusterJoinclusterRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["join_cluster_parameters"] = bindings.NewReferenceType(model.JoinClusterParametersBindingType) + fieldNameMap["join_cluster_parameters"] = "JoinClusterParameters" + paramsTypeMap["join_cluster_parameters"] = bindings.NewReferenceType(model.JoinClusterParametersBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=join_cluster", + "join_cluster_parameters", + "POST", + "/api/v1/cluster", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func clusterRemovenodeInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["graceful_shutdown"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["ignore_repository_ip_check"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["force"] = "Force" + fieldNameMap["graceful_shutdown"] = "GracefulShutdown" + fieldNameMap["ignore_repository_ip_check"] = "IgnoreRepositoryIpCheck" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clusterRemovenodeOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterConfigurationBindingType) +} + +func clusterRemovenodeRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["graceful_shutdown"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["ignore_repository_ip_check"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["force"] = "Force" + fieldNameMap["graceful_shutdown"] = "GracefulShutdown" + fieldNameMap["ignore_repository_ip_check"] = "IgnoreRepositoryIpCheck" + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["ignore_repository_ip_check"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["graceful_shutdown"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + queryParams["graceful_shutdown"] = "graceful-shutdown" + queryParams["ignore_repository_ip_check"] = "ignore-repository-ip-check" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=remove_node", + "", + "POST", + "/api/v1/cluster/{nodeId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func clusterSummarizeinventorytoremoteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clusterSummarizeinventorytoremoteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func clusterSummarizeinventorytoremoteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=summarize_inventory_to_remote", + "", + "POST", + "/api/v1/cluster", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func clusterUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["target_node_id"] = bindings.NewStringType() + fields["target_uri"] = bindings.NewStringType() + fieldNameMap["target_node_id"] = "TargetNodeId" + fieldNameMap["target_uri"] = "TargetUri" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clusterUpdateOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func clusterUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["target_node_id"] = bindings.NewStringType() + fields["target_uri"] = bindings.NewStringType() + fieldNameMap["target_node_id"] = "TargetNodeId" + fieldNameMap["target_uri"] = "TargetUri" + paramsTypeMap["target_uri"] = bindings.NewStringType() + paramsTypeMap["target_node_id"] = bindings.NewStringType() + paramsTypeMap["targetNodeId"] = bindings.NewStringType() + paramsTypeMap["targetUri"] = bindings.NewStringType() + pathParams["target_uri"] = "targetUri" + pathParams["target_node_id"] = "targetNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "PUT", + "/api/v1/cluster/{targetNodeId}/{targetUri}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.timed_out": 500, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/EdgeClustersClient.go b/services/nsxt-mp/nsx/EdgeClustersClient.go new file mode 100644 index 000000000..50f3fac18 --- /dev/null +++ b/services/nsxt-mp/nsx/EdgeClustersClient.go @@ -0,0 +1,310 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: EdgeClusters +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type EdgeClustersClient interface { + + // Creates a new edge cluster. It only supports homogeneous members. The TransportNodes backed by EdgeNode are only allowed in cluster members. DeploymentType (VIRTUAL_MACHINE|PHYSICAL_MACHINE) of these EdgeNodes is recommended to be the same. EdgeCluster supports members of different deployment types. + // + // @param edgeClusterParam (required) + // @return com.vmware.nsx.model.EdgeCluster + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(edgeClusterParam model.EdgeCluster) (model.EdgeCluster, error) + + // Deletes the specified edge cluster. + // + // @param edgeClusterIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(edgeClusterIdParam string) error + + // Returns information about the specified edge cluster. + // + // @param edgeClusterIdParam (required) + // @return com.vmware.nsx.model.EdgeCluster + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(edgeClusterIdParam string) (model.EdgeCluster, error) + + // Returns information about the configured edge clusters, which enable you to group together transport nodes of the type EdgeNode and apply fabric profiles to all members of the edge cluster. Each edge node can participate in only one edge cluster. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.EdgeClusterListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.EdgeClusterListResult, error) + + // Replace the transport node in the specified member of the edge-cluster. This is a disruptive action. This will move all the LogicalRouterPorts(uplink and routerLink) host on the old transport_node to the new transport_node. The transportNode cannot be present in another member of any edgeClusters. + // + // @param edgeClusterIdParam (required) + // @param edgeClusterMemberTransportNodeParam (required) + // @return com.vmware.nsx.model.EdgeCluster + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Replacetransportnode(edgeClusterIdParam string, edgeClusterMemberTransportNodeParam model.EdgeClusterMemberTransportNode) (model.EdgeCluster, error) + + // Modifies the specified edge cluster. Modifiable parameters include the description, display_name, transport-node-id. If the optional fabric_profile_binding is included, resource_type and profile_id are required. User should do a GET on the edge-cluster and obtain the payload and retain the member_index of the existing members as returning in the GET output. For new member additions, the member_index cannot be defined by the user, user can read the system allocated index to the new member in the output of this API call or by doing a GET call. User cannot use this PUT api to replace the transport_node of an existing member because this is a disruption action, we have exposed a explicit API for doing so, refer to \"ReplaceEdgeClusterMemberTransportNode\" EdgeCluster only supports homogeneous members. The TransportNodes backed by EdgeNode are only allowed in cluster members. DeploymentType (VIRTUAL_MACHINE|PHYSICAL_MACHINE) of these EdgeNodes is recommended to be the same. EdgeCluster supports members of different deployment types. + // + // @param edgeClusterIdParam (required) + // @param edgeClusterParam (required) + // @return com.vmware.nsx.model.EdgeCluster + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(edgeClusterIdParam string, edgeClusterParam model.EdgeCluster) (model.EdgeCluster, error) +} + +type edgeClustersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewEdgeClustersClient(connector client.Connector) *edgeClustersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.edge_clusters") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "replacetransportnode": core.NewMethodIdentifier(interfaceIdentifier, "replacetransportnode"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + eIface := edgeClustersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &eIface +} + +func (eIface *edgeClustersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := eIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (eIface *edgeClustersClient) Create(edgeClusterParam model.EdgeCluster) (model.EdgeCluster, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(edgeClustersCreateInputType(), typeConverter) + sv.AddStructField("EdgeCluster", edgeClusterParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EdgeCluster + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := edgeClustersCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.edge_clusters", "create", inputDataValue, executionContext) + var emptyOutput model.EdgeCluster + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), edgeClustersCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EdgeCluster), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *edgeClustersClient) Delete(edgeClusterIdParam string) error { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(edgeClustersDeleteInputType(), typeConverter) + sv.AddStructField("EdgeClusterId", edgeClusterIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := edgeClustersDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.edge_clusters", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (eIface *edgeClustersClient) Get(edgeClusterIdParam string) (model.EdgeCluster, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(edgeClustersGetInputType(), typeConverter) + sv.AddStructField("EdgeClusterId", edgeClusterIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EdgeCluster + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := edgeClustersGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.edge_clusters", "get", inputDataValue, executionContext) + var emptyOutput model.EdgeCluster + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), edgeClustersGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EdgeCluster), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *edgeClustersClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.EdgeClusterListResult, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(edgeClustersListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EdgeClusterListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := edgeClustersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.edge_clusters", "list", inputDataValue, executionContext) + var emptyOutput model.EdgeClusterListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), edgeClustersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EdgeClusterListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *edgeClustersClient) Replacetransportnode(edgeClusterIdParam string, edgeClusterMemberTransportNodeParam model.EdgeClusterMemberTransportNode) (model.EdgeCluster, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(edgeClustersReplacetransportnodeInputType(), typeConverter) + sv.AddStructField("EdgeClusterId", edgeClusterIdParam) + sv.AddStructField("EdgeClusterMemberTransportNode", edgeClusterMemberTransportNodeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EdgeCluster + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := edgeClustersReplacetransportnodeRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.edge_clusters", "replacetransportnode", inputDataValue, executionContext) + var emptyOutput model.EdgeCluster + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), edgeClustersReplacetransportnodeOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EdgeCluster), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *edgeClustersClient) Update(edgeClusterIdParam string, edgeClusterParam model.EdgeCluster) (model.EdgeCluster, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(edgeClustersUpdateInputType(), typeConverter) + sv.AddStructField("EdgeClusterId", edgeClusterIdParam) + sv.AddStructField("EdgeCluster", edgeClusterParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EdgeCluster + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := edgeClustersUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.edge_clusters", "update", inputDataValue, executionContext) + var emptyOutput model.EdgeCluster + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), edgeClustersUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EdgeCluster), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/EdgeClustersTypes.go b/services/nsxt-mp/nsx/EdgeClustersTypes.go new file mode 100644 index 000000000..2f456198d --- /dev/null +++ b/services/nsxt-mp/nsx/EdgeClustersTypes.go @@ -0,0 +1,350 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: EdgeClusters. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func edgeClustersCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["edge_cluster"] = bindings.NewReferenceType(model.EdgeClusterBindingType) + fieldNameMap["edge_cluster"] = "EdgeCluster" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func edgeClustersCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EdgeClusterBindingType) +} + +func edgeClustersCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["edge_cluster"] = bindings.NewReferenceType(model.EdgeClusterBindingType) + fieldNameMap["edge_cluster"] = "EdgeCluster" + paramsTypeMap["edge_cluster"] = bindings.NewReferenceType(model.EdgeClusterBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "edge_cluster", + "POST", + "/api/v1/edge-clusters", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func edgeClustersDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["edge_cluster_id"] = bindings.NewStringType() + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func edgeClustersDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func edgeClustersDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["edge_cluster_id"] = bindings.NewStringType() + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + paramsTypeMap["edge_cluster_id"] = bindings.NewStringType() + paramsTypeMap["edgeClusterId"] = bindings.NewStringType() + pathParams["edge_cluster_id"] = "edgeClusterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/edge-clusters/{edgeClusterId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func edgeClustersGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["edge_cluster_id"] = bindings.NewStringType() + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func edgeClustersGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EdgeClusterBindingType) +} + +func edgeClustersGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["edge_cluster_id"] = bindings.NewStringType() + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + paramsTypeMap["edge_cluster_id"] = bindings.NewStringType() + paramsTypeMap["edgeClusterId"] = bindings.NewStringType() + pathParams["edge_cluster_id"] = "edgeClusterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/edge-clusters/{edgeClusterId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func edgeClustersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func edgeClustersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EdgeClusterListResultBindingType) +} + +func edgeClustersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/edge-clusters", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func edgeClustersReplacetransportnodeInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["edge_cluster_id"] = bindings.NewStringType() + fields["edge_cluster_member_transport_node"] = bindings.NewReferenceType(model.EdgeClusterMemberTransportNodeBindingType) + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + fieldNameMap["edge_cluster_member_transport_node"] = "EdgeClusterMemberTransportNode" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func edgeClustersReplacetransportnodeOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EdgeClusterBindingType) +} + +func edgeClustersReplacetransportnodeRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["edge_cluster_id"] = bindings.NewStringType() + fields["edge_cluster_member_transport_node"] = bindings.NewReferenceType(model.EdgeClusterMemberTransportNodeBindingType) + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + fieldNameMap["edge_cluster_member_transport_node"] = "EdgeClusterMemberTransportNode" + paramsTypeMap["edge_cluster_id"] = bindings.NewStringType() + paramsTypeMap["edge_cluster_member_transport_node"] = bindings.NewReferenceType(model.EdgeClusterMemberTransportNodeBindingType) + paramsTypeMap["edgeClusterId"] = bindings.NewStringType() + pathParams["edge_cluster_id"] = "edgeClusterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=replace_transport_node", + "edge_cluster_member_transport_node", + "POST", + "/api/v1/edge-clusters/{edgeClusterId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func edgeClustersUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["edge_cluster_id"] = bindings.NewStringType() + fields["edge_cluster"] = bindings.NewReferenceType(model.EdgeClusterBindingType) + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + fieldNameMap["edge_cluster"] = "EdgeCluster" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func edgeClustersUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EdgeClusterBindingType) +} + +func edgeClustersUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["edge_cluster_id"] = bindings.NewStringType() + fields["edge_cluster"] = bindings.NewReferenceType(model.EdgeClusterBindingType) + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + fieldNameMap["edge_cluster"] = "EdgeCluster" + paramsTypeMap["edge_cluster_id"] = bindings.NewStringType() + paramsTypeMap["edge_cluster"] = bindings.NewReferenceType(model.EdgeClusterBindingType) + paramsTypeMap["edgeClusterId"] = bindings.NewStringType() + pathParams["edge_cluster_id"] = "edgeClusterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "edge_cluster", + "PUT", + "/api/v1/edge-clusters/{edgeClusterId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ErrorResolverClient.go b/services/nsxt-mp/nsx/ErrorResolverClient.go new file mode 100644 index 000000000..29b0acd95 --- /dev/null +++ b/services/nsxt-mp/nsx/ErrorResolverClient.go @@ -0,0 +1,166 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ErrorResolver +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ErrorResolverClient interface { + + // Returns some metadata about the given error_id. This includes information of whether there is a resolver present for the given error_id and its associated user input data + // + // @param errorIdParam (required) + // @return com.vmware.nsx.model.ErrorResolverInfo + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(errorIdParam string) (model.ErrorResolverInfo, error) + + // Returns a list of metadata for all the error resolvers registered. + // @return com.vmware.nsx.model.ErrorResolverInfoList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.ErrorResolverInfoList, error) + + // Invokes the corresponding error resolver for the given error(s) present in the payload + // + // @param errorResolverMetadataListParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Resolveerror(errorResolverMetadataListParam model.ErrorResolverMetadataList) error +} + +type errorResolverClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewErrorResolverClient(connector client.Connector) *errorResolverClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.error_resolver") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "resolveerror": core.NewMethodIdentifier(interfaceIdentifier, "resolveerror"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + eIface := errorResolverClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &eIface +} + +func (eIface *errorResolverClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := eIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (eIface *errorResolverClient) Get(errorIdParam string) (model.ErrorResolverInfo, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(errorResolverGetInputType(), typeConverter) + sv.AddStructField("ErrorId", errorIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ErrorResolverInfo + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := errorResolverGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.error_resolver", "get", inputDataValue, executionContext) + var emptyOutput model.ErrorResolverInfo + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), errorResolverGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ErrorResolverInfo), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *errorResolverClient) List() (model.ErrorResolverInfoList, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(errorResolverListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ErrorResolverInfoList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := errorResolverListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.error_resolver", "list", inputDataValue, executionContext) + var emptyOutput model.ErrorResolverInfoList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), errorResolverListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ErrorResolverInfoList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *errorResolverClient) Resolveerror(errorResolverMetadataListParam model.ErrorResolverMetadataList) error { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(errorResolverResolveerrorInputType(), typeConverter) + sv.AddStructField("ErrorResolverMetadataList", errorResolverMetadataListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := errorResolverResolveerrorRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.error_resolver", "resolveerror", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ErrorResolverTypes.go b/services/nsxt-mp/nsx/ErrorResolverTypes.go new file mode 100644 index 000000000..67ba487ac --- /dev/null +++ b/services/nsxt-mp/nsx/ErrorResolverTypes.go @@ -0,0 +1,160 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ErrorResolver. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func errorResolverGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_id"] = bindings.NewStringType() + fieldNameMap["error_id"] = "ErrorId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func errorResolverGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ErrorResolverInfoBindingType) +} + +func errorResolverGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["error_id"] = bindings.NewStringType() + fieldNameMap["error_id"] = "ErrorId" + paramsTypeMap["error_id"] = bindings.NewStringType() + paramsTypeMap["errorId"] = bindings.NewStringType() + pathParams["error_id"] = "errorId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/error-resolver/{errorId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func errorResolverListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func errorResolverListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ErrorResolverInfoListBindingType) +} + +func errorResolverListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/error-resolver", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func errorResolverResolveerrorInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_resolver_metadata_list"] = bindings.NewReferenceType(model.ErrorResolverMetadataListBindingType) + fieldNameMap["error_resolver_metadata_list"] = "ErrorResolverMetadataList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func errorResolverResolveerrorOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func errorResolverResolveerrorRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["error_resolver_metadata_list"] = bindings.NewReferenceType(model.ErrorResolverMetadataListBindingType) + fieldNameMap["error_resolver_metadata_list"] = "ErrorResolverMetadataList" + paramsTypeMap["error_resolver_metadata_list"] = bindings.NewReferenceType(model.ErrorResolverMetadataListBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=resolve_error", + "error_resolver_metadata_list", + "POST", + "/api/v1/error-resolver", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/EventsClient.go b/services/nsxt-mp/nsx/EventsClient.go new file mode 100644 index 000000000..8cea906b0 --- /dev/null +++ b/services/nsxt-mp/nsx/EventsClient.go @@ -0,0 +1,218 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Events +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type EventsClient interface { + + // Returns event associated with event-id. + // + // @param eventIdParam (required) + // @return com.vmware.nsx.model.MonitoringEvent + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(eventIdParam string) (model.MonitoringEvent, error) + + // Returns a list of all Events defined in NSX. + // @return com.vmware.nsx.model.EventListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.EventListResult, error) + + // Reset all user configurable values for event identified by event-id to factory defaults. + // + // @param eventIdParam (required) + // @return com.vmware.nsx.model.MonitoringEvent + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Setdefault(eventIdParam string) (model.MonitoringEvent, error) + + // Update event identified by event-id. + // + // @param eventIdParam (required) + // @param monitoringEventParam (required) + // @return com.vmware.nsx.model.MonitoringEvent + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(eventIdParam string, monitoringEventParam model.MonitoringEvent) (model.MonitoringEvent, error) +} + +type eventsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewEventsClient(connector client.Connector) *eventsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.events") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "setdefault": core.NewMethodIdentifier(interfaceIdentifier, "setdefault"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + eIface := eventsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &eIface +} + +func (eIface *eventsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := eIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (eIface *eventsClient) Get(eventIdParam string) (model.MonitoringEvent, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(eventsGetInputType(), typeConverter) + sv.AddStructField("EventId", eventIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MonitoringEvent + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := eventsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.events", "get", inputDataValue, executionContext) + var emptyOutput model.MonitoringEvent + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), eventsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MonitoringEvent), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *eventsClient) List() (model.EventListResult, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(eventsListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EventListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := eventsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.events", "list", inputDataValue, executionContext) + var emptyOutput model.EventListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), eventsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EventListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *eventsClient) Setdefault(eventIdParam string) (model.MonitoringEvent, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(eventsSetdefaultInputType(), typeConverter) + sv.AddStructField("EventId", eventIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MonitoringEvent + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := eventsSetdefaultRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.events", "setdefault", inputDataValue, executionContext) + var emptyOutput model.MonitoringEvent + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), eventsSetdefaultOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MonitoringEvent), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *eventsClient) Update(eventIdParam string, monitoringEventParam model.MonitoringEvent) (model.MonitoringEvent, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(eventsUpdateInputType(), typeConverter) + sv.AddStructField("EventId", eventIdParam) + sv.AddStructField("MonitoringEvent", monitoringEventParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MonitoringEvent + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := eventsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.events", "update", inputDataValue, executionContext) + var emptyOutput model.MonitoringEvent + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), eventsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MonitoringEvent), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/EventsTypes.go b/services/nsxt-mp/nsx/EventsTypes.go new file mode 100644 index 000000000..5f5366cc6 --- /dev/null +++ b/services/nsxt-mp/nsx/EventsTypes.go @@ -0,0 +1,217 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Events. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func eventsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["event_id"] = bindings.NewStringType() + fieldNameMap["event_id"] = "EventId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func eventsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MonitoringEventBindingType) +} + +func eventsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["event_id"] = bindings.NewStringType() + fieldNameMap["event_id"] = "EventId" + paramsTypeMap["event_id"] = bindings.NewStringType() + paramsTypeMap["eventId"] = bindings.NewStringType() + pathParams["event_id"] = "eventId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/events/{eventId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func eventsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func eventsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EventListResultBindingType) +} + +func eventsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/events", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func eventsSetdefaultInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["event_id"] = bindings.NewStringType() + fieldNameMap["event_id"] = "EventId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func eventsSetdefaultOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MonitoringEventBindingType) +} + +func eventsSetdefaultRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["event_id"] = bindings.NewStringType() + fieldNameMap["event_id"] = "EventId" + paramsTypeMap["event_id"] = bindings.NewStringType() + paramsTypeMap["eventId"] = bindings.NewStringType() + pathParams["event_id"] = "eventId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=set_default", + "", + "POST", + "/api/v1/events/{eventId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func eventsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["event_id"] = bindings.NewStringType() + fields["monitoring_event"] = bindings.NewReferenceType(model.MonitoringEventBindingType) + fieldNameMap["event_id"] = "EventId" + fieldNameMap["monitoring_event"] = "MonitoringEvent" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func eventsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MonitoringEventBindingType) +} + +func eventsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["event_id"] = bindings.NewStringType() + fields["monitoring_event"] = bindings.NewReferenceType(model.MonitoringEventBindingType) + fieldNameMap["event_id"] = "EventId" + fieldNameMap["monitoring_event"] = "MonitoringEvent" + paramsTypeMap["event_id"] = bindings.NewStringType() + paramsTypeMap["monitoring_event"] = bindings.NewReferenceType(model.MonitoringEventBindingType) + paramsTypeMap["eventId"] = bindings.NewStringType() + pathParams["event_id"] = "eventId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "monitoring_event", + "PUT", + "/api/v1/events/{eventId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/FailureDomainsClient.go b/services/nsxt-mp/nsx/FailureDomainsClient.go new file mode 100644 index 000000000..f569de8b0 --- /dev/null +++ b/services/nsxt-mp/nsx/FailureDomainsClient.go @@ -0,0 +1,254 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: FailureDomains +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type FailureDomainsClient interface { + + // Creates a new failure domain. + // + // @param failureDomainParam (required) + // @return com.vmware.nsx.model.FailureDomain + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(failureDomainParam model.FailureDomain) (model.FailureDomain, error) + + // Deletes an existing failure domain. You can not delete system generated default failure domain. + // + // @param failureDomainIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(failureDomainIdParam string) error + + // Returns information about a single failure domain. + // + // @param failureDomainIdParam (required) + // @return com.vmware.nsx.model.FailureDomain + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(failureDomainIdParam string) (model.FailureDomain, error) + + // Returns information about configured failure domains. + // @return com.vmware.nsx.model.FailureDomainListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.FailureDomainListResult, error) + + // Updates an existing failure domain. Modifiable parameters are display_name, preferred_active_edge_services flag. + // + // @param failureDomainIdParam (required) + // @param failureDomainParam (required) + // @return com.vmware.nsx.model.FailureDomain + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(failureDomainIdParam string, failureDomainParam model.FailureDomain) (model.FailureDomain, error) +} + +type failureDomainsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewFailureDomainsClient(connector client.Connector) *failureDomainsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.failure_domains") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + fIface := failureDomainsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &fIface +} + +func (fIface *failureDomainsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := fIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (fIface *failureDomainsClient) Create(failureDomainParam model.FailureDomain) (model.FailureDomain, error) { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(failureDomainsCreateInputType(), typeConverter) + sv.AddStructField("FailureDomain", failureDomainParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FailureDomain + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := failureDomainsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.failure_domains", "create", inputDataValue, executionContext) + var emptyOutput model.FailureDomain + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), failureDomainsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FailureDomain), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (fIface *failureDomainsClient) Delete(failureDomainIdParam string) error { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(failureDomainsDeleteInputType(), typeConverter) + sv.AddStructField("FailureDomainId", failureDomainIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := failureDomainsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.failure_domains", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (fIface *failureDomainsClient) Get(failureDomainIdParam string) (model.FailureDomain, error) { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(failureDomainsGetInputType(), typeConverter) + sv.AddStructField("FailureDomainId", failureDomainIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FailureDomain + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := failureDomainsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.failure_domains", "get", inputDataValue, executionContext) + var emptyOutput model.FailureDomain + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), failureDomainsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FailureDomain), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (fIface *failureDomainsClient) List() (model.FailureDomainListResult, error) { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(failureDomainsListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FailureDomainListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := failureDomainsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.failure_domains", "list", inputDataValue, executionContext) + var emptyOutput model.FailureDomainListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), failureDomainsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FailureDomainListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (fIface *failureDomainsClient) Update(failureDomainIdParam string, failureDomainParam model.FailureDomain) (model.FailureDomain, error) { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(failureDomainsUpdateInputType(), typeConverter) + sv.AddStructField("FailureDomainId", failureDomainIdParam) + sv.AddStructField("FailureDomain", failureDomainParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FailureDomain + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := failureDomainsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.failure_domains", "update", inputDataValue, executionContext) + var emptyOutput model.FailureDomain + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), failureDomainsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FailureDomain), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/FailureDomainsTypes.go b/services/nsxt-mp/nsx/FailureDomainsTypes.go new file mode 100644 index 000000000..a0fdfaa9b --- /dev/null +++ b/services/nsxt-mp/nsx/FailureDomainsTypes.go @@ -0,0 +1,265 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: FailureDomains. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func failureDomainsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["failure_domain"] = bindings.NewReferenceType(model.FailureDomainBindingType) + fieldNameMap["failure_domain"] = "FailureDomain" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func failureDomainsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FailureDomainBindingType) +} + +func failureDomainsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["failure_domain"] = bindings.NewReferenceType(model.FailureDomainBindingType) + fieldNameMap["failure_domain"] = "FailureDomain" + paramsTypeMap["failure_domain"] = bindings.NewReferenceType(model.FailureDomainBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "failure_domain", + "POST", + "/api/v1/failure-domains", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func failureDomainsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["failure_domain_id"] = bindings.NewStringType() + fieldNameMap["failure_domain_id"] = "FailureDomainId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func failureDomainsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func failureDomainsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["failure_domain_id"] = bindings.NewStringType() + fieldNameMap["failure_domain_id"] = "FailureDomainId" + paramsTypeMap["failure_domain_id"] = bindings.NewStringType() + paramsTypeMap["failureDomainId"] = bindings.NewStringType() + pathParams["failure_domain_id"] = "failureDomainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/failure-domains/{failureDomainId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func failureDomainsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["failure_domain_id"] = bindings.NewStringType() + fieldNameMap["failure_domain_id"] = "FailureDomainId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func failureDomainsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FailureDomainBindingType) +} + +func failureDomainsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["failure_domain_id"] = bindings.NewStringType() + fieldNameMap["failure_domain_id"] = "FailureDomainId" + paramsTypeMap["failure_domain_id"] = bindings.NewStringType() + paramsTypeMap["failureDomainId"] = bindings.NewStringType() + pathParams["failure_domain_id"] = "failureDomainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/failure-domains/{failureDomainId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func failureDomainsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func failureDomainsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FailureDomainListResultBindingType) +} + +func failureDomainsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/failure-domains", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func failureDomainsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["failure_domain_id"] = bindings.NewStringType() + fields["failure_domain"] = bindings.NewReferenceType(model.FailureDomainBindingType) + fieldNameMap["failure_domain_id"] = "FailureDomainId" + fieldNameMap["failure_domain"] = "FailureDomain" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func failureDomainsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FailureDomainBindingType) +} + +func failureDomainsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["failure_domain_id"] = bindings.NewStringType() + fields["failure_domain"] = bindings.NewReferenceType(model.FailureDomainBindingType) + fieldNameMap["failure_domain_id"] = "FailureDomainId" + fieldNameMap["failure_domain"] = "FailureDomain" + paramsTypeMap["failure_domain_id"] = bindings.NewStringType() + paramsTypeMap["failure_domain"] = bindings.NewReferenceType(model.FailureDomainBindingType) + paramsTypeMap["failureDomainId"] = bindings.NewStringType() + pathParams["failure_domain_id"] = "failureDomainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "failure_domain", + "PUT", + "/api/v1/failure-domains/{failureDomainId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/GlobalConfigsClient.go b/services/nsxt-mp/nsx/GlobalConfigsClient.go new file mode 100644 index 000000000..90ea57379 --- /dev/null +++ b/services/nsxt-mp/nsx/GlobalConfigsClient.go @@ -0,0 +1,226 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: GlobalConfigs +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type GlobalConfigsClient interface { + + // Returns global configurations that belong to the config type. This rest routine is deprecated, and will be removed after a year. + // + // @param configTypeParam (required) + // @return com.vmware.nsx.model.GlobalConfigs + // The return value will contain all the properties defined in model.GlobalConfigs. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(configTypeParam string) (*data.StructValue, error) + + // Returns global configurations of a NSX domain grouped by the config types. These global configurations are valid across NSX domain for their respective types unless they are overridden by a more granular configurations. This rest routine is deprecated, and will be removed after a year. + // @return com.vmware.nsx.model.GlobalConfigsListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.GlobalConfigsListResult, error) + + // It is similar to update global configurations but this request would trigger update even if the configs are unmodified. However, the realization of the new configurations is config-type specific. Refer to config-type specific documentation for details about the configuration push state. This rest routine is deprecated, and will be removed after a year. + // + // @param configTypeParam (required) + // @param globalConfigsParam (required) + // The parameter must contain all the properties defined in model.GlobalConfigs. + // @return com.vmware.nsx.model.GlobalConfigs + // The return value will contain all the properties defined in model.GlobalConfigs. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Resyncconfig(configTypeParam string, globalConfigsParam *data.StructValue) (*data.StructValue, error) + + // Updates global configurations that belong to a config type. The request must include the updated values along with the unmodified values. The values that are updated(different) would trigger update to config-type specific state. However, the realization of the new configurations is config-type specific. Refer to config-type specific documentation for details about the config- uration push state. This rest routine is deprecated, and will be removed after a year. + // + // @param configTypeParam (required) + // @param globalConfigsParam (required) + // The parameter must contain all the properties defined in model.GlobalConfigs. + // @return com.vmware.nsx.model.GlobalConfigs + // The return value will contain all the properties defined in model.GlobalConfigs. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(configTypeParam string, globalConfigsParam *data.StructValue) (*data.StructValue, error) +} + +type globalConfigsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewGlobalConfigsClient(connector client.Connector) *globalConfigsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.global_configs") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "resyncconfig": core.NewMethodIdentifier(interfaceIdentifier, "resyncconfig"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + gIface := globalConfigsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &gIface +} + +func (gIface *globalConfigsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := gIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (gIface *globalConfigsClient) Get(configTypeParam string) (*data.StructValue, error) { + typeConverter := gIface.connector.TypeConverter() + executionContext := gIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(globalConfigsGetInputType(), typeConverter) + sv.AddStructField("ConfigType", configTypeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := globalConfigsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := gIface.connector.GetApiProvider().Invoke("com.vmware.nsx.global_configs", "get", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), globalConfigsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (gIface *globalConfigsClient) List() (model.GlobalConfigsListResult, error) { + typeConverter := gIface.connector.TypeConverter() + executionContext := gIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(globalConfigsListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.GlobalConfigsListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := globalConfigsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := gIface.connector.GetApiProvider().Invoke("com.vmware.nsx.global_configs", "list", inputDataValue, executionContext) + var emptyOutput model.GlobalConfigsListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), globalConfigsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.GlobalConfigsListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (gIface *globalConfigsClient) Resyncconfig(configTypeParam string, globalConfigsParam *data.StructValue) (*data.StructValue, error) { + typeConverter := gIface.connector.TypeConverter() + executionContext := gIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(globalConfigsResyncconfigInputType(), typeConverter) + sv.AddStructField("ConfigType", configTypeParam) + sv.AddStructField("GlobalConfigs", globalConfigsParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := globalConfigsResyncconfigRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := gIface.connector.GetApiProvider().Invoke("com.vmware.nsx.global_configs", "resyncconfig", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), globalConfigsResyncconfigOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (gIface *globalConfigsClient) Update(configTypeParam string, globalConfigsParam *data.StructValue) (*data.StructValue, error) { + typeConverter := gIface.connector.TypeConverter() + executionContext := gIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(globalConfigsUpdateInputType(), typeConverter) + sv.AddStructField("ConfigType", configTypeParam) + sv.AddStructField("GlobalConfigs", globalConfigsParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := globalConfigsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := gIface.connector.GetApiProvider().Invoke("com.vmware.nsx.global_configs", "update", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), globalConfigsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/GlobalConfigsTypes.go b/services/nsxt-mp/nsx/GlobalConfigsTypes.go new file mode 100644 index 000000000..4c275a486 --- /dev/null +++ b/services/nsxt-mp/nsx/GlobalConfigsTypes.go @@ -0,0 +1,222 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: GlobalConfigs. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func globalConfigsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["config_type"] = bindings.NewStringType() + fieldNameMap["config_type"] = "ConfigType" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func globalConfigsGetOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.GlobalConfigsBindingType)}, bindings.REST) +} + +func globalConfigsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["config_type"] = bindings.NewStringType() + fieldNameMap["config_type"] = "ConfigType" + paramsTypeMap["config_type"] = bindings.NewStringType() + paramsTypeMap["configType"] = bindings.NewStringType() + pathParams["config_type"] = "configType" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/global-configs/{configType}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func globalConfigsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func globalConfigsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.GlobalConfigsListResultBindingType) +} + +func globalConfigsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/global-configs", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func globalConfigsResyncconfigInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["config_type"] = bindings.NewStringType() + fields["global_configs"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.GlobalConfigsBindingType)}, bindings.REST) + fieldNameMap["config_type"] = "ConfigType" + fieldNameMap["global_configs"] = "GlobalConfigs" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func globalConfigsResyncconfigOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.GlobalConfigsBindingType)}, bindings.REST) +} + +func globalConfigsResyncconfigRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["config_type"] = bindings.NewStringType() + fields["global_configs"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.GlobalConfigsBindingType)}, bindings.REST) + fieldNameMap["config_type"] = "ConfigType" + fieldNameMap["global_configs"] = "GlobalConfigs" + paramsTypeMap["global_configs"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.GlobalConfigsBindingType)}, bindings.REST) + paramsTypeMap["config_type"] = bindings.NewStringType() + paramsTypeMap["configType"] = bindings.NewStringType() + pathParams["config_type"] = "configType" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=resync_config", + "global_configs", + "PUT", + "/api/v1/global-configs/{configType}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func globalConfigsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["config_type"] = bindings.NewStringType() + fields["global_configs"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.GlobalConfigsBindingType)}, bindings.REST) + fieldNameMap["config_type"] = "ConfigType" + fieldNameMap["global_configs"] = "GlobalConfigs" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func globalConfigsUpdateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.GlobalConfigsBindingType)}, bindings.REST) +} + +func globalConfigsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["config_type"] = bindings.NewStringType() + fields["global_configs"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.GlobalConfigsBindingType)}, bindings.REST) + fieldNameMap["config_type"] = "ConfigType" + fieldNameMap["global_configs"] = "GlobalConfigs" + paramsTypeMap["global_configs"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.GlobalConfigsBindingType)}, bindings.REST) + paramsTypeMap["config_type"] = bindings.NewStringType() + paramsTypeMap["configType"] = bindings.NewStringType() + pathParams["config_type"] = "configType" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "global_configs", + "PUT", + "/api/v1/global-configs/{configType}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/HostSwitchProfilesClient.go b/services/nsxt-mp/nsx/HostSwitchProfilesClient.go new file mode 100644 index 000000000..8db6402df --- /dev/null +++ b/services/nsxt-mp/nsx/HostSwitchProfilesClient.go @@ -0,0 +1,281 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: HostSwitchProfiles +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type HostSwitchProfilesClient interface { + + // Creates a hostswitch profile. The resource_type is required. For uplink profiles, the teaming and policy parameters are required. By default, the mtu is 1600 and the transport_vlan is 0. The supported MTU range is 1280 through (uplink_mtu_threshold). (uplink_mtu_threshold) is 9000 by default. Range can be extended by modifying (uplink_mtu_threshold) in SwitchingGlobalConfig to the required upper threshold. This api is now deprecated. Please use new api - PUT policy/api/v1/infra/host-switch-profiles/uplinkProfile1 + // + // @param baseHostSwitchProfileParam (required) + // The parameter must contain all the properties defined in model.BaseHostSwitchProfile. + // @return com.vmware.nsx.model.BaseHostSwitchProfile + // The return value will contain all the properties defined in model.BaseHostSwitchProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(baseHostSwitchProfileParam *data.StructValue) (*data.StructValue, error) + + // Deletes a specified hostswitch profile. This api is now deprecated. Please use new api - DELETE policy/api/v1/infra/host-switch-profiles/uplinkProfile1 + // + // @param hostSwitchProfileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(hostSwitchProfileIdParam string) error + + // Returns information about a specified hostswitch profile. This api is now deprecated. Please use new api - policy/api/v1/infra/host-switch-profiles/uplinkProfile1 + // + // @param hostSwitchProfileIdParam (required) + // @return com.vmware.nsx.model.BaseHostSwitchProfile + // The return value will contain all the properties defined in model.BaseHostSwitchProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(hostSwitchProfileIdParam string) (*data.StructValue, error) + + // Returns information about the configured hostswitch profiles. Hostswitch profiles define networking policies for hostswitches (sometimes referred to as bridges in OVS). Currently, only uplink teaming is supported. Uplink teaming allows NSX to load balance traffic across different physical NICs (PNICs) on the hypervisor hosts. Multiple teaming policies are supported, including LACP active, LACP passive, load balancing based on source ID, and failover order. This api is now deprecated. Please use new api - policy/api/v1/infra/host-switch-profiles + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param deploymentTypeParam Supported edge deployment type. (optional) + // @param hostswitchProfileTypeParam Supported HostSwitch profiles. (optional) + // @param includeSystemOwnedParam Whether the list result contains system resources (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param nodeTypeParam Fabric node type for which uplink profiles are to be listed (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param uplinkTeamingPolicyNameParam The host switch profile's uplink teaming policy name (optional) + // @return com.vmware.nsx.model.HostSwitchProfilesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, deploymentTypeParam *string, hostswitchProfileTypeParam *string, includeSystemOwnedParam *bool, includedFieldsParam *string, nodeTypeParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, uplinkTeamingPolicyNameParam *string) (model.HostSwitchProfilesListResult, error) + + // Modifies a specified hostswitch profile. The body of the PUT request must include the resource_type. For uplink profiles, the put request must also include teaming parameters. Modifiable attributes include display_name, mtu, and transport_vlan. For uplink teaming policies, uplink_name and policy are also modifiable. This api is now deprecated. Please use new api - PATCH policy/api/v1/infra/host-switch-profiles/uplinkProfile1 + // + // @param hostSwitchProfileIdParam (required) + // @param baseHostSwitchProfileParam (required) + // The parameter must contain all the properties defined in model.BaseHostSwitchProfile. + // @return com.vmware.nsx.model.BaseHostSwitchProfile + // The return value will contain all the properties defined in model.BaseHostSwitchProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(hostSwitchProfileIdParam string, baseHostSwitchProfileParam *data.StructValue) (*data.StructValue, error) +} + +type hostSwitchProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewHostSwitchProfilesClient(connector client.Connector) *hostSwitchProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.host_switch_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + hIface := hostSwitchProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &hIface +} + +func (hIface *hostSwitchProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := hIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (hIface *hostSwitchProfilesClient) Create(baseHostSwitchProfileParam *data.StructValue) (*data.StructValue, error) { + typeConverter := hIface.connector.TypeConverter() + executionContext := hIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(hostSwitchProfilesCreateInputType(), typeConverter) + sv.AddStructField("BaseHostSwitchProfile", baseHostSwitchProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := hostSwitchProfilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + hIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := hIface.connector.GetApiProvider().Invoke("com.vmware.nsx.host_switch_profiles", "create", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), hostSwitchProfilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), hIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (hIface *hostSwitchProfilesClient) Delete(hostSwitchProfileIdParam string) error { + typeConverter := hIface.connector.TypeConverter() + executionContext := hIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(hostSwitchProfilesDeleteInputType(), typeConverter) + sv.AddStructField("HostSwitchProfileId", hostSwitchProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := hostSwitchProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + hIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := hIface.connector.GetApiProvider().Invoke("com.vmware.nsx.host_switch_profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), hIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (hIface *hostSwitchProfilesClient) Get(hostSwitchProfileIdParam string) (*data.StructValue, error) { + typeConverter := hIface.connector.TypeConverter() + executionContext := hIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(hostSwitchProfilesGetInputType(), typeConverter) + sv.AddStructField("HostSwitchProfileId", hostSwitchProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := hostSwitchProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + hIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := hIface.connector.GetApiProvider().Invoke("com.vmware.nsx.host_switch_profiles", "get", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), hostSwitchProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), hIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (hIface *hostSwitchProfilesClient) List(cursorParam *string, deploymentTypeParam *string, hostswitchProfileTypeParam *string, includeSystemOwnedParam *bool, includedFieldsParam *string, nodeTypeParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, uplinkTeamingPolicyNameParam *string) (model.HostSwitchProfilesListResult, error) { + typeConverter := hIface.connector.TypeConverter() + executionContext := hIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(hostSwitchProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("DeploymentType", deploymentTypeParam) + sv.AddStructField("HostswitchProfileType", hostswitchProfileTypeParam) + sv.AddStructField("IncludeSystemOwned", includeSystemOwnedParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("NodeType", nodeTypeParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("UplinkTeamingPolicyName", uplinkTeamingPolicyNameParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.HostSwitchProfilesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := hostSwitchProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + hIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := hIface.connector.GetApiProvider().Invoke("com.vmware.nsx.host_switch_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.HostSwitchProfilesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), hostSwitchProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.HostSwitchProfilesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), hIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (hIface *hostSwitchProfilesClient) Update(hostSwitchProfileIdParam string, baseHostSwitchProfileParam *data.StructValue) (*data.StructValue, error) { + typeConverter := hIface.connector.TypeConverter() + executionContext := hIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(hostSwitchProfilesUpdateInputType(), typeConverter) + sv.AddStructField("HostSwitchProfileId", hostSwitchProfileIdParam) + sv.AddStructField("BaseHostSwitchProfile", baseHostSwitchProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := hostSwitchProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + hIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := hIface.connector.GetApiProvider().Invoke("com.vmware.nsx.host_switch_profiles", "update", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), hostSwitchProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), hIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/HostSwitchProfilesTypes.go b/services/nsxt-mp/nsx/HostSwitchProfilesTypes.go new file mode 100644 index 000000000..1d9398602 --- /dev/null +++ b/services/nsxt-mp/nsx/HostSwitchProfilesTypes.go @@ -0,0 +1,352 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: HostSwitchProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``deploymentType`` of method HostSwitchProfiles#list. +const HostSwitchProfiles_LIST_DEPLOYMENT_TYPE_VIRTUAL_MACHINE = "VIRTUAL_MACHINE" + +// Possible value for ``deploymentType`` of method HostSwitchProfiles#list. +const HostSwitchProfiles_LIST_DEPLOYMENT_TYPE_PHYSICAL_MACHINE = "PHYSICAL_MACHINE" + +// Possible value for ``deploymentType`` of method HostSwitchProfiles#list. +const HostSwitchProfiles_LIST_DEPLOYMENT_TYPE_UNKNOWN = "UNKNOWN" + +// Possible value for ``hostswitchProfileType`` of method HostSwitchProfiles#list. +const HostSwitchProfiles_LIST_HOSTSWITCH_PROFILE_TYPE_UPLINKHOSTSWITCHPROFILE = "UplinkHostSwitchProfile" + +// Possible value for ``hostswitchProfileType`` of method HostSwitchProfiles#list. +const HostSwitchProfiles_LIST_HOSTSWITCH_PROFILE_TYPE_LLDPHOSTSWITCHPROFILE = "LldpHostSwitchProfile" + +// Possible value for ``hostswitchProfileType`` of method HostSwitchProfiles#list. +const HostSwitchProfiles_LIST_HOSTSWITCH_PROFILE_TYPE_NIOCPROFILE = "NiocProfile" + +// Possible value for ``hostswitchProfileType`` of method HostSwitchProfiles#list. +const HostSwitchProfiles_LIST_HOSTSWITCH_PROFILE_TYPE_EXTRACONFIGHOSTSWITCHPROFILE = "ExtraConfigHostSwitchProfile" + +// Possible value for ``nodeType`` of method HostSwitchProfiles#list. +const HostSwitchProfiles_LIST_NODE_TYPE_EDGENODE = "EdgeNode" + +// Possible value for ``nodeType`` of method HostSwitchProfiles#list. +const HostSwitchProfiles_LIST_NODE_TYPE_PUBLICCLOUDGATEWAYNODE = "PublicCloudGatewayNode" + +func hostSwitchProfilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["base_host_switch_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseHostSwitchProfileBindingType)}, bindings.REST) + fieldNameMap["base_host_switch_profile"] = "BaseHostSwitchProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func hostSwitchProfilesCreateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseHostSwitchProfileBindingType)}, bindings.REST) +} + +func hostSwitchProfilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["base_host_switch_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseHostSwitchProfileBindingType)}, bindings.REST) + fieldNameMap["base_host_switch_profile"] = "BaseHostSwitchProfile" + paramsTypeMap["base_host_switch_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseHostSwitchProfileBindingType)}, bindings.REST) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "base_host_switch_profile", + "POST", + "/api/v1/host-switch-profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func hostSwitchProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["host_switch_profile_id"] = bindings.NewStringType() + fieldNameMap["host_switch_profile_id"] = "HostSwitchProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func hostSwitchProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func hostSwitchProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["host_switch_profile_id"] = bindings.NewStringType() + fieldNameMap["host_switch_profile_id"] = "HostSwitchProfileId" + paramsTypeMap["host_switch_profile_id"] = bindings.NewStringType() + paramsTypeMap["hostSwitchProfileId"] = bindings.NewStringType() + pathParams["host_switch_profile_id"] = "hostSwitchProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/host-switch-profiles/{hostSwitchProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func hostSwitchProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["host_switch_profile_id"] = bindings.NewStringType() + fieldNameMap["host_switch_profile_id"] = "HostSwitchProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func hostSwitchProfilesGetOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseHostSwitchProfileBindingType)}, bindings.REST) +} + +func hostSwitchProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["host_switch_profile_id"] = bindings.NewStringType() + fieldNameMap["host_switch_profile_id"] = "HostSwitchProfileId" + paramsTypeMap["host_switch_profile_id"] = bindings.NewStringType() + paramsTypeMap["hostSwitchProfileId"] = bindings.NewStringType() + pathParams["host_switch_profile_id"] = "hostSwitchProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/host-switch-profiles/{hostSwitchProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func hostSwitchProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["deployment_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["hostswitch_profile_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["uplink_teaming_policy_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["deployment_type"] = "DeploymentType" + fieldNameMap["hostswitch_profile_type"] = "HostswitchProfileType" + fieldNameMap["include_system_owned"] = "IncludeSystemOwned" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["node_type"] = "NodeType" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["uplink_teaming_policy_name"] = "UplinkTeamingPolicyName" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func hostSwitchProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.HostSwitchProfilesListResultBindingType) +} + +func hostSwitchProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["deployment_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["hostswitch_profile_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["uplink_teaming_policy_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["deployment_type"] = "DeploymentType" + fieldNameMap["hostswitch_profile_type"] = "HostswitchProfileType" + fieldNameMap["include_system_owned"] = "IncludeSystemOwned" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["node_type"] = "NodeType" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["uplink_teaming_policy_name"] = "UplinkTeamingPolicyName" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["hostswitch_profile_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["deployment_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["uplink_teaming_policy_name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["include_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["hostswitch_profile_type"] = "hostswitch_profile_type" + queryParams["uplink_teaming_policy_name"] = "uplink_teaming_policy_name" + queryParams["deployment_type"] = "deployment_type" + queryParams["include_system_owned"] = "include_system_owned" + queryParams["node_type"] = "node_type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/host-switch-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func hostSwitchProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["host_switch_profile_id"] = bindings.NewStringType() + fields["base_host_switch_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseHostSwitchProfileBindingType)}, bindings.REST) + fieldNameMap["host_switch_profile_id"] = "HostSwitchProfileId" + fieldNameMap["base_host_switch_profile"] = "BaseHostSwitchProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func hostSwitchProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseHostSwitchProfileBindingType)}, bindings.REST) +} + +func hostSwitchProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["host_switch_profile_id"] = bindings.NewStringType() + fields["base_host_switch_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseHostSwitchProfileBindingType)}, bindings.REST) + fieldNameMap["host_switch_profile_id"] = "HostSwitchProfileId" + fieldNameMap["base_host_switch_profile"] = "BaseHostSwitchProfile" + paramsTypeMap["host_switch_profile_id"] = bindings.NewStringType() + paramsTypeMap["base_host_switch_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseHostSwitchProfileBindingType)}, bindings.REST) + paramsTypeMap["hostSwitchProfileId"] = bindings.NewStringType() + pathParams["host_switch_profile_id"] = "hostSwitchProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "base_host_switch_profile", + "PUT", + "/api/v1/host-switch-profiles/{hostSwitchProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/IpSetsClient.go b/services/nsxt-mp/nsx/IpSetsClient.go new file mode 100644 index 000000000..7222c82c0 --- /dev/null +++ b/services/nsxt-mp/nsx/IpSetsClient.go @@ -0,0 +1,315 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: IpSets +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type IpSetsClient interface { + + // Creates a new IPSet that can group either IPv4 or IPv6 individual ip addresses, ranges or subnets. + // + // @param ipSetParam (required) + // @return com.vmware.nsx.model.IPSet + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(ipSetParam model.IPSet) (model.IPSet, error) + + // Add/Remove an individual IP address to an IPSet + // + // @param ipSetIdParam IP Set Id (required) + // @param ipAddressElementParam (required) + // @param actionParam Specifies addition or removal action (required) + // @return com.vmware.nsx.model.IPAddressElement + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create0(ipSetIdParam string, ipAddressElementParam model.IPAddressElement, actionParam string) (model.IPAddressElement, error) + + // Deletes the specified IPSet. By default, if the IPSet is added to an NSGroup, it won't be deleted. In such situations, pass \"force=true\" as query param to force delete the IPSet. + // + // @param ipSetIdParam IPSet Id (required) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(ipSetIdParam string, forceParam *bool) error + + // Returns information about the specified IPSet + // + // @param ipSetIdParam IPSet Id (required) + // @return com.vmware.nsx.model.IPSet + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ipSetIdParam string) (model.IPSet, error) + + // Returns paginated list of IPSets + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.IPSetListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPSetListResult, error) + + // Updates the specified IPSet. Modifiable parameters include description, display_name and ip_addresses. + // + // @param ipSetIdParam IPSet Id (required) + // @param ipSetParam (required) + // @return com.vmware.nsx.model.IPSet + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(ipSetIdParam string, ipSetParam model.IPSet) (model.IPSet, error) +} + +type ipSetsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewIpSetsClient(connector client.Connector) *ipSetsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ip_sets") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "create_0": core.NewMethodIdentifier(interfaceIdentifier, "create_0"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := ipSetsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *ipSetsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *ipSetsClient) Create(ipSetParam model.IPSet) (model.IPSet, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipSetsCreateInputType(), typeConverter) + sv.AddStructField("IpSet", ipSetParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSet + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipSetsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ip_sets", "create", inputDataValue, executionContext) + var emptyOutput model.IPSet + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipSetsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSet), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipSetsClient) Create0(ipSetIdParam string, ipAddressElementParam model.IPAddressElement, actionParam string) (model.IPAddressElement, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipSetsCreate0InputType(), typeConverter) + sv.AddStructField("IpSetId", ipSetIdParam) + sv.AddStructField("IpAddressElement", ipAddressElementParam) + sv.AddStructField("Action", actionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPAddressElement + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipSetsCreate0RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ip_sets", "create_0", inputDataValue, executionContext) + var emptyOutput model.IPAddressElement + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipSetsCreate0OutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPAddressElement), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipSetsClient) Delete(ipSetIdParam string, forceParam *bool) error { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipSetsDeleteInputType(), typeConverter) + sv.AddStructField("IpSetId", ipSetIdParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipSetsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ip_sets", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *ipSetsClient) Get(ipSetIdParam string) (model.IPSet, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipSetsGetInputType(), typeConverter) + sv.AddStructField("IpSetId", ipSetIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSet + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipSetsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ip_sets", "get", inputDataValue, executionContext) + var emptyOutput model.IPSet + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipSetsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSet), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipSetsClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPSetListResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipSetsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSetListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipSetsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ip_sets", "list", inputDataValue, executionContext) + var emptyOutput model.IPSetListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipSetsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSetListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipSetsClient) Update(ipSetIdParam string, ipSetParam model.IPSet) (model.IPSet, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipSetsUpdateInputType(), typeConverter) + sv.AddStructField("IpSetId", ipSetIdParam) + sv.AddStructField("IpSet", ipSetParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSet + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipSetsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ip_sets", "update", inputDataValue, executionContext) + var emptyOutput model.IPSet + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipSetsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSet), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/IpSetsTypes.go b/services/nsxt-mp/nsx/IpSetsTypes.go new file mode 100644 index 000000000..61ec9e61f --- /dev/null +++ b/services/nsxt-mp/nsx/IpSetsTypes.go @@ -0,0 +1,368 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: IpSets. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``action`` of method IpSets#create0. +const IpSets_CREATE_0_ACTION_ADD_IP = "add_ip" + +// Possible value for ``action`` of method IpSets#create0. +const IpSets_CREATE_0_ACTION_REMOVE_IP = "remove_ip" + +func ipSetsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_set"] = bindings.NewReferenceType(model.IPSetBindingType) + fieldNameMap["ip_set"] = "IpSet" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipSetsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSetBindingType) +} + +func ipSetsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ip_set"] = bindings.NewReferenceType(model.IPSetBindingType) + fieldNameMap["ip_set"] = "IpSet" + paramsTypeMap["ip_set"] = bindings.NewReferenceType(model.IPSetBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_set", + "POST", + "/api/v1/ip-sets", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipSetsCreate0InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_set_id"] = bindings.NewStringType() + fields["ip_address_element"] = bindings.NewReferenceType(model.IPAddressElementBindingType) + fields["action"] = bindings.NewStringType() + fieldNameMap["ip_set_id"] = "IpSetId" + fieldNameMap["ip_address_element"] = "IpAddressElement" + fieldNameMap["action"] = "Action" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipSetsCreate0OutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPAddressElementBindingType) +} + +func ipSetsCreate0RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ip_set_id"] = bindings.NewStringType() + fields["ip_address_element"] = bindings.NewReferenceType(model.IPAddressElementBindingType) + fields["action"] = bindings.NewStringType() + fieldNameMap["ip_set_id"] = "IpSetId" + fieldNameMap["ip_address_element"] = "IpAddressElement" + fieldNameMap["action"] = "Action" + paramsTypeMap["action"] = bindings.NewStringType() + paramsTypeMap["ip_set_id"] = bindings.NewStringType() + paramsTypeMap["ip_address_element"] = bindings.NewReferenceType(model.IPAddressElementBindingType) + paramsTypeMap["ipSetId"] = bindings.NewStringType() + pathParams["ip_set_id"] = "ipSetId" + queryParams["action"] = "action" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_address_element", + "POST", + "/api/v1/ip-sets/{ipSetId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipSetsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_set_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ip_set_id"] = "IpSetId" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipSetsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipSetsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ip_set_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ip_set_id"] = "IpSetId" + fieldNameMap["force"] = "Force" + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["ip_set_id"] = bindings.NewStringType() + paramsTypeMap["ipSetId"] = bindings.NewStringType() + pathParams["ip_set_id"] = "ipSetId" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/ip-sets/{ipSetId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipSetsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_set_id"] = bindings.NewStringType() + fieldNameMap["ip_set_id"] = "IpSetId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipSetsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSetBindingType) +} + +func ipSetsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ip_set_id"] = bindings.NewStringType() + fieldNameMap["ip_set_id"] = "IpSetId" + paramsTypeMap["ip_set_id"] = bindings.NewStringType() + paramsTypeMap["ipSetId"] = bindings.NewStringType() + pathParams["ip_set_id"] = "ipSetId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ip-sets/{ipSetId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipSetsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipSetsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSetListResultBindingType) +} + +func ipSetsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ip-sets", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipSetsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_set_id"] = bindings.NewStringType() + fields["ip_set"] = bindings.NewReferenceType(model.IPSetBindingType) + fieldNameMap["ip_set_id"] = "IpSetId" + fieldNameMap["ip_set"] = "IpSet" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipSetsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSetBindingType) +} + +func ipSetsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ip_set_id"] = bindings.NewStringType() + fields["ip_set"] = bindings.NewReferenceType(model.IPSetBindingType) + fieldNameMap["ip_set_id"] = "IpSetId" + fieldNameMap["ip_set"] = "IpSet" + paramsTypeMap["ip_set_id"] = bindings.NewStringType() + paramsTypeMap["ip_set"] = bindings.NewReferenceType(model.IPSetBindingType) + paramsTypeMap["ipSetId"] = bindings.NewStringType() + pathParams["ip_set_id"] = "ipSetId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_set", + "PUT", + "/api/v1/ip-sets/{ipSetId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/IpfixCollectorProfilesClient.go b/services/nsxt-mp/nsx/IpfixCollectorProfilesClient.go new file mode 100644 index 000000000..793032973 --- /dev/null +++ b/services/nsxt-mp/nsx/IpfixCollectorProfilesClient.go @@ -0,0 +1,267 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: IpfixCollectorProfiles +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type IpfixCollectorProfilesClient interface { + + // Create a new IPFIX collector profile with essential properties. + // + // @param ipfixCollectorUpmProfileParam (required) + // @return com.vmware.nsx.model.IpfixCollectorUpmProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(ipfixCollectorUpmProfileParam model.IpfixCollectorUpmProfile) (model.IpfixCollectorUpmProfile, error) + + // Delete an existing IPFIX collector profile by ID. + // + // @param ipfixCollectorProfileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(ipfixCollectorProfileIdParam string) error + + // Get an existing IPFIX collector profile by profile ID. + // + // @param ipfixCollectorProfileIdParam (required) + // @return com.vmware.nsx.model.IpfixCollectorUpmProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ipfixCollectorProfileIdParam string) (model.IpfixCollectorUpmProfile, error) + + // Query IPFIX collector profiles with list parameters. List result can be filtered by profile type defined by IpfixCollectorUpmProfileType. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param profileTypesParam IPFIX Collector Profile Type List (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.IpfixCollectorUpmProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, profileTypesParam *string, sortAscendingParam *bool, sortByParam *string) (model.IpfixCollectorUpmProfileListResult, error) + + // Update an existing IPFIX collector profile with profile ID and modified properties. + // + // @param ipfixCollectorProfileIdParam (required) + // @param ipfixCollectorUpmProfileParam (required) + // @return com.vmware.nsx.model.IpfixCollectorUpmProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(ipfixCollectorProfileIdParam string, ipfixCollectorUpmProfileParam model.IpfixCollectorUpmProfile) (model.IpfixCollectorUpmProfile, error) +} + +type ipfixCollectorProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewIpfixCollectorProfilesClient(connector client.Connector) *ipfixCollectorProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ipfix_collector_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := ipfixCollectorProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *ipfixCollectorProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *ipfixCollectorProfilesClient) Create(ipfixCollectorUpmProfileParam model.IpfixCollectorUpmProfile) (model.IpfixCollectorUpmProfile, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipfixCollectorProfilesCreateInputType(), typeConverter) + sv.AddStructField("IpfixCollectorUpmProfile", ipfixCollectorUpmProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IpfixCollectorUpmProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixCollectorProfilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipfix_collector_profiles", "create", inputDataValue, executionContext) + var emptyOutput model.IpfixCollectorUpmProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipfixCollectorProfilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IpfixCollectorUpmProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipfixCollectorProfilesClient) Delete(ipfixCollectorProfileIdParam string) error { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipfixCollectorProfilesDeleteInputType(), typeConverter) + sv.AddStructField("IpfixCollectorProfileId", ipfixCollectorProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixCollectorProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipfix_collector_profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *ipfixCollectorProfilesClient) Get(ipfixCollectorProfileIdParam string) (model.IpfixCollectorUpmProfile, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipfixCollectorProfilesGetInputType(), typeConverter) + sv.AddStructField("IpfixCollectorProfileId", ipfixCollectorProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IpfixCollectorUpmProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixCollectorProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipfix_collector_profiles", "get", inputDataValue, executionContext) + var emptyOutput model.IpfixCollectorUpmProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipfixCollectorProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IpfixCollectorUpmProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipfixCollectorProfilesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, profileTypesParam *string, sortAscendingParam *bool, sortByParam *string) (model.IpfixCollectorUpmProfileListResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipfixCollectorProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("ProfileTypes", profileTypesParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IpfixCollectorUpmProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixCollectorProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipfix_collector_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.IpfixCollectorUpmProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipfixCollectorProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IpfixCollectorUpmProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipfixCollectorProfilesClient) Update(ipfixCollectorProfileIdParam string, ipfixCollectorUpmProfileParam model.IpfixCollectorUpmProfile) (model.IpfixCollectorUpmProfile, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipfixCollectorProfilesUpdateInputType(), typeConverter) + sv.AddStructField("IpfixCollectorProfileId", ipfixCollectorProfileIdParam) + sv.AddStructField("IpfixCollectorUpmProfile", ipfixCollectorUpmProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IpfixCollectorUpmProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixCollectorProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipfix_collector_profiles", "update", inputDataValue, executionContext) + var emptyOutput model.IpfixCollectorUpmProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipfixCollectorProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IpfixCollectorUpmProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/IpfixCollectorProfilesTypes.go b/services/nsxt-mp/nsx/IpfixCollectorProfilesTypes.go new file mode 100644 index 000000000..04b2c8683 --- /dev/null +++ b/services/nsxt-mp/nsx/IpfixCollectorProfilesTypes.go @@ -0,0 +1,301 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: IpfixCollectorProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func ipfixCollectorProfilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_collector_upm_profile"] = bindings.NewReferenceType(model.IpfixCollectorUpmProfileBindingType) + fieldNameMap["ipfix_collector_upm_profile"] = "IpfixCollectorUpmProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixCollectorProfilesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IpfixCollectorUpmProfileBindingType) +} + +func ipfixCollectorProfilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_collector_upm_profile"] = bindings.NewReferenceType(model.IpfixCollectorUpmProfileBindingType) + fieldNameMap["ipfix_collector_upm_profile"] = "IpfixCollectorUpmProfile" + paramsTypeMap["ipfix_collector_upm_profile"] = bindings.NewReferenceType(model.IpfixCollectorUpmProfileBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ipfix_collector_upm_profile", + "POST", + "/api/v1/ipfix-collector-profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixCollectorProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_collector_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_collector_profile_id"] = "IpfixCollectorProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixCollectorProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipfixCollectorProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_collector_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_collector_profile_id"] = "IpfixCollectorProfileId" + paramsTypeMap["ipfix_collector_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipfixCollectorProfileId"] = bindings.NewStringType() + pathParams["ipfix_collector_profile_id"] = "ipfixCollectorProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/ipfix-collector-profiles/{ipfixCollectorProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixCollectorProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_collector_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_collector_profile_id"] = "IpfixCollectorProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixCollectorProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IpfixCollectorUpmProfileBindingType) +} + +func ipfixCollectorProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_collector_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_collector_profile_id"] = "IpfixCollectorProfileId" + paramsTypeMap["ipfix_collector_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipfixCollectorProfileId"] = bindings.NewStringType() + pathParams["ipfix_collector_profile_id"] = "ipfixCollectorProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ipfix-collector-profiles/{ipfixCollectorProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixCollectorProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["profile_types"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["profile_types"] = "ProfileTypes" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixCollectorProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IpfixCollectorUpmProfileListResultBindingType) +} + +func ipfixCollectorProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["profile_types"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["profile_types"] = "ProfileTypes" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["profile_types"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["profile_types"] = "profile_types" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ipfix-collector-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixCollectorProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_collector_profile_id"] = bindings.NewStringType() + fields["ipfix_collector_upm_profile"] = bindings.NewReferenceType(model.IpfixCollectorUpmProfileBindingType) + fieldNameMap["ipfix_collector_profile_id"] = "IpfixCollectorProfileId" + fieldNameMap["ipfix_collector_upm_profile"] = "IpfixCollectorUpmProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixCollectorProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IpfixCollectorUpmProfileBindingType) +} + +func ipfixCollectorProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_collector_profile_id"] = bindings.NewStringType() + fields["ipfix_collector_upm_profile"] = bindings.NewReferenceType(model.IpfixCollectorUpmProfileBindingType) + fieldNameMap["ipfix_collector_profile_id"] = "IpfixCollectorProfileId" + fieldNameMap["ipfix_collector_upm_profile"] = "IpfixCollectorUpmProfile" + paramsTypeMap["ipfix_collector_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipfix_collector_upm_profile"] = bindings.NewReferenceType(model.IpfixCollectorUpmProfileBindingType) + paramsTypeMap["ipfixCollectorProfileId"] = bindings.NewStringType() + pathParams["ipfix_collector_profile_id"] = "ipfixCollectorProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ipfix_collector_upm_profile", + "PUT", + "/api/v1/ipfix-collector-profiles/{ipfixCollectorProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/IpfixProfilesClient.go b/services/nsxt-mp/nsx/IpfixProfilesClient.go new file mode 100644 index 000000000..0c0bad1ca --- /dev/null +++ b/services/nsxt-mp/nsx/IpfixProfilesClient.go @@ -0,0 +1,277 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: IpfixProfiles +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type IpfixProfilesClient interface { + + // Create a new IPFIX profile with essential properties. + // + // @param ipfixUpmProfileParam (required) + // The parameter must contain all the properties defined in model.IpfixUpmProfile. + // @return com.vmware.nsx.model.IpfixUpmProfile + // The return value will contain all the properties defined in model.IpfixUpmProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(ipfixUpmProfileParam *data.StructValue) (*data.StructValue, error) + + // Delete an existing IPFIX profile by ID. + // + // @param ipfixProfileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(ipfixProfileIdParam string) error + + // Get an existing IPFIX profile by profile ID. + // + // @param ipfixProfileIdParam (required) + // @return com.vmware.nsx.model.IpfixUpmProfile + // The return value will contain all the properties defined in model.IpfixUpmProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ipfixProfileIdParam string) (*data.StructValue, error) + + // Query IPFIX profiles with list parameters. List result can be filtered by profile type defined by IpfixUpmProfileType. + // + // @param appliedToEntityIdParam ID of Entity Applied with Profile (optional) + // @param appliedToEntityTypeParam Supported Entity Types (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param profileTypesParam IPFIX Profile Type List (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.IpfixUpmProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(appliedToEntityIdParam *string, appliedToEntityTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, profileTypesParam *string, sortAscendingParam *bool, sortByParam *string) (model.IpfixUpmProfileListResult, error) + + // Update an existing IPFIX profile with profile ID and modified properties. + // + // @param ipfixProfileIdParam (required) + // @param ipfixUpmProfileParam (required) + // The parameter must contain all the properties defined in model.IpfixUpmProfile. + // @return com.vmware.nsx.model.IpfixUpmProfile + // The return value will contain all the properties defined in model.IpfixUpmProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(ipfixProfileIdParam string, ipfixUpmProfileParam *data.StructValue) (*data.StructValue, error) +} + +type ipfixProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewIpfixProfilesClient(connector client.Connector) *ipfixProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ipfix_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := ipfixProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *ipfixProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *ipfixProfilesClient) Create(ipfixUpmProfileParam *data.StructValue) (*data.StructValue, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipfixProfilesCreateInputType(), typeConverter) + sv.AddStructField("IpfixUpmProfile", ipfixUpmProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixProfilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipfix_profiles", "create", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipfixProfilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipfixProfilesClient) Delete(ipfixProfileIdParam string) error { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipfixProfilesDeleteInputType(), typeConverter) + sv.AddStructField("IpfixProfileId", ipfixProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipfix_profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *ipfixProfilesClient) Get(ipfixProfileIdParam string) (*data.StructValue, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipfixProfilesGetInputType(), typeConverter) + sv.AddStructField("IpfixProfileId", ipfixProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipfix_profiles", "get", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipfixProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipfixProfilesClient) List(appliedToEntityIdParam *string, appliedToEntityTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, profileTypesParam *string, sortAscendingParam *bool, sortByParam *string) (model.IpfixUpmProfileListResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipfixProfilesListInputType(), typeConverter) + sv.AddStructField("AppliedToEntityId", appliedToEntityIdParam) + sv.AddStructField("AppliedToEntityType", appliedToEntityTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("ProfileTypes", profileTypesParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IpfixUpmProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipfix_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.IpfixUpmProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipfixProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IpfixUpmProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipfixProfilesClient) Update(ipfixProfileIdParam string, ipfixUpmProfileParam *data.StructValue) (*data.StructValue, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipfixProfilesUpdateInputType(), typeConverter) + sv.AddStructField("IpfixProfileId", ipfixProfileIdParam) + sv.AddStructField("IpfixUpmProfile", ipfixUpmProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipfixProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipfix_profiles", "update", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipfixProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/IpfixProfilesTypes.go b/services/nsxt-mp/nsx/IpfixProfilesTypes.go new file mode 100644 index 000000000..abb1ec9f2 --- /dev/null +++ b/services/nsxt-mp/nsx/IpfixProfilesTypes.go @@ -0,0 +1,322 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: IpfixProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``appliedToEntityType`` of method IpfixProfiles#list. +const IpfixProfiles_LIST_APPLIED_TO_ENTITY_TYPE_LOGICALPORT = "LogicalPort" + +// Possible value for ``appliedToEntityType`` of method IpfixProfiles#list. +const IpfixProfiles_LIST_APPLIED_TO_ENTITY_TYPE_LOGICALSWITCH = "LogicalSwitch" + +// Possible value for ``appliedToEntityType`` of method IpfixProfiles#list. +const IpfixProfiles_LIST_APPLIED_TO_ENTITY_TYPE_NSGROUP = "NSGroup" + +func ipfixProfilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_upm_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IpfixUpmProfileBindingType)}, bindings.REST) + fieldNameMap["ipfix_upm_profile"] = "IpfixUpmProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixProfilesCreateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IpfixUpmProfileBindingType)}, bindings.REST) +} + +func ipfixProfilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_upm_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IpfixUpmProfileBindingType)}, bindings.REST) + fieldNameMap["ipfix_upm_profile"] = "IpfixUpmProfile" + paramsTypeMap["ipfix_upm_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IpfixUpmProfileBindingType)}, bindings.REST) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ipfix_upm_profile", + "POST", + "/api/v1/ipfix-profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_profile_id"] = "IpfixProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipfixProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_profile_id"] = "IpfixProfileId" + paramsTypeMap["ipfix_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipfixProfileId"] = bindings.NewStringType() + pathParams["ipfix_profile_id"] = "ipfixProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/ipfix-profiles/{ipfixProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_profile_id"] = "IpfixProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixProfilesGetOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IpfixUpmProfileBindingType)}, bindings.REST) +} + +func ipfixProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_profile_id"] = bindings.NewStringType() + fieldNameMap["ipfix_profile_id"] = "IpfixProfileId" + paramsTypeMap["ipfix_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipfixProfileId"] = bindings.NewStringType() + pathParams["ipfix_profile_id"] = "ipfixProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ipfix-profiles/{ipfixProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["applied_to_entity_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["applied_to_entity_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["profile_types"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["applied_to_entity_id"] = "AppliedToEntityId" + fieldNameMap["applied_to_entity_type"] = "AppliedToEntityType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["profile_types"] = "ProfileTypes" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IpfixUpmProfileListResultBindingType) +} + +func ipfixProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["applied_to_entity_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["applied_to_entity_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["profile_types"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["applied_to_entity_id"] = "AppliedToEntityId" + fieldNameMap["applied_to_entity_type"] = "AppliedToEntityType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["profile_types"] = "ProfileTypes" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["profile_types"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["applied_to_entity_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["applied_to_entity_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["applied_to_entity_id"] = "applied_to_entity_id" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["profile_types"] = "profile_types" + queryParams["sort_by"] = "sort_by" + queryParams["applied_to_entity_type"] = "applied_to_entity_type" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ipfix-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipfixProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_profile_id"] = bindings.NewStringType() + fields["ipfix_upm_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IpfixUpmProfileBindingType)}, bindings.REST) + fieldNameMap["ipfix_profile_id"] = "IpfixProfileId" + fieldNameMap["ipfix_upm_profile"] = "IpfixUpmProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipfixProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IpfixUpmProfileBindingType)}, bindings.REST) +} + +func ipfixProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_profile_id"] = bindings.NewStringType() + fields["ipfix_upm_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IpfixUpmProfileBindingType)}, bindings.REST) + fieldNameMap["ipfix_profile_id"] = "IpfixProfileId" + fieldNameMap["ipfix_upm_profile"] = "IpfixUpmProfile" + paramsTypeMap["ipfix_upm_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IpfixUpmProfileBindingType)}, bindings.REST) + paramsTypeMap["ipfix_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipfixProfileId"] = bindings.NewStringType() + pathParams["ipfix_profile_id"] = "ipfixProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ipfix_upm_profile", + "PUT", + "/api/v1/ipfix-profiles/{ipfixProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/LatencyProfilesClient.go b/services/nsxt-mp/nsx/LatencyProfilesClient.go new file mode 100644 index 000000000..3424e60bc --- /dev/null +++ b/services/nsxt-mp/nsx/LatencyProfilesClient.go @@ -0,0 +1,265 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: LatencyProfiles +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type LatencyProfilesClient interface { + + // Create a new latency profile + // + // @param latencyStatProfileParam (required) + // @return com.vmware.nsx.model.LatencyStatProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(latencyStatProfileParam model.LatencyStatProfile) (model.LatencyStatProfile, error) + + // Delete an existing latency profile + // + // @param latencyProfileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(latencyProfileIdParam string) error + + // Get an existing latency profile configuration + // + // @param latencyProfileIdParam (required) + // @return com.vmware.nsx.model.LatencyStatProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(latencyProfileIdParam string) (model.LatencyStatProfile, error) + + // List latency profiles + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.LatencyStatProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LatencyStatProfileListResult, error) + + // Update an existing latency profile + // + // @param latencyProfileIdParam (required) + // @param latencyStatProfileParam (required) + // @return com.vmware.nsx.model.LatencyStatProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(latencyProfileIdParam string, latencyStatProfileParam model.LatencyStatProfile) (model.LatencyStatProfile, error) +} + +type latencyProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewLatencyProfilesClient(connector client.Connector) *latencyProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.latency_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + lIface := latencyProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &lIface +} + +func (lIface *latencyProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := lIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (lIface *latencyProfilesClient) Create(latencyStatProfileParam model.LatencyStatProfile) (model.LatencyStatProfile, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(latencyProfilesCreateInputType(), typeConverter) + sv.AddStructField("LatencyStatProfile", latencyStatProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LatencyStatProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := latencyProfilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.latency_profiles", "create", inputDataValue, executionContext) + var emptyOutput model.LatencyStatProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), latencyProfilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LatencyStatProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *latencyProfilesClient) Delete(latencyProfileIdParam string) error { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(latencyProfilesDeleteInputType(), typeConverter) + sv.AddStructField("LatencyProfileId", latencyProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := latencyProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.latency_profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (lIface *latencyProfilesClient) Get(latencyProfileIdParam string) (model.LatencyStatProfile, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(latencyProfilesGetInputType(), typeConverter) + sv.AddStructField("LatencyProfileId", latencyProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LatencyStatProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := latencyProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.latency_profiles", "get", inputDataValue, executionContext) + var emptyOutput model.LatencyStatProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), latencyProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LatencyStatProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *latencyProfilesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LatencyStatProfileListResult, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(latencyProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LatencyStatProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := latencyProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.latency_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.LatencyStatProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), latencyProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LatencyStatProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *latencyProfilesClient) Update(latencyProfileIdParam string, latencyStatProfileParam model.LatencyStatProfile) (model.LatencyStatProfile, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(latencyProfilesUpdateInputType(), typeConverter) + sv.AddStructField("LatencyProfileId", latencyProfileIdParam) + sv.AddStructField("LatencyStatProfile", latencyStatProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LatencyStatProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := latencyProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.latency_profiles", "update", inputDataValue, executionContext) + var emptyOutput model.LatencyStatProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), latencyProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LatencyStatProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/LatencyProfilesTypes.go b/services/nsxt-mp/nsx/LatencyProfilesTypes.go new file mode 100644 index 000000000..6fc04abb3 --- /dev/null +++ b/services/nsxt-mp/nsx/LatencyProfilesTypes.go @@ -0,0 +1,295 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: LatencyProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func latencyProfilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["latency_stat_profile"] = bindings.NewReferenceType(model.LatencyStatProfileBindingType) + fieldNameMap["latency_stat_profile"] = "LatencyStatProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func latencyProfilesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LatencyStatProfileBindingType) +} + +func latencyProfilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["latency_stat_profile"] = bindings.NewReferenceType(model.LatencyStatProfileBindingType) + fieldNameMap["latency_stat_profile"] = "LatencyStatProfile" + paramsTypeMap["latency_stat_profile"] = bindings.NewReferenceType(model.LatencyStatProfileBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "latency_stat_profile", + "POST", + "/api/v1/latency-profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func latencyProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["latency_profile_id"] = bindings.NewStringType() + fieldNameMap["latency_profile_id"] = "LatencyProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func latencyProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func latencyProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["latency_profile_id"] = bindings.NewStringType() + fieldNameMap["latency_profile_id"] = "LatencyProfileId" + paramsTypeMap["latency_profile_id"] = bindings.NewStringType() + paramsTypeMap["latencyProfileId"] = bindings.NewStringType() + pathParams["latency_profile_id"] = "latencyProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/latency-profiles/{latencyProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func latencyProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["latency_profile_id"] = bindings.NewStringType() + fieldNameMap["latency_profile_id"] = "LatencyProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func latencyProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LatencyStatProfileBindingType) +} + +func latencyProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["latency_profile_id"] = bindings.NewStringType() + fieldNameMap["latency_profile_id"] = "LatencyProfileId" + paramsTypeMap["latency_profile_id"] = bindings.NewStringType() + paramsTypeMap["latencyProfileId"] = bindings.NewStringType() + pathParams["latency_profile_id"] = "latencyProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/latency-profiles/{latencyProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func latencyProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func latencyProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LatencyStatProfileListResultBindingType) +} + +func latencyProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/latency-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func latencyProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["latency_profile_id"] = bindings.NewStringType() + fields["latency_stat_profile"] = bindings.NewReferenceType(model.LatencyStatProfileBindingType) + fieldNameMap["latency_profile_id"] = "LatencyProfileId" + fieldNameMap["latency_stat_profile"] = "LatencyStatProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func latencyProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LatencyStatProfileBindingType) +} + +func latencyProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["latency_profile_id"] = bindings.NewStringType() + fields["latency_stat_profile"] = bindings.NewReferenceType(model.LatencyStatProfileBindingType) + fieldNameMap["latency_profile_id"] = "LatencyProfileId" + fieldNameMap["latency_stat_profile"] = "LatencyStatProfile" + paramsTypeMap["latency_profile_id"] = bindings.NewStringType() + paramsTypeMap["latency_stat_profile"] = bindings.NewReferenceType(model.LatencyStatProfileBindingType) + paramsTypeMap["latencyProfileId"] = bindings.NewStringType() + pathParams["latency_profile_id"] = "latencyProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "latency_stat_profile", + "PUT", + "/api/v1/latency-profiles/{latencyProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/LicensesClient.go b/services/nsxt-mp/nsx/LicensesClient.go new file mode 100644 index 000000000..78e3fb5b5 --- /dev/null +++ b/services/nsxt-mp/nsx/LicensesClient.go @@ -0,0 +1,328 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Licenses +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type LicensesClient interface { + + // This will add a license key to the system. The API supports adding only one license key for each license edition type - Standard, Advanced or Enterprise. If a new license key is tried to add for an edition for which the license key already exists, then this API will return an error. + // + // @param licenseParam (required) + // @return com.vmware.nsx.model.License + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(licenseParam model.License) (model.License, error) + + // Deprecated. Use POST /licenses?action=delete API instead. + // + // @param licenseKeyParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(licenseKeyParam string) error + + // This will delete the license key identified in the request body by \"license_key\" and its properties from the system. Attempting to delete the last license key will result in an error. + // + // @param licenseParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete0(licenseParam model.License) error + + // Deprecated. Use the GET /licenses API instead. + // @return com.vmware.nsx.model.License + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.License, error) + + // Deprecated. Use GET /licenses API instead. + // + // @param licenseKeyParam (required) + // @return com.vmware.nsx.model.License + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Getlicensebykey(licenseKeyParam string) (model.License, error) + + // Returns all licenses. + // @return com.vmware.nsx.model.LicensesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.LicensesListResult, error) + + // Deprecated. Use the POST /licenses API instead + // + // @param licenseParam (required) + // @return com.vmware.nsx.model.License + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(licenseParam model.License) (model.License, error) +} + +type licensesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewLicensesClient(connector client.Connector) *licensesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.licenses") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "delete_0": core.NewMethodIdentifier(interfaceIdentifier, "delete_0"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "getlicensebykey": core.NewMethodIdentifier(interfaceIdentifier, "getlicensebykey"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + lIface := licensesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &lIface +} + +func (lIface *licensesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := lIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (lIface *licensesClient) Create(licenseParam model.License) (model.License, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(licensesCreateInputType(), typeConverter) + sv.AddStructField("License", licenseParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.License + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := licensesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.licenses", "create", inputDataValue, executionContext) + var emptyOutput model.License + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), licensesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.License), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *licensesClient) Delete(licenseKeyParam string) error { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(licensesDeleteInputType(), typeConverter) + sv.AddStructField("LicenseKey", licenseKeyParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := licensesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.licenses", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (lIface *licensesClient) Delete0(licenseParam model.License) error { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(licensesDelete0InputType(), typeConverter) + sv.AddStructField("License", licenseParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := licensesDelete0RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.licenses", "delete_0", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (lIface *licensesClient) Get() (model.License, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(licensesGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.License + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := licensesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.licenses", "get", inputDataValue, executionContext) + var emptyOutput model.License + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), licensesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.License), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *licensesClient) Getlicensebykey(licenseKeyParam string) (model.License, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(licensesGetlicensebykeyInputType(), typeConverter) + sv.AddStructField("LicenseKey", licenseKeyParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.License + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := licensesGetlicensebykeyRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.licenses", "getlicensebykey", inputDataValue, executionContext) + var emptyOutput model.License + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), licensesGetlicensebykeyOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.License), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *licensesClient) List() (model.LicensesListResult, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(licensesListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LicensesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := licensesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.licenses", "list", inputDataValue, executionContext) + var emptyOutput model.LicensesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), licensesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LicensesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *licensesClient) Update(licenseParam model.License) (model.License, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(licensesUpdateInputType(), typeConverter) + sv.AddStructField("License", licenseParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.License + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := licensesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.licenses", "update", inputDataValue, executionContext) + var emptyOutput model.License + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), licensesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.License), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/LicensesTypes.go b/services/nsxt-mp/nsx/LicensesTypes.go new file mode 100644 index 000000000..738a93ce1 --- /dev/null +++ b/services/nsxt-mp/nsx/LicensesTypes.go @@ -0,0 +1,349 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Licenses. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func licensesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["license"] = bindings.NewReferenceType(model.LicenseBindingType) + fieldNameMap["license"] = "License" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func licensesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LicenseBindingType) +} + +func licensesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["license"] = bindings.NewReferenceType(model.LicenseBindingType) + fieldNameMap["license"] = "License" + paramsTypeMap["license"] = bindings.NewReferenceType(model.LicenseBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "license", + "POST", + "/api/v1/licenses", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func licensesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["license_key"] = bindings.NewStringType() + fieldNameMap["license_key"] = "LicenseKey" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func licensesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func licensesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["license_key"] = bindings.NewStringType() + fieldNameMap["license_key"] = "LicenseKey" + paramsTypeMap["license_key"] = bindings.NewStringType() + paramsTypeMap["licenseKey"] = bindings.NewStringType() + pathParams["license_key"] = "licenseKey" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/licenses/{licenseKey}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func licensesDelete0InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["license"] = bindings.NewReferenceType(model.LicenseBindingType) + fieldNameMap["license"] = "License" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func licensesDelete0OutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func licensesDelete0RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["license"] = bindings.NewReferenceType(model.LicenseBindingType) + fieldNameMap["license"] = "License" + paramsTypeMap["license"] = bindings.NewReferenceType(model.LicenseBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=delete", + "license", + "POST", + "/api/v1/licenses", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func licensesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func licensesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LicenseBindingType) +} + +func licensesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/license", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func licensesGetlicensebykeyInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["license_key"] = bindings.NewStringType() + fieldNameMap["license_key"] = "LicenseKey" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func licensesGetlicensebykeyOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LicenseBindingType) +} + +func licensesGetlicensebykeyRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["license_key"] = bindings.NewStringType() + fieldNameMap["license_key"] = "LicenseKey" + paramsTypeMap["license_key"] = bindings.NewStringType() + paramsTypeMap["licenseKey"] = bindings.NewStringType() + pathParams["license_key"] = "licenseKey" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/licenses/{licenseKey}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func licensesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func licensesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LicensesListResultBindingType) +} + +func licensesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/licenses", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func licensesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["license"] = bindings.NewReferenceType(model.LicenseBindingType) + fieldNameMap["license"] = "License" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func licensesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LicenseBindingType) +} + +func licensesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["license"] = bindings.NewReferenceType(model.LicenseBindingType) + fieldNameMap["license"] = "License" + paramsTypeMap["license"] = bindings.NewReferenceType(model.LicenseBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "license", + "PUT", + "/api/v1/license", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/LivetracesClient.go b/services/nsxt-mp/nsx/LivetracesClient.go new file mode 100644 index 000000000..8e3da7dbd --- /dev/null +++ b/services/nsxt-mp/nsx/LivetracesClient.go @@ -0,0 +1,220 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Livetraces +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type LivetracesClient interface { + + // Create a livetrace session + // + // @param liveTraceRequestParam (required) + // @return com.vmware.nsx.model.LiveTraceStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(liveTraceRequestParam model.LiveTraceRequest) (model.LiveTraceStatus, error) + + // Delete a livetrace session + // + // @param livetraceSessionIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(livetraceSessionIdParam string) error + + // Get the status of a livetrace session + // + // @param livetraceSessionIdParam (required) + // @return com.vmware.nsx.model.LiveTraceStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(livetraceSessionIdParam string) (model.LiveTraceStatus, error) + + // List all livetrace sessions + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.LiveTraceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LiveTraceListResult, error) +} + +type livetracesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewLivetracesClient(connector client.Connector) *livetracesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.livetraces") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + lIface := livetracesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &lIface +} + +func (lIface *livetracesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := lIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (lIface *livetracesClient) Create(liveTraceRequestParam model.LiveTraceRequest) (model.LiveTraceStatus, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(livetracesCreateInputType(), typeConverter) + sv.AddStructField("LiveTraceRequest", liveTraceRequestParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LiveTraceStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := livetracesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.livetraces", "create", inputDataValue, executionContext) + var emptyOutput model.LiveTraceStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), livetracesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LiveTraceStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *livetracesClient) Delete(livetraceSessionIdParam string) error { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(livetracesDeleteInputType(), typeConverter) + sv.AddStructField("LivetraceSessionId", livetraceSessionIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := livetracesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.livetraces", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (lIface *livetracesClient) Get(livetraceSessionIdParam string) (model.LiveTraceStatus, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(livetracesGetInputType(), typeConverter) + sv.AddStructField("LivetraceSessionId", livetraceSessionIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LiveTraceStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := livetracesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.livetraces", "get", inputDataValue, executionContext) + var emptyOutput model.LiveTraceStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), livetracesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LiveTraceStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *livetracesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LiveTraceListResult, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(livetracesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LiveTraceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := livetracesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.livetraces", "list", inputDataValue, executionContext) + var emptyOutput model.LiveTraceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), livetracesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LiveTraceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/LivetracesTypes.go b/services/nsxt-mp/nsx/LivetracesTypes.go new file mode 100644 index 000000000..bd209c80c --- /dev/null +++ b/services/nsxt-mp/nsx/LivetracesTypes.go @@ -0,0 +1,240 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Livetraces. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func livetracesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["live_trace_request"] = bindings.NewReferenceType(model.LiveTraceRequestBindingType) + fieldNameMap["live_trace_request"] = "LiveTraceRequest" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func livetracesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LiveTraceStatusBindingType) +} + +func livetracesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["live_trace_request"] = bindings.NewReferenceType(model.LiveTraceRequestBindingType) + fieldNameMap["live_trace_request"] = "LiveTraceRequest" + paramsTypeMap["live_trace_request"] = bindings.NewReferenceType(model.LiveTraceRequestBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "live_trace_request", + "POST", + "/api/v1/livetraces", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func livetracesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["livetrace_session_id"] = bindings.NewStringType() + fieldNameMap["livetrace_session_id"] = "LivetraceSessionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func livetracesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func livetracesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["livetrace_session_id"] = bindings.NewStringType() + fieldNameMap["livetrace_session_id"] = "LivetraceSessionId" + paramsTypeMap["livetrace_session_id"] = bindings.NewStringType() + paramsTypeMap["livetraceSessionId"] = bindings.NewStringType() + pathParams["livetrace_session_id"] = "livetraceSessionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/livetraces/{livetraceSessionId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func livetracesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["livetrace_session_id"] = bindings.NewStringType() + fieldNameMap["livetrace_session_id"] = "LivetraceSessionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func livetracesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LiveTraceStatusBindingType) +} + +func livetracesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["livetrace_session_id"] = bindings.NewStringType() + fieldNameMap["livetrace_session_id"] = "LivetraceSessionId" + paramsTypeMap["livetrace_session_id"] = bindings.NewStringType() + paramsTypeMap["livetraceSessionId"] = bindings.NewStringType() + pathParams["livetrace_session_id"] = "livetraceSessionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/livetraces/{livetraceSessionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func livetracesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func livetracesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LiveTraceListResultBindingType) +} + +func livetracesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/livetraces", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/LogicalPortsClient.go b/services/nsxt-mp/nsx/LogicalPortsClient.go new file mode 100644 index 000000000..785197119 --- /dev/null +++ b/services/nsxt-mp/nsx/LogicalPortsClient.go @@ -0,0 +1,287 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: LogicalPorts +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type LogicalPortsClient interface { + + // Creates a new logical switch port. The required parameters are the associated logical_switch_id and admin_state (UP or DOWN). Optional parameters are the attachment and switching_profile_ids. If you don't specify switching_profile_ids, default switching profiles are assigned to the port. If you don't specify an attachment, the switch port remains empty. To configure an attachment, you must specify an id, and optionally you can specify an attachment_type (VIF or LOGICALROUTER). The attachment_type is VIF by default. This api is now deprecated. Please use new api - PUT /infra/segments//ports/ + // + // @param logicalPortParam (required) + // @return com.vmware.nsx.model.LogicalPort + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(logicalPortParam model.LogicalPort) (model.LogicalPort, error) + + // Deletes the specified logical switch port. By default, if logical port has attachments, or it is added to any NSGroup, the deletion will be failed. Option detach could be used for deleting logical port forcibly. This api is now deprecated. Please use new api - DELETE /infra/segments//ports/ + // + // @param lportIdParam (required) + // @param detachParam force delete even if attached or referenced by a group (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(lportIdParam string, detachParam *bool) error + + // Returns information about a specified logical port. in impactor-ufo branch. Please use corresponding policy API /infra/segments//ports/ + // + // @param lportIdParam (required) + // @return com.vmware.nsx.model.LogicalPort + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(lportIdParam string) (model.LogicalPort, error) + + // Returns information about all configured logical switch ports. Logical switch ports connect to VM virtual network interface cards (NICs). Each logical port is associated with one logical switch. This api is now deprecated. Please use new api - /infra/segments//ports + // + // @param attachmentIdParam Logical Port attachment Id (optional) + // @param attachmentTypeParam Type of attachment for logical port; for query only. (optional) + // @param bridgeClusterIdParam Bridge Cluster identifier (optional) + // @param containerPortsOnlyParam Only container VIF logical ports will be returned if true (optional, default to false) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param diagnosticParam Flag to enable showing of transit logical port. (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param logicalSwitchIdParam Logical Switch identifier (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param parentVifIdParam ID of the VIF of type PARENT (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param switchingProfileIdParam Network Profile identifier (optional) + // @param transportNodeIdParam Transport node identifier (optional) + // @param transportZoneIdParam Transport zone identifier (optional) + // @return com.vmware.nsx.model.LogicalPortListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(attachmentIdParam *string, attachmentTypeParam *string, bridgeClusterIdParam *string, containerPortsOnlyParam *bool, cursorParam *string, diagnosticParam *bool, includedFieldsParam *string, logicalSwitchIdParam *string, pageSizeParam *int64, parentVifIdParam *string, sortAscendingParam *bool, sortByParam *string, switchingProfileIdParam *string, transportNodeIdParam *string, transportZoneIdParam *string) (model.LogicalPortListResult, error) + + // Modifies an existing logical switch port. Parameters that can be modified include attachment_type (LOGICALROUTER, VIF), admin_state (UP or DOWN), attachment id and switching_profile_ids. You cannot modify the logical_switch_id. In other words, you cannot move an existing port from one switch to another switch. This api is now deprecated. Please use new api - /infra/segments//ports/ + // + // @param lportIdParam (required) + // @param logicalPortParam (required) + // @return com.vmware.nsx.model.LogicalPort + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(lportIdParam string, logicalPortParam model.LogicalPort) (model.LogicalPort, error) +} + +type logicalPortsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewLogicalPortsClient(connector client.Connector) *logicalPortsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_ports") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + lIface := logicalPortsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &lIface +} + +func (lIface *logicalPortsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := lIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (lIface *logicalPortsClient) Create(logicalPortParam model.LogicalPort) (model.LogicalPort, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logicalPortsCreateInputType(), typeConverter) + sv.AddStructField("LogicalPort", logicalPortParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalPort + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logicalPortsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_ports", "create", inputDataValue, executionContext) + var emptyOutput model.LogicalPort + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), logicalPortsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalPort), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *logicalPortsClient) Delete(lportIdParam string, detachParam *bool) error { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logicalPortsDeleteInputType(), typeConverter) + sv.AddStructField("LportId", lportIdParam) + sv.AddStructField("Detach", detachParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logicalPortsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_ports", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (lIface *logicalPortsClient) Get(lportIdParam string) (model.LogicalPort, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logicalPortsGetInputType(), typeConverter) + sv.AddStructField("LportId", lportIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalPort + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logicalPortsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_ports", "get", inputDataValue, executionContext) + var emptyOutput model.LogicalPort + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), logicalPortsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalPort), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *logicalPortsClient) List(attachmentIdParam *string, attachmentTypeParam *string, bridgeClusterIdParam *string, containerPortsOnlyParam *bool, cursorParam *string, diagnosticParam *bool, includedFieldsParam *string, logicalSwitchIdParam *string, pageSizeParam *int64, parentVifIdParam *string, sortAscendingParam *bool, sortByParam *string, switchingProfileIdParam *string, transportNodeIdParam *string, transportZoneIdParam *string) (model.LogicalPortListResult, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logicalPortsListInputType(), typeConverter) + sv.AddStructField("AttachmentId", attachmentIdParam) + sv.AddStructField("AttachmentType", attachmentTypeParam) + sv.AddStructField("BridgeClusterId", bridgeClusterIdParam) + sv.AddStructField("ContainerPortsOnly", containerPortsOnlyParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("Diagnostic", diagnosticParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("LogicalSwitchId", logicalSwitchIdParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("ParentVifId", parentVifIdParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("SwitchingProfileId", switchingProfileIdParam) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + sv.AddStructField("TransportZoneId", transportZoneIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalPortListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logicalPortsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_ports", "list", inputDataValue, executionContext) + var emptyOutput model.LogicalPortListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), logicalPortsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalPortListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *logicalPortsClient) Update(lportIdParam string, logicalPortParam model.LogicalPort) (model.LogicalPort, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logicalPortsUpdateInputType(), typeConverter) + sv.AddStructField("LportId", lportIdParam) + sv.AddStructField("LogicalPort", logicalPortParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalPort + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logicalPortsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_ports", "update", inputDataValue, executionContext) + var emptyOutput model.LogicalPort + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), logicalPortsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalPort), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/LogicalPortsTypes.go b/services/nsxt-mp/nsx/LogicalPortsTypes.go new file mode 100644 index 000000000..76f836275 --- /dev/null +++ b/services/nsxt-mp/nsx/LogicalPortsTypes.go @@ -0,0 +1,382 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: LogicalPorts. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``attachmentType`` of method LogicalPorts#list. +const LogicalPorts_LIST_ATTACHMENT_TYPE_VIF = "VIF" + +// Possible value for ``attachmentType`` of method LogicalPorts#list. +const LogicalPorts_LIST_ATTACHMENT_TYPE_LOGICALROUTER = "LOGICALROUTER" + +// Possible value for ``attachmentType`` of method LogicalPorts#list. +const LogicalPorts_LIST_ATTACHMENT_TYPE_BRIDGEENDPOINT = "BRIDGEENDPOINT" + +// Possible value for ``attachmentType`` of method LogicalPorts#list. +const LogicalPorts_LIST_ATTACHMENT_TYPE_DHCP_SERVICE = "DHCP_SERVICE" + +// Possible value for ``attachmentType`` of method LogicalPorts#list. +const LogicalPorts_LIST_ATTACHMENT_TYPE_METADATA_PROXY = "METADATA_PROXY" + +// Possible value for ``attachmentType`` of method LogicalPorts#list. +const LogicalPorts_LIST_ATTACHMENT_TYPE_L2VPN_SESSION = "L2VPN_SESSION" + +// Possible value for ``attachmentType`` of method LogicalPorts#list. +const LogicalPorts_LIST_ATTACHMENT_TYPE_NONE = "NONE" + +func logicalPortsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_port"] = bindings.NewReferenceType(model.LogicalPortBindingType) + fieldNameMap["logical_port"] = "LogicalPort" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logicalPortsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalPortBindingType) +} + +func logicalPortsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_port"] = bindings.NewReferenceType(model.LogicalPortBindingType) + fieldNameMap["logical_port"] = "LogicalPort" + paramsTypeMap["logical_port"] = bindings.NewReferenceType(model.LogicalPortBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "logical_port", + "POST", + "/api/v1/logical-ports", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func logicalPortsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lport_id"] = bindings.NewStringType() + fields["detach"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["lport_id"] = "LportId" + fieldNameMap["detach"] = "Detach" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logicalPortsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func logicalPortsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lport_id"] = bindings.NewStringType() + fields["detach"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["lport_id"] = "LportId" + fieldNameMap["detach"] = "Detach" + paramsTypeMap["lport_id"] = bindings.NewStringType() + paramsTypeMap["detach"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["lportId"] = bindings.NewStringType() + pathParams["lport_id"] = "lportId" + queryParams["detach"] = "detach" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/logical-ports/{lportId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func logicalPortsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lport_id"] = bindings.NewStringType() + fieldNameMap["lport_id"] = "LportId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logicalPortsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalPortBindingType) +} + +func logicalPortsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lport_id"] = bindings.NewStringType() + fieldNameMap["lport_id"] = "LportId" + paramsTypeMap["lport_id"] = bindings.NewStringType() + paramsTypeMap["lportId"] = bindings.NewStringType() + pathParams["lport_id"] = "lportId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-ports/{lportId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func logicalPortsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["attachment_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["attachment_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["bridge_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["container_ports_only"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["diagnostic"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["parent_vif_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["switching_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["attachment_id"] = "AttachmentId" + fieldNameMap["attachment_type"] = "AttachmentType" + fieldNameMap["bridge_cluster_id"] = "BridgeClusterId" + fieldNameMap["container_ports_only"] = "ContainerPortsOnly" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["diagnostic"] = "Diagnostic" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["parent_vif_id"] = "ParentVifId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["switching_profile_id"] = "SwitchingProfileId" + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["transport_zone_id"] = "TransportZoneId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logicalPortsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalPortListResultBindingType) +} + +func logicalPortsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["attachment_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["attachment_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["bridge_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["container_ports_only"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["diagnostic"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["parent_vif_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["switching_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["attachment_id"] = "AttachmentId" + fieldNameMap["attachment_type"] = "AttachmentType" + fieldNameMap["bridge_cluster_id"] = "BridgeClusterId" + fieldNameMap["container_ports_only"] = "ContainerPortsOnly" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["diagnostic"] = "Diagnostic" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["parent_vif_id"] = "ParentVifId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["switching_profile_id"] = "SwitchingProfileId" + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["transport_zone_id"] = "TransportZoneId" + paramsTypeMap["bridge_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["switching_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["parent_vif_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["container_ports_only"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["diagnostic"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["attachment_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["attachment_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["switching_profile_id"] = "switching_profile_id" + queryParams["sort_by"] = "sort_by" + queryParams["transport_node_id"] = "transport_node_id" + queryParams["bridge_cluster_id"] = "bridge_cluster_id" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["attachment_type"] = "attachment_type" + queryParams["included_fields"] = "included_fields" + queryParams["attachment_id"] = "attachment_id" + queryParams["transport_zone_id"] = "transport_zone_id" + queryParams["container_ports_only"] = "container_ports_only" + queryParams["diagnostic"] = "diagnostic" + queryParams["parent_vif_id"] = "parent_vif_id" + queryParams["logical_switch_id"] = "logical_switch_id" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-ports", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func logicalPortsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lport_id"] = bindings.NewStringType() + fields["logical_port"] = bindings.NewReferenceType(model.LogicalPortBindingType) + fieldNameMap["lport_id"] = "LportId" + fieldNameMap["logical_port"] = "LogicalPort" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logicalPortsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalPortBindingType) +} + +func logicalPortsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lport_id"] = bindings.NewStringType() + fields["logical_port"] = bindings.NewReferenceType(model.LogicalPortBindingType) + fieldNameMap["lport_id"] = "LportId" + fieldNameMap["logical_port"] = "LogicalPort" + paramsTypeMap["lport_id"] = bindings.NewStringType() + paramsTypeMap["logical_port"] = bindings.NewReferenceType(model.LogicalPortBindingType) + paramsTypeMap["lportId"] = bindings.NewStringType() + pathParams["lport_id"] = "lportId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "logical_port", + "PUT", + "/api/v1/logical-ports/{lportId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/LogicalRouterPortsClient.go b/services/nsxt-mp/nsx/LogicalRouterPortsClient.go new file mode 100644 index 000000000..a71ee531e --- /dev/null +++ b/services/nsxt-mp/nsx/LogicalRouterPortsClient.go @@ -0,0 +1,281 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: LogicalRouterPorts +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type LogicalRouterPortsClient interface { + + // Creates a logical router port. The required parameters include resource_type (LogicalRouterUpLinkPort, LogicalRouterDownLinkPort, LogicalRouterLinkPort, LogicalRouterLoopbackPort, LogicalRouterCentralizedServicePort); and logical_router_id (the router to which each logical router port is assigned). The service_bindings parameter is optional. + // + // @param logicalRouterPortParam (required) + // The parameter must contain all the properties defined in model.LogicalRouterPort. + // @return com.vmware.nsx.model.LogicalRouterPort + // The return value will contain all the properties defined in model.LogicalRouterPort. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(logicalRouterPortParam *data.StructValue) (*data.StructValue, error) + + // Deletes the specified logical router port. You must delete logical router ports before you can delete the associated logical router. To Delete Tier0 router link port you must have to delete attached tier1 router link port, otherwise pass \"force=true\" as query param to force delete the Tier0 router link port. + // + // @param logicalRouterPortIdParam (required) + // @param cascadeDeleteLinkedPortsParam Flag to specify whether to delete related logical switch ports (optional, default to false) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(logicalRouterPortIdParam string, cascadeDeleteLinkedPortsParam *bool, forceParam *bool) error + + // Returns information about the specified logical router port. + // + // @param logicalRouterPortIdParam (required) + // @return com.vmware.nsx.model.LogicalRouterPort + // The return value will contain all the properties defined in model.LogicalRouterPort. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterPortIdParam string) (*data.StructValue, error) + + // Returns information about all logical router ports. Information includes the resource_type (LogicalRouterUpLinkPort, LogicalRouterDownLinkPort, LogicalRouterLinkPort, LogicalRouterLoopbackPort, LogicalRouterCentralizedServicePort); logical_router_id (the router to which each logical router port is assigned); and any service_bindings (such as DHCP relay service). The GET request can include a query parameter (logical_router_id or logical_switch_id). + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param logicalRouterIdParam Logical Router identifier (optional) + // @param logicalSwitchIdParam Logical Switch identifier (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param resourceTypeParam Resource types of logical router port (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.LogicalRouterPortListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, logicalRouterIdParam *string, logicalSwitchIdParam *string, pageSizeParam *int64, resourceTypeParam *string, sortAscendingParam *bool, sortByParam *string) (model.LogicalRouterPortListResult, error) + + // Modifies the specified logical router port. Required parameters include the resource_type and logical_router_id. Modifiable parameters include the resource_type (LogicalRouterUpLinkPort, LogicalRouterDownLinkPort, LogicalRouterLinkPort, LogicalRouterLoopbackPort, LogicalRouterCentralizedServicePort), logical_router_id (to reassign the port to a different router), and service_bindings. + // + // @param logicalRouterPortIdParam (required) + // @param logicalRouterPortParam (required) + // The parameter must contain all the properties defined in model.LogicalRouterPort. + // @return com.vmware.nsx.model.LogicalRouterPort + // The return value will contain all the properties defined in model.LogicalRouterPort. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(logicalRouterPortIdParam string, logicalRouterPortParam *data.StructValue) (*data.StructValue, error) +} + +type logicalRouterPortsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewLogicalRouterPortsClient(connector client.Connector) *logicalRouterPortsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_router_ports") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + lIface := logicalRouterPortsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &lIface +} + +func (lIface *logicalRouterPortsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := lIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (lIface *logicalRouterPortsClient) Create(logicalRouterPortParam *data.StructValue) (*data.StructValue, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logicalRouterPortsCreateInputType(), typeConverter) + sv.AddStructField("LogicalRouterPort", logicalRouterPortParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logicalRouterPortsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_router_ports", "create", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), logicalRouterPortsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *logicalRouterPortsClient) Delete(logicalRouterPortIdParam string, cascadeDeleteLinkedPortsParam *bool, forceParam *bool) error { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logicalRouterPortsDeleteInputType(), typeConverter) + sv.AddStructField("LogicalRouterPortId", logicalRouterPortIdParam) + sv.AddStructField("CascadeDeleteLinkedPorts", cascadeDeleteLinkedPortsParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logicalRouterPortsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_router_ports", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (lIface *logicalRouterPortsClient) Get(logicalRouterPortIdParam string) (*data.StructValue, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logicalRouterPortsGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterPortId", logicalRouterPortIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logicalRouterPortsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_router_ports", "get", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), logicalRouterPortsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *logicalRouterPortsClient) List(cursorParam *string, includedFieldsParam *string, logicalRouterIdParam *string, logicalSwitchIdParam *string, pageSizeParam *int64, resourceTypeParam *string, sortAscendingParam *bool, sortByParam *string) (model.LogicalRouterPortListResult, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logicalRouterPortsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("LogicalSwitchId", logicalSwitchIdParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("ResourceType", resourceTypeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalRouterPortListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logicalRouterPortsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_router_ports", "list", inputDataValue, executionContext) + var emptyOutput model.LogicalRouterPortListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), logicalRouterPortsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalRouterPortListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *logicalRouterPortsClient) Update(logicalRouterPortIdParam string, logicalRouterPortParam *data.StructValue) (*data.StructValue, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logicalRouterPortsUpdateInputType(), typeConverter) + sv.AddStructField("LogicalRouterPortId", logicalRouterPortIdParam) + sv.AddStructField("LogicalRouterPort", logicalRouterPortParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logicalRouterPortsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_router_ports", "update", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), logicalRouterPortsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/LogicalRouterPortsTypes.go b/services/nsxt-mp/nsx/LogicalRouterPortsTypes.go new file mode 100644 index 000000000..027827d66 --- /dev/null +++ b/services/nsxt-mp/nsx/LogicalRouterPortsTypes.go @@ -0,0 +1,346 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: LogicalRouterPorts. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``resourceType`` of method LogicalRouterPorts#list. +const LogicalRouterPorts_LIST_RESOURCE_TYPE_LOGICALROUTERUPLINKPORT = "LogicalRouterUpLinkPort" + +// Possible value for ``resourceType`` of method LogicalRouterPorts#list. +const LogicalRouterPorts_LIST_RESOURCE_TYPE_LOGICALROUTERDOWNLINKPORT = "LogicalRouterDownLinkPort" + +// Possible value for ``resourceType`` of method LogicalRouterPorts#list. +const LogicalRouterPorts_LIST_RESOURCE_TYPE_LOGICALROUTERLINKPORTONTIER0 = "LogicalRouterLinkPortOnTIER0" + +// Possible value for ``resourceType`` of method LogicalRouterPorts#list. +const LogicalRouterPorts_LIST_RESOURCE_TYPE_LOGICALROUTERLINKPORTONTIER1 = "LogicalRouterLinkPortOnTIER1" + +// Possible value for ``resourceType`` of method LogicalRouterPorts#list. +const LogicalRouterPorts_LIST_RESOURCE_TYPE_LOGICALROUTERLOOPBACKPORT = "LogicalRouterLoopbackPort" + +// Possible value for ``resourceType`` of method LogicalRouterPorts#list. +const LogicalRouterPorts_LIST_RESOURCE_TYPE_LOGICALROUTERIPTUNNELPORT = "LogicalRouterIPTunnelPort" + +// Possible value for ``resourceType`` of method LogicalRouterPorts#list. +const LogicalRouterPorts_LIST_RESOURCE_TYPE_LOGICALROUTERCENTRALIZEDSERVICEPORT = "LogicalRouterCentralizedServicePort" + +func logicalRouterPortsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_port"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LogicalRouterPortBindingType)}, bindings.REST) + fieldNameMap["logical_router_port"] = "LogicalRouterPort" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logicalRouterPortsCreateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LogicalRouterPortBindingType)}, bindings.REST) +} + +func logicalRouterPortsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_port"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LogicalRouterPortBindingType)}, bindings.REST) + fieldNameMap["logical_router_port"] = "LogicalRouterPort" + paramsTypeMap["logical_router_port"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LogicalRouterPortBindingType)}, bindings.REST) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "logical_router_port", + "POST", + "/api/v1/logical-router-ports", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func logicalRouterPortsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_port_id"] = bindings.NewStringType() + fields["cascade_delete_linked_ports"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + fieldNameMap["cascade_delete_linked_ports"] = "CascadeDeleteLinkedPorts" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logicalRouterPortsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func logicalRouterPortsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_port_id"] = bindings.NewStringType() + fields["cascade_delete_linked_ports"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + fieldNameMap["cascade_delete_linked_ports"] = "CascadeDeleteLinkedPorts" + fieldNameMap["force"] = "Force" + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["logical_router_port_id"] = bindings.NewStringType() + paramsTypeMap["cascade_delete_linked_ports"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["logicalRouterPortId"] = bindings.NewStringType() + pathParams["logical_router_port_id"] = "logicalRouterPortId" + queryParams["cascade_delete_linked_ports"] = "cascade_delete_linked_ports" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/logical-router-ports/{logicalRouterPortId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func logicalRouterPortsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_port_id"] = bindings.NewStringType() + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logicalRouterPortsGetOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LogicalRouterPortBindingType)}, bindings.REST) +} + +func logicalRouterPortsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_port_id"] = bindings.NewStringType() + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + paramsTypeMap["logical_router_port_id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterPortId"] = bindings.NewStringType() + pathParams["logical_router_port_id"] = "logicalRouterPortId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-router-ports/{logicalRouterPortId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func logicalRouterPortsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["resource_type"] = "ResourceType" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logicalRouterPortsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalRouterPortListResultBindingType) +} + +func logicalRouterPortsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["resource_type"] = "ResourceType" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["logical_router_id"] = "logical_router_id" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["resource_type"] = "resource_type" + queryParams["sort_by"] = "sort_by" + queryParams["logical_switch_id"] = "logical_switch_id" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-router-ports", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func logicalRouterPortsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_port_id"] = bindings.NewStringType() + fields["logical_router_port"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LogicalRouterPortBindingType)}, bindings.REST) + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + fieldNameMap["logical_router_port"] = "LogicalRouterPort" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logicalRouterPortsUpdateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LogicalRouterPortBindingType)}, bindings.REST) +} + +func logicalRouterPortsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_port_id"] = bindings.NewStringType() + fields["logical_router_port"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LogicalRouterPortBindingType)}, bindings.REST) + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + fieldNameMap["logical_router_port"] = "LogicalRouterPort" + paramsTypeMap["logical_router_port"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LogicalRouterPortBindingType)}, bindings.REST) + paramsTypeMap["logical_router_port_id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterPortId"] = bindings.NewStringType() + pathParams["logical_router_port_id"] = "logicalRouterPortId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "logical_router_port", + "PUT", + "/api/v1/logical-router-ports/{logicalRouterPortId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/LogicalRoutersClient.go b/services/nsxt-mp/nsx/LogicalRoutersClient.go new file mode 100644 index 000000000..9c92637a8 --- /dev/null +++ b/services/nsxt-mp/nsx/LogicalRoutersClient.go @@ -0,0 +1,354 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: LogicalRouters +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type LogicalRoutersClient interface { + + // Creates a logical router. The required parameters are router_type (TIER0 or TIER1) and edge_cluster_id (TIER0 only). Optional parameters include internal and external transit network addresses. + // + // @param logicalRouterParam (required) + // @return com.vmware.nsx.model.LogicalRouter + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(logicalRouterParam model.LogicalRouter) (model.LogicalRouter, error) + + // Deletes the specified logical router. You must delete associated logical router ports before you can delete a logical router. Otherwise use force delete which will delete all related ports and other entities associated with that LR. To force delete logical router pass force=true in query param. + // + // @param logicalRouterIdParam (required) + // @param cascadeDeleteLinkedPortsParam Flag to specify whether to delete related logical switch ports (optional, default to false) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(logicalRouterIdParam string, cascadeDeleteLinkedPortsParam *bool, forceParam *bool) error + + // Returns information about the specified logical router. + // + // @param logicalRouterIdParam (required) + // @return com.vmware.nsx.model.LogicalRouter + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterIdParam string) (model.LogicalRouter, error) + + // Returns information about all logical routers, including the UUID, internal and external transit network addresses, and the router type (TIER0 or TIER1). You can get information for only TIER0 routers or only the TIER1 routers by including the router_type query parameter. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param routerTypeParam Type of Logical Router (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param vrfsOnLogicalRouterIdParam List all VRFs on the specified logical router. (optional) + // @return com.vmware.nsx.model.LogicalRouterListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, routerTypeParam *string, sortAscendingParam *bool, sortByParam *string, vrfsOnLogicalRouterIdParam *string) (model.LogicalRouterListResult, error) + + // API to re allocate edge node placement for TIER1 logical router. You can re-allocate service routers of TIER1 in same edge cluster or different edge cluster. You can also place edge nodes manually and provide maximum two indices for HA mode ACTIVE_STANDBY. To re-allocate on new edge cluster you must have existing edge cluster for TIER1 logical router. This will be disruptive operation and all existing statistics of logical router will be remove. + // + // @param logicalRouterIdParam (required) + // @param serviceRouterAllocationConfigParam (required) + // @return com.vmware.nsx.model.LogicalRouter + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Reallocate(logicalRouterIdParam string, serviceRouterAllocationConfigParam model.ServiceRouterAllocationConfig) (model.LogicalRouter, error) + + // Reprocess logical router configuration and configuration of related entities like logical router ports, static routing, etc. Any missing Updates are published to controller. + // + // @param logicalRouterIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Reprocess(logicalRouterIdParam string) error + + // Modifies the specified logical router. Modifiable attributes include the internal_transit_network, external_transit_networks, and edge_cluster_id (for TIER0 routers). + // + // @param logicalRouterIdParam (required) + // @param logicalRouterParam (required) + // @return com.vmware.nsx.model.LogicalRouter + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(logicalRouterIdParam string, logicalRouterParam model.LogicalRouter) (model.LogicalRouter, error) +} + +type logicalRoutersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewLogicalRoutersClient(connector client.Connector) *logicalRoutersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "reallocate": core.NewMethodIdentifier(interfaceIdentifier, "reallocate"), + "reprocess": core.NewMethodIdentifier(interfaceIdentifier, "reprocess"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + lIface := logicalRoutersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &lIface +} + +func (lIface *logicalRoutersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := lIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (lIface *logicalRoutersClient) Create(logicalRouterParam model.LogicalRouter) (model.LogicalRouter, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logicalRoutersCreateInputType(), typeConverter) + sv.AddStructField("LogicalRouter", logicalRouterParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalRouter + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logicalRoutersCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers", "create", inputDataValue, executionContext) + var emptyOutput model.LogicalRouter + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), logicalRoutersCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalRouter), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *logicalRoutersClient) Delete(logicalRouterIdParam string, cascadeDeleteLinkedPortsParam *bool, forceParam *bool) error { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logicalRoutersDeleteInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("CascadeDeleteLinkedPorts", cascadeDeleteLinkedPortsParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logicalRoutersDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (lIface *logicalRoutersClient) Get(logicalRouterIdParam string) (model.LogicalRouter, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logicalRoutersGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalRouter + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logicalRoutersGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers", "get", inputDataValue, executionContext) + var emptyOutput model.LogicalRouter + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), logicalRoutersGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalRouter), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *logicalRoutersClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, routerTypeParam *string, sortAscendingParam *bool, sortByParam *string, vrfsOnLogicalRouterIdParam *string) (model.LogicalRouterListResult, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logicalRoutersListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("RouterType", routerTypeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("VrfsOnLogicalRouterId", vrfsOnLogicalRouterIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalRouterListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logicalRoutersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers", "list", inputDataValue, executionContext) + var emptyOutput model.LogicalRouterListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), logicalRoutersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalRouterListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *logicalRoutersClient) Reallocate(logicalRouterIdParam string, serviceRouterAllocationConfigParam model.ServiceRouterAllocationConfig) (model.LogicalRouter, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logicalRoutersReallocateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("ServiceRouterAllocationConfig", serviceRouterAllocationConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalRouter + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logicalRoutersReallocateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers", "reallocate", inputDataValue, executionContext) + var emptyOutput model.LogicalRouter + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), logicalRoutersReallocateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalRouter), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *logicalRoutersClient) Reprocess(logicalRouterIdParam string) error { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logicalRoutersReprocessInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logicalRoutersReprocessRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers", "reprocess", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (lIface *logicalRoutersClient) Update(logicalRouterIdParam string, logicalRouterParam model.LogicalRouter) (model.LogicalRouter, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logicalRoutersUpdateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("LogicalRouter", logicalRouterParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalRouter + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logicalRoutersUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers", "update", inputDataValue, executionContext) + var emptyOutput model.LogicalRouter + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), logicalRoutersUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalRouter), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/LogicalRoutersTypes.go b/services/nsxt-mp/nsx/LogicalRoutersTypes.go new file mode 100644 index 000000000..5d327d39a --- /dev/null +++ b/services/nsxt-mp/nsx/LogicalRoutersTypes.go @@ -0,0 +1,433 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: LogicalRouters. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``routerType`` of method LogicalRouters#list. +const LogicalRouters_LIST_ROUTER_TYPE_TIER0 = "TIER0" + +// Possible value for ``routerType`` of method LogicalRouters#list. +const LogicalRouters_LIST_ROUTER_TYPE_TIER1 = "TIER1" + +// Possible value for ``routerType`` of method LogicalRouters#list. +const LogicalRouters_LIST_ROUTER_TYPE_VRF = "VRF" + +func logicalRoutersCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router"] = bindings.NewReferenceType(model.LogicalRouterBindingType) + fieldNameMap["logical_router"] = "LogicalRouter" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logicalRoutersCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalRouterBindingType) +} + +func logicalRoutersCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router"] = bindings.NewReferenceType(model.LogicalRouterBindingType) + fieldNameMap["logical_router"] = "LogicalRouter" + paramsTypeMap["logical_router"] = bindings.NewReferenceType(model.LogicalRouterBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "logical_router", + "POST", + "/api/v1/logical-routers", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func logicalRoutersDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["cascade_delete_linked_ports"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["cascade_delete_linked_ports"] = "CascadeDeleteLinkedPorts" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logicalRoutersDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func logicalRoutersDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["cascade_delete_linked_ports"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["cascade_delete_linked_ports"] = "CascadeDeleteLinkedPorts" + fieldNameMap["force"] = "Force" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["cascade_delete_linked_ports"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + queryParams["cascade_delete_linked_ports"] = "cascade_delete_linked_ports" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/logical-routers/{logicalRouterId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func logicalRoutersGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logicalRoutersGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalRouterBindingType) +} + +func logicalRoutersGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func logicalRoutersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["router_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["vrfs_on_logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["router_type"] = "RouterType" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["vrfs_on_logical_router_id"] = "VrfsOnLogicalRouterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logicalRoutersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalRouterListResultBindingType) +} + +func logicalRoutersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["router_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["vrfs_on_logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["router_type"] = "RouterType" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["vrfs_on_logical_router_id"] = "VrfsOnLogicalRouterId" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["router_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["vrfs_on_logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["router_type"] = "router_type" + queryParams["page_size"] = "page_size" + queryParams["vrfs_on_logical_router_id"] = "vrfs_on_logical_router_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func logicalRoutersReallocateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["service_router_allocation_config"] = bindings.NewReferenceType(model.ServiceRouterAllocationConfigBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["service_router_allocation_config"] = "ServiceRouterAllocationConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logicalRoutersReallocateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalRouterBindingType) +} + +func logicalRoutersReallocateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["service_router_allocation_config"] = bindings.NewReferenceType(model.ServiceRouterAllocationConfigBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["service_router_allocation_config"] = "ServiceRouterAllocationConfig" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["service_router_allocation_config"] = bindings.NewReferenceType(model.ServiceRouterAllocationConfigBindingType) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=reallocate", + "service_router_allocation_config", + "POST", + "/api/v1/logical-routers/{logicalRouterId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func logicalRoutersReprocessInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logicalRoutersReprocessOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func logicalRoutersReprocessRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=reprocess", + "", + "POST", + "/api/v1/logical-routers/{logicalRouterId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func logicalRoutersUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["logical_router"] = bindings.NewReferenceType(model.LogicalRouterBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["logical_router"] = "LogicalRouter" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logicalRoutersUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalRouterBindingType) +} + +func logicalRoutersUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["logical_router"] = bindings.NewReferenceType(model.LogicalRouterBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["logical_router"] = "LogicalRouter" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["logical_router"] = bindings.NewReferenceType(model.LogicalRouterBindingType) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "logical_router", + "PUT", + "/api/v1/logical-routers/{logicalRouterId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/LogicalSwitchesClient.go b/services/nsxt-mp/nsx/LogicalSwitchesClient.go new file mode 100644 index 000000000..1a5cc03cc --- /dev/null +++ b/services/nsxt-mp/nsx/LogicalSwitchesClient.go @@ -0,0 +1,285 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: LogicalSwitches +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type LogicalSwitchesClient interface { + + // Creates a new logical switch. The request must include the transport_zone_id, display_name, and admin_state (UP or DOWN). The replication_mode (MTEP or SOURCE) is required for overlay logical switches, but not for VLAN-based logical switches. A vlan needs to be provided for VLAN-based logical switches. This api is now deprecated. Please use new api -/infra/segments/ + // + // @param logicalSwitchParam (required) + // @return com.vmware.nsx.model.LogicalSwitch + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(logicalSwitchParam model.LogicalSwitch) (model.LogicalSwitch, error) + + // Removes a logical switch from the associated overlay or VLAN transport zone. By default, a logical switch cannot be deleted if there are logical ports on the switch, or it is added to a NSGroup. Cascade option can be used to delete all ports and the logical switch. Detach option can be used to delete the logical switch forcibly. This api is now deprecated. Please use new api - /infra/segments/ + // + // @param lswitchIdParam (required) + // @param cascadeParam Delete a Logical Switch and all the logical ports in it, if none of the logical ports have any attachment. (optional, default to false) + // @param detachParam Force delete a logical switch (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(lswitchIdParam string, cascadeParam *bool, detachParam *bool) error + + // Returns information about the specified logical switch Id. This api is now deprecated. Please use new api - /infra/segments/ + // + // @param lswitchIdParam (required) + // @return com.vmware.nsx.model.LogicalSwitch + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(lswitchIdParam string) (model.LogicalSwitch, error) + + // Returns information about all configured logical switches. This api is now deprecated. Please use new api - /infra/segments + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param diagnosticParam Flag to enable showing of transit logical switch. (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param switchTypeParam Logical Switch type (optional) + // @param switchingProfileIdParam Switching Profile identifier (optional) + // @param transportTypeParam Mode of transport supported in the transport zone for this logical switch (optional) + // @param transportZoneIdParam Transport zone identifier (optional) + // @param uplinkTeamingPolicyNameParam The logical switch's uplink teaming policy name (optional) + // @param vlanParam Virtual Local Area Network Identifier (optional) + // @param vniParam VNI of the OVERLAY LogicalSwitch(es) to return. (optional) + // @return com.vmware.nsx.model.LogicalSwitchListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, diagnosticParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, switchTypeParam *string, switchingProfileIdParam *string, transportTypeParam *string, transportZoneIdParam *string, uplinkTeamingPolicyNameParam *string, vlanParam *int64, vniParam *int64) (model.LogicalSwitchListResult, error) + + // Modifies attributes of an existing logical switch. Modifiable attributes include admin_state, replication_mode, switching_profile_ids and VLAN spec. You cannot modify the original transport_zone_id. This api is now deprecated. Please use new api - PATCH /infra/segments/ + // + // @param lswitchIdParam (required) + // @param logicalSwitchParam (required) + // @return com.vmware.nsx.model.LogicalSwitch + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(lswitchIdParam string, logicalSwitchParam model.LogicalSwitch) (model.LogicalSwitch, error) +} + +type logicalSwitchesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewLogicalSwitchesClient(connector client.Connector) *logicalSwitchesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_switches") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + lIface := logicalSwitchesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &lIface +} + +func (lIface *logicalSwitchesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := lIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (lIface *logicalSwitchesClient) Create(logicalSwitchParam model.LogicalSwitch) (model.LogicalSwitch, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logicalSwitchesCreateInputType(), typeConverter) + sv.AddStructField("LogicalSwitch", logicalSwitchParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalSwitch + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logicalSwitchesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_switches", "create", inputDataValue, executionContext) + var emptyOutput model.LogicalSwitch + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), logicalSwitchesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalSwitch), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *logicalSwitchesClient) Delete(lswitchIdParam string, cascadeParam *bool, detachParam *bool) error { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logicalSwitchesDeleteInputType(), typeConverter) + sv.AddStructField("LswitchId", lswitchIdParam) + sv.AddStructField("Cascade", cascadeParam) + sv.AddStructField("Detach", detachParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logicalSwitchesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_switches", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (lIface *logicalSwitchesClient) Get(lswitchIdParam string) (model.LogicalSwitch, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logicalSwitchesGetInputType(), typeConverter) + sv.AddStructField("LswitchId", lswitchIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalSwitch + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logicalSwitchesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_switches", "get", inputDataValue, executionContext) + var emptyOutput model.LogicalSwitch + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), logicalSwitchesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalSwitch), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *logicalSwitchesClient) List(cursorParam *string, diagnosticParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, switchTypeParam *string, switchingProfileIdParam *string, transportTypeParam *string, transportZoneIdParam *string, uplinkTeamingPolicyNameParam *string, vlanParam *int64, vniParam *int64) (model.LogicalSwitchListResult, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logicalSwitchesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("Diagnostic", diagnosticParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("SwitchType", switchTypeParam) + sv.AddStructField("SwitchingProfileId", switchingProfileIdParam) + sv.AddStructField("TransportType", transportTypeParam) + sv.AddStructField("TransportZoneId", transportZoneIdParam) + sv.AddStructField("UplinkTeamingPolicyName", uplinkTeamingPolicyNameParam) + sv.AddStructField("Vlan", vlanParam) + sv.AddStructField("Vni", vniParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalSwitchListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logicalSwitchesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_switches", "list", inputDataValue, executionContext) + var emptyOutput model.LogicalSwitchListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), logicalSwitchesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalSwitchListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *logicalSwitchesClient) Update(lswitchIdParam string, logicalSwitchParam model.LogicalSwitch) (model.LogicalSwitch, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logicalSwitchesUpdateInputType(), typeConverter) + sv.AddStructField("LswitchId", lswitchIdParam) + sv.AddStructField("LogicalSwitch", logicalSwitchParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalSwitch + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logicalSwitchesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_switches", "update", inputDataValue, executionContext) + var emptyOutput model.LogicalSwitch + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), logicalSwitchesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalSwitch), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/LogicalSwitchesTypes.go b/services/nsxt-mp/nsx/LogicalSwitchesTypes.go new file mode 100644 index 000000000..3daaca710 --- /dev/null +++ b/services/nsxt-mp/nsx/LogicalSwitchesTypes.go @@ -0,0 +1,382 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: LogicalSwitches. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``switchType`` of method LogicalSwitches#list. +const LogicalSwitches_LIST_SWITCH_TYPE_DEFAULT = "DEFAULT" + +// Possible value for ``switchType`` of method LogicalSwitches#list. +const LogicalSwitches_LIST_SWITCH_TYPE_SERVICE_PLANE = "SERVICE_PLANE" + +// Possible value for ``switchType`` of method LogicalSwitches#list. +const LogicalSwitches_LIST_SWITCH_TYPE_DHCP_RELAY = "DHCP_RELAY" + +// Possible value for ``switchType`` of method LogicalSwitches#list. +const LogicalSwitches_LIST_SWITCH_TYPE_GLOBAL = "GLOBAL" + +// Possible value for ``switchType`` of method LogicalSwitches#list. +const LogicalSwitches_LIST_SWITCH_TYPE_INTER_ROUTER = "INTER_ROUTER" + +// Possible value for ``switchType`` of method LogicalSwitches#list. +const LogicalSwitches_LIST_SWITCH_TYPE_EVPN = "EVPN" + +// Possible value for ``switchType`` of method LogicalSwitches#list. +const LogicalSwitches_LIST_SWITCH_TYPE_DVPG = "DVPG" + +// Possible value for ``transportType`` of method LogicalSwitches#list. +const LogicalSwitches_LIST_TRANSPORT_TYPE_OVERLAY = "OVERLAY" + +// Possible value for ``transportType`` of method LogicalSwitches#list. +const LogicalSwitches_LIST_TRANSPORT_TYPE_VLAN = "VLAN" + +func logicalSwitchesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_switch"] = bindings.NewReferenceType(model.LogicalSwitchBindingType) + fieldNameMap["logical_switch"] = "LogicalSwitch" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logicalSwitchesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalSwitchBindingType) +} + +func logicalSwitchesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_switch"] = bindings.NewReferenceType(model.LogicalSwitchBindingType) + fieldNameMap["logical_switch"] = "LogicalSwitch" + paramsTypeMap["logical_switch"] = bindings.NewReferenceType(model.LogicalSwitchBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "logical_switch", + "POST", + "/api/v1/logical-switches", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func logicalSwitchesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lswitch_id"] = bindings.NewStringType() + fields["cascade"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["detach"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["lswitch_id"] = "LswitchId" + fieldNameMap["cascade"] = "Cascade" + fieldNameMap["detach"] = "Detach" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logicalSwitchesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func logicalSwitchesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lswitch_id"] = bindings.NewStringType() + fields["cascade"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["detach"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["lswitch_id"] = "LswitchId" + fieldNameMap["cascade"] = "Cascade" + fieldNameMap["detach"] = "Detach" + paramsTypeMap["detach"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["lswitch_id"] = bindings.NewStringType() + paramsTypeMap["cascade"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["lswitchId"] = bindings.NewStringType() + pathParams["lswitch_id"] = "lswitchId" + queryParams["cascade"] = "cascade" + queryParams["detach"] = "detach" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/logical-switches/{lswitchId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func logicalSwitchesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lswitch_id"] = bindings.NewStringType() + fieldNameMap["lswitch_id"] = "LswitchId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logicalSwitchesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalSwitchBindingType) +} + +func logicalSwitchesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lswitch_id"] = bindings.NewStringType() + fieldNameMap["lswitch_id"] = "LswitchId" + paramsTypeMap["lswitch_id"] = bindings.NewStringType() + paramsTypeMap["lswitchId"] = bindings.NewStringType() + pathParams["lswitch_id"] = "lswitchId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-switches/{lswitchId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func logicalSwitchesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["diagnostic"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["switch_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["switching_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["uplink_teaming_policy_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["vlan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["vni"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["diagnostic"] = "Diagnostic" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["switch_type"] = "SwitchType" + fieldNameMap["switching_profile_id"] = "SwitchingProfileId" + fieldNameMap["transport_type"] = "TransportType" + fieldNameMap["transport_zone_id"] = "TransportZoneId" + fieldNameMap["uplink_teaming_policy_name"] = "UplinkTeamingPolicyName" + fieldNameMap["vlan"] = "Vlan" + fieldNameMap["vni"] = "Vni" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logicalSwitchesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalSwitchListResultBindingType) +} + +func logicalSwitchesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["diagnostic"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["switch_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["switching_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["uplink_teaming_policy_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["vlan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["vni"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["diagnostic"] = "Diagnostic" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["switch_type"] = "SwitchType" + fieldNameMap["switching_profile_id"] = "SwitchingProfileId" + fieldNameMap["transport_type"] = "TransportType" + fieldNameMap["transport_zone_id"] = "TransportZoneId" + fieldNameMap["uplink_teaming_policy_name"] = "UplinkTeamingPolicyName" + fieldNameMap["vlan"] = "Vlan" + fieldNameMap["vni"] = "Vni" + paramsTypeMap["switch_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["switching_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["diagnostic"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["vni"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["uplink_teaming_policy_name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["vlan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + queryParams["cursor"] = "cursor" + queryParams["switching_profile_id"] = "switching_profile_id" + queryParams["sort_by"] = "sort_by" + queryParams["switch_type"] = "switch_type" + queryParams["uplink_teaming_policy_name"] = "uplink_teaming_policy_name" + queryParams["vni"] = "vni" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["vlan"] = "vlan" + queryParams["included_fields"] = "included_fields" + queryParams["transport_type"] = "transport_type" + queryParams["transport_zone_id"] = "transport_zone_id" + queryParams["diagnostic"] = "diagnostic" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-switches", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func logicalSwitchesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lswitch_id"] = bindings.NewStringType() + fields["logical_switch"] = bindings.NewReferenceType(model.LogicalSwitchBindingType) + fieldNameMap["lswitch_id"] = "LswitchId" + fieldNameMap["logical_switch"] = "LogicalSwitch" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logicalSwitchesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalSwitchBindingType) +} + +func logicalSwitchesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lswitch_id"] = bindings.NewStringType() + fields["logical_switch"] = bindings.NewReferenceType(model.LogicalSwitchBindingType) + fieldNameMap["lswitch_id"] = "LswitchId" + fieldNameMap["logical_switch"] = "LogicalSwitch" + paramsTypeMap["lswitch_id"] = bindings.NewStringType() + paramsTypeMap["logical_switch"] = bindings.NewReferenceType(model.LogicalSwitchBindingType) + paramsTypeMap["lswitchId"] = bindings.NewStringType() + pathParams["lswitch_id"] = "lswitchId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "logical_switch", + "PUT", + "/api/v1/logical-switches/{lswitchId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/MacSetsClient.go b/services/nsxt-mp/nsx/MacSetsClient.go new file mode 100644 index 000000000..aea94b207 --- /dev/null +++ b/services/nsxt-mp/nsx/MacSetsClient.go @@ -0,0 +1,268 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MacSets +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MacSetsClient interface { + + // Creates a new MACSet that can group individual MAC addresses. + // + // @param mACSetParam (required) + // @return com.vmware.nsx.model.MACSet + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(mACSetParam model.MACSet) (model.MACSet, error) + + // Deletes the specified MACSet. By default, if the MACSet is added to an NSGroup, it won't be deleted. In such situations, pass \"force=true\" as query param to force delete the MACSet. + // + // @param macSetIdParam MACSet Id (required) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(macSetIdParam string, forceParam *bool) error + + // Returns information about the specified MACSet + // + // @param macSetIdParam MACSet Id (required) + // @return com.vmware.nsx.model.MACSet + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(macSetIdParam string) (model.MACSet, error) + + // Returns paginated list of MACSets + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.MACSetListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.MACSetListResult, error) + + // Updates the specified MACSet. Modifiable parameters include the description, display_name and mac_addresses. + // + // @param macSetIdParam MACSet Id (required) + // @param mACSetParam (required) + // @return com.vmware.nsx.model.MACSet + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(macSetIdParam string, mACSetParam model.MACSet) (model.MACSet, error) +} + +type macSetsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMacSetsClient(connector client.Connector) *macSetsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.mac_sets") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := macSetsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *macSetsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *macSetsClient) Create(mACSetParam model.MACSet) (model.MACSet, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(macSetsCreateInputType(), typeConverter) + sv.AddStructField("MACSet", mACSetParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MACSet + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := macSetsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.mac_sets", "create", inputDataValue, executionContext) + var emptyOutput model.MACSet + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), macSetsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MACSet), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *macSetsClient) Delete(macSetIdParam string, forceParam *bool) error { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(macSetsDeleteInputType(), typeConverter) + sv.AddStructField("MacSetId", macSetIdParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := macSetsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.mac_sets", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (mIface *macSetsClient) Get(macSetIdParam string) (model.MACSet, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(macSetsGetInputType(), typeConverter) + sv.AddStructField("MacSetId", macSetIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MACSet + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := macSetsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.mac_sets", "get", inputDataValue, executionContext) + var emptyOutput model.MACSet + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), macSetsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MACSet), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *macSetsClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.MACSetListResult, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(macSetsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MACSetListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := macSetsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.mac_sets", "list", inputDataValue, executionContext) + var emptyOutput model.MACSetListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), macSetsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MACSetListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *macSetsClient) Update(macSetIdParam string, mACSetParam model.MACSet) (model.MACSet, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(macSetsUpdateInputType(), typeConverter) + sv.AddStructField("MacSetId", macSetIdParam) + sv.AddStructField("MACSet", mACSetParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MACSet + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := macSetsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.mac_sets", "update", inputDataValue, executionContext) + var emptyOutput model.MACSet + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), macSetsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MACSet), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/MacSetsTypes.go b/services/nsxt-mp/nsx/MacSetsTypes.go new file mode 100644 index 000000000..352fc2794 --- /dev/null +++ b/services/nsxt-mp/nsx/MacSetsTypes.go @@ -0,0 +1,301 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MacSets. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func macSetsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["m_AC_set"] = bindings.NewReferenceType(model.MACSetBindingType) + fieldNameMap["m_AC_set"] = "MACSet" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func macSetsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MACSetBindingType) +} + +func macSetsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["m_AC_set"] = bindings.NewReferenceType(model.MACSetBindingType) + fieldNameMap["m_AC_set"] = "MACSet" + paramsTypeMap["m_AC_set"] = bindings.NewReferenceType(model.MACSetBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "m_AC_set", + "POST", + "/api/v1/mac-sets", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func macSetsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mac_set_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["mac_set_id"] = "MacSetId" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func macSetsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func macSetsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["mac_set_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["mac_set_id"] = "MacSetId" + fieldNameMap["force"] = "Force" + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["mac_set_id"] = bindings.NewStringType() + paramsTypeMap["macSetId"] = bindings.NewStringType() + pathParams["mac_set_id"] = "macSetId" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/mac-sets/{macSetId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func macSetsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mac_set_id"] = bindings.NewStringType() + fieldNameMap["mac_set_id"] = "MacSetId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func macSetsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MACSetBindingType) +} + +func macSetsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["mac_set_id"] = bindings.NewStringType() + fieldNameMap["mac_set_id"] = "MacSetId" + paramsTypeMap["mac_set_id"] = bindings.NewStringType() + paramsTypeMap["macSetId"] = bindings.NewStringType() + pathParams["mac_set_id"] = "macSetId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/mac-sets/{macSetId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func macSetsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func macSetsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MACSetListResultBindingType) +} + +func macSetsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/mac-sets", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func macSetsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mac_set_id"] = bindings.NewStringType() + fields["m_AC_set"] = bindings.NewReferenceType(model.MACSetBindingType) + fieldNameMap["mac_set_id"] = "MacSetId" + fieldNameMap["m_AC_set"] = "MACSet" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func macSetsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MACSetBindingType) +} + +func macSetsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["mac_set_id"] = bindings.NewStringType() + fields["m_AC_set"] = bindings.NewReferenceType(model.MACSetBindingType) + fieldNameMap["mac_set_id"] = "MacSetId" + fieldNameMap["m_AC_set"] = "MACSet" + paramsTypeMap["mac_set_id"] = bindings.NewStringType() + paramsTypeMap["m_AC_set"] = bindings.NewReferenceType(model.MACSetBindingType) + paramsTypeMap["macSetId"] = bindings.NewStringType() + pathParams["mac_set_id"] = "macSetId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "m_AC_set", + "PUT", + "/api/v1/mac-sets/{macSetId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ManualHealthChecksClient.go b/services/nsxt-mp/nsx/ManualHealthChecksClient.go new file mode 100644 index 000000000..6e646ea0f --- /dev/null +++ b/services/nsxt-mp/nsx/ManualHealthChecksClient.go @@ -0,0 +1,220 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ManualHealthChecks +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ManualHealthChecksClient interface { + + // Create a new manual health check request with essential properties. It's disallowed to create new one until the count of in-progress manual health check is less than 50. A manual health check will be deleted automatically after finished for 24 hours. + // + // @param manualHealthCheckParam (required) + // @return com.vmware.nsx.model.ManualHealthCheck + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(manualHealthCheckParam model.ManualHealthCheck) (model.ManualHealthCheck, error) + + // Delete an existing manual health check by ID. + // + // @param manualHealthCheckIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(manualHealthCheckIdParam string) error + + // Get an existing manual health check by health check ID. + // + // @param manualHealthCheckIdParam (required) + // @return com.vmware.nsx.model.ManualHealthCheck + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(manualHealthCheckIdParam string) (model.ManualHealthCheck, error) + + // Query manual health checks with list parameters. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.ManualHealthCheckListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ManualHealthCheckListResult, error) +} + +type manualHealthChecksClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewManualHealthChecksClient(connector client.Connector) *manualHealthChecksClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.manual_health_checks") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := manualHealthChecksClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *manualHealthChecksClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *manualHealthChecksClient) Create(manualHealthCheckParam model.ManualHealthCheck) (model.ManualHealthCheck, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(manualHealthChecksCreateInputType(), typeConverter) + sv.AddStructField("ManualHealthCheck", manualHealthCheckParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ManualHealthCheck + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := manualHealthChecksCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.manual_health_checks", "create", inputDataValue, executionContext) + var emptyOutput model.ManualHealthCheck + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), manualHealthChecksCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ManualHealthCheck), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *manualHealthChecksClient) Delete(manualHealthCheckIdParam string) error { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(manualHealthChecksDeleteInputType(), typeConverter) + sv.AddStructField("ManualHealthCheckId", manualHealthCheckIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := manualHealthChecksDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.manual_health_checks", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (mIface *manualHealthChecksClient) Get(manualHealthCheckIdParam string) (model.ManualHealthCheck, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(manualHealthChecksGetInputType(), typeConverter) + sv.AddStructField("ManualHealthCheckId", manualHealthCheckIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ManualHealthCheck + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := manualHealthChecksGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.manual_health_checks", "get", inputDataValue, executionContext) + var emptyOutput model.ManualHealthCheck + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), manualHealthChecksGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ManualHealthCheck), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *manualHealthChecksClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ManualHealthCheckListResult, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(manualHealthChecksListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ManualHealthCheckListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := manualHealthChecksListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.manual_health_checks", "list", inputDataValue, executionContext) + var emptyOutput model.ManualHealthCheckListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), manualHealthChecksListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ManualHealthCheckListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ManualHealthChecksTypes.go b/services/nsxt-mp/nsx/ManualHealthChecksTypes.go new file mode 100644 index 000000000..1c6d17639 --- /dev/null +++ b/services/nsxt-mp/nsx/ManualHealthChecksTypes.go @@ -0,0 +1,240 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ManualHealthChecks. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func manualHealthChecksCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["manual_health_check"] = bindings.NewReferenceType(model.ManualHealthCheckBindingType) + fieldNameMap["manual_health_check"] = "ManualHealthCheck" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func manualHealthChecksCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ManualHealthCheckBindingType) +} + +func manualHealthChecksCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["manual_health_check"] = bindings.NewReferenceType(model.ManualHealthCheckBindingType) + fieldNameMap["manual_health_check"] = "ManualHealthCheck" + paramsTypeMap["manual_health_check"] = bindings.NewReferenceType(model.ManualHealthCheckBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "manual_health_check", + "POST", + "/api/v1/manual-health-checks", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func manualHealthChecksDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["manual_health_check_id"] = bindings.NewStringType() + fieldNameMap["manual_health_check_id"] = "ManualHealthCheckId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func manualHealthChecksDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func manualHealthChecksDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["manual_health_check_id"] = bindings.NewStringType() + fieldNameMap["manual_health_check_id"] = "ManualHealthCheckId" + paramsTypeMap["manual_health_check_id"] = bindings.NewStringType() + paramsTypeMap["manualHealthCheckId"] = bindings.NewStringType() + pathParams["manual_health_check_id"] = "manualHealthCheckId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/manual-health-checks/{manualHealthCheckId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func manualHealthChecksGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["manual_health_check_id"] = bindings.NewStringType() + fieldNameMap["manual_health_check_id"] = "ManualHealthCheckId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func manualHealthChecksGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ManualHealthCheckBindingType) +} + +func manualHealthChecksGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["manual_health_check_id"] = bindings.NewStringType() + fieldNameMap["manual_health_check_id"] = "ManualHealthCheckId" + paramsTypeMap["manual_health_check_id"] = bindings.NewStringType() + paramsTypeMap["manualHealthCheckId"] = bindings.NewStringType() + pathParams["manual_health_check_id"] = "manualHealthCheckId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/manual-health-checks/{manualHealthCheckId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func manualHealthChecksListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func manualHealthChecksListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ManualHealthCheckListResultBindingType) +} + +func manualHealthChecksListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/manual-health-checks", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/MdProxiesClient.go b/services/nsxt-mp/nsx/MdProxiesClient.go new file mode 100644 index 000000000..49b7de23c --- /dev/null +++ b/services/nsxt-mp/nsx/MdProxiesClient.go @@ -0,0 +1,265 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MdProxies +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MdProxiesClient interface { + + // Create a metadata proxy + // + // @param metadataProxyParam (required) + // @return com.vmware.nsx.model.MetadataProxy + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(metadataProxyParam model.MetadataProxy) (model.MetadataProxy, error) + + // Delete a metadata proxy + // + // @param proxyIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(proxyIdParam string) error + + // Get a metadata proxy + // + // @param proxyIdParam (required) + // @return com.vmware.nsx.model.MetadataProxy + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(proxyIdParam string) (model.MetadataProxy, error) + + // Get a paginated list of metadata proxies + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.MetadataProxyListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.MetadataProxyListResult, error) + + // Update a metadata proxy + // + // @param proxyIdParam (required) + // @param metadataProxyParam (required) + // @return com.vmware.nsx.model.MetadataProxy + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(proxyIdParam string, metadataProxyParam model.MetadataProxy) (model.MetadataProxy, error) +} + +type mdProxiesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMdProxiesClient(connector client.Connector) *mdProxiesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.md_proxies") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := mdProxiesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *mdProxiesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *mdProxiesClient) Create(metadataProxyParam model.MetadataProxy) (model.MetadataProxy, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(mdProxiesCreateInputType(), typeConverter) + sv.AddStructField("MetadataProxy", metadataProxyParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MetadataProxy + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := mdProxiesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.md_proxies", "create", inputDataValue, executionContext) + var emptyOutput model.MetadataProxy + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), mdProxiesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MetadataProxy), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *mdProxiesClient) Delete(proxyIdParam string) error { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(mdProxiesDeleteInputType(), typeConverter) + sv.AddStructField("ProxyId", proxyIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := mdProxiesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.md_proxies", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (mIface *mdProxiesClient) Get(proxyIdParam string) (model.MetadataProxy, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(mdProxiesGetInputType(), typeConverter) + sv.AddStructField("ProxyId", proxyIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MetadataProxy + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := mdProxiesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.md_proxies", "get", inputDataValue, executionContext) + var emptyOutput model.MetadataProxy + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), mdProxiesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MetadataProxy), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *mdProxiesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.MetadataProxyListResult, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(mdProxiesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MetadataProxyListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := mdProxiesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.md_proxies", "list", inputDataValue, executionContext) + var emptyOutput model.MetadataProxyListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), mdProxiesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MetadataProxyListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *mdProxiesClient) Update(proxyIdParam string, metadataProxyParam model.MetadataProxy) (model.MetadataProxy, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(mdProxiesUpdateInputType(), typeConverter) + sv.AddStructField("ProxyId", proxyIdParam) + sv.AddStructField("MetadataProxy", metadataProxyParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MetadataProxy + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := mdProxiesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.md_proxies", "update", inputDataValue, executionContext) + var emptyOutput model.MetadataProxy + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), mdProxiesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MetadataProxy), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/MdProxiesTypes.go b/services/nsxt-mp/nsx/MdProxiesTypes.go new file mode 100644 index 000000000..2dc3f6746 --- /dev/null +++ b/services/nsxt-mp/nsx/MdProxiesTypes.go @@ -0,0 +1,295 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MdProxies. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func mdProxiesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["metadata_proxy"] = bindings.NewReferenceType(model.MetadataProxyBindingType) + fieldNameMap["metadata_proxy"] = "MetadataProxy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func mdProxiesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MetadataProxyBindingType) +} + +func mdProxiesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["metadata_proxy"] = bindings.NewReferenceType(model.MetadataProxyBindingType) + fieldNameMap["metadata_proxy"] = "MetadataProxy" + paramsTypeMap["metadata_proxy"] = bindings.NewReferenceType(model.MetadataProxyBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "metadata_proxy", + "POST", + "/api/v1/md-proxies", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func mdProxiesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["proxy_id"] = bindings.NewStringType() + fieldNameMap["proxy_id"] = "ProxyId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func mdProxiesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func mdProxiesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["proxy_id"] = bindings.NewStringType() + fieldNameMap["proxy_id"] = "ProxyId" + paramsTypeMap["proxy_id"] = bindings.NewStringType() + paramsTypeMap["proxyId"] = bindings.NewStringType() + pathParams["proxy_id"] = "proxyId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/md-proxies/{proxyId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func mdProxiesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["proxy_id"] = bindings.NewStringType() + fieldNameMap["proxy_id"] = "ProxyId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func mdProxiesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MetadataProxyBindingType) +} + +func mdProxiesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["proxy_id"] = bindings.NewStringType() + fieldNameMap["proxy_id"] = "ProxyId" + paramsTypeMap["proxy_id"] = bindings.NewStringType() + paramsTypeMap["proxyId"] = bindings.NewStringType() + pathParams["proxy_id"] = "proxyId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/md-proxies/{proxyId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func mdProxiesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func mdProxiesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MetadataProxyListResultBindingType) +} + +func mdProxiesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/md-proxies", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func mdProxiesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["proxy_id"] = bindings.NewStringType() + fields["metadata_proxy"] = bindings.NewReferenceType(model.MetadataProxyBindingType) + fieldNameMap["proxy_id"] = "ProxyId" + fieldNameMap["metadata_proxy"] = "MetadataProxy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func mdProxiesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MetadataProxyBindingType) +} + +func mdProxiesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["proxy_id"] = bindings.NewStringType() + fields["metadata_proxy"] = bindings.NewReferenceType(model.MetadataProxyBindingType) + fieldNameMap["proxy_id"] = "ProxyId" + fieldNameMap["metadata_proxy"] = "MetadataProxy" + paramsTypeMap["metadata_proxy"] = bindings.NewReferenceType(model.MetadataProxyBindingType) + paramsTypeMap["proxy_id"] = bindings.NewStringType() + paramsTypeMap["proxyId"] = bindings.NewStringType() + pathParams["proxy_id"] = "proxyId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "metadata_proxy", + "PUT", + "/api/v1/md-proxies/{proxyId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/MigrationClient.go b/services/nsxt-mp/nsx/MigrationClient.go new file mode 100644 index 000000000..9a17704df --- /dev/null +++ b/services/nsxt-mp/nsx/MigrationClient.go @@ -0,0 +1,79 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Migration +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MigrationClient interface { + + // Perform steps that are required to finalize the infra such as remove the temporary security groups, remove other objects created temporarily for the migration. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Finalizeinfra() error +} + +type migrationClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMigrationClient(connector client.Connector) *migrationClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration") + methodIdentifiers := map[string]core.MethodIdentifier{ + "finalizeinfra": core.NewMethodIdentifier(interfaceIdentifier, "finalizeinfra"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := migrationClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *migrationClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *migrationClient) Finalizeinfra() error { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(migrationFinalizeinfraInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := migrationFinalizeinfraRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration", "finalizeinfra", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/MigrationTypes.go b/services/nsxt-mp/nsx/MigrationTypes.go new file mode 100644 index 000000000..cbab030b9 --- /dev/null +++ b/services/nsxt-mp/nsx/MigrationTypes.go @@ -0,0 +1,61 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Migration. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "reflect" +) + +func migrationFinalizeinfraInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func migrationFinalizeinfraOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func migrationFinalizeinfraRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=finalize_infra", + "", + "POST", + "/api/v1/migration", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/MirrorSessionsClient.go b/services/nsxt-mp/nsx/MirrorSessionsClient.go new file mode 100644 index 000000000..1284972d0 --- /dev/null +++ b/services/nsxt-mp/nsx/MirrorSessionsClient.go @@ -0,0 +1,301 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MirrorSessions +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MirrorSessionsClient interface { + + // Create a mirror session + // + // @param portMirroringSessionParam (required) + // @return com.vmware.nsx.model.PortMirroringSession + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(portMirroringSessionParam model.PortMirroringSession) (model.PortMirroringSession, error) + + // Delete the mirror session + // + // @param mirrorSessionIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(mirrorSessionIdParam string) error + + // Get the mirror session + // + // @param mirrorSessionIdParam (required) + // @return com.vmware.nsx.model.PortMirroringSession + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(mirrorSessionIdParam string) (model.PortMirroringSession, error) + + // List all mirror sessions + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.PortMirroringSessionListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PortMirroringSessionListResult, error) + + // Update the mirror session + // + // @param mirrorSessionIdParam (required) + // @param portMirroringSessionParam (required) + // @return com.vmware.nsx.model.PortMirroringSession + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(mirrorSessionIdParam string, portMirroringSessionParam model.PortMirroringSession) (model.PortMirroringSession, error) + + // Verify whether all participants are on the same transport node + // + // @param mirrorSessionIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Verify(mirrorSessionIdParam string) error +} + +type mirrorSessionsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMirrorSessionsClient(connector client.Connector) *mirrorSessionsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.mirror_sessions") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + "verify": core.NewMethodIdentifier(interfaceIdentifier, "verify"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := mirrorSessionsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *mirrorSessionsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *mirrorSessionsClient) Create(portMirroringSessionParam model.PortMirroringSession) (model.PortMirroringSession, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(mirrorSessionsCreateInputType(), typeConverter) + sv.AddStructField("PortMirroringSession", portMirroringSessionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PortMirroringSession + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := mirrorSessionsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.mirror_sessions", "create", inputDataValue, executionContext) + var emptyOutput model.PortMirroringSession + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), mirrorSessionsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PortMirroringSession), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *mirrorSessionsClient) Delete(mirrorSessionIdParam string) error { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(mirrorSessionsDeleteInputType(), typeConverter) + sv.AddStructField("MirrorSessionId", mirrorSessionIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := mirrorSessionsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.mirror_sessions", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (mIface *mirrorSessionsClient) Get(mirrorSessionIdParam string) (model.PortMirroringSession, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(mirrorSessionsGetInputType(), typeConverter) + sv.AddStructField("MirrorSessionId", mirrorSessionIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PortMirroringSession + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := mirrorSessionsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.mirror_sessions", "get", inputDataValue, executionContext) + var emptyOutput model.PortMirroringSession + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), mirrorSessionsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PortMirroringSession), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *mirrorSessionsClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PortMirroringSessionListResult, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(mirrorSessionsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PortMirroringSessionListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := mirrorSessionsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.mirror_sessions", "list", inputDataValue, executionContext) + var emptyOutput model.PortMirroringSessionListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), mirrorSessionsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PortMirroringSessionListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *mirrorSessionsClient) Update(mirrorSessionIdParam string, portMirroringSessionParam model.PortMirroringSession) (model.PortMirroringSession, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(mirrorSessionsUpdateInputType(), typeConverter) + sv.AddStructField("MirrorSessionId", mirrorSessionIdParam) + sv.AddStructField("PortMirroringSession", portMirroringSessionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PortMirroringSession + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := mirrorSessionsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.mirror_sessions", "update", inputDataValue, executionContext) + var emptyOutput model.PortMirroringSession + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), mirrorSessionsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PortMirroringSession), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *mirrorSessionsClient) Verify(mirrorSessionIdParam string) error { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(mirrorSessionsVerifyInputType(), typeConverter) + sv.AddStructField("MirrorSessionId", mirrorSessionIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := mirrorSessionsVerifyRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.mirror_sessions", "verify", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/MirrorSessionsTypes.go b/services/nsxt-mp/nsx/MirrorSessionsTypes.go new file mode 100644 index 000000000..84b32b266 --- /dev/null +++ b/services/nsxt-mp/nsx/MirrorSessionsTypes.go @@ -0,0 +1,345 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MirrorSessions. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func mirrorSessionsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["port_mirroring_session"] = bindings.NewReferenceType(model.PortMirroringSessionBindingType) + fieldNameMap["port_mirroring_session"] = "PortMirroringSession" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func mirrorSessionsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PortMirroringSessionBindingType) +} + +func mirrorSessionsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["port_mirroring_session"] = bindings.NewReferenceType(model.PortMirroringSessionBindingType) + fieldNameMap["port_mirroring_session"] = "PortMirroringSession" + paramsTypeMap["port_mirroring_session"] = bindings.NewReferenceType(model.PortMirroringSessionBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "port_mirroring_session", + "POST", + "/api/v1/mirror-sessions", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func mirrorSessionsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mirror_session_id"] = bindings.NewStringType() + fieldNameMap["mirror_session_id"] = "MirrorSessionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func mirrorSessionsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func mirrorSessionsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["mirror_session_id"] = bindings.NewStringType() + fieldNameMap["mirror_session_id"] = "MirrorSessionId" + paramsTypeMap["mirror_session_id"] = bindings.NewStringType() + paramsTypeMap["mirrorSessionId"] = bindings.NewStringType() + pathParams["mirror_session_id"] = "mirrorSessionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/mirror-sessions/{mirrorSessionId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func mirrorSessionsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mirror_session_id"] = bindings.NewStringType() + fieldNameMap["mirror_session_id"] = "MirrorSessionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func mirrorSessionsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PortMirroringSessionBindingType) +} + +func mirrorSessionsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["mirror_session_id"] = bindings.NewStringType() + fieldNameMap["mirror_session_id"] = "MirrorSessionId" + paramsTypeMap["mirror_session_id"] = bindings.NewStringType() + paramsTypeMap["mirrorSessionId"] = bindings.NewStringType() + pathParams["mirror_session_id"] = "mirrorSessionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/mirror-sessions/{mirrorSessionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func mirrorSessionsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func mirrorSessionsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PortMirroringSessionListResultBindingType) +} + +func mirrorSessionsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/mirror-sessions", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func mirrorSessionsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mirror_session_id"] = bindings.NewStringType() + fields["port_mirroring_session"] = bindings.NewReferenceType(model.PortMirroringSessionBindingType) + fieldNameMap["mirror_session_id"] = "MirrorSessionId" + fieldNameMap["port_mirroring_session"] = "PortMirroringSession" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func mirrorSessionsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PortMirroringSessionBindingType) +} + +func mirrorSessionsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["mirror_session_id"] = bindings.NewStringType() + fields["port_mirroring_session"] = bindings.NewReferenceType(model.PortMirroringSessionBindingType) + fieldNameMap["mirror_session_id"] = "MirrorSessionId" + fieldNameMap["port_mirroring_session"] = "PortMirroringSession" + paramsTypeMap["mirror_session_id"] = bindings.NewStringType() + paramsTypeMap["port_mirroring_session"] = bindings.NewReferenceType(model.PortMirroringSessionBindingType) + paramsTypeMap["mirrorSessionId"] = bindings.NewStringType() + pathParams["mirror_session_id"] = "mirrorSessionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "port_mirroring_session", + "PUT", + "/api/v1/mirror-sessions/{mirrorSessionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func mirrorSessionsVerifyInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mirror_session_id"] = bindings.NewStringType() + fieldNameMap["mirror_session_id"] = "MirrorSessionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func mirrorSessionsVerifyOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func mirrorSessionsVerifyRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["mirror_session_id"] = bindings.NewStringType() + fieldNameMap["mirror_session_id"] = "MirrorSessionId" + paramsTypeMap["mirror_session_id"] = bindings.NewStringType() + paramsTypeMap["mirrorSessionId"] = bindings.NewStringType() + pathParams["mirror_session_id"] = "mirrorSessionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=verify", + "", + "POST", + "/api/v1/mirror-sessions/{mirrorSessionId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/NodeClient.go b/services/nsxt-mp/nsx/NodeClient.go new file mode 100644 index 000000000..b8e65328b --- /dev/null +++ b/services/nsxt-mp/nsx/NodeClient.go @@ -0,0 +1,233 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Node +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NodeClient interface { + + // Returns information about the NSX appliance. Information includes release number, time zone, system time, kernel version, message of the day (motd), and host name. + // @return com.vmware.nsx.model.NodeProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeProperties, error) + + // Restarts or shuts down the NSX appliance. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() error + + // Set the node system time to the given time in UTC in the RFC3339 format 'yyyy-mm-ddThh:mm:ssZ'. + // + // @param nodeTimeParam (required) + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Setsystemtime(nodeTimeParam model.NodeTime) error + + // Restarts or shuts down the NSX appliance. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Shutdown() error + + // Modifies NSX appliance properties. Modifiable properties include the timezone, message of the day (motd), and hostname. The NSX appliance node_version, system_time, and kernel_version are read only and cannot be modified with this method. + // + // @param nodePropertiesParam (required) + // @return com.vmware.nsx.model.NodeProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(nodePropertiesParam model.NodeProperties) (model.NodeProperties, error) +} + +type nodeClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNodeClient(connector client.Connector) *nodeClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "setsystemtime": core.NewMethodIdentifier(interfaceIdentifier, "setsystemtime"), + "shutdown": core.NewMethodIdentifier(interfaceIdentifier, "shutdown"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nodeClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nodeClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nodeClient) Get() (model.NodeProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodeGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodeGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node", "get", inputDataValue, executionContext) + var emptyOutput model.NodeProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nodeGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nodeClient) Restart() error { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodeRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodeRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node", "restart", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (nIface *nodeClient) Setsystemtime(nodeTimeParam model.NodeTime) error { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodeSetsystemtimeInputType(), typeConverter) + sv.AddStructField("NodeTime", nodeTimeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodeSetsystemtimeRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node", "setsystemtime", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (nIface *nodeClient) Shutdown() error { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodeShutdownInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodeShutdownRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node", "shutdown", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (nIface *nodeClient) Update(nodePropertiesParam model.NodeProperties) (model.NodeProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodeUpdateInputType(), typeConverter) + sv.AddStructField("NodeProperties", nodePropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodeUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node", "update", inputDataValue, executionContext) + var emptyOutput model.NodeProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nodeUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/NodeTypes.go b/services/nsxt-mp/nsx/NodeTypes.go new file mode 100644 index 000000000..e26c35e88 --- /dev/null +++ b/services/nsxt-mp/nsx/NodeTypes.go @@ -0,0 +1,244 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Node. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func nodeGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodeGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodePropertiesBindingType) +} + +func nodeGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nodeRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodeRestartOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func nodeRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nodeSetsystemtimeInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_time"] = bindings.NewReferenceType(model.NodeTimeBindingType) + fieldNameMap["node_time"] = "NodeTime" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodeSetsystemtimeOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func nodeSetsystemtimeRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_time"] = bindings.NewReferenceType(model.NodeTimeBindingType) + fieldNameMap["node_time"] = "NodeTime" + paramsTypeMap["node_time"] = bindings.NewReferenceType(model.NodeTimeBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=set_system_time", + "node_time", + "POST", + "/api/v1/node", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nodeShutdownInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodeShutdownOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func nodeShutdownRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=shutdown", + "", + "POST", + "/api/v1/node", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nodeUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_properties"] = bindings.NewReferenceType(model.NodePropertiesBindingType) + fieldNameMap["node_properties"] = "NodeProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodeUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodePropertiesBindingType) +} + +func nodeUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_properties"] = bindings.NewReferenceType(model.NodePropertiesBindingType) + fieldNameMap["node_properties"] = "NodeProperties" + paramsTypeMap["node_properties"] = bindings.NewReferenceType(model.NodePropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "node_properties", + "PUT", + "/api/v1/node", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/NormalizationsClient.go b/services/nsxt-mp/nsx/NormalizationsClient.go new file mode 100644 index 000000000..e1ac00a83 --- /dev/null +++ b/services/nsxt-mp/nsx/NormalizationsClient.go @@ -0,0 +1,104 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Normalizations +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NormalizationsClient interface { + + // Returns the list of normalized resources based on the query parameters. Id and Type of the resource on which the normalizations is to be performed, are to be specified as query parameters in the URI. The target resource types to which normalization is to be done should also be specified as query parameter. + // + // @param preferredNormalizationTypeParam Resource type valid for use as target in normalization API. (required) + // @param resourceIdParam Identifier of the resource on which normalization is to be performed (required) + // @param resourceTypeParam Resource type valid for use as source in normalization API. (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.NormalizedResourceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(preferredNormalizationTypeParam string, resourceIdParam string, resourceTypeParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.NormalizedResourceListResult, error) +} + +type normalizationsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNormalizationsClient(connector client.Connector) *normalizationsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.normalizations") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := normalizationsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *normalizationsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *normalizationsClient) List(preferredNormalizationTypeParam string, resourceIdParam string, resourceTypeParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.NormalizedResourceListResult, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(normalizationsListInputType(), typeConverter) + sv.AddStructField("PreferredNormalizationType", preferredNormalizationTypeParam) + sv.AddStructField("ResourceId", resourceIdParam) + sv.AddStructField("ResourceType", resourceTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NormalizedResourceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := normalizationsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.normalizations", "list", inputDataValue, executionContext) + var emptyOutput model.NormalizedResourceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), normalizationsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NormalizedResourceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/NormalizationsTypes.go b/services/nsxt-mp/nsx/NormalizationsTypes.go new file mode 100644 index 000000000..4e8270c93 --- /dev/null +++ b/services/nsxt-mp/nsx/NormalizationsTypes.go @@ -0,0 +1,131 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Normalizations. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``preferredNormalizationType`` of method Normalizations#list. +const Normalizations_LIST_PREFERRED_NORMALIZATION_TYPE_NSGROUP = "NSGroup" + +// Possible value for ``preferredNormalizationType`` of method Normalizations#list. +const Normalizations_LIST_PREFERRED_NORMALIZATION_TYPE_IPSET = "IPSet" + +// Possible value for ``preferredNormalizationType`` of method Normalizations#list. +const Normalizations_LIST_PREFERRED_NORMALIZATION_TYPE_MACSET = "MACSet" + +// Possible value for ``preferredNormalizationType`` of method Normalizations#list. +const Normalizations_LIST_PREFERRED_NORMALIZATION_TYPE_LOGICALSWITCH = "LogicalSwitch" + +// Possible value for ``preferredNormalizationType`` of method Normalizations#list. +const Normalizations_LIST_PREFERRED_NORMALIZATION_TYPE_LOGICALPORT = "LogicalPort" + +// Possible value for ``preferredNormalizationType`` of method Normalizations#list. +const Normalizations_LIST_PREFERRED_NORMALIZATION_TYPE_DIRECTORYGROUP = "DirectoryGroup" + +// Possible value for ``resourceType`` of method Normalizations#list. +const Normalizations_LIST_RESOURCE_TYPE_NSGROUP = "NSGroup" + +func normalizationsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["preferred_normalization_type"] = bindings.NewStringType() + fields["resource_id"] = bindings.NewStringType() + fields["resource_type"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["preferred_normalization_type"] = "PreferredNormalizationType" + fieldNameMap["resource_id"] = "ResourceId" + fieldNameMap["resource_type"] = "ResourceType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func normalizationsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NormalizedResourceListResultBindingType) +} + +func normalizationsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["preferred_normalization_type"] = bindings.NewStringType() + fields["resource_id"] = bindings.NewStringType() + fields["resource_type"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["preferred_normalization_type"] = "PreferredNormalizationType" + fieldNameMap["resource_id"] = "ResourceId" + fieldNameMap["resource_type"] = "ResourceType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["resource_type"] = bindings.NewStringType() + paramsTypeMap["resource_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["preferred_normalization_type"] = bindings.NewStringType() + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["resource_type"] = "resource_type" + queryParams["resource_id"] = "resource_id" + queryParams["preferred_normalization_type"] = "preferred_normalization_type" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/normalizations", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/NotificationWatchersClient.go b/services/nsxt-mp/nsx/NotificationWatchersClient.go new file mode 100644 index 000000000..d850d5268 --- /dev/null +++ b/services/nsxt-mp/nsx/NotificationWatchersClient.go @@ -0,0 +1,254 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: NotificationWatchers +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NotificationWatchersClient interface { + + // Add a new notification watcher. + // + // @param notificationWatcherParam (required) + // @return com.vmware.nsx.model.NotificationWatcher + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(notificationWatcherParam model.NotificationWatcher) (model.NotificationWatcher, error) + + // Delete notification watcher. + // + // @param watcherIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(watcherIdParam string) error + + // Returns notification watcher by watcher id. + // + // @param watcherIdParam (required) + // @return com.vmware.nsx.model.NotificationWatcher + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(watcherIdParam string) (model.NotificationWatcher, error) + + // Returns a list of registered notification watchers. + // @return com.vmware.nsx.model.NotificationWatcherListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.NotificationWatcherListResult, error) + + // Update notification watcher. + // + // @param watcherIdParam (required) + // @param notificationWatcherParam (required) + // @return com.vmware.nsx.model.NotificationWatcher + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(watcherIdParam string, notificationWatcherParam model.NotificationWatcher) (model.NotificationWatcher, error) +} + +type notificationWatchersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNotificationWatchersClient(connector client.Connector) *notificationWatchersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.notification_watchers") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := notificationWatchersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *notificationWatchersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *notificationWatchersClient) Create(notificationWatcherParam model.NotificationWatcher) (model.NotificationWatcher, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(notificationWatchersCreateInputType(), typeConverter) + sv.AddStructField("NotificationWatcher", notificationWatcherParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NotificationWatcher + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := notificationWatchersCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.notification_watchers", "create", inputDataValue, executionContext) + var emptyOutput model.NotificationWatcher + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), notificationWatchersCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NotificationWatcher), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *notificationWatchersClient) Delete(watcherIdParam string) error { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(notificationWatchersDeleteInputType(), typeConverter) + sv.AddStructField("WatcherId", watcherIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := notificationWatchersDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.notification_watchers", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (nIface *notificationWatchersClient) Get(watcherIdParam string) (model.NotificationWatcher, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(notificationWatchersGetInputType(), typeConverter) + sv.AddStructField("WatcherId", watcherIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NotificationWatcher + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := notificationWatchersGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.notification_watchers", "get", inputDataValue, executionContext) + var emptyOutput model.NotificationWatcher + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), notificationWatchersGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NotificationWatcher), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *notificationWatchersClient) List() (model.NotificationWatcherListResult, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(notificationWatchersListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NotificationWatcherListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := notificationWatchersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.notification_watchers", "list", inputDataValue, executionContext) + var emptyOutput model.NotificationWatcherListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), notificationWatchersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NotificationWatcherListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *notificationWatchersClient) Update(watcherIdParam string, notificationWatcherParam model.NotificationWatcher) (model.NotificationWatcher, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(notificationWatchersUpdateInputType(), typeConverter) + sv.AddStructField("WatcherId", watcherIdParam) + sv.AddStructField("NotificationWatcher", notificationWatcherParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NotificationWatcher + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := notificationWatchersUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.notification_watchers", "update", inputDataValue, executionContext) + var emptyOutput model.NotificationWatcher + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), notificationWatchersUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NotificationWatcher), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/NotificationWatchersTypes.go b/services/nsxt-mp/nsx/NotificationWatchersTypes.go new file mode 100644 index 000000000..a8a3c2442 --- /dev/null +++ b/services/nsxt-mp/nsx/NotificationWatchersTypes.go @@ -0,0 +1,265 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: NotificationWatchers. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func notificationWatchersCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["notification_watcher"] = bindings.NewReferenceType(model.NotificationWatcherBindingType) + fieldNameMap["notification_watcher"] = "NotificationWatcher" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func notificationWatchersCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NotificationWatcherBindingType) +} + +func notificationWatchersCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["notification_watcher"] = bindings.NewReferenceType(model.NotificationWatcherBindingType) + fieldNameMap["notification_watcher"] = "NotificationWatcher" + paramsTypeMap["notification_watcher"] = bindings.NewReferenceType(model.NotificationWatcherBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "notification_watcher", + "POST", + "/api/v1/notification-watchers", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func notificationWatchersDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["watcher_id"] = bindings.NewStringType() + fieldNameMap["watcher_id"] = "WatcherId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func notificationWatchersDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func notificationWatchersDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["watcher_id"] = bindings.NewStringType() + fieldNameMap["watcher_id"] = "WatcherId" + paramsTypeMap["watcher_id"] = bindings.NewStringType() + paramsTypeMap["watcherId"] = bindings.NewStringType() + pathParams["watcher_id"] = "watcherId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/notification-watchers/{watcherId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func notificationWatchersGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["watcher_id"] = bindings.NewStringType() + fieldNameMap["watcher_id"] = "WatcherId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func notificationWatchersGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NotificationWatcherBindingType) +} + +func notificationWatchersGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["watcher_id"] = bindings.NewStringType() + fieldNameMap["watcher_id"] = "WatcherId" + paramsTypeMap["watcher_id"] = bindings.NewStringType() + paramsTypeMap["watcherId"] = bindings.NewStringType() + pathParams["watcher_id"] = "watcherId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/notification-watchers/{watcherId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func notificationWatchersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func notificationWatchersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NotificationWatcherListResultBindingType) +} + +func notificationWatchersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/notification-watchers", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func notificationWatchersUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["watcher_id"] = bindings.NewStringType() + fields["notification_watcher"] = bindings.NewReferenceType(model.NotificationWatcherBindingType) + fieldNameMap["watcher_id"] = "WatcherId" + fieldNameMap["notification_watcher"] = "NotificationWatcher" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func notificationWatchersUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NotificationWatcherBindingType) +} + +func notificationWatchersUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["watcher_id"] = bindings.NewStringType() + fields["notification_watcher"] = bindings.NewReferenceType(model.NotificationWatcherBindingType) + fieldNameMap["watcher_id"] = "WatcherId" + fieldNameMap["notification_watcher"] = "NotificationWatcher" + paramsTypeMap["watcher_id"] = bindings.NewStringType() + paramsTypeMap["notification_watcher"] = bindings.NewReferenceType(model.NotificationWatcherBindingType) + paramsTypeMap["watcherId"] = bindings.NewStringType() + pathParams["watcher_id"] = "watcherId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "notification_watcher", + "PUT", + "/api/v1/notification-watchers/{watcherId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/NsGroupsClient.go b/services/nsxt-mp/nsx/NsGroupsClient.go new file mode 100644 index 000000000..ec2f6a957 --- /dev/null +++ b/services/nsxt-mp/nsx/NsGroupsClient.go @@ -0,0 +1,320 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: NsGroups +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NsGroupsClient interface { + + // Add/remove the expressions passed in the request body to/from the NSGroup + // + // @param nsGroupIdParam NSGroup Id (required) + // @param nsGroupExpressionListParam (required) + // @param actionParam Specifies addition or removal action (required) + // @return com.vmware.nsx.model.NSGroup + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Addorremoveexpression(nsGroupIdParam string, nsGroupExpressionListParam model.NSGroupExpressionList, actionParam string) (model.NSGroup, error) + + // Creates a new NSGroup that can group NSX resources - VIFs, Lports and LSwitches as well as the grouping objects - IPSet, MACSet and other NSGroups. For NSGroups containing VM criteria(both static and dynamic), system VMs will not be included as members. This filter applies at VM level only. Exceptions are as follows: 1. LogicalPorts and VNI of System VMs will be included in NSGroup if the criteria is based on LogicalPort, LogicalSwitch or VNI directly. + // + // @param nsGroupParam (required) + // @return com.vmware.nsx.model.NSGroup + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(nsGroupParam model.NSGroup) (model.NSGroup, error) + + // Deletes the specified NSGroup. By default, if the NSGroup is added to another NSGroup, it won't be deleted. In such situations, pass \"force=true\" as query param to force delete the NSGroup. + // + // @param nsGroupIdParam NSGroup Id (required) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(nsGroupIdParam string, forceParam *bool) error + + // Returns information about the specified NSGroup. + // + // @param nsGroupIdParam NSGroup Id (required) + // @param populateReferencesParam Populate metadata of resource referenced by NSGroupExpressions (optional, default to false) + // @return com.vmware.nsx.model.NSGroup + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nsGroupIdParam string, populateReferencesParam *bool) (model.NSGroup, error) + + // List the NSGroups in a paginated format. The page size is restricted to 50 NSGroups so that the size of the response remains small even in the worst case. Optionally, specify valid member types as request parameter to filter NSGroups. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param memberTypesParam Specify member types to filter corresponding NSGroups (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param populateReferencesParam Populate metadata of resource referenced by NSGroupExpressions (optional, default to false) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.NSGroupListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, memberTypesParam *string, pageSizeParam *int64, populateReferencesParam *bool, sortAscendingParam *bool, sortByParam *string) (model.NSGroupListResult, error) + + // Updates the specified NSGroup. Modifiable parameters include the description, display_name and members. For NSGroups containing VM criteria(both static and dynamic), system VMs will not be included as members. This filter applies at VM level only. Exceptions are as follows. 1. LogicalPorts and VNI of system VMs will be included in NSGroup if the criteria is based on LogicalPort, LogicalSwitch or VNI directly. + // + // @param nsGroupIdParam NSGroup Id (required) + // @param nsGroupParam (required) + // @return com.vmware.nsx.model.NSGroup + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(nsGroupIdParam string, nsGroupParam model.NSGroup) (model.NSGroup, error) +} + +type nsGroupsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNsGroupsClient(connector client.Connector) *nsGroupsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ns_groups") + methodIdentifiers := map[string]core.MethodIdentifier{ + "addorremoveexpression": core.NewMethodIdentifier(interfaceIdentifier, "addorremoveexpression"), + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nsGroupsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nsGroupsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nsGroupsClient) Addorremoveexpression(nsGroupIdParam string, nsGroupExpressionListParam model.NSGroupExpressionList, actionParam string) (model.NSGroup, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsGroupsAddorremoveexpressionInputType(), typeConverter) + sv.AddStructField("NsGroupId", nsGroupIdParam) + sv.AddStructField("NsGroupExpressionList", nsGroupExpressionListParam) + sv.AddStructField("Action", actionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NSGroup + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsGroupsAddorremoveexpressionRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_groups", "addorremoveexpression", inputDataValue, executionContext) + var emptyOutput model.NSGroup + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsGroupsAddorremoveexpressionOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NSGroup), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nsGroupsClient) Create(nsGroupParam model.NSGroup) (model.NSGroup, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsGroupsCreateInputType(), typeConverter) + sv.AddStructField("NsGroup", nsGroupParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NSGroup + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsGroupsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_groups", "create", inputDataValue, executionContext) + var emptyOutput model.NSGroup + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsGroupsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NSGroup), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nsGroupsClient) Delete(nsGroupIdParam string, forceParam *bool) error { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsGroupsDeleteInputType(), typeConverter) + sv.AddStructField("NsGroupId", nsGroupIdParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsGroupsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_groups", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (nIface *nsGroupsClient) Get(nsGroupIdParam string, populateReferencesParam *bool) (model.NSGroup, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsGroupsGetInputType(), typeConverter) + sv.AddStructField("NsGroupId", nsGroupIdParam) + sv.AddStructField("PopulateReferences", populateReferencesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NSGroup + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsGroupsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_groups", "get", inputDataValue, executionContext) + var emptyOutput model.NSGroup + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsGroupsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NSGroup), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nsGroupsClient) List(cursorParam *string, includedFieldsParam *string, memberTypesParam *string, pageSizeParam *int64, populateReferencesParam *bool, sortAscendingParam *bool, sortByParam *string) (model.NSGroupListResult, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsGroupsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("MemberTypes", memberTypesParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("PopulateReferences", populateReferencesParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NSGroupListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsGroupsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_groups", "list", inputDataValue, executionContext) + var emptyOutput model.NSGroupListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsGroupsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NSGroupListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nsGroupsClient) Update(nsGroupIdParam string, nsGroupParam model.NSGroup) (model.NSGroup, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsGroupsUpdateInputType(), typeConverter) + sv.AddStructField("NsGroupId", nsGroupIdParam) + sv.AddStructField("NsGroup", nsGroupParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NSGroup + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsGroupsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_groups", "update", inputDataValue, executionContext) + var emptyOutput model.NSGroup + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsGroupsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NSGroup), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/NsGroupsTypes.go b/services/nsxt-mp/nsx/NsGroupsTypes.go new file mode 100644 index 000000000..8898529f7 --- /dev/null +++ b/services/nsxt-mp/nsx/NsGroupsTypes.go @@ -0,0 +1,386 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: NsGroups. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``action`` of method NsGroups#addorremoveexpression. +const NsGroups_ADDORREMOVEEXPRESSION_ACTION_ADD_MEMBERS = "ADD_MEMBERS" + +// Possible value for ``action`` of method NsGroups#addorremoveexpression. +const NsGroups_ADDORREMOVEEXPRESSION_ACTION_REMOVE_MEMBERS = "REMOVE_MEMBERS" + +func nsGroupsAddorremoveexpressionInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_group_id"] = bindings.NewStringType() + fields["ns_group_expression_list"] = bindings.NewReferenceType(model.NSGroupExpressionListBindingType) + fields["action"] = bindings.NewStringType() + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["ns_group_expression_list"] = "NsGroupExpressionList" + fieldNameMap["action"] = "Action" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsGroupsAddorremoveexpressionOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NSGroupBindingType) +} + +func nsGroupsAddorremoveexpressionRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_group_id"] = bindings.NewStringType() + fields["ns_group_expression_list"] = bindings.NewReferenceType(model.NSGroupExpressionListBindingType) + fields["action"] = bindings.NewStringType() + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["ns_group_expression_list"] = "NsGroupExpressionList" + fieldNameMap["action"] = "Action" + paramsTypeMap["ns_group_id"] = bindings.NewStringType() + paramsTypeMap["action"] = bindings.NewStringType() + paramsTypeMap["ns_group_expression_list"] = bindings.NewReferenceType(model.NSGroupExpressionListBindingType) + paramsTypeMap["nsGroupId"] = bindings.NewStringType() + pathParams["ns_group_id"] = "nsGroupId" + queryParams["action"] = "action" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ns_group_expression_list", + "POST", + "/api/v1/ns-groups/{nsGroupId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsGroupsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_group"] = bindings.NewReferenceType(model.NSGroupBindingType) + fieldNameMap["ns_group"] = "NsGroup" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsGroupsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NSGroupBindingType) +} + +func nsGroupsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_group"] = bindings.NewReferenceType(model.NSGroupBindingType) + fieldNameMap["ns_group"] = "NsGroup" + paramsTypeMap["ns_group"] = bindings.NewReferenceType(model.NSGroupBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ns_group", + "POST", + "/api/v1/ns-groups", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsGroupsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_group_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsGroupsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func nsGroupsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_group_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["force"] = "Force" + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["ns_group_id"] = bindings.NewStringType() + paramsTypeMap["nsGroupId"] = bindings.NewStringType() + pathParams["ns_group_id"] = "nsGroupId" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/ns-groups/{nsGroupId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsGroupsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_group_id"] = bindings.NewStringType() + fields["populate_references"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["populate_references"] = "PopulateReferences" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsGroupsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NSGroupBindingType) +} + +func nsGroupsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_group_id"] = bindings.NewStringType() + fields["populate_references"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["populate_references"] = "PopulateReferences" + paramsTypeMap["ns_group_id"] = bindings.NewStringType() + paramsTypeMap["populate_references"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["nsGroupId"] = bindings.NewStringType() + pathParams["ns_group_id"] = "nsGroupId" + queryParams["populate_references"] = "populate_references" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-groups/{nsGroupId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsGroupsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["member_types"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["populate_references"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["member_types"] = "MemberTypes" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["populate_references"] = "PopulateReferences" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsGroupsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NSGroupListResultBindingType) +} + +func nsGroupsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["member_types"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["populate_references"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["member_types"] = "MemberTypes" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["populate_references"] = "PopulateReferences" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["member_types"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["populate_references"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["populate_references"] = "populate_references" + queryParams["member_types"] = "member_types" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-groups", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsGroupsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_group_id"] = bindings.NewStringType() + fields["ns_group"] = bindings.NewReferenceType(model.NSGroupBindingType) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["ns_group"] = "NsGroup" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsGroupsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NSGroupBindingType) +} + +func nsGroupsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_group_id"] = bindings.NewStringType() + fields["ns_group"] = bindings.NewReferenceType(model.NSGroupBindingType) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["ns_group"] = "NsGroup" + paramsTypeMap["ns_group"] = bindings.NewReferenceType(model.NSGroupBindingType) + paramsTypeMap["ns_group_id"] = bindings.NewStringType() + paramsTypeMap["nsGroupId"] = bindings.NewStringType() + pathParams["ns_group_id"] = "nsGroupId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ns_group", + "PUT", + "/api/v1/ns-groups/{nsGroupId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/NsProfilesClient.go b/services/nsxt-mp/nsx/NsProfilesClient.go new file mode 100644 index 000000000..4f0d3bb8b --- /dev/null +++ b/services/nsxt-mp/nsx/NsProfilesClient.go @@ -0,0 +1,269 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: NsProfiles +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NsProfilesClient interface { + + // Creates a new NSProfile which allows users to encapsulate attribute and sub-attributes of network services. Rules for using attributes and sub-attributes in single NSProfile 1. One type of attribute can't have multiple occurrences. ( Example - Attribute type APP_ID can be used only once per NSProfile.) 2. Values for an attribute are mentioned as array of strings. ( Example - For type APP_ID , values can be mentioned as [\"SSL\",\"FTP\"].) 3. If sub-attribtes are mentioned for an attribute, then only single value is allowed for that attribute. 4. To get a list of supported attributes and sub-attributes fire the following REST API GET https:///api/v1/ns-profiles/attributes + // + // @param nsProfileParam (required) + // @return com.vmware.nsx.model.NSProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(nsProfileParam model.NSProfile) (model.NSProfile, error) + + // Deletes the specified NSProfile. By default, if the NSProfile is consumed in a Firewall rule, it won't get deleted. In such situations, pass \"force=true\" as query param to force delete the NSProfile. + // + // @param nsProfileIdParam NSProfile Id (required) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(nsProfileIdParam string, forceParam *bool) error + + // Returns information about the specified NSProfile. + // + // @param nsProfileIdParam NSProfile Id (required) + // @return com.vmware.nsx.model.NSProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nsProfileIdParam string) (model.NSProfile, error) + + // List the NSProfiles created in a paginated format.The page size is restricted to 50 NSProfiles, so that the size of the response remains small even when there are high number of NSProfiles with multiple attributes and multiple attribute values for each attribute. + // + // @param attributeTypeParam Fetch NSProfiles for the given attribute type (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.NSProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(attributeTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.NSProfileListResult, error) + + // Updates the specified NSProfile. Rules for using attributes and sub-attributes in single NSProfile 1. One type of attribute can't have multiple occurrences. ( Example - Attribute type APP_ID can be used only once per NSProfile.) 2. Values for an attribute are mentioned as array of strings. ( Example - For type APP_ID , values can be mentioned as [\"SSL\",\"FTP\"].) 3. If sub-attribtes are mentioned for an attribute, then only single value is allowed for that attribute. 4. To get a list of supported attributes and sub-attributes fire the following REST API GET https:///api/v1/ns-profiles/attributes + // + // @param nsProfileIdParam NSProfile Id (required) + // @param nsProfileParam (required) + // @return com.vmware.nsx.model.NSProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(nsProfileIdParam string, nsProfileParam model.NSProfile) (model.NSProfile, error) +} + +type nsProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNsProfilesClient(connector client.Connector) *nsProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ns_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nsProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nsProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nsProfilesClient) Create(nsProfileParam model.NSProfile) (model.NSProfile, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsProfilesCreateInputType(), typeConverter) + sv.AddStructField("NsProfile", nsProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NSProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsProfilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_profiles", "create", inputDataValue, executionContext) + var emptyOutput model.NSProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsProfilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NSProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nsProfilesClient) Delete(nsProfileIdParam string, forceParam *bool) error { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsProfilesDeleteInputType(), typeConverter) + sv.AddStructField("NsProfileId", nsProfileIdParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (nIface *nsProfilesClient) Get(nsProfileIdParam string) (model.NSProfile, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsProfilesGetInputType(), typeConverter) + sv.AddStructField("NsProfileId", nsProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NSProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_profiles", "get", inputDataValue, executionContext) + var emptyOutput model.NSProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NSProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nsProfilesClient) List(attributeTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.NSProfileListResult, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsProfilesListInputType(), typeConverter) + sv.AddStructField("AttributeType", attributeTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NSProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.NSProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NSProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nsProfilesClient) Update(nsProfileIdParam string, nsProfileParam model.NSProfile) (model.NSProfile, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsProfilesUpdateInputType(), typeConverter) + sv.AddStructField("NsProfileId", nsProfileIdParam) + sv.AddStructField("NsProfile", nsProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NSProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_profiles", "update", inputDataValue, executionContext) + var emptyOutput model.NSProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NSProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/NsProfilesTypes.go b/services/nsxt-mp/nsx/NsProfilesTypes.go new file mode 100644 index 000000000..3f24b7cdd --- /dev/null +++ b/services/nsxt-mp/nsx/NsProfilesTypes.go @@ -0,0 +1,307 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: NsProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func nsProfilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_profile"] = bindings.NewReferenceType(model.NSProfileBindingType) + fieldNameMap["ns_profile"] = "NsProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsProfilesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NSProfileBindingType) +} + +func nsProfilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_profile"] = bindings.NewReferenceType(model.NSProfileBindingType) + fieldNameMap["ns_profile"] = "NsProfile" + paramsTypeMap["ns_profile"] = bindings.NewReferenceType(model.NSProfileBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ns_profile", + "POST", + "/api/v1/ns-profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_profile_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ns_profile_id"] = "NsProfileId" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func nsProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_profile_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ns_profile_id"] = "NsProfileId" + fieldNameMap["force"] = "Force" + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["ns_profile_id"] = bindings.NewStringType() + paramsTypeMap["nsProfileId"] = bindings.NewStringType() + pathParams["ns_profile_id"] = "nsProfileId" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/ns-profiles/{nsProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_profile_id"] = bindings.NewStringType() + fieldNameMap["ns_profile_id"] = "NsProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NSProfileBindingType) +} + +func nsProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_profile_id"] = bindings.NewStringType() + fieldNameMap["ns_profile_id"] = "NsProfileId" + paramsTypeMap["ns_profile_id"] = bindings.NewStringType() + paramsTypeMap["nsProfileId"] = bindings.NewStringType() + pathParams["ns_profile_id"] = "nsProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-profiles/{nsProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["attribute_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["attribute_type"] = "AttributeType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NSProfileListResultBindingType) +} + +func nsProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["attribute_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["attribute_type"] = "AttributeType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["attribute_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["attribute_type"] = "attribute_type" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_profile_id"] = bindings.NewStringType() + fields["ns_profile"] = bindings.NewReferenceType(model.NSProfileBindingType) + fieldNameMap["ns_profile_id"] = "NsProfileId" + fieldNameMap["ns_profile"] = "NsProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NSProfileBindingType) +} + +func nsProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_profile_id"] = bindings.NewStringType() + fields["ns_profile"] = bindings.NewReferenceType(model.NSProfileBindingType) + fieldNameMap["ns_profile_id"] = "NsProfileId" + fieldNameMap["ns_profile"] = "NsProfile" + paramsTypeMap["ns_profile_id"] = bindings.NewStringType() + paramsTypeMap["ns_profile"] = bindings.NewReferenceType(model.NSProfileBindingType) + paramsTypeMap["nsProfileId"] = bindings.NewStringType() + pathParams["ns_profile_id"] = "nsProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ns_profile", + "PUT", + "/api/v1/ns-profiles/{nsProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/NsServiceGroupsClient.go b/services/nsxt-mp/nsx/NsServiceGroupsClient.go new file mode 100644 index 000000000..5a185090a --- /dev/null +++ b/services/nsxt-mp/nsx/NsServiceGroupsClient.go @@ -0,0 +1,271 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: NsServiceGroups +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NsServiceGroupsClient interface { + + // Creates a new NSServiceGroup which can contain NSServices. A given NSServiceGroup can contain either only ether type of NSServices or only non-ether type of NSServices, i.e. an NSServiceGroup cannot contain a mix of both ether and non-ether types of NSServices. + // + // @param nsServiceGroupParam (required) + // @return com.vmware.nsx.model.NSServiceGroup + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(nsServiceGroupParam model.NSServiceGroup) (model.NSServiceGroup, error) + + // Deletes the specified NSServiceGroup. By default, if the NSServiceGroup is consumed in a Firewall rule, it won't get deleted. In such situations, pass \"force=true\" as query param to force delete the NSServiceGroup. + // + // @param nsServiceGroupIdParam NSServiceGroup Id (required) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(nsServiceGroupIdParam string, forceParam *bool) error + + // Returns information about the specified NSServiceGroup + // + // @param nsServiceGroupIdParam NSServiceGroup Id (required) + // @return com.vmware.nsx.model.NSServiceGroup + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nsServiceGroupIdParam string) (model.NSServiceGroup, error) + + // Returns paginated list of NSServiceGroups + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param defaultServiceParam Fetch all default NSServiceGroups (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.NSServiceGroupListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, defaultServiceParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.NSServiceGroupListResult, error) + + // Updates the specified NSService. Modifiable parameters include the description, display_name and members. + // + // @param nsServiceGroupIdParam NSServiceGroup Id (required) + // @param nsServiceGroupParam (required) + // @return com.vmware.nsx.model.NSServiceGroup + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(nsServiceGroupIdParam string, nsServiceGroupParam model.NSServiceGroup) (model.NSServiceGroup, error) +} + +type nsServiceGroupsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNsServiceGroupsClient(connector client.Connector) *nsServiceGroupsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ns_service_groups") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nsServiceGroupsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nsServiceGroupsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nsServiceGroupsClient) Create(nsServiceGroupParam model.NSServiceGroup) (model.NSServiceGroup, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsServiceGroupsCreateInputType(), typeConverter) + sv.AddStructField("NsServiceGroup", nsServiceGroupParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NSServiceGroup + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsServiceGroupsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_service_groups", "create", inputDataValue, executionContext) + var emptyOutput model.NSServiceGroup + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsServiceGroupsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NSServiceGroup), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nsServiceGroupsClient) Delete(nsServiceGroupIdParam string, forceParam *bool) error { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsServiceGroupsDeleteInputType(), typeConverter) + sv.AddStructField("NsServiceGroupId", nsServiceGroupIdParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsServiceGroupsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_service_groups", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (nIface *nsServiceGroupsClient) Get(nsServiceGroupIdParam string) (model.NSServiceGroup, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsServiceGroupsGetInputType(), typeConverter) + sv.AddStructField("NsServiceGroupId", nsServiceGroupIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NSServiceGroup + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsServiceGroupsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_service_groups", "get", inputDataValue, executionContext) + var emptyOutput model.NSServiceGroup + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsServiceGroupsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NSServiceGroup), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nsServiceGroupsClient) List(cursorParam *string, defaultServiceParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.NSServiceGroupListResult, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsServiceGroupsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("DefaultService", defaultServiceParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NSServiceGroupListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsServiceGroupsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_service_groups", "list", inputDataValue, executionContext) + var emptyOutput model.NSServiceGroupListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsServiceGroupsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NSServiceGroupListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nsServiceGroupsClient) Update(nsServiceGroupIdParam string, nsServiceGroupParam model.NSServiceGroup) (model.NSServiceGroup, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsServiceGroupsUpdateInputType(), typeConverter) + sv.AddStructField("NsServiceGroupId", nsServiceGroupIdParam) + sv.AddStructField("NsServiceGroup", nsServiceGroupParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NSServiceGroup + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsServiceGroupsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_service_groups", "update", inputDataValue, executionContext) + var emptyOutput model.NSServiceGroup + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsServiceGroupsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NSServiceGroup), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/NsServiceGroupsTypes.go b/services/nsxt-mp/nsx/NsServiceGroupsTypes.go new file mode 100644 index 000000000..c31248e6a --- /dev/null +++ b/services/nsxt-mp/nsx/NsServiceGroupsTypes.go @@ -0,0 +1,307 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: NsServiceGroups. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func nsServiceGroupsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_service_group"] = bindings.NewReferenceType(model.NSServiceGroupBindingType) + fieldNameMap["ns_service_group"] = "NsServiceGroup" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsServiceGroupsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NSServiceGroupBindingType) +} + +func nsServiceGroupsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_service_group"] = bindings.NewReferenceType(model.NSServiceGroupBindingType) + fieldNameMap["ns_service_group"] = "NsServiceGroup" + paramsTypeMap["ns_service_group"] = bindings.NewReferenceType(model.NSServiceGroupBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ns_service_group", + "POST", + "/api/v1/ns-service-groups", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsServiceGroupsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_service_group_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ns_service_group_id"] = "NsServiceGroupId" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsServiceGroupsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func nsServiceGroupsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_service_group_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ns_service_group_id"] = "NsServiceGroupId" + fieldNameMap["force"] = "Force" + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["ns_service_group_id"] = bindings.NewStringType() + paramsTypeMap["nsServiceGroupId"] = bindings.NewStringType() + pathParams["ns_service_group_id"] = "nsServiceGroupId" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/ns-service-groups/{nsServiceGroupId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsServiceGroupsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_service_group_id"] = bindings.NewStringType() + fieldNameMap["ns_service_group_id"] = "NsServiceGroupId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsServiceGroupsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NSServiceGroupBindingType) +} + +func nsServiceGroupsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_service_group_id"] = bindings.NewStringType() + fieldNameMap["ns_service_group_id"] = "NsServiceGroupId" + paramsTypeMap["ns_service_group_id"] = bindings.NewStringType() + paramsTypeMap["nsServiceGroupId"] = bindings.NewStringType() + pathParams["ns_service_group_id"] = "nsServiceGroupId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-service-groups/{nsServiceGroupId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsServiceGroupsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["default_service"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["default_service"] = "DefaultService" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsServiceGroupsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NSServiceGroupListResultBindingType) +} + +func nsServiceGroupsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["default_service"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["default_service"] = "DefaultService" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["default_service"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["default_service"] = "default_service" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-service-groups", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsServiceGroupsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_service_group_id"] = bindings.NewStringType() + fields["ns_service_group"] = bindings.NewReferenceType(model.NSServiceGroupBindingType) + fieldNameMap["ns_service_group_id"] = "NsServiceGroupId" + fieldNameMap["ns_service_group"] = "NsServiceGroup" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsServiceGroupsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NSServiceGroupBindingType) +} + +func nsServiceGroupsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_service_group_id"] = bindings.NewStringType() + fields["ns_service_group"] = bindings.NewReferenceType(model.NSServiceGroupBindingType) + fieldNameMap["ns_service_group_id"] = "NsServiceGroupId" + fieldNameMap["ns_service_group"] = "NsServiceGroup" + paramsTypeMap["ns_service_group"] = bindings.NewReferenceType(model.NSServiceGroupBindingType) + paramsTypeMap["ns_service_group_id"] = bindings.NewStringType() + paramsTypeMap["nsServiceGroupId"] = bindings.NewStringType() + pathParams["ns_service_group_id"] = "nsServiceGroupId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ns_service_group", + "PUT", + "/api/v1/ns-service-groups/{nsServiceGroupId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/NsServicesClient.go b/services/nsxt-mp/nsx/NsServicesClient.go new file mode 100644 index 000000000..4ba56e928 --- /dev/null +++ b/services/nsxt-mp/nsx/NsServicesClient.go @@ -0,0 +1,271 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: NsServices +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NsServicesClient interface { + + // Creates a new NSService which allows users to specify characteristics to use for matching network traffic. + // + // @param nsServiceParam (required) + // @return com.vmware.nsx.model.NSService + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(nsServiceParam model.NSService) (model.NSService, error) + + // Deletes the specified NSService. By default, if the NSService is being referred in an NSServiceGroup, it can't be deleted. In such situations, pass \"force=true\" as a parameter to force delete the NSService. System defined NSServices can't be deleted using \"force\" flag. + // + // @param nsServiceIdParam NSService Id (required) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(nsServiceIdParam string, forceParam *bool) error + + // Returns information about the specified NSService + // + // @param nsServiceIdParam NSService Id (required) + // @return com.vmware.nsx.model.NSService + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nsServiceIdParam string) (model.NSService, error) + + // Returns paginated list of NSServices + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param defaultServiceParam Fetch all default NSServices (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.NSServiceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, defaultServiceParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.NSServiceListResult, error) + + // Updates the specified NSService. Modifiable parameters include the description, display_name and the NSService element. The system defined NSServices can't be modified + // + // @param nsServiceIdParam NSService Id (required) + // @param nsServiceParam (required) + // @return com.vmware.nsx.model.NSService + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(nsServiceIdParam string, nsServiceParam model.NSService) (model.NSService, error) +} + +type nsServicesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNsServicesClient(connector client.Connector) *nsServicesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ns_services") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nsServicesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nsServicesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nsServicesClient) Create(nsServiceParam model.NSService) (model.NSService, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsServicesCreateInputType(), typeConverter) + sv.AddStructField("NsService", nsServiceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NSService + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsServicesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_services", "create", inputDataValue, executionContext) + var emptyOutput model.NSService + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsServicesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NSService), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nsServicesClient) Delete(nsServiceIdParam string, forceParam *bool) error { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsServicesDeleteInputType(), typeConverter) + sv.AddStructField("NsServiceId", nsServiceIdParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsServicesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_services", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (nIface *nsServicesClient) Get(nsServiceIdParam string) (model.NSService, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsServicesGetInputType(), typeConverter) + sv.AddStructField("NsServiceId", nsServiceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NSService + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsServicesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_services", "get", inputDataValue, executionContext) + var emptyOutput model.NSService + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsServicesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NSService), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nsServicesClient) List(cursorParam *string, defaultServiceParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.NSServiceListResult, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsServicesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("DefaultService", defaultServiceParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NSServiceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsServicesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_services", "list", inputDataValue, executionContext) + var emptyOutput model.NSServiceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsServicesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NSServiceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nsServicesClient) Update(nsServiceIdParam string, nsServiceParam model.NSService) (model.NSService, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsServicesUpdateInputType(), typeConverter) + sv.AddStructField("NsServiceId", nsServiceIdParam) + sv.AddStructField("NsService", nsServiceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NSService + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsServicesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_services", "update", inputDataValue, executionContext) + var emptyOutput model.NSService + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsServicesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NSService), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/NsServicesTypes.go b/services/nsxt-mp/nsx/NsServicesTypes.go new file mode 100644 index 000000000..48f255e68 --- /dev/null +++ b/services/nsxt-mp/nsx/NsServicesTypes.go @@ -0,0 +1,307 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: NsServices. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func nsServicesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_service"] = bindings.NewReferenceType(model.NSServiceBindingType) + fieldNameMap["ns_service"] = "NsService" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsServicesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NSServiceBindingType) +} + +func nsServicesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_service"] = bindings.NewReferenceType(model.NSServiceBindingType) + fieldNameMap["ns_service"] = "NsService" + paramsTypeMap["ns_service"] = bindings.NewReferenceType(model.NSServiceBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ns_service", + "POST", + "/api/v1/ns-services", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsServicesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_service_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ns_service_id"] = "NsServiceId" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsServicesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func nsServicesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_service_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ns_service_id"] = "NsServiceId" + fieldNameMap["force"] = "Force" + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["ns_service_id"] = bindings.NewStringType() + paramsTypeMap["nsServiceId"] = bindings.NewStringType() + pathParams["ns_service_id"] = "nsServiceId" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/ns-services/{nsServiceId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsServicesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_service_id"] = bindings.NewStringType() + fieldNameMap["ns_service_id"] = "NsServiceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsServicesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NSServiceBindingType) +} + +func nsServicesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_service_id"] = bindings.NewStringType() + fieldNameMap["ns_service_id"] = "NsServiceId" + paramsTypeMap["ns_service_id"] = bindings.NewStringType() + paramsTypeMap["nsServiceId"] = bindings.NewStringType() + pathParams["ns_service_id"] = "nsServiceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-services/{nsServiceId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsServicesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["default_service"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["default_service"] = "DefaultService" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsServicesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NSServiceListResultBindingType) +} + +func nsServicesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["default_service"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["default_service"] = "DefaultService" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["default_service"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["default_service"] = "default_service" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-services", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsServicesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_service_id"] = bindings.NewStringType() + fields["ns_service"] = bindings.NewReferenceType(model.NSServiceBindingType) + fieldNameMap["ns_service_id"] = "NsServiceId" + fieldNameMap["ns_service"] = "NsService" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsServicesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NSServiceBindingType) +} + +func nsServicesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_service_id"] = bindings.NewStringType() + fields["ns_service"] = bindings.NewReferenceType(model.NSServiceBindingType) + fieldNameMap["ns_service_id"] = "NsServiceId" + fieldNameMap["ns_service"] = "NsService" + paramsTypeMap["ns_service_id"] = bindings.NewStringType() + paramsTypeMap["ns_service"] = bindings.NewReferenceType(model.NSServiceBindingType) + paramsTypeMap["nsServiceId"] = bindings.NewStringType() + pathParams["ns_service_id"] = "nsServiceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ns_service", + "PUT", + "/api/v1/ns-services/{nsServiceId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/NsxPackageTypes.go b/services/nsxt-mp/nsx/NsxPackageTypes.go new file mode 100644 index 000000000..918db5545 --- /dev/null +++ b/services/nsxt-mp/nsx/NsxPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx diff --git a/services/nsxt-mp/nsx/NvdsUrtClient.go b/services/nsxt-mp/nsx/NvdsUrtClient.go new file mode 100644 index 000000000..719aa9b56 --- /dev/null +++ b/services/nsxt-mp/nsx/NvdsUrtClient.go @@ -0,0 +1,112 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: NvdsUrt +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NvdsUrtClient interface { + + // Clean up all nvds upgrade related configurations + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Cleanup() error + + // Set the migrate status key of ExtraConfigProfile of all Transport Nodes to IGNORE + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Ignoremigratestatus() error +} + +type nvdsUrtClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNvdsUrtClient(connector client.Connector) *nvdsUrtClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.nvds_urt") + methodIdentifiers := map[string]core.MethodIdentifier{ + "cleanup": core.NewMethodIdentifier(interfaceIdentifier, "cleanup"), + "ignoremigratestatus": core.NewMethodIdentifier(interfaceIdentifier, "ignoremigratestatus"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nvdsUrtClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nvdsUrtClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nvdsUrtClient) Cleanup() error { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nvdsUrtCleanupInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nvdsUrtCleanupRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.nvds_urt", "cleanup", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (nIface *nvdsUrtClient) Ignoremigratestatus() error { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nvdsUrtIgnoremigratestatusInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nvdsUrtIgnoremigratestatusRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.nvds_urt", "ignoremigratestatus", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/NvdsUrtTypes.go b/services/nsxt-mp/nsx/NvdsUrtTypes.go new file mode 100644 index 000000000..c8552fbcd --- /dev/null +++ b/services/nsxt-mp/nsx/NvdsUrtTypes.go @@ -0,0 +1,104 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: NvdsUrt. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "reflect" +) + +func nvdsUrtCleanupInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nvdsUrtCleanupOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func nvdsUrtCleanupRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=cleanup", + "", + "POST", + "/api/v1/nvds-urt", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nvdsUrtIgnoremigratestatusInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nvdsUrtIgnoremigratestatusOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func nvdsUrtIgnoremigratestatusRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=ignore_migrate_status", + "", + "POST", + "/api/v1/nvds-urt", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ServiceConfigsClient.go b/services/nsxt-mp/nsx/ServiceConfigsClient.go new file mode 100644 index 000000000..543d271bf --- /dev/null +++ b/services/nsxt-mp/nsx/ServiceConfigsClient.go @@ -0,0 +1,267 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ServiceConfigs +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ServiceConfigsClient interface { + + // Creates a new service config that can group profiles and configs + // + // @param serviceConfigParam (required) + // @return com.vmware.nsx.model.ServiceConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(serviceConfigParam model.ServiceConfig) (model.ServiceConfig, error) + + // Deletes the specified service config + // + // @param configSetIdParam service Ccnfig Id (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(configSetIdParam string) error + + // Returns information about the specified Service Config. + // + // @param configSetIdParam Service Config Id (required) + // @return com.vmware.nsx.model.ServiceConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(configSetIdParam string) (model.ServiceConfig, error) + + // List of all service configs. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param profileTypeParam Fetch ServiceConfig for the given attribute profile_type (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.ServiceConfigListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, profileTypeParam *string, sortAscendingParam *bool, sortByParam *string) (model.ServiceConfigListResult, error) + + // Updates the specified ServiceConfig. + // + // @param configSetIdParam service config Id (required) + // @param serviceConfigParam (required) + // @return com.vmware.nsx.model.ServiceConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(configSetIdParam string, serviceConfigParam model.ServiceConfig) (model.ServiceConfig, error) +} + +type serviceConfigsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewServiceConfigsClient(connector client.Connector) *serviceConfigsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.service_configs") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := serviceConfigsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *serviceConfigsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *serviceConfigsClient) Create(serviceConfigParam model.ServiceConfig) (model.ServiceConfig, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceConfigsCreateInputType(), typeConverter) + sv.AddStructField("ServiceConfig", serviceConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceConfigsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.service_configs", "create", inputDataValue, executionContext) + var emptyOutput model.ServiceConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceConfigsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serviceConfigsClient) Delete(configSetIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceConfigsDeleteInputType(), typeConverter) + sv.AddStructField("ConfigSetId", configSetIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceConfigsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.service_configs", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *serviceConfigsClient) Get(configSetIdParam string) (model.ServiceConfig, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceConfigsGetInputType(), typeConverter) + sv.AddStructField("ConfigSetId", configSetIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceConfigsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.service_configs", "get", inputDataValue, executionContext) + var emptyOutput model.ServiceConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceConfigsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serviceConfigsClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, profileTypeParam *string, sortAscendingParam *bool, sortByParam *string) (model.ServiceConfigListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceConfigsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("ProfileType", profileTypeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceConfigListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceConfigsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.service_configs", "list", inputDataValue, executionContext) + var emptyOutput model.ServiceConfigListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceConfigsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceConfigListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serviceConfigsClient) Update(configSetIdParam string, serviceConfigParam model.ServiceConfig) (model.ServiceConfig, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceConfigsUpdateInputType(), typeConverter) + sv.AddStructField("ConfigSetId", configSetIdParam) + sv.AddStructField("ServiceConfig", serviceConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceConfigsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.service_configs", "update", inputDataValue, executionContext) + var emptyOutput model.ServiceConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceConfigsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ServiceConfigsTypes.go b/services/nsxt-mp/nsx/ServiceConfigsTypes.go new file mode 100644 index 000000000..3ad2c4228 --- /dev/null +++ b/services/nsxt-mp/nsx/ServiceConfigsTypes.go @@ -0,0 +1,301 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ServiceConfigs. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func serviceConfigsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_config"] = bindings.NewReferenceType(model.ServiceConfigBindingType) + fieldNameMap["service_config"] = "ServiceConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceConfigsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceConfigBindingType) +} + +func serviceConfigsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_config"] = bindings.NewReferenceType(model.ServiceConfigBindingType) + fieldNameMap["service_config"] = "ServiceConfig" + paramsTypeMap["service_config"] = bindings.NewReferenceType(model.ServiceConfigBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "service_config", + "POST", + "/api/v1/service-configs", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceConfigsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["config_set_id"] = bindings.NewStringType() + fieldNameMap["config_set_id"] = "ConfigSetId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceConfigsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func serviceConfigsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["config_set_id"] = bindings.NewStringType() + fieldNameMap["config_set_id"] = "ConfigSetId" + paramsTypeMap["config_set_id"] = bindings.NewStringType() + paramsTypeMap["configSetId"] = bindings.NewStringType() + pathParams["config_set_id"] = "configSetId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/service-configs/{configSetId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceConfigsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["config_set_id"] = bindings.NewStringType() + fieldNameMap["config_set_id"] = "ConfigSetId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceConfigsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceConfigBindingType) +} + +func serviceConfigsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["config_set_id"] = bindings.NewStringType() + fieldNameMap["config_set_id"] = "ConfigSetId" + paramsTypeMap["config_set_id"] = bindings.NewStringType() + paramsTypeMap["configSetId"] = bindings.NewStringType() + pathParams["config_set_id"] = "configSetId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/service-configs/{configSetId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceConfigsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["profile_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["profile_type"] = "ProfileType" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceConfigsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceConfigListResultBindingType) +} + +func serviceConfigsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["profile_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["profile_type"] = "ProfileType" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["profile_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["profile_type"] = "profile_type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/service-configs", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceConfigsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["config_set_id"] = bindings.NewStringType() + fields["service_config"] = bindings.NewReferenceType(model.ServiceConfigBindingType) + fieldNameMap["config_set_id"] = "ConfigSetId" + fieldNameMap["service_config"] = "ServiceConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceConfigsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceConfigBindingType) +} + +func serviceConfigsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["config_set_id"] = bindings.NewStringType() + fields["service_config"] = bindings.NewReferenceType(model.ServiceConfigBindingType) + fieldNameMap["config_set_id"] = "ConfigSetId" + fieldNameMap["service_config"] = "ServiceConfig" + paramsTypeMap["config_set_id"] = bindings.NewStringType() + paramsTypeMap["service_config"] = bindings.NewReferenceType(model.ServiceConfigBindingType) + paramsTypeMap["configSetId"] = bindings.NewStringType() + pathParams["config_set_id"] = "configSetId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "service_config", + "PUT", + "/api/v1/service-configs/{configSetId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/SitesClient.go b/services/nsxt-mp/nsx/SitesClient.go new file mode 100644 index 000000000..b0b3f013f --- /dev/null +++ b/services/nsxt-mp/nsx/SitesClient.go @@ -0,0 +1,207 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Sites +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SitesClient interface { + + // Get the site configuration + // @return com.vmware.nsx.model.FederationConfiguration + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.FederationConfiguration, error) + + // Get the site configuration, some attributes won't be shown based on version + // @return com.vmware.nsx.model.FederationConfiguration + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get0() (model.FederationConfiguration, error) + + // Get the site configuration, some attributes won't be shown based on version + // @return com.vmware.nsx.model.FederationConfiguration + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get1() (model.FederationConfiguration, error) + + // Get the site configuration, some attributes won't be shown based on version + // @return com.vmware.nsx.model.FederationConfiguration + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get2() (model.FederationConfiguration, error) +} + +type sitesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSitesClient(connector client.Connector) *sitesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.sites") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "get_0": core.NewMethodIdentifier(interfaceIdentifier, "get_0"), + "get_1": core.NewMethodIdentifier(interfaceIdentifier, "get_1"), + "get_2": core.NewMethodIdentifier(interfaceIdentifier, "get_2"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := sitesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *sitesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *sitesClient) Get() (model.FederationConfiguration, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sitesGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FederationConfiguration + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sitesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.sites", "get", inputDataValue, executionContext) + var emptyOutput model.FederationConfiguration + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sitesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FederationConfiguration), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sitesClient) Get0() (model.FederationConfiguration, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sitesGet0InputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FederationConfiguration + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sitesGet0RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.sites", "get_0", inputDataValue, executionContext) + var emptyOutput model.FederationConfiguration + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sitesGet0OutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FederationConfiguration), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sitesClient) Get1() (model.FederationConfiguration, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sitesGet1InputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FederationConfiguration + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sitesGet1RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.sites", "get_1", inputDataValue, executionContext) + var emptyOutput model.FederationConfiguration + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sitesGet1OutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FederationConfiguration), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sitesClient) Get2() (model.FederationConfiguration, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sitesGet2InputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FederationConfiguration + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sitesGet2RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.sites", "get_2", inputDataValue, executionContext) + var emptyOutput model.FederationConfiguration + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sitesGet2OutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FederationConfiguration), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/SitesTypes.go b/services/nsxt-mp/nsx/SitesTypes.go new file mode 100644 index 000000000..8782eb080 --- /dev/null +++ b/services/nsxt-mp/nsx/SitesTypes.go @@ -0,0 +1,191 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Sites. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func sitesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sitesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FederationConfigurationBindingType) +} + +func sitesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/sites", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sitesGet0InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sitesGet0OutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FederationConfigurationBindingType) +} + +func sitesGet0RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "version=3.0.2", + "", + "GET", + "/api/v1/sites", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sitesGet1InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sitesGet1OutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FederationConfigurationBindingType) +} + +func sitesGet1RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "version=3.1.0", + "", + "GET", + "/api/v1/sites", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sitesGet2InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sitesGet2OutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FederationConfigurationBindingType) +} + +func sitesGet2RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "version=latest", + "", + "GET", + "/api/v1/sites", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/SwitchingProfilesClient.go b/services/nsxt-mp/nsx/SwitchingProfilesClient.go new file mode 100644 index 000000000..961ef9295 --- /dev/null +++ b/services/nsxt-mp/nsx/SwitchingProfilesClient.go @@ -0,0 +1,277 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: SwitchingProfiles +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SwitchingProfilesClient interface { + + // Creates a new, custom qos, port-mirroring, spoof-guard or port-security switching profile. You can override their default switching profile assignments by creating a new switching profile and assigning it to one or more logical switches. You cannot override the default ipfix or ip_discovery switching profiles. This api is now deprecated. Please use new api - For eg. for QOS profile, please use - PUT /infra/qos-profiles/ + // + // @param baseSwitchingProfileParam (required) + // The parameter must contain all the properties defined in model.BaseSwitchingProfile. + // @return com.vmware.nsx.model.BaseSwitchingProfile + // The return value will contain all the properties defined in model.BaseSwitchingProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(baseSwitchingProfileParam *data.StructValue) (*data.StructValue, error) + + // Deletes the specified switching profile. This api is now deprecated. Use new api - for QOS profile, please use - DELETE /infra/qos-profiles/ + // + // @param switchingProfileIdParam (required) + // @param unbindParam force unbinding of logical switches and ports from a switching profile (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(switchingProfileIdParam string, unbindParam *bool) error + + // Returns information about a specified switching profile. This api is now deprecated. Please use new api - for QOS profile, please use - /infra/qos-profiles/ + // + // @param switchingProfileIdParam (required) + // @return com.vmware.nsx.model.BaseSwitchingProfile + // The return value will contain all the properties defined in model.BaseSwitchingProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(switchingProfileIdParam string) (*data.StructValue, error) + + // Returns information about the system-default and user-configured switching profiles. Each switching profile has a unique ID, a display name, and various other read-only and configurable properties. The default switching profiles are assigned automatically to each switch. This api is now deprecated. Please use new api - for QOS profile, please use - /infra/qos-profiles + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeSystemOwnedParam Whether the list result contains system resources (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param switchingProfileTypeParam comma-separated list of switching profile types, e.g. ?switching_profile_type=QosSwitchingProfile,IpDiscoverySwitchingProfile (optional) + // @return com.vmware.nsx.model.SwitchingProfilesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeSystemOwnedParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, switchingProfileTypeParam *string) (model.SwitchingProfilesListResult, error) + + // Updates the user-configurable parameters of a switching profile. Only the qos, port-mirroring, spoof-guard and port-security switching profiles can be modified. You cannot modify the ipfix or ip-discovery switching profiles. This api is now deprecated. Use new api, for eg., QOS profile - PATCH /infra/qos-profiles/ + // + // @param switchingProfileIdParam (required) + // @param baseSwitchingProfileParam (required) + // The parameter must contain all the properties defined in model.BaseSwitchingProfile. + // @return com.vmware.nsx.model.BaseSwitchingProfile + // The return value will contain all the properties defined in model.BaseSwitchingProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(switchingProfileIdParam string, baseSwitchingProfileParam *data.StructValue) (*data.StructValue, error) +} + +type switchingProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSwitchingProfilesClient(connector client.Connector) *switchingProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.switching_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := switchingProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *switchingProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *switchingProfilesClient) Create(baseSwitchingProfileParam *data.StructValue) (*data.StructValue, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(switchingProfilesCreateInputType(), typeConverter) + sv.AddStructField("BaseSwitchingProfile", baseSwitchingProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := switchingProfilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.switching_profiles", "create", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), switchingProfilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *switchingProfilesClient) Delete(switchingProfileIdParam string, unbindParam *bool) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(switchingProfilesDeleteInputType(), typeConverter) + sv.AddStructField("SwitchingProfileId", switchingProfileIdParam) + sv.AddStructField("Unbind", unbindParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := switchingProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.switching_profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *switchingProfilesClient) Get(switchingProfileIdParam string) (*data.StructValue, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(switchingProfilesGetInputType(), typeConverter) + sv.AddStructField("SwitchingProfileId", switchingProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := switchingProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.switching_profiles", "get", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), switchingProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *switchingProfilesClient) List(cursorParam *string, includeSystemOwnedParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, switchingProfileTypeParam *string) (model.SwitchingProfilesListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(switchingProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeSystemOwned", includeSystemOwnedParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("SwitchingProfileType", switchingProfileTypeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SwitchingProfilesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := switchingProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.switching_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.SwitchingProfilesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), switchingProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SwitchingProfilesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *switchingProfilesClient) Update(switchingProfileIdParam string, baseSwitchingProfileParam *data.StructValue) (*data.StructValue, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(switchingProfilesUpdateInputType(), typeConverter) + sv.AddStructField("SwitchingProfileId", switchingProfileIdParam) + sv.AddStructField("BaseSwitchingProfile", baseSwitchingProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := switchingProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.switching_profiles", "update", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), switchingProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/SwitchingProfilesTypes.go b/services/nsxt-mp/nsx/SwitchingProfilesTypes.go new file mode 100644 index 000000000..ed4f89c25 --- /dev/null +++ b/services/nsxt-mp/nsx/SwitchingProfilesTypes.go @@ -0,0 +1,313 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: SwitchingProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func switchingProfilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["base_switching_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseSwitchingProfileBindingType)}, bindings.REST) + fieldNameMap["base_switching_profile"] = "BaseSwitchingProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func switchingProfilesCreateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseSwitchingProfileBindingType)}, bindings.REST) +} + +func switchingProfilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["base_switching_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseSwitchingProfileBindingType)}, bindings.REST) + fieldNameMap["base_switching_profile"] = "BaseSwitchingProfile" + paramsTypeMap["base_switching_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseSwitchingProfileBindingType)}, bindings.REST) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "base_switching_profile", + "POST", + "/api/v1/switching-profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func switchingProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["switching_profile_id"] = bindings.NewStringType() + fields["unbind"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["switching_profile_id"] = "SwitchingProfileId" + fieldNameMap["unbind"] = "Unbind" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func switchingProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func switchingProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["switching_profile_id"] = bindings.NewStringType() + fields["unbind"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["switching_profile_id"] = "SwitchingProfileId" + fieldNameMap["unbind"] = "Unbind" + paramsTypeMap["switching_profile_id"] = bindings.NewStringType() + paramsTypeMap["unbind"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["switchingProfileId"] = bindings.NewStringType() + pathParams["switching_profile_id"] = "switchingProfileId" + queryParams["unbind"] = "unbind" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/switching-profiles/{switchingProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func switchingProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["switching_profile_id"] = bindings.NewStringType() + fieldNameMap["switching_profile_id"] = "SwitchingProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func switchingProfilesGetOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseSwitchingProfileBindingType)}, bindings.REST) +} + +func switchingProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["switching_profile_id"] = bindings.NewStringType() + fieldNameMap["switching_profile_id"] = "SwitchingProfileId" + paramsTypeMap["switching_profile_id"] = bindings.NewStringType() + paramsTypeMap["switchingProfileId"] = bindings.NewStringType() + pathParams["switching_profile_id"] = "switchingProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/switching-profiles/{switchingProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func switchingProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["switching_profile_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_system_owned"] = "IncludeSystemOwned" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["switching_profile_type"] = "SwitchingProfileType" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func switchingProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SwitchingProfilesListResultBindingType) +} + +func switchingProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["switching_profile_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_system_owned"] = "IncludeSystemOwned" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["switching_profile_type"] = "SwitchingProfileType" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["include_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["switching_profile_type"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["cursor"] = "cursor" + queryParams["include_system_owned"] = "include_system_owned" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["switching_profile_type"] = "switching_profile_type" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/switching-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func switchingProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["switching_profile_id"] = bindings.NewStringType() + fields["base_switching_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseSwitchingProfileBindingType)}, bindings.REST) + fieldNameMap["switching_profile_id"] = "SwitchingProfileId" + fieldNameMap["base_switching_profile"] = "BaseSwitchingProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func switchingProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseSwitchingProfileBindingType)}, bindings.REST) +} + +func switchingProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["switching_profile_id"] = bindings.NewStringType() + fields["base_switching_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseSwitchingProfileBindingType)}, bindings.REST) + fieldNameMap["switching_profile_id"] = "SwitchingProfileId" + fieldNameMap["base_switching_profile"] = "BaseSwitchingProfile" + paramsTypeMap["switching_profile_id"] = bindings.NewStringType() + paramsTypeMap["base_switching_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseSwitchingProfileBindingType)}, bindings.REST) + paramsTypeMap["switchingProfileId"] = bindings.NewStringType() + pathParams["switching_profile_id"] = "switchingProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "base_switching_profile", + "PUT", + "/api/v1/switching-profiles/{switchingProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/TasksClient.go b/services/nsxt-mp/nsx/TasksClient.go new file mode 100644 index 000000000..ac26859ca --- /dev/null +++ b/services/nsxt-mp/nsx/TasksClient.go @@ -0,0 +1,147 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Tasks +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type TasksClient interface { + + // Get information about the specified task + // + // @param taskIdParam ID of task to read (required) + // @return com.vmware.nsx.model.TaskProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(taskIdParam string) (model.TaskProperties, error) + + // Get information about all tasks + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param requestUriParam Request URI(s) to include in query result (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param statusParam Status(es) to include in query result (optional) + // @param userParam Names of users to include in query result (optional) + // @return com.vmware.nsx.model.TaskListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, requestUriParam *string, sortAscendingParam *bool, sortByParam *string, statusParam *string, userParam *string) (model.TaskListResult, error) +} + +type tasksClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewTasksClient(connector client.Connector) *tasksClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.tasks") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + tIface := tasksClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &tIface +} + +func (tIface *tasksClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := tIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (tIface *tasksClient) Get(taskIdParam string) (model.TaskProperties, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(tasksGetInputType(), typeConverter) + sv.AddStructField("TaskId", taskIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TaskProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tasksGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.tasks", "get", inputDataValue, executionContext) + var emptyOutput model.TaskProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), tasksGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TaskProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *tasksClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, requestUriParam *string, sortAscendingParam *bool, sortByParam *string, statusParam *string, userParam *string) (model.TaskListResult, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(tasksListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("RequestUri", requestUriParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Status", statusParam) + sv.AddStructField("User", userParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TaskListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tasksListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.tasks", "list", inputDataValue, executionContext) + var emptyOutput model.TaskListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), tasksListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TaskListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/TasksTypes.go b/services/nsxt-mp/nsx/TasksTypes.go new file mode 100644 index 000000000..c3e5db60d --- /dev/null +++ b/services/nsxt-mp/nsx/TasksTypes.go @@ -0,0 +1,160 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Tasks. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func tasksGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["task_id"] = bindings.NewStringType() + fieldNameMap["task_id"] = "TaskId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tasksGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TaskPropertiesBindingType) +} + +func tasksGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["task_id"] = bindings.NewStringType() + fieldNameMap["task_id"] = "TaskId" + paramsTypeMap["task_id"] = bindings.NewStringType() + paramsTypeMap["taskId"] = bindings.NewStringType() + pathParams["task_id"] = "taskId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/tasks/{taskId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func tasksListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["request_uri"] = "RequestUri" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["status"] = "Status" + fieldNameMap["user"] = "User" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tasksListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TaskListResultBindingType) +} + +func tasksListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["request_uri"] = "RequestUri" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["status"] = "Status" + fieldNameMap["user"] = "User" + paramsTypeMap["request_uri"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["user"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["status"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["user"] = "user" + queryParams["request_uri"] = "request_uri" + queryParams["page_size"] = "page_size" + queryParams["status"] = "status" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/tasks", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/TraceflowsClient.go b/services/nsxt-mp/nsx/TraceflowsClient.go new file mode 100644 index 000000000..212035be5 --- /dev/null +++ b/services/nsxt-mp/nsx/TraceflowsClient.go @@ -0,0 +1,222 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Traceflows +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type TraceflowsClient interface { + + // Initiate a Traceflow Operation on the Specified Port + // + // @param traceflowRequestParam (required) + // @return com.vmware.nsx.model.Traceflow + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(traceflowRequestParam model.TraceflowRequest) (model.Traceflow, error) + + // Delete the Traceflow round + // + // @param traceflowIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(traceflowIdParam string) error + + // Get the Traceflow round status and result summary + // + // @param traceflowIdParam (required) + // @return com.vmware.nsx.model.Traceflow + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(traceflowIdParam string) (model.Traceflow, error) + + // List all Traceflow rounds; if a logical port id is given as a query parameter, only those originated from the logical port are returned. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param lportIdParam id of the source logical port where the trace flows originated (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.TraceflowListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, lportIdParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.TraceflowListResult, error) +} + +type traceflowsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewTraceflowsClient(connector client.Connector) *traceflowsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.traceflows") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + tIface := traceflowsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &tIface +} + +func (tIface *traceflowsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := tIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (tIface *traceflowsClient) Create(traceflowRequestParam model.TraceflowRequest) (model.Traceflow, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(traceflowsCreateInputType(), typeConverter) + sv.AddStructField("TraceflowRequest", traceflowRequestParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Traceflow + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := traceflowsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.traceflows", "create", inputDataValue, executionContext) + var emptyOutput model.Traceflow + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), traceflowsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Traceflow), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *traceflowsClient) Delete(traceflowIdParam string) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(traceflowsDeleteInputType(), typeConverter) + sv.AddStructField("TraceflowId", traceflowIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := traceflowsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.traceflows", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *traceflowsClient) Get(traceflowIdParam string) (model.Traceflow, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(traceflowsGetInputType(), typeConverter) + sv.AddStructField("TraceflowId", traceflowIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Traceflow + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := traceflowsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.traceflows", "get", inputDataValue, executionContext) + var emptyOutput model.Traceflow + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), traceflowsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Traceflow), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *traceflowsClient) List(cursorParam *string, includedFieldsParam *string, lportIdParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.TraceflowListResult, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(traceflowsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("LportId", lportIdParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TraceflowListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := traceflowsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.traceflows", "list", inputDataValue, executionContext) + var emptyOutput model.TraceflowListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), traceflowsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TraceflowListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/TraceflowsTypes.go b/services/nsxt-mp/nsx/TraceflowsTypes.go new file mode 100644 index 000000000..5eac221ba --- /dev/null +++ b/services/nsxt-mp/nsx/TraceflowsTypes.go @@ -0,0 +1,246 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Traceflows. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func traceflowsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["traceflow_request"] = bindings.NewReferenceType(model.TraceflowRequestBindingType) + fieldNameMap["traceflow_request"] = "TraceflowRequest" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func traceflowsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TraceflowBindingType) +} + +func traceflowsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["traceflow_request"] = bindings.NewReferenceType(model.TraceflowRequestBindingType) + fieldNameMap["traceflow_request"] = "TraceflowRequest" + paramsTypeMap["traceflow_request"] = bindings.NewReferenceType(model.TraceflowRequestBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "traceflow_request", + "POST", + "/api/v1/traceflows", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func traceflowsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["traceflow_id"] = bindings.NewStringType() + fieldNameMap["traceflow_id"] = "TraceflowId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func traceflowsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func traceflowsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["traceflow_id"] = bindings.NewStringType() + fieldNameMap["traceflow_id"] = "TraceflowId" + paramsTypeMap["traceflow_id"] = bindings.NewStringType() + paramsTypeMap["traceflowId"] = bindings.NewStringType() + pathParams["traceflow_id"] = "traceflowId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/traceflows/{traceflowId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func traceflowsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["traceflow_id"] = bindings.NewStringType() + fieldNameMap["traceflow_id"] = "TraceflowId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func traceflowsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TraceflowBindingType) +} + +func traceflowsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["traceflow_id"] = bindings.NewStringType() + fieldNameMap["traceflow_id"] = "TraceflowId" + paramsTypeMap["traceflow_id"] = bindings.NewStringType() + paramsTypeMap["traceflowId"] = bindings.NewStringType() + pathParams["traceflow_id"] = "traceflowId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/traceflows/{traceflowId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func traceflowsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["lport_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["lport_id"] = "LportId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func traceflowsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TraceflowListResultBindingType) +} + +func traceflowsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["lport_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["lport_id"] = "LportId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["lport_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["lport_id"] = "lport_id" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/traceflows", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/TransportNodeCollectionsClient.go b/services/nsxt-mp/nsx/TransportNodeCollectionsClient.go new file mode 100644 index 000000000..7b69d783b --- /dev/null +++ b/services/nsxt-mp/nsx/TransportNodeCollectionsClient.go @@ -0,0 +1,299 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: TransportNodeCollections +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type TransportNodeCollectionsClient interface { + + // When transport node collection is created the hosts which are part of compute collection will be prepared automatically i.e. NSX Manager attempts to install the NSX components on hosts. Transport nodes for these hosts are created using the configuration specified in transport node profile. + // + // @param transportNodeCollectionParam (required) + // @param applyProfileParam Indicates if the Transport Node Profile (TNP) configuration should be applied during creation (optional, default to true) + // @return com.vmware.nsx.model.TransportNodeCollection + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(transportNodeCollectionParam model.TransportNodeCollection, applyProfileParam *bool) (model.TransportNodeCollection, error) + + // By deleting transport node collection, we are detaching the transport node profile(TNP) from the compute collection. It has no effect on existing transport nodes. However, new hosts added to the compute collection will no longer be automatically converted to NSX transport node. Detaching TNP from compute collection does not delete TNP. + // + // @param transportNodeCollectionIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(transportNodeCollectionIdParam string) error + + // Returns transport node collection by id + // + // @param transportNodeCollectionIdParam (required) + // @return com.vmware.nsx.model.TransportNodeCollection + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(transportNodeCollectionIdParam string) (model.TransportNodeCollection, error) + + // Returns all Transport Node collections + // + // @param clusterMoidParam Managed object ID of cluster in VC (optional) + // @param computeCollectionIdParam Compute collection id (optional) + // @param vcInstanceUuidParam UUID for VC deployment (optional) + // @return com.vmware.nsx.model.TransportNodeCollectionListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(clusterMoidParam *string, computeCollectionIdParam *string, vcInstanceUuidParam *string) (model.TransportNodeCollectionListResult, error) + + // This API is relevant for compute collection on which vLCM is enabled. This API shpuld be invoked to retry the realization of transport node profile on the compute collection. This is useful when profile realization had failed because of error in vLCM. This API has no effect if vLCM is not enabled on the computer collection. + // + // @param transportNodeCollectionIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Retryprofilerealization(transportNodeCollectionIdParam string) error + + // Attach different transport node profile to compute collection by updating transport node collection. + // + // @param transportNodeCollectionIdParam (required) + // @param transportNodeCollectionParam (required) + // @return com.vmware.nsx.model.TransportNodeCollection + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(transportNodeCollectionIdParam string, transportNodeCollectionParam model.TransportNodeCollection) (model.TransportNodeCollection, error) +} + +type transportNodeCollectionsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewTransportNodeCollectionsClient(connector client.Connector) *transportNodeCollectionsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_node_collections") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "retryprofilerealization": core.NewMethodIdentifier(interfaceIdentifier, "retryprofilerealization"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + tIface := transportNodeCollectionsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &tIface +} + +func (tIface *transportNodeCollectionsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := tIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (tIface *transportNodeCollectionsClient) Create(transportNodeCollectionParam model.TransportNodeCollection, applyProfileParam *bool) (model.TransportNodeCollection, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodeCollectionsCreateInputType(), typeConverter) + sv.AddStructField("TransportNodeCollection", transportNodeCollectionParam) + sv.AddStructField("ApplyProfile", applyProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportNodeCollection + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodeCollectionsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_node_collections", "create", inputDataValue, executionContext) + var emptyOutput model.TransportNodeCollection + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportNodeCollectionsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportNodeCollection), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *transportNodeCollectionsClient) Delete(transportNodeCollectionIdParam string) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodeCollectionsDeleteInputType(), typeConverter) + sv.AddStructField("TransportNodeCollectionId", transportNodeCollectionIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodeCollectionsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_node_collections", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *transportNodeCollectionsClient) Get(transportNodeCollectionIdParam string) (model.TransportNodeCollection, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodeCollectionsGetInputType(), typeConverter) + sv.AddStructField("TransportNodeCollectionId", transportNodeCollectionIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportNodeCollection + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodeCollectionsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_node_collections", "get", inputDataValue, executionContext) + var emptyOutput model.TransportNodeCollection + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportNodeCollectionsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportNodeCollection), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *transportNodeCollectionsClient) List(clusterMoidParam *string, computeCollectionIdParam *string, vcInstanceUuidParam *string) (model.TransportNodeCollectionListResult, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodeCollectionsListInputType(), typeConverter) + sv.AddStructField("ClusterMoid", clusterMoidParam) + sv.AddStructField("ComputeCollectionId", computeCollectionIdParam) + sv.AddStructField("VcInstanceUuid", vcInstanceUuidParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportNodeCollectionListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodeCollectionsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_node_collections", "list", inputDataValue, executionContext) + var emptyOutput model.TransportNodeCollectionListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportNodeCollectionsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportNodeCollectionListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *transportNodeCollectionsClient) Retryprofilerealization(transportNodeCollectionIdParam string) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodeCollectionsRetryprofilerealizationInputType(), typeConverter) + sv.AddStructField("TransportNodeCollectionId", transportNodeCollectionIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodeCollectionsRetryprofilerealizationRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_node_collections", "retryprofilerealization", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *transportNodeCollectionsClient) Update(transportNodeCollectionIdParam string, transportNodeCollectionParam model.TransportNodeCollection) (model.TransportNodeCollection, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodeCollectionsUpdateInputType(), typeConverter) + sv.AddStructField("TransportNodeCollectionId", transportNodeCollectionIdParam) + sv.AddStructField("TransportNodeCollection", transportNodeCollectionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportNodeCollection + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodeCollectionsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_node_collections", "update", inputDataValue, executionContext) + var emptyOutput model.TransportNodeCollection + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportNodeCollectionsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportNodeCollection), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/TransportNodeCollectionsTypes.go b/services/nsxt-mp/nsx/TransportNodeCollectionsTypes.go new file mode 100644 index 000000000..5f8b19e85 --- /dev/null +++ b/services/nsxt-mp/nsx/TransportNodeCollectionsTypes.go @@ -0,0 +1,339 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: TransportNodeCollections. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func transportNodeCollectionsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_collection"] = bindings.NewReferenceType(model.TransportNodeCollectionBindingType) + fields["apply_profile"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["transport_node_collection"] = "TransportNodeCollection" + fieldNameMap["apply_profile"] = "ApplyProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodeCollectionsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportNodeCollectionBindingType) +} + +func transportNodeCollectionsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_collection"] = bindings.NewReferenceType(model.TransportNodeCollectionBindingType) + fields["apply_profile"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["transport_node_collection"] = "TransportNodeCollection" + fieldNameMap["apply_profile"] = "ApplyProfile" + paramsTypeMap["apply_profile"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["transport_node_collection"] = bindings.NewReferenceType(model.TransportNodeCollectionBindingType) + queryParams["apply_profile"] = "apply_profile" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "transport_node_collection", + "POST", + "/api/v1/transport-node-collections", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodeCollectionsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_collection_id"] = bindings.NewStringType() + fieldNameMap["transport_node_collection_id"] = "TransportNodeCollectionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodeCollectionsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func transportNodeCollectionsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_collection_id"] = bindings.NewStringType() + fieldNameMap["transport_node_collection_id"] = "TransportNodeCollectionId" + paramsTypeMap["transport_node_collection_id"] = bindings.NewStringType() + paramsTypeMap["transportNodeCollectionId"] = bindings.NewStringType() + pathParams["transport_node_collection_id"] = "transportNodeCollectionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/transport-node-collections/{transportNodeCollectionId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodeCollectionsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_collection_id"] = bindings.NewStringType() + fieldNameMap["transport_node_collection_id"] = "TransportNodeCollectionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodeCollectionsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportNodeCollectionBindingType) +} + +func transportNodeCollectionsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_collection_id"] = bindings.NewStringType() + fieldNameMap["transport_node_collection_id"] = "TransportNodeCollectionId" + paramsTypeMap["transport_node_collection_id"] = bindings.NewStringType() + paramsTypeMap["transportNodeCollectionId"] = bindings.NewStringType() + pathParams["transport_node_collection_id"] = "transportNodeCollectionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-node-collections/{transportNodeCollectionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodeCollectionsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cluster_moid"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["compute_collection_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["vc_instance_uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cluster_moid"] = "ClusterMoid" + fieldNameMap["compute_collection_id"] = "ComputeCollectionId" + fieldNameMap["vc_instance_uuid"] = "VcInstanceUuid" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodeCollectionsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportNodeCollectionListResultBindingType) +} + +func transportNodeCollectionsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cluster_moid"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["compute_collection_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["vc_instance_uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cluster_moid"] = "ClusterMoid" + fieldNameMap["compute_collection_id"] = "ComputeCollectionId" + fieldNameMap["vc_instance_uuid"] = "VcInstanceUuid" + paramsTypeMap["compute_collection_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["vc_instance_uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cluster_moid"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["cluster_moid"] = "cluster_moid" + queryParams["compute_collection_id"] = "compute_collection_id" + queryParams["vc_instance_uuid"] = "vc_instance_uuid" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-node-collections", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodeCollectionsRetryprofilerealizationInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_collection_id"] = bindings.NewStringType() + fieldNameMap["transport_node_collection_id"] = "TransportNodeCollectionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodeCollectionsRetryprofilerealizationOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func transportNodeCollectionsRetryprofilerealizationRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_collection_id"] = bindings.NewStringType() + fieldNameMap["transport_node_collection_id"] = "TransportNodeCollectionId" + paramsTypeMap["transport_node_collection_id"] = bindings.NewStringType() + paramsTypeMap["transportNodeCollectionId"] = bindings.NewStringType() + pathParams["transport_node_collection_id"] = "transportNodeCollectionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=retry_profile_realization", + "", + "POST", + "/api/v1/transport-node-collections/{transportNodeCollectionId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodeCollectionsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_collection_id"] = bindings.NewStringType() + fields["transport_node_collection"] = bindings.NewReferenceType(model.TransportNodeCollectionBindingType) + fieldNameMap["transport_node_collection_id"] = "TransportNodeCollectionId" + fieldNameMap["transport_node_collection"] = "TransportNodeCollection" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodeCollectionsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportNodeCollectionBindingType) +} + +func transportNodeCollectionsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_collection_id"] = bindings.NewStringType() + fields["transport_node_collection"] = bindings.NewReferenceType(model.TransportNodeCollectionBindingType) + fieldNameMap["transport_node_collection_id"] = "TransportNodeCollectionId" + fieldNameMap["transport_node_collection"] = "TransportNodeCollection" + paramsTypeMap["transport_node_collection_id"] = bindings.NewStringType() + paramsTypeMap["transport_node_collection"] = bindings.NewReferenceType(model.TransportNodeCollectionBindingType) + paramsTypeMap["transportNodeCollectionId"] = bindings.NewStringType() + pathParams["transport_node_collection_id"] = "transportNodeCollectionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "transport_node_collection", + "PUT", + "/api/v1/transport-node-collections/{transportNodeCollectionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/TransportNodeProfilesClient.go b/services/nsxt-mp/nsx/TransportNodeProfilesClient.go new file mode 100644 index 000000000..381f54606 --- /dev/null +++ b/services/nsxt-mp/nsx/TransportNodeProfilesClient.go @@ -0,0 +1,277 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: TransportNodeProfiles +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type TransportNodeProfilesClient interface { + + // Transport node profile captures the configuration needed to create a transport node. A transport node profile can be attached to compute collections for automatic TN creation of member hosts. This api is now deprecated. Please use new api - /policy/api/v1/infra/host-transport-node-profiles/ + // + // @param transportNodeProfileParam (required) + // @return com.vmware.nsx.model.TransportNodeProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(transportNodeProfileParam model.TransportNodeProfile) (model.TransportNodeProfile, error) + + // Deletes the specified transport node profile. A transport node profile can be deleted only when it is not attached to any compute collection. This api is now deprecated. Please use new api - /policy/api/v1/infra/host-transport-node-profiles/ + // + // @param transportNodeProfileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(transportNodeProfileIdParam string) error + + // Returns information about a specified transport node profile. This api is now deprecated. Please use new api - /policy/api/v1/infra/host-transport-node-profiles/ + // + // @param transportNodeProfileIdParam (required) + // @return com.vmware.nsx.model.TransportNodeProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(transportNodeProfileIdParam string) (model.TransportNodeProfile, error) + + // Returns information about all transport node profiles. This api is now deprecated. Please use new api - /policy/api/v1/infra/host-transport-node-profiles + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.TransportNodeProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.TransportNodeProfileListResult, error) + + // When configurations of a transport node profile(TNP) is updated, all the transport nodes in all the compute collections to which this TNP is attached are updated to reflect the updated configuration. This api is now deprecated. Please use new api - /policy/api/v1/infra/host-transport-node-profiles/ + // + // @param transportNodeProfileIdParam (required) + // @param transportNodeProfileParam (required) + // @param esxMgmtIfMigrationDestParam The network ids to which the ESX vmk interfaces will be migrated (optional) + // @param ifIdParam The ESX vmk interfaces to migrate (optional) + // @param pingIpParam IP Addresses to ping right after ESX vmk interfaces were migrated. (optional) + // @param skipValidationParam Whether to skip front-end validation for vmk/vnic/pnic migration (optional, default to false) + // @param vnicParam The ESX vmk interfaces and/or VM NIC to migrate (optional) + // @param vnicMigrationDestParam The migration destinations of ESX vmk interfaces and/or VM NIC (optional) + // @return com.vmware.nsx.model.TransportNodeProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(transportNodeProfileIdParam string, transportNodeProfileParam model.TransportNodeProfile, esxMgmtIfMigrationDestParam *string, ifIdParam *string, pingIpParam *string, skipValidationParam *bool, vnicParam *string, vnicMigrationDestParam *string) (model.TransportNodeProfile, error) +} + +type transportNodeProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewTransportNodeProfilesClient(connector client.Connector) *transportNodeProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_node_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + tIface := transportNodeProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &tIface +} + +func (tIface *transportNodeProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := tIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (tIface *transportNodeProfilesClient) Create(transportNodeProfileParam model.TransportNodeProfile) (model.TransportNodeProfile, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodeProfilesCreateInputType(), typeConverter) + sv.AddStructField("TransportNodeProfile", transportNodeProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportNodeProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodeProfilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_node_profiles", "create", inputDataValue, executionContext) + var emptyOutput model.TransportNodeProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportNodeProfilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportNodeProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *transportNodeProfilesClient) Delete(transportNodeProfileIdParam string) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodeProfilesDeleteInputType(), typeConverter) + sv.AddStructField("TransportNodeProfileId", transportNodeProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodeProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_node_profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *transportNodeProfilesClient) Get(transportNodeProfileIdParam string) (model.TransportNodeProfile, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodeProfilesGetInputType(), typeConverter) + sv.AddStructField("TransportNodeProfileId", transportNodeProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportNodeProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodeProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_node_profiles", "get", inputDataValue, executionContext) + var emptyOutput model.TransportNodeProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportNodeProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportNodeProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *transportNodeProfilesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.TransportNodeProfileListResult, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodeProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportNodeProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodeProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_node_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.TransportNodeProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportNodeProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportNodeProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *transportNodeProfilesClient) Update(transportNodeProfileIdParam string, transportNodeProfileParam model.TransportNodeProfile, esxMgmtIfMigrationDestParam *string, ifIdParam *string, pingIpParam *string, skipValidationParam *bool, vnicParam *string, vnicMigrationDestParam *string) (model.TransportNodeProfile, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodeProfilesUpdateInputType(), typeConverter) + sv.AddStructField("TransportNodeProfileId", transportNodeProfileIdParam) + sv.AddStructField("TransportNodeProfile", transportNodeProfileParam) + sv.AddStructField("EsxMgmtIfMigrationDest", esxMgmtIfMigrationDestParam) + sv.AddStructField("IfId", ifIdParam) + sv.AddStructField("PingIp", pingIpParam) + sv.AddStructField("SkipValidation", skipValidationParam) + sv.AddStructField("Vnic", vnicParam) + sv.AddStructField("VnicMigrationDest", vnicMigrationDestParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportNodeProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodeProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_node_profiles", "update", inputDataValue, executionContext) + var emptyOutput model.TransportNodeProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportNodeProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportNodeProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/TransportNodeProfilesTypes.go b/services/nsxt-mp/nsx/TransportNodeProfilesTypes.go new file mode 100644 index 000000000..4d3afd4f6 --- /dev/null +++ b/services/nsxt-mp/nsx/TransportNodeProfilesTypes.go @@ -0,0 +1,331 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: TransportNodeProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func transportNodeProfilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_profile"] = bindings.NewReferenceType(model.TransportNodeProfileBindingType) + fieldNameMap["transport_node_profile"] = "TransportNodeProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodeProfilesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportNodeProfileBindingType) +} + +func transportNodeProfilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_profile"] = bindings.NewReferenceType(model.TransportNodeProfileBindingType) + fieldNameMap["transport_node_profile"] = "TransportNodeProfile" + paramsTypeMap["transport_node_profile"] = bindings.NewReferenceType(model.TransportNodeProfileBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "transport_node_profile", + "POST", + "/api/v1/transport-node-profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodeProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_profile_id"] = bindings.NewStringType() + fieldNameMap["transport_node_profile_id"] = "TransportNodeProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodeProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func transportNodeProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_profile_id"] = bindings.NewStringType() + fieldNameMap["transport_node_profile_id"] = "TransportNodeProfileId" + paramsTypeMap["transport_node_profile_id"] = bindings.NewStringType() + paramsTypeMap["transportNodeProfileId"] = bindings.NewStringType() + pathParams["transport_node_profile_id"] = "transportNodeProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/transport-node-profiles/{transportNodeProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodeProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_profile_id"] = bindings.NewStringType() + fieldNameMap["transport_node_profile_id"] = "TransportNodeProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodeProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportNodeProfileBindingType) +} + +func transportNodeProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_profile_id"] = bindings.NewStringType() + fieldNameMap["transport_node_profile_id"] = "TransportNodeProfileId" + paramsTypeMap["transport_node_profile_id"] = bindings.NewStringType() + paramsTypeMap["transportNodeProfileId"] = bindings.NewStringType() + pathParams["transport_node_profile_id"] = "transportNodeProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-node-profiles/{transportNodeProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodeProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodeProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportNodeProfileListResultBindingType) +} + +func transportNodeProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-node-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodeProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_profile_id"] = bindings.NewStringType() + fields["transport_node_profile"] = bindings.NewReferenceType(model.TransportNodeProfileBindingType) + fields["esx_mgmt_if_migration_dest"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["if_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["ping_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["skip_validation"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["vnic"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["vnic_migration_dest"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_profile_id"] = "TransportNodeProfileId" + fieldNameMap["transport_node_profile"] = "TransportNodeProfile" + fieldNameMap["esx_mgmt_if_migration_dest"] = "EsxMgmtIfMigrationDest" + fieldNameMap["if_id"] = "IfId" + fieldNameMap["ping_ip"] = "PingIp" + fieldNameMap["skip_validation"] = "SkipValidation" + fieldNameMap["vnic"] = "Vnic" + fieldNameMap["vnic_migration_dest"] = "VnicMigrationDest" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodeProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportNodeProfileBindingType) +} + +func transportNodeProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_profile_id"] = bindings.NewStringType() + fields["transport_node_profile"] = bindings.NewReferenceType(model.TransportNodeProfileBindingType) + fields["esx_mgmt_if_migration_dest"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["if_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["ping_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["skip_validation"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["vnic"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["vnic_migration_dest"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_profile_id"] = "TransportNodeProfileId" + fieldNameMap["transport_node_profile"] = "TransportNodeProfile" + fieldNameMap["esx_mgmt_if_migration_dest"] = "EsxMgmtIfMigrationDest" + fieldNameMap["if_id"] = "IfId" + fieldNameMap["ping_ip"] = "PingIp" + fieldNameMap["skip_validation"] = "SkipValidation" + fieldNameMap["vnic"] = "Vnic" + fieldNameMap["vnic_migration_dest"] = "VnicMigrationDest" + paramsTypeMap["transport_node_profile"] = bindings.NewReferenceType(model.TransportNodeProfileBindingType) + paramsTypeMap["vnic"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["skip_validation"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["if_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["esx_mgmt_if_migration_dest"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["ping_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["vnic_migration_dest"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["transport_node_profile_id"] = bindings.NewStringType() + paramsTypeMap["transportNodeProfileId"] = bindings.NewStringType() + pathParams["transport_node_profile_id"] = "transportNodeProfileId" + queryParams["ping_ip"] = "ping_ip" + queryParams["vnic"] = "vnic" + queryParams["skip_validation"] = "skip_validation" + queryParams["esx_mgmt_if_migration_dest"] = "esx_mgmt_if_migration_dest" + queryParams["if_id"] = "if_id" + queryParams["vnic_migration_dest"] = "vnic_migration_dest" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "transport_node_profile", + "PUT", + "/api/v1/transport-node-profiles/{transportNodeProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/TransportNodesClient.go b/services/nsxt-mp/nsx/TransportNodesClient.go new file mode 100644 index 000000000..3ff8a31af --- /dev/null +++ b/services/nsxt-mp/nsx/TransportNodesClient.go @@ -0,0 +1,819 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: TransportNodes +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type TransportNodesClient interface { + + // Edge transport node maintains its entry in many internal tables. In some cases a few of these entries might not get cleaned up during edge transport node deletion. This api cleans up any stale entries that may exist in the internal tables that store the Edge Transport Node data. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Cleanstaleentries() error + + // Transport nodes are hypervisor hosts and NSX Edges that will participate in an NSX-T overlay. For a hypervisor host, this means that it hosts VMs that will communicate over NSX-T logical switches. For NSX Edges, this means that it will have logical router uplinks and downlinks. This API creates transport node for a host node (hypervisor) or edge node (router) in the transport network. When you run this command for a host, NSX Manager attempts to install the NSX kernel modules, which are packaged as VIB, RPM, or DEB files. For the installation to succeed, you must provide the host login credentials and the host thumbprint. To get the ESXi host thumbprint, SSH to the host and run the **openssl x509 -in /etc/vmware/ssl/rui.crt -fingerprint -sha256 -noout** command. To generate host key thumbprint using SHA-256 algorithm please follow the steps below. Log into the host, making sure that the connection is not vulnerable to a man in the middle attack. Check whether a public key already exists. Host public key is generally located at '/etc/ssh/ssh_host_rsa_key.pub'. If the key is not present then generate a new key by running the following command and follow the instructions. **ssh-keygen -t rsa** Now generate a SHA256 hash of the key using the following command. Please make sure to pass the appropriate file name if the public key is stored with a different file name other than the default 'id_rsa.pub'. **awk '{print $2}' id_rsa.pub | base64 -d | sha256sum -b | sed 's/ .\*$//' | xxd -r -p | base64** This api is deprecated as part of FN+TN unification. Please use Transport Node API to install NSX components on a node. Additional documentation on creating a transport node can be found in the NSX-T Installation Guide. In order for the transport node to forward packets, the host_switch_spec property must be specified. Host switches (called bridges in OVS on KVM hypervisors) are the individual switches within the host virtual switch. Virtual machines are connected to the host switches. When creating a transport node, you need to specify if the host switches are already manually preconfigured on the node, or if NSX should create and manage the host switches. You specify this choice by the type of host switches you pass in the host_switch_spec property of the TransportNode request payload. For a KVM host, you can preconfigure the host switch, or you can have NSX Manager perform the configuration. For an ESXi host or NSX Edge node, NSX Manager always configures the host switch. To preconfigure the host switches on a KVM host, pass an array of PreconfiguredHostSwitchSpec objects that describes those host switches. In the current NSX-T release, only one prefonfigured host switch can be specified. See the PreconfiguredHostSwitchSpec schema definition for documentation on the properties that must be provided. Preconfigured host switches are only supported on KVM hosts, not on ESXi hosts or NSX Edge nodes. To allow NSX to manage the host switch configuration on KVM hosts, ESXi hosts, or NSX Edge nodes, pass an array of StandardHostSwitchSpec objects in the host_switch_spec property, and NSX will automatically create host switches with the properties you provide. In the current NSX-T release, up to 16 host switches can be automatically managed. See the StandardHostSwitchSpec schema definition for documentation on the properties that must be provided. Note: Previous versions of NSX-T also used a property named transport_zone_endpoints at TransportNode level. This property is deprecated which creates some combinations of new client along with old client payloads. Examples [1] & [2] show old/existing client request and response by populating transport_zone_endpoints property at TransportNode level. Example [3] shows TransportNode creation request/response by populating transport_zone_endpoints property at StandardHostSwitch level and other new properties. The request should either provide node_deployement_info or node_id. If the host node (hypervisor) or edge node (router) is already added in system then it can be converted to transport node by providing node_id in request. If host node (hypervisor) or edge node (router) is not already present in system then information should be provided under node_deployment_info. This api is now deprecated. Please use new api - /infra/sites//enforcement-points//host-transport-nodes/ + // + // @param transportNodeParam (required) + // @return com.vmware.nsx.model.TransportNode + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(transportNodeParam model.TransportNode) (model.TransportNode, error) + + // Deletes the specified transport node. Query param force can be used to force delete the host nodes. Force deletion of edge and public cloud gateway nodes is not supported. It also removes the specified node (host or edge) from system. If unprepare_host option is set to false, then host will be deleted without uninstalling the NSX components from the host. This api is now deprecated. Please use new api - /infra/sites//enforcement-points//host-transport-nodes/ + // + // @param transportNodeIdParam (required) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @param unprepareHostParam Uninstall NSX components from host while deleting (optional, default to true) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(transportNodeIdParam string, forceParam *bool, unprepareHostParam *bool) error + + // Invoke DELETE request on target transport node + // + // @param targetNodeIdParam Target node UUID (required) + // @param targetUriParam URI of API to invoke on target node (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws TimedOut Gateway Timeout + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Deleteontransportnode(targetNodeIdParam string, targetUriParam string) error + + // Disable flow cache for edge transport node. Caution: This involves restart of the edge dataplane and hence may lead to network disruption. + // + // @param transportNodeIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Disableflowcache(transportNodeIdParam string) error + + // Enable flow cache for edge transport node. Caution: This involves restart of the edge dataplane and hence may lead to network disruption. + // + // @param transportNodeIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Enableflowcache(transportNodeIdParam string) error + + // Returns information about a specified transport node. This api is now deprecated. Please use new api - /infra/sites//enforcement-points//host-transport-nodes/ + // + // @param transportNodeIdParam (required) + // @return com.vmware.nsx.model.TransportNode + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(transportNodeIdParam string) (model.TransportNode, error) + + // Invoke GET request on target transport node + // + // @param targetNodeIdParam Target node UUID (required) + // @param targetUriParam URI of API to invoke on target node (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws TimedOut Gateway Timeout + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Getontransportnode(targetNodeIdParam string, targetUriParam string) error + + // Returns information about all transport nodes along with underlying host or edge details. A transport node is a host or edge that contains hostswitches. A hostswitch can have virtual machines connected to them. Because each transport node has hostswitches, transport nodes can also have virtual tunnel endpoints, which means that they can be part of the overlay. This api is now deprecated. Please use new api - /infra/sites//enforcement-points//host-transport-nodes + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param inMaintenanceModeParam maintenance mode flag (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param nodeIdParam node identifier (optional) + // @param nodeIpParam Fabric node IP address (optional) + // @param nodeTypesParam a list of fabric node types separated by comma or a single type (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param transportZoneIdParam Transport zone identifier (optional) + // @return com.vmware.nsx.model.TransportNodeListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, inMaintenanceModeParam *bool, includedFieldsParam *string, nodeIdParam *string, nodeIpParam *string, nodeTypesParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, transportZoneIdParam *string) (model.TransportNodeListResult, error) + + // Migrates all NVDS to VDS on given TransportNode. Upgrade precheck apis should have been run prior to invoking this API on transport node and a migration topology should be created. Please refer to Migration guide for details about migration APIs. This api is now deprecated. Please use new api - /infra/sites//enforcement-points//host-transport-nodes/?action=migrate_to_vds + // + // @param transportNodeIdParam (required) + // @param skipMaintmodeParam Skip Maintenance mode check (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Migratetovds(transportNodeIdParam string, skipMaintmodeParam *bool) error + + // Invoke POST request on target transport node + // + // @param targetNodeIdParam Target node UUID (required) + // @param targetUriParam URI of API to invoke on target node (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws TimedOut Gateway Timeout + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Postontransportnode(targetNodeIdParam string, targetUriParam string) error + + // Invoke PUT request on target transport node + // + // @param targetNodeIdParam Target node UUID (required) + // @param targetUriParam URI of API to invoke on target node (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws TimedOut Gateway Timeout + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Putontransportnode(targetNodeIdParam string, targetUriParam string) error + + // Redeploys an edge node at NSX Manager that replaces the edge node with identifier . If NSX Manager can access the specified edge node, then the node is put into maintenance mode and then the associated VM is deleted. This is a means to reset all configuration on the edge node. The communication channel between NSX Manager and edge is established after this operation. + // + // @param nodeIdParam (required) + // @param transportNodeParam (required) + // @return com.vmware.nsx.model.TransportNode + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Redeploy(nodeIdParam string, transportNodeParam model.TransportNode) (model.TransportNode, error) + + // The API is applicable for Edge transport nodes. If you update the edge configuration and find a discrepancy in Edge configuration at NSX Manager in compare with realized, then use this API to refresh configuration at NSX Manager. It refreshes the Edge configuration from sources external to NSX Manager like vSphere Server or the Edge node CLI. After this action, Edge configuration at NSX Manager is updated and the API GET api/v1/transport-nodes will show refreshed data. From 3.2 release onwards, refresh API updates the MP intent by default. + // + // @param transportNodeIdParam (required) + // @param readOnlyParam Read-only flag for Refresh API (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Refreshnodeconfiguration(transportNodeIdParam string, readOnlyParam *bool) error + + // Restart the inventory sync for the node if it is currently internally paused. After this action the next inventory sync coming from the node is processed. + // + // @param transportNodeIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restartinventorysync(transportNodeIdParam string) error + + // A host can be overridden to have different configuration than Transport Node Profile(TNP) on cluster. This action will restore such overridden host back to cluster level TNP. This API can be used in other case. When TNP is applied to a cluster, if any validation fails (e.g. VMs running on host) then existing transport node (TN) is not updated. In that case after the issue is resolved manually (e.g. VMs powered off), you can call this API to update TN as per cluster level TNP. This api is now deprecated. Please use new api - /infra/sites//enforcement-points//host-transport-nodes/?action=restore_cluster_config + // + // @param transportNodeIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restoreclusterconfig(transportNodeIdParam string) error + + // Resync the TransportNode configuration on a host. It is similar to updating the TransportNode with existing configuration, but force synce these configurations to the host (no backend optimizations). + // + // @param transportnodeIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Resynchostconfig(transportnodeIdParam string) error + + // Modifies the transport node information. The host_switch_name field must match the host_switch_name value specified in the transport zone (API: transport-zones). You must create the associated uplink profile (API: host-switch-profiles) before you can specify an uplink_name here. If the host is an ESX and has only one physical NIC being used by a vSphere standard switch, TransportNodeUpdateParameters should be used to migrate the management interface and the physical NIC into a logical switch that is in a transport zone this transport node will join or has already joined. If the migration is already done, TransportNodeUpdateParameters can also be used to migrate the management interface and the physical NIC back to a vSphere standard switch. In other cases, the TransportNodeUpdateParameters should NOT be used. When updating transport node you should follow pattern where you should fetch the existing transport node and then only modify the required properties keeping other properties as is. It also modifies attributes of node (host or edge). Note: Previous versions of NSX-T also used a property named transport_zone_endpoints at TransportNode level. This property is deprecated which creates some combinations of new client along with old client payloads. Examples [1] shows old/existing client request and response by populating transport_zone_endpoints property at TransportNode level. Example [2] shows TransportNode updating TransportNode from exmaple [1] request/response by adding a new StandardHostSwitch by populating transport_zone_endpoints at StandardHostSwitch level. TransportNode level transport_zone_endpoints will ONLY have TransportZoneEndpoints that were originally specified here during create/update operation and does not include TransportZoneEndpoints that were directly specified at StandardHostSwitch level. This api is now deprecated. Please use new api - /infra/sites//enforcement-points//host-transport-nodes/ + // + // @param transportNodeIdParam (required) + // @param transportNodeParam (required) + // @param esxMgmtIfMigrationDestParam The network ids to which the ESX vmk interfaces will be migrated (optional) + // @param ifIdParam The ESX vmk interfaces to migrate (optional) + // @param pingIpParam IP Addresses to ping right after ESX vmk interfaces were migrated. (optional) + // @param skipValidationParam Whether to skip front-end validation for vmk/vnic/pnic migration (optional, default to false) + // @param vnicParam The ESX vmk interfaces and/or VM NIC to migrate (optional) + // @param vnicMigrationDestParam The migration destinations of ESX vmk interfaces and/or VM NIC (optional) + // @return com.vmware.nsx.model.TransportNode + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(transportNodeIdParam string, transportNodeParam model.TransportNode, esxMgmtIfMigrationDestParam *string, ifIdParam *string, pingIpParam *string, skipValidationParam *bool, vnicParam *string, vnicMigrationDestParam *string) (model.TransportNode, error) + + // Put transport node into maintenance mode or exit from maintenance mode. + // + // @param transportnodeIdParam (required) + // @param actionParam (optional) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Updatemaintenancemode(transportnodeIdParam string, actionParam *string) error +} + +type transportNodesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewTransportNodesClient(connector client.Connector) *transportNodesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes") + methodIdentifiers := map[string]core.MethodIdentifier{ + "cleanstaleentries": core.NewMethodIdentifier(interfaceIdentifier, "cleanstaleentries"), + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "deleteontransportnode": core.NewMethodIdentifier(interfaceIdentifier, "deleteontransportnode"), + "disableflowcache": core.NewMethodIdentifier(interfaceIdentifier, "disableflowcache"), + "enableflowcache": core.NewMethodIdentifier(interfaceIdentifier, "enableflowcache"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "getontransportnode": core.NewMethodIdentifier(interfaceIdentifier, "getontransportnode"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "migratetovds": core.NewMethodIdentifier(interfaceIdentifier, "migratetovds"), + "postontransportnode": core.NewMethodIdentifier(interfaceIdentifier, "postontransportnode"), + "putontransportnode": core.NewMethodIdentifier(interfaceIdentifier, "putontransportnode"), + "redeploy": core.NewMethodIdentifier(interfaceIdentifier, "redeploy"), + "refreshnodeconfiguration": core.NewMethodIdentifier(interfaceIdentifier, "refreshnodeconfiguration"), + "restartinventorysync": core.NewMethodIdentifier(interfaceIdentifier, "restartinventorysync"), + "restoreclusterconfig": core.NewMethodIdentifier(interfaceIdentifier, "restoreclusterconfig"), + "resynchostconfig": core.NewMethodIdentifier(interfaceIdentifier, "resynchostconfig"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + "updatemaintenancemode": core.NewMethodIdentifier(interfaceIdentifier, "updatemaintenancemode"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + tIface := transportNodesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &tIface +} + +func (tIface *transportNodesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := tIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (tIface *transportNodesClient) Cleanstaleentries() error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodesCleanstaleentriesInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodesCleanstaleentriesRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes", "cleanstaleentries", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *transportNodesClient) Create(transportNodeParam model.TransportNode) (model.TransportNode, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodesCreateInputType(), typeConverter) + sv.AddStructField("TransportNode", transportNodeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportNode + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes", "create", inputDataValue, executionContext) + var emptyOutput model.TransportNode + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportNodesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportNode), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *transportNodesClient) Delete(transportNodeIdParam string, forceParam *bool, unprepareHostParam *bool) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodesDeleteInputType(), typeConverter) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + sv.AddStructField("Force", forceParam) + sv.AddStructField("UnprepareHost", unprepareHostParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *transportNodesClient) Deleteontransportnode(targetNodeIdParam string, targetUriParam string) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodesDeleteontransportnodeInputType(), typeConverter) + sv.AddStructField("TargetNodeId", targetNodeIdParam) + sv.AddStructField("TargetUri", targetUriParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodesDeleteontransportnodeRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes", "deleteontransportnode", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *transportNodesClient) Disableflowcache(transportNodeIdParam string) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodesDisableflowcacheInputType(), typeConverter) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodesDisableflowcacheRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes", "disableflowcache", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *transportNodesClient) Enableflowcache(transportNodeIdParam string) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodesEnableflowcacheInputType(), typeConverter) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodesEnableflowcacheRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes", "enableflowcache", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *transportNodesClient) Get(transportNodeIdParam string) (model.TransportNode, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodesGetInputType(), typeConverter) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportNode + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes", "get", inputDataValue, executionContext) + var emptyOutput model.TransportNode + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportNodesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportNode), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *transportNodesClient) Getontransportnode(targetNodeIdParam string, targetUriParam string) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodesGetontransportnodeInputType(), typeConverter) + sv.AddStructField("TargetNodeId", targetNodeIdParam) + sv.AddStructField("TargetUri", targetUriParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodesGetontransportnodeRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes", "getontransportnode", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *transportNodesClient) List(cursorParam *string, inMaintenanceModeParam *bool, includedFieldsParam *string, nodeIdParam *string, nodeIpParam *string, nodeTypesParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, transportZoneIdParam *string) (model.TransportNodeListResult, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("InMaintenanceMode", inMaintenanceModeParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("NodeIp", nodeIpParam) + sv.AddStructField("NodeTypes", nodeTypesParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("TransportZoneId", transportZoneIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportNodeListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes", "list", inputDataValue, executionContext) + var emptyOutput model.TransportNodeListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportNodesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportNodeListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *transportNodesClient) Migratetovds(transportNodeIdParam string, skipMaintmodeParam *bool) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodesMigratetovdsInputType(), typeConverter) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + sv.AddStructField("SkipMaintmode", skipMaintmodeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodesMigratetovdsRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes", "migratetovds", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *transportNodesClient) Postontransportnode(targetNodeIdParam string, targetUriParam string) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodesPostontransportnodeInputType(), typeConverter) + sv.AddStructField("TargetNodeId", targetNodeIdParam) + sv.AddStructField("TargetUri", targetUriParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodesPostontransportnodeRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes", "postontransportnode", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *transportNodesClient) Putontransportnode(targetNodeIdParam string, targetUriParam string) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodesPutontransportnodeInputType(), typeConverter) + sv.AddStructField("TargetNodeId", targetNodeIdParam) + sv.AddStructField("TargetUri", targetUriParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodesPutontransportnodeRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes", "putontransportnode", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *transportNodesClient) Redeploy(nodeIdParam string, transportNodeParam model.TransportNode) (model.TransportNode, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodesRedeployInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("TransportNode", transportNodeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportNode + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodesRedeployRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes", "redeploy", inputDataValue, executionContext) + var emptyOutput model.TransportNode + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportNodesRedeployOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportNode), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *transportNodesClient) Refreshnodeconfiguration(transportNodeIdParam string, readOnlyParam *bool) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodesRefreshnodeconfigurationInputType(), typeConverter) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + sv.AddStructField("ReadOnly", readOnlyParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodesRefreshnodeconfigurationRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes", "refreshnodeconfiguration", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *transportNodesClient) Restartinventorysync(transportNodeIdParam string) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodesRestartinventorysyncInputType(), typeConverter) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodesRestartinventorysyncRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes", "restartinventorysync", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *transportNodesClient) Restoreclusterconfig(transportNodeIdParam string) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodesRestoreclusterconfigInputType(), typeConverter) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodesRestoreclusterconfigRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes", "restoreclusterconfig", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *transportNodesClient) Resynchostconfig(transportnodeIdParam string) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodesResynchostconfigInputType(), typeConverter) + sv.AddStructField("TransportnodeId", transportnodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodesResynchostconfigRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes", "resynchostconfig", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *transportNodesClient) Update(transportNodeIdParam string, transportNodeParam model.TransportNode, esxMgmtIfMigrationDestParam *string, ifIdParam *string, pingIpParam *string, skipValidationParam *bool, vnicParam *string, vnicMigrationDestParam *string) (model.TransportNode, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodesUpdateInputType(), typeConverter) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + sv.AddStructField("TransportNode", transportNodeParam) + sv.AddStructField("EsxMgmtIfMigrationDest", esxMgmtIfMigrationDestParam) + sv.AddStructField("IfId", ifIdParam) + sv.AddStructField("PingIp", pingIpParam) + sv.AddStructField("SkipValidation", skipValidationParam) + sv.AddStructField("Vnic", vnicParam) + sv.AddStructField("VnicMigrationDest", vnicMigrationDestParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportNode + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes", "update", inputDataValue, executionContext) + var emptyOutput model.TransportNode + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportNodesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportNode), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *transportNodesClient) Updatemaintenancemode(transportnodeIdParam string, actionParam *string) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodesUpdatemaintenancemodeInputType(), typeConverter) + sv.AddStructField("TransportnodeId", transportnodeIdParam) + sv.AddStructField("Action", actionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodesUpdatemaintenancemodeRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes", "updatemaintenancemode", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/TransportNodesTypes.go b/services/nsxt-mp/nsx/TransportNodesTypes.go new file mode 100644 index 000000000..986f63624 --- /dev/null +++ b/services/nsxt-mp/nsx/TransportNodesTypes.go @@ -0,0 +1,1126 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: TransportNodes. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``action`` of method TransportNodes#updatemaintenancemode. +const TransportNodes_UPDATEMAINTENANCEMODE_ACTION_ENTER_MAINTENANCE_MODE = "enter_maintenance_mode" + +// Possible value for ``action`` of method TransportNodes#updatemaintenancemode. +const TransportNodes_UPDATEMAINTENANCEMODE_ACTION_FORCED_ENTER_MAINTENANCE_MODE = "forced_enter_maintenance_mode" + +// Possible value for ``action`` of method TransportNodes#updatemaintenancemode. +const TransportNodes_UPDATEMAINTENANCEMODE_ACTION_EXIT_MAINTENANCE_MODE = "exit_maintenance_mode" + +func transportNodesCleanstaleentriesInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodesCleanstaleentriesOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func transportNodesCleanstaleentriesRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=clean_stale_entries", + "", + "POST", + "/api/v1/transport-nodes", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node"] = bindings.NewReferenceType(model.TransportNodeBindingType) + fieldNameMap["transport_node"] = "TransportNode" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportNodeBindingType) +} + +func transportNodesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node"] = bindings.NewReferenceType(model.TransportNodeBindingType) + fieldNameMap["transport_node"] = "TransportNode" + paramsTypeMap["transport_node"] = bindings.NewReferenceType(model.TransportNodeBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "transport_node", + "POST", + "/api/v1/transport-nodes", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["unprepare_host"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["force"] = "Force" + fieldNameMap["unprepare_host"] = "UnprepareHost" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func transportNodesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["unprepare_host"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["force"] = "Force" + fieldNameMap["unprepare_host"] = "UnprepareHost" + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["transport_node_id"] = bindings.NewStringType() + paramsTypeMap["unprepare_host"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["transportNodeId"] = bindings.NewStringType() + pathParams["transport_node_id"] = "transportNodeId" + queryParams["unprepare_host"] = "unprepare_host" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/transport-nodes/{transportNodeId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodesDeleteontransportnodeInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["target_node_id"] = bindings.NewStringType() + fields["target_uri"] = bindings.NewStringType() + fieldNameMap["target_node_id"] = "TargetNodeId" + fieldNameMap["target_uri"] = "TargetUri" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodesDeleteontransportnodeOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func transportNodesDeleteontransportnodeRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["target_node_id"] = bindings.NewStringType() + fields["target_uri"] = bindings.NewStringType() + fieldNameMap["target_node_id"] = "TargetNodeId" + fieldNameMap["target_uri"] = "TargetUri" + paramsTypeMap["target_uri"] = bindings.NewStringType() + paramsTypeMap["target_node_id"] = bindings.NewStringType() + paramsTypeMap["targetNodeId"] = bindings.NewStringType() + paramsTypeMap["targetUri"] = bindings.NewStringType() + pathParams["target_uri"] = "targetUri" + pathParams["target_node_id"] = "targetNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/transport-nodes/{targetNodeId}/{targetUri}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.timed_out": 500, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodesDisableflowcacheInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_id"] = bindings.NewStringType() + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodesDisableflowcacheOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func transportNodesDisableflowcacheRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_id"] = bindings.NewStringType() + fieldNameMap["transport_node_id"] = "TransportNodeId" + paramsTypeMap["transport_node_id"] = bindings.NewStringType() + paramsTypeMap["transportNodeId"] = bindings.NewStringType() + pathParams["transport_node_id"] = "transportNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=disable_flow_cache", + "", + "POST", + "/api/v1/transport-nodes/{transportNodeId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodesEnableflowcacheInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_id"] = bindings.NewStringType() + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodesEnableflowcacheOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func transportNodesEnableflowcacheRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_id"] = bindings.NewStringType() + fieldNameMap["transport_node_id"] = "TransportNodeId" + paramsTypeMap["transport_node_id"] = bindings.NewStringType() + paramsTypeMap["transportNodeId"] = bindings.NewStringType() + pathParams["transport_node_id"] = "transportNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=enable_flow_cache", + "", + "POST", + "/api/v1/transport-nodes/{transportNodeId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_id"] = bindings.NewStringType() + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportNodeBindingType) +} + +func transportNodesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_id"] = bindings.NewStringType() + fieldNameMap["transport_node_id"] = "TransportNodeId" + paramsTypeMap["transport_node_id"] = bindings.NewStringType() + paramsTypeMap["transportNodeId"] = bindings.NewStringType() + pathParams["transport_node_id"] = "transportNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-nodes/{transportNodeId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodesGetontransportnodeInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["target_node_id"] = bindings.NewStringType() + fields["target_uri"] = bindings.NewStringType() + fieldNameMap["target_node_id"] = "TargetNodeId" + fieldNameMap["target_uri"] = "TargetUri" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodesGetontransportnodeOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func transportNodesGetontransportnodeRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["target_node_id"] = bindings.NewStringType() + fields["target_uri"] = bindings.NewStringType() + fieldNameMap["target_node_id"] = "TargetNodeId" + fieldNameMap["target_uri"] = "TargetUri" + paramsTypeMap["target_uri"] = bindings.NewStringType() + paramsTypeMap["target_node_id"] = bindings.NewStringType() + paramsTypeMap["targetNodeId"] = bindings.NewStringType() + paramsTypeMap["targetUri"] = bindings.NewStringType() + pathParams["target_uri"] = "targetUri" + pathParams["target_node_id"] = "targetNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-nodes/{targetNodeId}/{targetUri}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.timed_out": 500, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["in_maintenance_mode"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["node_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["node_types"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["in_maintenance_mode"] = "InMaintenanceMode" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["node_ip"] = "NodeIp" + fieldNameMap["node_types"] = "NodeTypes" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["transport_zone_id"] = "TransportZoneId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportNodeListResultBindingType) +} + +func transportNodesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["in_maintenance_mode"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["node_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["node_types"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["in_maintenance_mode"] = "InMaintenanceMode" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["node_ip"] = "NodeIp" + fieldNameMap["node_types"] = "NodeTypes" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["transport_zone_id"] = "TransportZoneId" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["in_maintenance_mode"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["node_types"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["node_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["node_types"] = "node_types" + queryParams["node_ip"] = "node_ip" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["transport_zone_id"] = "transport_zone_id" + queryParams["sort_by"] = "sort_by" + queryParams["in_maintenance_mode"] = "in_maintenance_mode" + queryParams["node_id"] = "node_id" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-nodes", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodesMigratetovdsInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_id"] = bindings.NewStringType() + fields["skip_maintmode"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["skip_maintmode"] = "SkipMaintmode" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodesMigratetovdsOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func transportNodesMigratetovdsRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_id"] = bindings.NewStringType() + fields["skip_maintmode"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["skip_maintmode"] = "SkipMaintmode" + paramsTypeMap["transport_node_id"] = bindings.NewStringType() + paramsTypeMap["skip_maintmode"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["transportNodeId"] = bindings.NewStringType() + pathParams["transport_node_id"] = "transportNodeId" + queryParams["skip_maintmode"] = "skip_maintmode" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=migrate_to_vds", + "", + "POST", + "/api/v1/transport-nodes/{transportNodeId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodesPostontransportnodeInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["target_node_id"] = bindings.NewStringType() + fields["target_uri"] = bindings.NewStringType() + fieldNameMap["target_node_id"] = "TargetNodeId" + fieldNameMap["target_uri"] = "TargetUri" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodesPostontransportnodeOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func transportNodesPostontransportnodeRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["target_node_id"] = bindings.NewStringType() + fields["target_uri"] = bindings.NewStringType() + fieldNameMap["target_node_id"] = "TargetNodeId" + fieldNameMap["target_uri"] = "TargetUri" + paramsTypeMap["target_uri"] = bindings.NewStringType() + paramsTypeMap["target_node_id"] = bindings.NewStringType() + paramsTypeMap["targetNodeId"] = bindings.NewStringType() + paramsTypeMap["targetUri"] = bindings.NewStringType() + pathParams["target_uri"] = "targetUri" + pathParams["target_node_id"] = "targetNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "POST", + "/api/v1/transport-nodes/{targetNodeId}/{targetUri}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.timed_out": 500, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodesPutontransportnodeInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["target_node_id"] = bindings.NewStringType() + fields["target_uri"] = bindings.NewStringType() + fieldNameMap["target_node_id"] = "TargetNodeId" + fieldNameMap["target_uri"] = "TargetUri" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodesPutontransportnodeOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func transportNodesPutontransportnodeRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["target_node_id"] = bindings.NewStringType() + fields["target_uri"] = bindings.NewStringType() + fieldNameMap["target_node_id"] = "TargetNodeId" + fieldNameMap["target_uri"] = "TargetUri" + paramsTypeMap["target_uri"] = bindings.NewStringType() + paramsTypeMap["target_node_id"] = bindings.NewStringType() + paramsTypeMap["targetNodeId"] = bindings.NewStringType() + paramsTypeMap["targetUri"] = bindings.NewStringType() + pathParams["target_uri"] = "targetUri" + pathParams["target_node_id"] = "targetNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "PUT", + "/api/v1/transport-nodes/{targetNodeId}/{targetUri}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.timed_out": 500, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodesRedeployInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fields["transport_node"] = bindings.NewReferenceType(model.TransportNodeBindingType) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["transport_node"] = "TransportNode" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodesRedeployOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportNodeBindingType) +} + +func transportNodesRedeployRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fields["transport_node"] = bindings.NewReferenceType(model.TransportNodeBindingType) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["transport_node"] = "TransportNode" + paramsTypeMap["transport_node"] = bindings.NewReferenceType(model.TransportNodeBindingType) + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=redeploy", + "transport_node", + "POST", + "/api/v1/transport-nodes/{nodeId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodesRefreshnodeconfigurationInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_id"] = bindings.NewStringType() + fields["read_only"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["read_only"] = "ReadOnly" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodesRefreshnodeconfigurationOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func transportNodesRefreshnodeconfigurationRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_id"] = bindings.NewStringType() + fields["read_only"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["read_only"] = "ReadOnly" + paramsTypeMap["read_only"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["transport_node_id"] = bindings.NewStringType() + paramsTypeMap["transportNodeId"] = bindings.NewStringType() + pathParams["transport_node_id"] = "transportNodeId" + queryParams["read_only"] = "read_only" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=refresh_node_configuration&resource_type=EdgeNode", + "", + "POST", + "/api/v1/transport-nodes/{transportNodeId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodesRestartinventorysyncInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_id"] = bindings.NewStringType() + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodesRestartinventorysyncOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func transportNodesRestartinventorysyncRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_id"] = bindings.NewStringType() + fieldNameMap["transport_node_id"] = "TransportNodeId" + paramsTypeMap["transport_node_id"] = bindings.NewStringType() + paramsTypeMap["transportNodeId"] = bindings.NewStringType() + pathParams["transport_node_id"] = "transportNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart_inventory_sync", + "", + "POST", + "/api/v1/transport-nodes/{transportNodeId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodesRestoreclusterconfigInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_id"] = bindings.NewStringType() + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodesRestoreclusterconfigOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func transportNodesRestoreclusterconfigRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_id"] = bindings.NewStringType() + fieldNameMap["transport_node_id"] = "TransportNodeId" + paramsTypeMap["transport_node_id"] = bindings.NewStringType() + paramsTypeMap["transportNodeId"] = bindings.NewStringType() + pathParams["transport_node_id"] = "transportNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restore_cluster_config", + "", + "POST", + "/api/v1/transport-nodes/{transportNodeId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodesResynchostconfigInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transportnode_id"] = bindings.NewStringType() + fieldNameMap["transportnode_id"] = "TransportnodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodesResynchostconfigOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func transportNodesResynchostconfigRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transportnode_id"] = bindings.NewStringType() + fieldNameMap["transportnode_id"] = "TransportnodeId" + paramsTypeMap["transportnode_id"] = bindings.NewStringType() + paramsTypeMap["transportnodeId"] = bindings.NewStringType() + pathParams["transportnode_id"] = "transportnodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=resync_host_config", + "", + "POST", + "/api/v1/transport-nodes/{transportnodeId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_id"] = bindings.NewStringType() + fields["transport_node"] = bindings.NewReferenceType(model.TransportNodeBindingType) + fields["esx_mgmt_if_migration_dest"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["if_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["ping_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["skip_validation"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["vnic"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["vnic_migration_dest"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["transport_node"] = "TransportNode" + fieldNameMap["esx_mgmt_if_migration_dest"] = "EsxMgmtIfMigrationDest" + fieldNameMap["if_id"] = "IfId" + fieldNameMap["ping_ip"] = "PingIp" + fieldNameMap["skip_validation"] = "SkipValidation" + fieldNameMap["vnic"] = "Vnic" + fieldNameMap["vnic_migration_dest"] = "VnicMigrationDest" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportNodeBindingType) +} + +func transportNodesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_id"] = bindings.NewStringType() + fields["transport_node"] = bindings.NewReferenceType(model.TransportNodeBindingType) + fields["esx_mgmt_if_migration_dest"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["if_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["ping_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["skip_validation"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["vnic"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["vnic_migration_dest"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["transport_node"] = "TransportNode" + fieldNameMap["esx_mgmt_if_migration_dest"] = "EsxMgmtIfMigrationDest" + fieldNameMap["if_id"] = "IfId" + fieldNameMap["ping_ip"] = "PingIp" + fieldNameMap["skip_validation"] = "SkipValidation" + fieldNameMap["vnic"] = "Vnic" + fieldNameMap["vnic_migration_dest"] = "VnicMigrationDest" + paramsTypeMap["vnic"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["skip_validation"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["if_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["esx_mgmt_if_migration_dest"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["transport_node"] = bindings.NewReferenceType(model.TransportNodeBindingType) + paramsTypeMap["transport_node_id"] = bindings.NewStringType() + paramsTypeMap["ping_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["vnic_migration_dest"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["transportNodeId"] = bindings.NewStringType() + pathParams["transport_node_id"] = "transportNodeId" + queryParams["ping_ip"] = "ping_ip" + queryParams["vnic"] = "vnic" + queryParams["skip_validation"] = "skip_validation" + queryParams["esx_mgmt_if_migration_dest"] = "esx_mgmt_if_migration_dest" + queryParams["if_id"] = "if_id" + queryParams["vnic_migration_dest"] = "vnic_migration_dest" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "transport_node", + "PUT", + "/api/v1/transport-nodes/{transportNodeId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodesUpdatemaintenancemodeInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transportnode_id"] = bindings.NewStringType() + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transportnode_id"] = "TransportnodeId" + fieldNameMap["action"] = "Action" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodesUpdatemaintenancemodeOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func transportNodesUpdatemaintenancemodeRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transportnode_id"] = bindings.NewStringType() + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transportnode_id"] = "TransportnodeId" + fieldNameMap["action"] = "Action" + paramsTypeMap["action"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["transportnode_id"] = bindings.NewStringType() + paramsTypeMap["transportnodeId"] = bindings.NewStringType() + pathParams["transportnode_id"] = "transportnodeId" + queryParams["action"] = "action" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "POST", + "/api/v1/transport-nodes/{transportnodeId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/TransportZonesClient.go b/services/nsxt-mp/nsx/TransportZonesClient.go new file mode 100644 index 000000000..4f46b1120 --- /dev/null +++ b/services/nsxt-mp/nsx/TransportZonesClient.go @@ -0,0 +1,275 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: TransportZones +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type TransportZonesClient interface { + + // Creates a new transport zone. The required parameters is transport_type (OVERLAY or VLAN). The optional parameters are description and display_name. + // + // @param transportZoneParam (required) + // @return com.vmware.nsx.model.TransportZone + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(transportZoneParam model.TransportZone) (model.TransportZone, error) + + // Deletes an existing transport zone. + // + // @param zoneIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(zoneIdParam string) error + + // Returns information about a single transport zone. + // + // @param zoneIdParam (required) + // @return com.vmware.nsx.model.TransportZone + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(zoneIdParam string) (model.TransportZone, error) + + // Returns information about configured transport zones. NSX requires at least one transport zone. NSX uses transport zones to provide connectivity based on the topology of the underlying network, trust zones, or organizational separations. For example, you might have hypervisors that use one network for management traffic and a different network for VM traffic. This architecture would require two transport zones. The combination of transport zones plus transport connectors enables NSX to form tunnels between hypervisors. Transport zones define which interfaces on the hypervisors can communicate with which other interfaces on other hypervisors to establish overlay tunnels or provide connectivity to a VLAN. A logical switch can be in one (and only one) transport zone. This means that all of a switch's interfaces must be in the same transport zone. However, each hypervisor virtual switch (OVS or VDS) has multiple interfaces (connectors), and each connector can be attached to a different logical switch. For example, on a single hypervisor with two connectors, connector A can be attached to logical switch 1 in transport zone A, while connector B is attached to logical switch 2 in transport zone B. In this way, a single hypervisor can participate in multiple transport zones. The API for creating a transport zone requires that a single host switch be specified for each transport zone, and multiple transport zones can share the same host switch. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param displayNameParam The transport zone's display name (optional) + // @param includeSystemOwnedParam Filter to indicate whether to include system owned Transport Zones. (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param isDefaultParam Filter to choose if default transport zones will be returned (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param transportTypeParam Filter to choose the type of transport zones to return (optional) + // @param uplinkTeamingPolicyNameParam The transport zone's uplink teaming policy name (optional) + // @return com.vmware.nsx.model.TransportZoneListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, displayNameParam *string, includeSystemOwnedParam *bool, includedFieldsParam *string, isDefaultParam *bool, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, transportTypeParam *string, uplinkTeamingPolicyNameParam *string) (model.TransportZoneListResult, error) + + // Updates an existing transport zone. Modifiable parameters are is_default, description, and display_name. + // + // @param zoneIdParam (required) + // @param transportZoneParam (required) + // @return com.vmware.nsx.model.TransportZone + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(zoneIdParam string, transportZoneParam model.TransportZone) (model.TransportZone, error) +} + +type transportZonesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewTransportZonesClient(connector client.Connector) *transportZonesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_zones") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + tIface := transportZonesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &tIface +} + +func (tIface *transportZonesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := tIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (tIface *transportZonesClient) Create(transportZoneParam model.TransportZone) (model.TransportZone, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportZonesCreateInputType(), typeConverter) + sv.AddStructField("TransportZone", transportZoneParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportZone + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportZonesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_zones", "create", inputDataValue, executionContext) + var emptyOutput model.TransportZone + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportZonesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportZone), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *transportZonesClient) Delete(zoneIdParam string) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportZonesDeleteInputType(), typeConverter) + sv.AddStructField("ZoneId", zoneIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportZonesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_zones", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *transportZonesClient) Get(zoneIdParam string) (model.TransportZone, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportZonesGetInputType(), typeConverter) + sv.AddStructField("ZoneId", zoneIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportZone + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportZonesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_zones", "get", inputDataValue, executionContext) + var emptyOutput model.TransportZone + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportZonesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportZone), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *transportZonesClient) List(cursorParam *string, displayNameParam *string, includeSystemOwnedParam *bool, includedFieldsParam *string, isDefaultParam *bool, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, transportTypeParam *string, uplinkTeamingPolicyNameParam *string) (model.TransportZoneListResult, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportZonesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("DisplayName", displayNameParam) + sv.AddStructField("IncludeSystemOwned", includeSystemOwnedParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("IsDefault", isDefaultParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("TransportType", transportTypeParam) + sv.AddStructField("UplinkTeamingPolicyName", uplinkTeamingPolicyNameParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportZoneListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportZonesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_zones", "list", inputDataValue, executionContext) + var emptyOutput model.TransportZoneListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportZonesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportZoneListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *transportZonesClient) Update(zoneIdParam string, transportZoneParam model.TransportZone) (model.TransportZone, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportZonesUpdateInputType(), typeConverter) + sv.AddStructField("ZoneId", zoneIdParam) + sv.AddStructField("TransportZone", transportZoneParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportZone + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportZonesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_zones", "update", inputDataValue, executionContext) + var emptyOutput model.TransportZone + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportZonesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportZone), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/TransportZonesTypes.go b/services/nsxt-mp/nsx/TransportZonesTypes.go new file mode 100644 index 000000000..3327f4651 --- /dev/null +++ b/services/nsxt-mp/nsx/TransportZonesTypes.go @@ -0,0 +1,331 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: TransportZones. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``transportType`` of method TransportZones#list. +const TransportZones_LIST_TRANSPORT_TYPE_OVERLAY = "OVERLAY" + +// Possible value for ``transportType`` of method TransportZones#list. +const TransportZones_LIST_TRANSPORT_TYPE_VLAN = "VLAN" + +func transportZonesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_zone"] = bindings.NewReferenceType(model.TransportZoneBindingType) + fieldNameMap["transport_zone"] = "TransportZone" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportZonesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportZoneBindingType) +} + +func transportZonesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_zone"] = bindings.NewReferenceType(model.TransportZoneBindingType) + fieldNameMap["transport_zone"] = "TransportZone" + paramsTypeMap["transport_zone"] = bindings.NewReferenceType(model.TransportZoneBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "transport_zone", + "POST", + "/api/v1/transport-zones", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportZonesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["zone_id"] = bindings.NewStringType() + fieldNameMap["zone_id"] = "ZoneId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportZonesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func transportZonesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["zone_id"] = bindings.NewStringType() + fieldNameMap["zone_id"] = "ZoneId" + paramsTypeMap["zone_id"] = bindings.NewStringType() + paramsTypeMap["zoneId"] = bindings.NewStringType() + pathParams["zone_id"] = "zoneId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/transport-zones/{zoneId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportZonesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["zone_id"] = bindings.NewStringType() + fieldNameMap["zone_id"] = "ZoneId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportZonesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportZoneBindingType) +} + +func transportZonesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["zone_id"] = bindings.NewStringType() + fieldNameMap["zone_id"] = "ZoneId" + paramsTypeMap["zone_id"] = bindings.NewStringType() + paramsTypeMap["zoneId"] = bindings.NewStringType() + pathParams["zone_id"] = "zoneId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-zones/{zoneId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportZonesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["uplink_teaming_policy_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["display_name"] = "DisplayName" + fieldNameMap["include_system_owned"] = "IncludeSystemOwned" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["is_default"] = "IsDefault" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["transport_type"] = "TransportType" + fieldNameMap["uplink_teaming_policy_name"] = "UplinkTeamingPolicyName" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportZonesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportZoneListResultBindingType) +} + +func transportZonesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["uplink_teaming_policy_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["display_name"] = "DisplayName" + fieldNameMap["include_system_owned"] = "IncludeSystemOwned" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["is_default"] = "IsDefault" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["transport_type"] = "TransportType" + fieldNameMap["uplink_teaming_policy_name"] = "UplinkTeamingPolicyName" + paramsTypeMap["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["uplink_teaming_policy_name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["include_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["uplink_teaming_policy_name"] = "uplink_teaming_policy_name" + queryParams["include_system_owned"] = "include_system_owned" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["transport_type"] = "transport_type" + queryParams["sort_by"] = "sort_by" + queryParams["display_name"] = "display_name" + queryParams["is_default"] = "is_default" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-zones", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportZonesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["zone_id"] = bindings.NewStringType() + fields["transport_zone"] = bindings.NewReferenceType(model.TransportZoneBindingType) + fieldNameMap["zone_id"] = "ZoneId" + fieldNameMap["transport_zone"] = "TransportZone" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportZonesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportZoneBindingType) +} + +func transportZonesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["zone_id"] = bindings.NewStringType() + fields["transport_zone"] = bindings.NewReferenceType(model.TransportZoneBindingType) + fieldNameMap["zone_id"] = "ZoneId" + fieldNameMap["transport_zone"] = "TransportZone" + paramsTypeMap["zone_id"] = bindings.NewStringType() + paramsTypeMap["transport_zone"] = bindings.NewReferenceType(model.TransportZoneBindingType) + paramsTypeMap["zoneId"] = bindings.NewStringType() + pathParams["zone_id"] = "zoneId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "transport_zone", + "PUT", + "/api/v1/transport-zones/{zoneId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/TransportzoneProfilesClient.go b/services/nsxt-mp/nsx/TransportzoneProfilesClient.go new file mode 100644 index 000000000..af6b8db6f --- /dev/null +++ b/services/nsxt-mp/nsx/TransportzoneProfilesClient.go @@ -0,0 +1,275 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: TransportzoneProfiles +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type TransportzoneProfilesClient interface { + + // Creates a transport zone profile. The resource_type is required. This api is now deprecated. Please use new api - PUT /policy/api/v1/infra/transport-zone-profiles/ + // + // @param transportZoneProfileParam (required) + // The parameter must contain all the properties defined in model.TransportZoneProfile. + // @return com.vmware.nsx.model.TransportZoneProfile + // The return value will contain all the properties defined in model.TransportZoneProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(transportZoneProfileParam *data.StructValue) (*data.StructValue, error) + + // Deletes a specified transport zone profile. This api is now deprecated. Please use new api - DELETE /policy/api/v1/infra/transport-zone-profiles/ + // + // @param transportzoneProfileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(transportzoneProfileIdParam string) error + + // Returns information about a specified transport zone profile. This api is now deprecated. Please use new api - /policy/api/v1/infra/transport-zone-profiles/ + // + // @param transportzoneProfileIdParam (required) + // @return com.vmware.nsx.model.TransportZoneProfile + // The return value will contain all the properties defined in model.TransportZoneProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(transportzoneProfileIdParam string) (*data.StructValue, error) + + // Returns information about the configured transport zone profiles. Transport zone profiles define networking policies for transport zones and transport zone endpoints. This api is now deprecated. Please use new api - /policy/api/v1/infra/transport-zone-profiles + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includeSystemOwnedParam Whether the list result contains system resources (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param resourceTypeParam comma-separated list of transport zone profile types, e.g. ?resource_type=BfdHealthMonitoringProfile (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.TransportZoneProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includeSystemOwnedParam *bool, includedFieldsParam *string, pageSizeParam *int64, resourceTypeParam *string, sortAscendingParam *bool, sortByParam *string) (model.TransportZoneProfileListResult, error) + + // Modifies a specified transport zone profile. The body of the PUT request must include the resource_type. This api is now deprecated. Please use new api - PATCH /policy/api/v1/infra/transport-zone-profiles/ + // + // @param transportzoneProfileIdParam (required) + // @param transportZoneProfileParam (required) + // The parameter must contain all the properties defined in model.TransportZoneProfile. + // @return com.vmware.nsx.model.TransportZoneProfile + // The return value will contain all the properties defined in model.TransportZoneProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(transportzoneProfileIdParam string, transportZoneProfileParam *data.StructValue) (*data.StructValue, error) +} + +type transportzoneProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewTransportzoneProfilesClient(connector client.Connector) *transportzoneProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transportzone_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + tIface := transportzoneProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &tIface +} + +func (tIface *transportzoneProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := tIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (tIface *transportzoneProfilesClient) Create(transportZoneProfileParam *data.StructValue) (*data.StructValue, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportzoneProfilesCreateInputType(), typeConverter) + sv.AddStructField("TransportZoneProfile", transportZoneProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportzoneProfilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transportzone_profiles", "create", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportzoneProfilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *transportzoneProfilesClient) Delete(transportzoneProfileIdParam string) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportzoneProfilesDeleteInputType(), typeConverter) + sv.AddStructField("TransportzoneProfileId", transportzoneProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportzoneProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transportzone_profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *transportzoneProfilesClient) Get(transportzoneProfileIdParam string) (*data.StructValue, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportzoneProfilesGetInputType(), typeConverter) + sv.AddStructField("TransportzoneProfileId", transportzoneProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportzoneProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transportzone_profiles", "get", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportzoneProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *transportzoneProfilesClient) List(cursorParam *string, includeSystemOwnedParam *bool, includedFieldsParam *string, pageSizeParam *int64, resourceTypeParam *string, sortAscendingParam *bool, sortByParam *string) (model.TransportZoneProfileListResult, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportzoneProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludeSystemOwned", includeSystemOwnedParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("ResourceType", resourceTypeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportZoneProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportzoneProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transportzone_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.TransportZoneProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportzoneProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportZoneProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *transportzoneProfilesClient) Update(transportzoneProfileIdParam string, transportZoneProfileParam *data.StructValue) (*data.StructValue, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportzoneProfilesUpdateInputType(), typeConverter) + sv.AddStructField("TransportzoneProfileId", transportzoneProfileIdParam) + sv.AddStructField("TransportZoneProfile", transportZoneProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportzoneProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transportzone_profiles", "update", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportzoneProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/TransportzoneProfilesTypes.go b/services/nsxt-mp/nsx/TransportzoneProfilesTypes.go new file mode 100644 index 000000000..5648a5cb5 --- /dev/null +++ b/services/nsxt-mp/nsx/TransportzoneProfilesTypes.go @@ -0,0 +1,307 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: TransportzoneProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func transportzoneProfilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_zone_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.TransportZoneProfileBindingType)}, bindings.REST) + fieldNameMap["transport_zone_profile"] = "TransportZoneProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportzoneProfilesCreateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.TransportZoneProfileBindingType)}, bindings.REST) +} + +func transportzoneProfilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_zone_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.TransportZoneProfileBindingType)}, bindings.REST) + fieldNameMap["transport_zone_profile"] = "TransportZoneProfile" + paramsTypeMap["transport_zone_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.TransportZoneProfileBindingType)}, bindings.REST) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "transport_zone_profile", + "POST", + "/api/v1/transportzone-profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportzoneProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transportzone_profile_id"] = bindings.NewStringType() + fieldNameMap["transportzone_profile_id"] = "TransportzoneProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportzoneProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func transportzoneProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transportzone_profile_id"] = bindings.NewStringType() + fieldNameMap["transportzone_profile_id"] = "TransportzoneProfileId" + paramsTypeMap["transportzone_profile_id"] = bindings.NewStringType() + paramsTypeMap["transportzoneProfileId"] = bindings.NewStringType() + pathParams["transportzone_profile_id"] = "transportzoneProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/transportzone-profiles/{transportzoneProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportzoneProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transportzone_profile_id"] = bindings.NewStringType() + fieldNameMap["transportzone_profile_id"] = "TransportzoneProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportzoneProfilesGetOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.TransportZoneProfileBindingType)}, bindings.REST) +} + +func transportzoneProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transportzone_profile_id"] = bindings.NewStringType() + fieldNameMap["transportzone_profile_id"] = "TransportzoneProfileId" + paramsTypeMap["transportzone_profile_id"] = bindings.NewStringType() + paramsTypeMap["transportzoneProfileId"] = bindings.NewStringType() + pathParams["transportzone_profile_id"] = "transportzoneProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transportzone-profiles/{transportzoneProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportzoneProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_system_owned"] = "IncludeSystemOwned" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["resource_type"] = "ResourceType" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportzoneProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportZoneProfileListResultBindingType) +} + +func transportzoneProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["include_system_owned"] = "IncludeSystemOwned" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["resource_type"] = "ResourceType" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["include_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["include_system_owned"] = "include_system_owned" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["resource_type"] = "resource_type" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transportzone-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportzoneProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transportzone_profile_id"] = bindings.NewStringType() + fields["transport_zone_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.TransportZoneProfileBindingType)}, bindings.REST) + fieldNameMap["transportzone_profile_id"] = "TransportzoneProfileId" + fieldNameMap["transport_zone_profile"] = "TransportZoneProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportzoneProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.TransportZoneProfileBindingType)}, bindings.REST) +} + +func transportzoneProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transportzone_profile_id"] = bindings.NewStringType() + fields["transport_zone_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.TransportZoneProfileBindingType)}, bindings.REST) + fieldNameMap["transportzone_profile_id"] = "TransportzoneProfileId" + fieldNameMap["transport_zone_profile"] = "TransportZoneProfile" + paramsTypeMap["transportzone_profile_id"] = bindings.NewStringType() + paramsTypeMap["transport_zone_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.TransportZoneProfileBindingType)}, bindings.REST) + paramsTypeMap["transportzoneProfileId"] = bindings.NewStringType() + pathParams["transportzone_profile_id"] = "transportzoneProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "transport_zone_profile", + "PUT", + "/api/v1/transportzone-profiles/{transportzoneProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/TrustManagementClient.go b/services/nsxt-mp/nsx/TrustManagementClient.go new file mode 100644 index 000000000..5c19a4067 --- /dev/null +++ b/services/nsxt-mp/nsx/TrustManagementClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: TrustManagement +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type TrustManagementClient interface { + + // Returns information about the supported algorithms and key sizes. + // @return com.vmware.nsx.model.TrustManagementData + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.TrustManagementData, error) +} + +type trustManagementClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewTrustManagementClient(connector client.Connector) *trustManagementClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.trust_management") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + tIface := trustManagementClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &tIface +} + +func (tIface *trustManagementClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := tIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (tIface *trustManagementClient) Get() (model.TrustManagementData, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(trustManagementGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TrustManagementData + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := trustManagementGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management", "get", inputDataValue, executionContext) + var emptyOutput model.TrustManagementData + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), trustManagementGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TrustManagementData), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/TrustManagementTypes.go b/services/nsxt-mp/nsx/TrustManagementTypes.go new file mode 100644 index 000000000..8c7ef911e --- /dev/null +++ b/services/nsxt-mp/nsx/TrustManagementTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: TrustManagement. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func trustManagementGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func trustManagementGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TrustManagementDataBindingType) +} + +func trustManagementGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/trust-management", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/UiViewsClient.go b/services/nsxt-mp/nsx/UiViewsClient.go new file mode 100644 index 000000000..7da320ae1 --- /dev/null +++ b/services/nsxt-mp/nsx/UiViewsClient.go @@ -0,0 +1,261 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: UiViews +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UiViewsClient interface { + + // Creates a new View. + // + // @param viewParam (required) + // @return com.vmware.nsx.model.View + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(viewParam model.View) (model.View, error) + + // Delete View + // + // @param viewIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(viewIdParam string) error + + // If no query params are specified then all the views entitled for the user are returned. The views to which a user is entitled to include the views created by the user and the shared views. + // + // @param tagParam The tag for which associated views to be queried. (optional) + // @param viewIdsParam Ids of the Views (optional) + // @param widgetIdParam Id of widget configuration (optional) + // @return com.vmware.nsx.model.ViewList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(tagParam *string, viewIdsParam *string, widgetIdParam *string) (model.ViewList, error) + + // Returns Information about a specific View. + // + // @param viewIdParam (required) + // @return com.vmware.nsx.model.View + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get0(viewIdParam string) (model.View, error) + + // Update View + // + // @param viewIdParam (required) + // @param viewParam (required) + // @return com.vmware.nsx.model.View + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(viewIdParam string, viewParam model.View) (model.View, error) +} + +type uiViewsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUiViewsClient(connector client.Connector) *uiViewsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ui_views") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "get_0": core.NewMethodIdentifier(interfaceIdentifier, "get_0"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := uiViewsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *uiViewsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *uiViewsClient) Create(viewParam model.View) (model.View, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(uiViewsCreateInputType(), typeConverter) + sv.AddStructField("View", viewParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.View + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := uiViewsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ui_views", "create", inputDataValue, executionContext) + var emptyOutput model.View + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), uiViewsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.View), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (uIface *uiViewsClient) Delete(viewIdParam string) error { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(uiViewsDeleteInputType(), typeConverter) + sv.AddStructField("ViewId", viewIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := uiViewsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ui_views", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (uIface *uiViewsClient) Get(tagParam *string, viewIdsParam *string, widgetIdParam *string) (model.ViewList, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(uiViewsGetInputType(), typeConverter) + sv.AddStructField("Tag", tagParam) + sv.AddStructField("ViewIds", viewIdsParam) + sv.AddStructField("WidgetId", widgetIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ViewList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := uiViewsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ui_views", "get", inputDataValue, executionContext) + var emptyOutput model.ViewList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), uiViewsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ViewList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (uIface *uiViewsClient) Get0(viewIdParam string) (model.View, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(uiViewsGet0InputType(), typeConverter) + sv.AddStructField("ViewId", viewIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.View + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := uiViewsGet0RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ui_views", "get_0", inputDataValue, executionContext) + var emptyOutput model.View + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), uiViewsGet0OutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.View), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (uIface *uiViewsClient) Update(viewIdParam string, viewParam model.View) (model.View, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(uiViewsUpdateInputType(), typeConverter) + sv.AddStructField("ViewId", viewIdParam) + sv.AddStructField("View", viewParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.View + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := uiViewsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ui_views", "update", inputDataValue, executionContext) + var emptyOutput model.View + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), uiViewsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.View), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/UiViewsTypes.go b/services/nsxt-mp/nsx/UiViewsTypes.go new file mode 100644 index 000000000..9a95f78b6 --- /dev/null +++ b/services/nsxt-mp/nsx/UiViewsTypes.go @@ -0,0 +1,283 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: UiViews. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func uiViewsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["view"] = bindings.NewReferenceType(model.ViewBindingType) + fieldNameMap["view"] = "View" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func uiViewsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ViewBindingType) +} + +func uiViewsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["view"] = bindings.NewReferenceType(model.ViewBindingType) + fieldNameMap["view"] = "View" + paramsTypeMap["view"] = bindings.NewReferenceType(model.ViewBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "view", + "POST", + "/api/v1/ui-views", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func uiViewsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["view_id"] = bindings.NewStringType() + fieldNameMap["view_id"] = "ViewId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func uiViewsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func uiViewsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["view_id"] = bindings.NewStringType() + fieldNameMap["view_id"] = "ViewId" + paramsTypeMap["view_id"] = bindings.NewStringType() + paramsTypeMap["viewId"] = bindings.NewStringType() + pathParams["view_id"] = "viewId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/ui-views/{viewId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func uiViewsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tag"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["view_ids"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["widget_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tag"] = "Tag" + fieldNameMap["view_ids"] = "ViewIds" + fieldNameMap["widget_id"] = "WidgetId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func uiViewsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ViewListBindingType) +} + +func uiViewsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tag"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["view_ids"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["widget_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tag"] = "Tag" + fieldNameMap["view_ids"] = "ViewIds" + fieldNameMap["widget_id"] = "WidgetId" + paramsTypeMap["widget_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["tag"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["view_ids"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["view_ids"] = "view_ids" + queryParams["widget_id"] = "widget_id" + queryParams["tag"] = "tag" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ui-views", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func uiViewsGet0InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["view_id"] = bindings.NewStringType() + fieldNameMap["view_id"] = "ViewId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func uiViewsGet0OutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ViewBindingType) +} + +func uiViewsGet0RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["view_id"] = bindings.NewStringType() + fieldNameMap["view_id"] = "ViewId" + paramsTypeMap["view_id"] = bindings.NewStringType() + paramsTypeMap["viewId"] = bindings.NewStringType() + pathParams["view_id"] = "viewId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ui-views/{viewId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func uiViewsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["view_id"] = bindings.NewStringType() + fields["view"] = bindings.NewReferenceType(model.ViewBindingType) + fieldNameMap["view_id"] = "ViewId" + fieldNameMap["view"] = "View" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func uiViewsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ViewBindingType) +} + +func uiViewsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["view_id"] = bindings.NewStringType() + fields["view"] = bindings.NewReferenceType(model.ViewBindingType) + fieldNameMap["view_id"] = "ViewId" + fieldNameMap["view"] = "View" + paramsTypeMap["view_id"] = bindings.NewStringType() + paramsTypeMap["view"] = bindings.NewReferenceType(model.ViewBindingType) + paramsTypeMap["viewId"] = bindings.NewStringType() + pathParams["view_id"] = "viewId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "view", + "PUT", + "/api/v1/ui-views/{viewId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/UpgradeClient.go b/services/nsxt-mp/nsx/UpgradeClient.go new file mode 100644 index 000000000..d7f41f2c3 --- /dev/null +++ b/services/nsxt-mp/nsx/UpgradeClient.go @@ -0,0 +1,194 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Upgrade +// Used by client-side stubs. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UpgradeClient interface { + + // Aborts execution of pre-upgrade checks if already in progress. Halts the execution of checks awaiting execution at this point and makes best-effort attempts to stop checks already in execution. Returns without action if execution of pre-upgrade checks is not in progress. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Abortpreupgradechecks() error + + // Run pre-defined checks to identify issues after upgrade of a component. The results of the checks are added to the respective upgrade units aggregate-info. The progress and status of post-upgrade checks is part of aggregate-info of individual upgrade unit groups. Returns HTTP status 500 with error code 30953 if execution of post-upgrade checks is already in progress. + // + // @param componentTypeParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Executepostupgradechecks(componentTypeParam string) error + + // Run pre-defined checks to identify potential issues which can be encountered during an upgrade or can cause an upgrade to fail. The results of the checks are added to the respective upgrade units aggregate-info. The progress and status of operation is part of upgrade status summary of individual components. Returns HTTP status 500 with error code 30953 if execution of pre-upgrade checks is already in progress. + // + // @param componentTypeParam Component type on which the action is performed or on which the results are filtered (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Executepreupgradechecks(componentTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) error + + // Upgrade the upgrade coordinator module itself. This call is invoked after user uploads an upgrade bundle. Once this call is invoked, upgrade coordinator stops and gets restarted and target version upgrade coordinator module comes up after restart. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Upgradeuc() error +} + +type upgradeClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUpgradeClient(connector client.Connector) *upgradeClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade") + methodIdentifiers := map[string]core.MethodIdentifier{ + "abortpreupgradechecks": core.NewMethodIdentifier(interfaceIdentifier, "abortpreupgradechecks"), + "executepostupgradechecks": core.NewMethodIdentifier(interfaceIdentifier, "executepostupgradechecks"), + "executepreupgradechecks": core.NewMethodIdentifier(interfaceIdentifier, "executepreupgradechecks"), + "upgradeuc": core.NewMethodIdentifier(interfaceIdentifier, "upgradeuc"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := upgradeClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *upgradeClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *upgradeClient) Abortpreupgradechecks() error { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(upgradeAbortpreupgradechecksInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := upgradeAbortpreupgradechecksRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade", "abortpreupgradechecks", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (uIface *upgradeClient) Executepostupgradechecks(componentTypeParam string) error { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(upgradeExecutepostupgradechecksInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := upgradeExecutepostupgradechecksRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade", "executepostupgradechecks", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (uIface *upgradeClient) Executepreupgradechecks(componentTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) error { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(upgradeExecutepreupgradechecksInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := upgradeExecutepreupgradechecksRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade", "executepreupgradechecks", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (uIface *upgradeClient) Upgradeuc() error { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(upgradeUpgradeucInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := upgradeUpgradeucRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade", "upgradeuc", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/UpgradeTypes.go b/services/nsxt-mp/nsx/UpgradeTypes.go new file mode 100644 index 000000000..bc086f10d --- /dev/null +++ b/services/nsxt-mp/nsx/UpgradeTypes.go @@ -0,0 +1,233 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Upgrade. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "reflect" +) + +func upgradeAbortpreupgradechecksInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func upgradeAbortpreupgradechecksOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func upgradeAbortpreupgradechecksRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=abort_pre_upgrade_checks", + "", + "POST", + "/api/v1/upgrade", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func upgradeExecutepostupgradechecksInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewStringType() + fieldNameMap["component_type"] = "ComponentType" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func upgradeExecutepostupgradechecksOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func upgradeExecutepostupgradechecksRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewStringType() + fieldNameMap["component_type"] = "ComponentType" + paramsTypeMap["component_type"] = bindings.NewStringType() + paramsTypeMap["componentType"] = bindings.NewStringType() + pathParams["component_type"] = "componentType" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=execute_post_upgrade_checks", + "", + "POST", + "/api/v1/upgrade/{componentType}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func upgradeExecutepreupgradechecksInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func upgradeExecutepreupgradechecksOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func upgradeExecutepreupgradechecksRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["component_type"] = "component_type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=execute_pre_upgrade_checks", + "", + "POST", + "/api/v1/upgrade", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func upgradeUpgradeucInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func upgradeUpgradeucOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func upgradeUpgradeucRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=upgrade_uc", + "", + "POST", + "/api/v1/upgrade", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/aaa/AaaPackageTypes.go b/services/nsxt-mp/nsx/aaa/AaaPackageTypes.go new file mode 100644 index 000000000..83db0642e --- /dev/null +++ b/services/nsxt-mp/nsx/aaa/AaaPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.aaa. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package aaa diff --git a/services/nsxt-mp/nsx/aaa/FeaturesWithPropertiesClient.go b/services/nsxt-mp/nsx/aaa/FeaturesWithPropertiesClient.go new file mode 100644 index 000000000..9f96db348 --- /dev/null +++ b/services/nsxt-mp/nsx/aaa/FeaturesWithPropertiesClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: FeaturesWithProperties +// Used by client-side stubs. + +package aaa + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type FeaturesWithPropertiesClient interface { + + // List features + // @return com.vmware.nsx.model.FeaturePermissionListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.FeaturePermissionListResult, error) +} + +type featuresWithPropertiesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewFeaturesWithPropertiesClient(connector client.Connector) *featuresWithPropertiesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.aaa.features_with_properties") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + fIface := featuresWithPropertiesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &fIface +} + +func (fIface *featuresWithPropertiesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := fIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (fIface *featuresWithPropertiesClient) List() (model.FeaturePermissionListResult, error) { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(featuresWithPropertiesListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FeaturePermissionListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := featuresWithPropertiesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.aaa.features_with_properties", "list", inputDataValue, executionContext) + var emptyOutput model.FeaturePermissionListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), featuresWithPropertiesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FeaturePermissionListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/aaa/FeaturesWithPropertiesTypes.go b/services/nsxt-mp/nsx/aaa/FeaturesWithPropertiesTypes.go new file mode 100644 index 000000000..ad4c93f05 --- /dev/null +++ b/services/nsxt-mp/nsx/aaa/FeaturesWithPropertiesTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: FeaturesWithProperties. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package aaa + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func featuresWithPropertiesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func featuresWithPropertiesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FeaturePermissionListResultBindingType) +} + +func featuresWithPropertiesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/aaa/features-with-properties", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/aaa/RegistrationTokenClient.go b/services/nsxt-mp/nsx/aaa/RegistrationTokenClient.go new file mode 100644 index 000000000..a319f4ba2 --- /dev/null +++ b/services/nsxt-mp/nsx/aaa/RegistrationTokenClient.go @@ -0,0 +1,166 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: RegistrationToken +// Used by client-side stubs. + +package aaa + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RegistrationTokenClient interface { + + // The privileges of the registration token will be the same as the caller. + // @return com.vmware.nsx.model.RegistrationToken + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create() (model.RegistrationToken, error) + + // Delete registration access token + // + // @param tokenParam Registration token (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(tokenParam string) error + + // Get registration access token + // + // @param tokenParam Registration token (required) + // @return com.vmware.nsx.model.RegistrationToken + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(tokenParam string) (model.RegistrationToken, error) +} + +type registrationTokenClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRegistrationTokenClient(connector client.Connector) *registrationTokenClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.aaa.registration_token") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := registrationTokenClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *registrationTokenClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *registrationTokenClient) Create() (model.RegistrationToken, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(registrationTokenCreateInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RegistrationToken + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := registrationTokenCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.aaa.registration_token", "create", inputDataValue, executionContext) + var emptyOutput model.RegistrationToken + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), registrationTokenCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RegistrationToken), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *registrationTokenClient) Delete(tokenParam string) error { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(registrationTokenDeleteInputType(), typeConverter) + sv.AddStructField("Token", tokenParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := registrationTokenDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.aaa.registration_token", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (rIface *registrationTokenClient) Get(tokenParam string) (model.RegistrationToken, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(registrationTokenGetInputType(), typeConverter) + sv.AddStructField("Token", tokenParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RegistrationToken + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := registrationTokenGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.aaa.registration_token", "get", inputDataValue, executionContext) + var emptyOutput model.RegistrationToken + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), registrationTokenGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RegistrationToken), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/aaa/RegistrationTokenTypes.go b/services/nsxt-mp/nsx/aaa/RegistrationTokenTypes.go new file mode 100644 index 000000000..417e25412 --- /dev/null +++ b/services/nsxt-mp/nsx/aaa/RegistrationTokenTypes.go @@ -0,0 +1,162 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: RegistrationToken. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package aaa + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func registrationTokenCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func registrationTokenCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RegistrationTokenBindingType) +} + +func registrationTokenCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "POST", + "/api/v1/aaa/registration-token", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func registrationTokenDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["token"] = bindings.NewStringType() + fieldNameMap["token"] = "Token" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func registrationTokenDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func registrationTokenDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["token"] = bindings.NewStringType() + fieldNameMap["token"] = "Token" + paramsTypeMap["token"] = bindings.NewStringType() + paramsTypeMap["token"] = bindings.NewStringType() + pathParams["token"] = "token" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/aaa/registration-token/{token}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func registrationTokenGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["token"] = bindings.NewStringType() + fieldNameMap["token"] = "Token" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func registrationTokenGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RegistrationTokenBindingType) +} + +func registrationTokenGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["token"] = bindings.NewStringType() + fieldNameMap["token"] = "Token" + paramsTypeMap["token"] = bindings.NewStringType() + paramsTypeMap["token"] = bindings.NewStringType() + pathParams["token"] = "token" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/aaa/registration-token/{token}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/aaa/RoleBindingsClient.go b/services/nsxt-mp/nsx/aaa/RoleBindingsClient.go new file mode 100644 index 000000000..a103619da --- /dev/null +++ b/services/nsxt-mp/nsx/aaa/RoleBindingsClient.go @@ -0,0 +1,369 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: RoleBindings +// Used by client-side stubs. + +package aaa + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RoleBindingsClient interface { + + // This API is used to assign a user/group any role(s) of choice. User has union of all the roles assigned to it. User name is dealt case-insensitively. + // + // @param roleBindingParam (required) + // @return com.vmware.nsx.model.RoleBinding + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(roleBindingParam model.RoleBinding) (model.RoleBinding, error) + + // Delete the user/group's role assignment. + // + // @param bindingIdParam User/Group's id (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param identitySourceIdParam Identity source ID (optional) + // @param identitySourceTypeParam Identity source type (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param nameParam User/Group name (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param roleParam Role ID (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param type_Param Type (optional) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(bindingIdParam string, cursorParam *string, identitySourceIdParam *string, identitySourceTypeParam *string, includedFieldsParam *string, nameParam *string, pageSizeParam *int64, roleParam *string, sortAscendingParam *bool, sortByParam *string, type_Param *string) error + + // Delete all stale role assignments + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param identitySourceIdParam Identity source ID (optional) + // @param identitySourceTypeParam Identity source type (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param nameParam User/Group name (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param roleParam Role ID (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param type_Param Type (optional) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Deletestalebindings(cursorParam *string, identitySourceIdParam *string, identitySourceTypeParam *string, includedFieldsParam *string, nameParam *string, pageSizeParam *int64, roleParam *string, sortAscendingParam *bool, sortByParam *string, type_Param *string) error + + // Get user/group's role information + // + // @param bindingIdParam User/Group's id (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param identitySourceIdParam Identity source ID (optional) + // @param identitySourceTypeParam Identity source type (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param nameParam User/Group name (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param roleParam Role ID (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param type_Param Type (optional) + // @return com.vmware.nsx.model.RoleBinding + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(bindingIdParam string, cursorParam *string, identitySourceIdParam *string, identitySourceTypeParam *string, includedFieldsParam *string, nameParam *string, pageSizeParam *int64, roleParam *string, sortAscendingParam *bool, sortByParam *string, type_Param *string) (model.RoleBinding, error) + + // Get all users and groups with their roles. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param identitySourceIdParam Identity source ID (optional) + // @param identitySourceTypeParam Identity source type (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param nameParam User/Group name (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param roleParam Role ID (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param type_Param Type (optional) + // @return com.vmware.nsx.model.RoleBindingListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, identitySourceIdParam *string, identitySourceTypeParam *string, includedFieldsParam *string, nameParam *string, pageSizeParam *int64, roleParam *string, sortAscendingParam *bool, sortByParam *string, type_Param *string) (model.RoleBindingListResult, error) + + // This API is used to update a user/group any role(s) of choice. User name is dealt case-insensitively. + // + // @param bindingIdParam User/Group's id (required) + // @param roleBindingParam (required) + // @return com.vmware.nsx.model.RoleBinding + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(bindingIdParam string, roleBindingParam model.RoleBinding) (model.RoleBinding, error) +} + +type roleBindingsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRoleBindingsClient(connector client.Connector) *roleBindingsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.aaa.role_bindings") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "deletestalebindings": core.NewMethodIdentifier(interfaceIdentifier, "deletestalebindings"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := roleBindingsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *roleBindingsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *roleBindingsClient) Create(roleBindingParam model.RoleBinding) (model.RoleBinding, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(roleBindingsCreateInputType(), typeConverter) + sv.AddStructField("RoleBinding", roleBindingParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RoleBinding + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := roleBindingsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.aaa.role_bindings", "create", inputDataValue, executionContext) + var emptyOutput model.RoleBinding + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), roleBindingsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RoleBinding), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *roleBindingsClient) Delete(bindingIdParam string, cursorParam *string, identitySourceIdParam *string, identitySourceTypeParam *string, includedFieldsParam *string, nameParam *string, pageSizeParam *int64, roleParam *string, sortAscendingParam *bool, sortByParam *string, type_Param *string) error { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(roleBindingsDeleteInputType(), typeConverter) + sv.AddStructField("BindingId", bindingIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IdentitySourceId", identitySourceIdParam) + sv.AddStructField("IdentitySourceType", identitySourceTypeParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("Name", nameParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("Role", roleParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Type_", type_Param) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := roleBindingsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.aaa.role_bindings", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (rIface *roleBindingsClient) Deletestalebindings(cursorParam *string, identitySourceIdParam *string, identitySourceTypeParam *string, includedFieldsParam *string, nameParam *string, pageSizeParam *int64, roleParam *string, sortAscendingParam *bool, sortByParam *string, type_Param *string) error { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(roleBindingsDeletestalebindingsInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IdentitySourceId", identitySourceIdParam) + sv.AddStructField("IdentitySourceType", identitySourceTypeParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("Name", nameParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("Role", roleParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Type_", type_Param) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := roleBindingsDeletestalebindingsRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.aaa.role_bindings", "deletestalebindings", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (rIface *roleBindingsClient) Get(bindingIdParam string, cursorParam *string, identitySourceIdParam *string, identitySourceTypeParam *string, includedFieldsParam *string, nameParam *string, pageSizeParam *int64, roleParam *string, sortAscendingParam *bool, sortByParam *string, type_Param *string) (model.RoleBinding, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(roleBindingsGetInputType(), typeConverter) + sv.AddStructField("BindingId", bindingIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IdentitySourceId", identitySourceIdParam) + sv.AddStructField("IdentitySourceType", identitySourceTypeParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("Name", nameParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("Role", roleParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Type_", type_Param) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RoleBinding + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := roleBindingsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.aaa.role_bindings", "get", inputDataValue, executionContext) + var emptyOutput model.RoleBinding + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), roleBindingsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RoleBinding), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *roleBindingsClient) List(cursorParam *string, identitySourceIdParam *string, identitySourceTypeParam *string, includedFieldsParam *string, nameParam *string, pageSizeParam *int64, roleParam *string, sortAscendingParam *bool, sortByParam *string, type_Param *string) (model.RoleBindingListResult, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(roleBindingsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IdentitySourceId", identitySourceIdParam) + sv.AddStructField("IdentitySourceType", identitySourceTypeParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("Name", nameParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("Role", roleParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Type_", type_Param) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RoleBindingListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := roleBindingsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.aaa.role_bindings", "list", inputDataValue, executionContext) + var emptyOutput model.RoleBindingListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), roleBindingsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RoleBindingListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *roleBindingsClient) Update(bindingIdParam string, roleBindingParam model.RoleBinding) (model.RoleBinding, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(roleBindingsUpdateInputType(), typeConverter) + sv.AddStructField("BindingId", bindingIdParam) + sv.AddStructField("RoleBinding", roleBindingParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RoleBinding + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := roleBindingsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.aaa.role_bindings", "update", inputDataValue, executionContext) + var emptyOutput model.RoleBinding + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), roleBindingsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RoleBinding), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/aaa/RoleBindingsTypes.go b/services/nsxt-mp/nsx/aaa/RoleBindingsTypes.go new file mode 100644 index 000000000..c87c1db51 --- /dev/null +++ b/services/nsxt-mp/nsx/aaa/RoleBindingsTypes.go @@ -0,0 +1,632 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: RoleBindings. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package aaa + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``identitySourceType`` of method RoleBindings#delete. +const RoleBindings_DELETE_IDENTITY_SOURCE_TYPE_VIDM = "VIDM" + +// Possible value for ``identitySourceType`` of method RoleBindings#delete. +const RoleBindings_DELETE_IDENTITY_SOURCE_TYPE_LDAP = "LDAP" + +// Possible value for ``identitySourceType`` of method RoleBindings#delete. +const RoleBindings_DELETE_IDENTITY_SOURCE_TYPE_OIDC = "OIDC" + +// Possible value for ``type`` of method RoleBindings#delete. +const RoleBindings_DELETE_TYPE_REMOTE_USER = "remote_user" + +// Possible value for ``type`` of method RoleBindings#delete. +const RoleBindings_DELETE_TYPE_REMOTE_GROUP = "remote_group" + +// Possible value for ``type`` of method RoleBindings#delete. +const RoleBindings_DELETE_TYPE_LOCAL_USER = "local_user" + +// Possible value for ``type`` of method RoleBindings#delete. +const RoleBindings_DELETE_TYPE_PRINCIPAL_IDENTITY = "principal_identity" + +// Possible value for ``identitySourceType`` of method RoleBindings#deletestalebindings. +const RoleBindings_DELETESTALEBINDINGS_IDENTITY_SOURCE_TYPE_VIDM = "VIDM" + +// Possible value for ``identitySourceType`` of method RoleBindings#deletestalebindings. +const RoleBindings_DELETESTALEBINDINGS_IDENTITY_SOURCE_TYPE_LDAP = "LDAP" + +// Possible value for ``identitySourceType`` of method RoleBindings#deletestalebindings. +const RoleBindings_DELETESTALEBINDINGS_IDENTITY_SOURCE_TYPE_OIDC = "OIDC" + +// Possible value for ``type`` of method RoleBindings#deletestalebindings. +const RoleBindings_DELETESTALEBINDINGS_TYPE_REMOTE_USER = "remote_user" + +// Possible value for ``type`` of method RoleBindings#deletestalebindings. +const RoleBindings_DELETESTALEBINDINGS_TYPE_REMOTE_GROUP = "remote_group" + +// Possible value for ``type`` of method RoleBindings#deletestalebindings. +const RoleBindings_DELETESTALEBINDINGS_TYPE_LOCAL_USER = "local_user" + +// Possible value for ``type`` of method RoleBindings#deletestalebindings. +const RoleBindings_DELETESTALEBINDINGS_TYPE_PRINCIPAL_IDENTITY = "principal_identity" + +// Possible value for ``identitySourceType`` of method RoleBindings#get. +const RoleBindings_GET_IDENTITY_SOURCE_TYPE_VIDM = "VIDM" + +// Possible value for ``identitySourceType`` of method RoleBindings#get. +const RoleBindings_GET_IDENTITY_SOURCE_TYPE_LDAP = "LDAP" + +// Possible value for ``identitySourceType`` of method RoleBindings#get. +const RoleBindings_GET_IDENTITY_SOURCE_TYPE_OIDC = "OIDC" + +// Possible value for ``type`` of method RoleBindings#get. +const RoleBindings_GET_TYPE_REMOTE_USER = "remote_user" + +// Possible value for ``type`` of method RoleBindings#get. +const RoleBindings_GET_TYPE_REMOTE_GROUP = "remote_group" + +// Possible value for ``type`` of method RoleBindings#get. +const RoleBindings_GET_TYPE_LOCAL_USER = "local_user" + +// Possible value for ``type`` of method RoleBindings#get. +const RoleBindings_GET_TYPE_PRINCIPAL_IDENTITY = "principal_identity" + +// Possible value for ``identitySourceType`` of method RoleBindings#list. +const RoleBindings_LIST_IDENTITY_SOURCE_TYPE_VIDM = "VIDM" + +// Possible value for ``identitySourceType`` of method RoleBindings#list. +const RoleBindings_LIST_IDENTITY_SOURCE_TYPE_LDAP = "LDAP" + +// Possible value for ``identitySourceType`` of method RoleBindings#list. +const RoleBindings_LIST_IDENTITY_SOURCE_TYPE_OIDC = "OIDC" + +// Possible value for ``type`` of method RoleBindings#list. +const RoleBindings_LIST_TYPE_REMOTE_USER = "remote_user" + +// Possible value for ``type`` of method RoleBindings#list. +const RoleBindings_LIST_TYPE_REMOTE_GROUP = "remote_group" + +// Possible value for ``type`` of method RoleBindings#list. +const RoleBindings_LIST_TYPE_LOCAL_USER = "local_user" + +// Possible value for ``type`` of method RoleBindings#list. +const RoleBindings_LIST_TYPE_PRINCIPAL_IDENTITY = "principal_identity" + +func roleBindingsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["role_binding"] = bindings.NewReferenceType(model.RoleBindingBindingType) + fieldNameMap["role_binding"] = "RoleBinding" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func roleBindingsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RoleBindingBindingType) +} + +func roleBindingsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["role_binding"] = bindings.NewReferenceType(model.RoleBindingBindingType) + fieldNameMap["role_binding"] = "RoleBinding" + paramsTypeMap["role_binding"] = bindings.NewReferenceType(model.RoleBindingBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "role_binding", + "POST", + "/api/v1/aaa/role-bindings", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func roleBindingsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["binding_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["identity_source_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["identity_source_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["role"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["binding_id"] = "BindingId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["identity_source_id"] = "IdentitySourceId" + fieldNameMap["identity_source_type"] = "IdentitySourceType" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["name"] = "Name" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["role"] = "Role" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func roleBindingsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func roleBindingsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["binding_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["identity_source_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["identity_source_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["role"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["binding_id"] = "BindingId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["identity_source_id"] = "IdentitySourceId" + fieldNameMap["identity_source_type"] = "IdentitySourceType" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["name"] = "Name" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["role"] = "Role" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + paramsTypeMap["identity_source_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["identity_source_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["role"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["binding_id"] = bindings.NewStringType() + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["bindingId"] = bindings.NewStringType() + pathParams["binding_id"] = "bindingId" + queryParams["cursor"] = "cursor" + queryParams["identity_source_id"] = "identity_source_id" + queryParams["role"] = "role" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["name"] = "name" + queryParams["sort_by"] = "sort_by" + queryParams["type"] = "type" + queryParams["identity_source_type"] = "identity_source_type" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/aaa/role-bindings/{bindingId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func roleBindingsDeletestalebindingsInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["identity_source_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["identity_source_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["role"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["identity_source_id"] = "IdentitySourceId" + fieldNameMap["identity_source_type"] = "IdentitySourceType" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["name"] = "Name" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["role"] = "Role" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func roleBindingsDeletestalebindingsOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func roleBindingsDeletestalebindingsRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["identity_source_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["identity_source_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["role"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["identity_source_id"] = "IdentitySourceId" + fieldNameMap["identity_source_type"] = "IdentitySourceType" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["name"] = "Name" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["role"] = "Role" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + paramsTypeMap["identity_source_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["identity_source_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["role"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["identity_source_id"] = "identity_source_id" + queryParams["role"] = "role" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["name"] = "name" + queryParams["sort_by"] = "sort_by" + queryParams["type"] = "type" + queryParams["identity_source_type"] = "identity_source_type" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=delete_stale_bindings", + "", + "POST", + "/api/v1/aaa/role-bindings", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func roleBindingsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["binding_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["identity_source_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["identity_source_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["role"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["binding_id"] = "BindingId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["identity_source_id"] = "IdentitySourceId" + fieldNameMap["identity_source_type"] = "IdentitySourceType" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["name"] = "Name" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["role"] = "Role" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func roleBindingsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RoleBindingBindingType) +} + +func roleBindingsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["binding_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["identity_source_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["identity_source_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["role"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["binding_id"] = "BindingId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["identity_source_id"] = "IdentitySourceId" + fieldNameMap["identity_source_type"] = "IdentitySourceType" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["name"] = "Name" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["role"] = "Role" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + paramsTypeMap["identity_source_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["identity_source_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["role"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["binding_id"] = bindings.NewStringType() + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["bindingId"] = bindings.NewStringType() + pathParams["binding_id"] = "bindingId" + queryParams["cursor"] = "cursor" + queryParams["identity_source_id"] = "identity_source_id" + queryParams["role"] = "role" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["name"] = "name" + queryParams["sort_by"] = "sort_by" + queryParams["type"] = "type" + queryParams["identity_source_type"] = "identity_source_type" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/aaa/role-bindings/{bindingId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func roleBindingsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["identity_source_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["identity_source_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["role"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["identity_source_id"] = "IdentitySourceId" + fieldNameMap["identity_source_type"] = "IdentitySourceType" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["name"] = "Name" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["role"] = "Role" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func roleBindingsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RoleBindingListResultBindingType) +} + +func roleBindingsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["identity_source_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["identity_source_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["role"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["identity_source_id"] = "IdentitySourceId" + fieldNameMap["identity_source_type"] = "IdentitySourceType" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["name"] = "Name" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["role"] = "Role" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + paramsTypeMap["identity_source_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["identity_source_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["role"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["identity_source_id"] = "identity_source_id" + queryParams["role"] = "role" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["name"] = "name" + queryParams["sort_by"] = "sort_by" + queryParams["type"] = "type" + queryParams["identity_source_type"] = "identity_source_type" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/aaa/role-bindings", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func roleBindingsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["binding_id"] = bindings.NewStringType() + fields["role_binding"] = bindings.NewReferenceType(model.RoleBindingBindingType) + fieldNameMap["binding_id"] = "BindingId" + fieldNameMap["role_binding"] = "RoleBinding" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func roleBindingsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RoleBindingBindingType) +} + +func roleBindingsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["binding_id"] = bindings.NewStringType() + fields["role_binding"] = bindings.NewReferenceType(model.RoleBindingBindingType) + fieldNameMap["binding_id"] = "BindingId" + fieldNameMap["role_binding"] = "RoleBinding" + paramsTypeMap["role_binding"] = bindings.NewReferenceType(model.RoleBindingBindingType) + paramsTypeMap["binding_id"] = bindings.NewStringType() + paramsTypeMap["bindingId"] = bindings.NewStringType() + pathParams["binding_id"] = "bindingId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "role_binding", + "PUT", + "/api/v1/aaa/role-bindings/{bindingId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/aaa/RolesClient.go b/services/nsxt-mp/nsx/aaa/RolesClient.go new file mode 100644 index 000000000..f512f7edd --- /dev/null +++ b/services/nsxt-mp/nsx/aaa/RolesClient.go @@ -0,0 +1,299 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Roles +// Used by client-side stubs. + +package aaa + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RolesClient interface { + + // The role with id is cloned and the new id, name and description are the ones provided in the request body. + // + // @param roleParam Role id (required) + // @param newRoleParam (required) + // @return com.vmware.nsx.model.NewRole + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Clone(roleParam string, newRoleParam model.NewRole) (model.NewRole, error) + + // If a role is assigned to a role binding then the deletion of the role is not allowed. Precanned roles cannot be deleted. + // + // @param roleParam Custom role id (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(roleParam string) error + + // Get role information + // + // @param roleParam Role id (required) + // @return com.vmware.nsx.model.RoleWithFeatures + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(roleParam string) (model.RoleWithFeatures, error) + + // Get information about all roles + // @return com.vmware.nsx.model.RoleListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.RoleListResult, error) + + // Creates a new role with id as if there does not exist any role with id , else updates the existing role. + // + // @param roleParam Custom role id (required) + // @param roleWithFeaturesParam (required) + // @return com.vmware.nsx.model.RoleWithFeatures + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(roleParam string, roleWithFeaturesParam model.RoleWithFeatures) (model.RoleWithFeatures, error) + + // Validate the permissions of an incoming role. Also, recommend the permissions which need to be corrected. + // + // @param featurePermissionArrayParam (required) + // @return com.vmware.nsx.model.RecommendedFeaturePermissionListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Validate(featurePermissionArrayParam model.FeaturePermissionArray) (model.RecommendedFeaturePermissionListResult, error) +} + +type rolesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRolesClient(connector client.Connector) *rolesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.aaa.roles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "clone": core.NewMethodIdentifier(interfaceIdentifier, "clone"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + "validate": core.NewMethodIdentifier(interfaceIdentifier, "validate"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := rolesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *rolesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *rolesClient) Clone(roleParam string, newRoleParam model.NewRole) (model.NewRole, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rolesCloneInputType(), typeConverter) + sv.AddStructField("Role", roleParam) + sv.AddStructField("NewRole", newRoleParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NewRole + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rolesCloneRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.aaa.roles", "clone", inputDataValue, executionContext) + var emptyOutput model.NewRole + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rolesCloneOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NewRole), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rolesClient) Delete(roleParam string) error { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rolesDeleteInputType(), typeConverter) + sv.AddStructField("Role", roleParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rolesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.aaa.roles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (rIface *rolesClient) Get(roleParam string) (model.RoleWithFeatures, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rolesGetInputType(), typeConverter) + sv.AddStructField("Role", roleParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RoleWithFeatures + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rolesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.aaa.roles", "get", inputDataValue, executionContext) + var emptyOutput model.RoleWithFeatures + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rolesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RoleWithFeatures), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rolesClient) List() (model.RoleListResult, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rolesListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RoleListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rolesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.aaa.roles", "list", inputDataValue, executionContext) + var emptyOutput model.RoleListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rolesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RoleListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rolesClient) Update(roleParam string, roleWithFeaturesParam model.RoleWithFeatures) (model.RoleWithFeatures, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rolesUpdateInputType(), typeConverter) + sv.AddStructField("Role", roleParam) + sv.AddStructField("RoleWithFeatures", roleWithFeaturesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RoleWithFeatures + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rolesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.aaa.roles", "update", inputDataValue, executionContext) + var emptyOutput model.RoleWithFeatures + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rolesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RoleWithFeatures), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rolesClient) Validate(featurePermissionArrayParam model.FeaturePermissionArray) (model.RecommendedFeaturePermissionListResult, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rolesValidateInputType(), typeConverter) + sv.AddStructField("FeaturePermissionArray", featurePermissionArrayParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RecommendedFeaturePermissionListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rolesValidateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.aaa.roles", "validate", inputDataValue, executionContext) + var emptyOutput model.RecommendedFeaturePermissionListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rolesValidateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RecommendedFeaturePermissionListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/aaa/RolesTypes.go b/services/nsxt-mp/nsx/aaa/RolesTypes.go new file mode 100644 index 000000000..e6f569394 --- /dev/null +++ b/services/nsxt-mp/nsx/aaa/RolesTypes.go @@ -0,0 +1,320 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Roles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package aaa + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func rolesCloneInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["role"] = bindings.NewStringType() + fields["new_role"] = bindings.NewReferenceType(model.NewRoleBindingType) + fieldNameMap["role"] = "Role" + fieldNameMap["new_role"] = "NewRole" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rolesCloneOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NewRoleBindingType) +} + +func rolesCloneRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["role"] = bindings.NewStringType() + fields["new_role"] = bindings.NewReferenceType(model.NewRoleBindingType) + fieldNameMap["role"] = "Role" + fieldNameMap["new_role"] = "NewRole" + paramsTypeMap["role"] = bindings.NewStringType() + paramsTypeMap["new_role"] = bindings.NewReferenceType(model.NewRoleBindingType) + paramsTypeMap["role"] = bindings.NewStringType() + pathParams["role"] = "role" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=clone", + "new_role", + "POST", + "/api/v1/aaa/roles/{role}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rolesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["role"] = bindings.NewStringType() + fieldNameMap["role"] = "Role" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rolesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func rolesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["role"] = bindings.NewStringType() + fieldNameMap["role"] = "Role" + paramsTypeMap["role"] = bindings.NewStringType() + paramsTypeMap["role"] = bindings.NewStringType() + pathParams["role"] = "role" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/aaa/roles/{role}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rolesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["role"] = bindings.NewStringType() + fieldNameMap["role"] = "Role" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rolesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RoleWithFeaturesBindingType) +} + +func rolesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["role"] = bindings.NewStringType() + fieldNameMap["role"] = "Role" + paramsTypeMap["role"] = bindings.NewStringType() + paramsTypeMap["role"] = bindings.NewStringType() + pathParams["role"] = "role" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/aaa/roles/{role}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rolesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rolesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RoleListResultBindingType) +} + +func rolesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/aaa/roles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rolesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["role"] = bindings.NewStringType() + fields["role_with_features"] = bindings.NewReferenceType(model.RoleWithFeaturesBindingType) + fieldNameMap["role"] = "Role" + fieldNameMap["role_with_features"] = "RoleWithFeatures" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rolesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RoleWithFeaturesBindingType) +} + +func rolesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["role"] = bindings.NewStringType() + fields["role_with_features"] = bindings.NewReferenceType(model.RoleWithFeaturesBindingType) + fieldNameMap["role"] = "Role" + fieldNameMap["role_with_features"] = "RoleWithFeatures" + paramsTypeMap["role"] = bindings.NewStringType() + paramsTypeMap["role_with_features"] = bindings.NewReferenceType(model.RoleWithFeaturesBindingType) + paramsTypeMap["role"] = bindings.NewStringType() + pathParams["role"] = "role" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "role_with_features", + "PUT", + "/api/v1/aaa/roles/{role}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rolesValidateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["feature_permission_array"] = bindings.NewReferenceType(model.FeaturePermissionArrayBindingType) + fieldNameMap["feature_permission_array"] = "FeaturePermissionArray" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rolesValidateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RecommendedFeaturePermissionListResultBindingType) +} + +func rolesValidateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["feature_permission_array"] = bindings.NewReferenceType(model.FeaturePermissionArrayBindingType) + fieldNameMap["feature_permission_array"] = "FeaturePermissionArray" + paramsTypeMap["feature_permission_array"] = bindings.NewReferenceType(model.FeaturePermissionArrayBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=validate", + "feature_permission_array", + "POST", + "/api/v1/aaa/roles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/aaa/RolesWithFeaturePermissionsClient.go b/services/nsxt-mp/nsx/aaa/RolesWithFeaturePermissionsClient.go new file mode 100644 index 000000000..6d5677716 --- /dev/null +++ b/services/nsxt-mp/nsx/aaa/RolesWithFeaturePermissionsClient.go @@ -0,0 +1,98 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: RolesWithFeaturePermissions +// Used by client-side stubs. + +package aaa + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RolesWithFeaturePermissionsClient interface { + + // Get information about all roles with features and their permissions + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.RoleWithFeaturesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.RoleWithFeaturesListResult, error) +} + +type rolesWithFeaturePermissionsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRolesWithFeaturePermissionsClient(connector client.Connector) *rolesWithFeaturePermissionsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.aaa.roles_with_feature_permissions") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := rolesWithFeaturePermissionsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *rolesWithFeaturePermissionsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *rolesWithFeaturePermissionsClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.RoleWithFeaturesListResult, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rolesWithFeaturePermissionsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RoleWithFeaturesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rolesWithFeaturePermissionsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.aaa.roles_with_feature_permissions", "list", inputDataValue, executionContext) + var emptyOutput model.RoleWithFeaturesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rolesWithFeaturePermissionsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RoleWithFeaturesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/aaa/RolesWithFeaturePermissionsTypes.go b/services/nsxt-mp/nsx/aaa/RolesWithFeaturePermissionsTypes.go new file mode 100644 index 000000000..4f317d3ae --- /dev/null +++ b/services/nsxt-mp/nsx/aaa/RolesWithFeaturePermissionsTypes.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: RolesWithFeaturePermissions. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package aaa + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func rolesWithFeaturePermissionsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rolesWithFeaturePermissionsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RoleWithFeaturesListResultBindingType) +} + +func rolesWithFeaturePermissionsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/aaa/roles-with-feature-permissions", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/aaa/UserInfoClient.go b/services/nsxt-mp/nsx/aaa/UserInfoClient.go new file mode 100644 index 000000000..281850ac9 --- /dev/null +++ b/services/nsxt-mp/nsx/aaa/UserInfoClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: UserInfo +// Used by client-side stubs. + +package aaa + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UserInfoClient interface { + + // This API will return the name and role information of the user invoking this API request. This API is available for all NSX users no matter their authentication method (Local account, VIDM, LDAP etc). + // + // @param rootPathParam Prefix path of the context (optional) + // @return com.vmware.nsx.model.UserInfo + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(rootPathParam *string) (model.UserInfo, error) +} + +type userInfoClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUserInfoClient(connector client.Connector) *userInfoClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.aaa.user_info") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := userInfoClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *userInfoClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *userInfoClient) Get(rootPathParam *string) (model.UserInfo, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(userInfoGetInputType(), typeConverter) + sv.AddStructField("RootPath", rootPathParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UserInfo + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := userInfoGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.aaa.user_info", "get", inputDataValue, executionContext) + var emptyOutput model.UserInfo + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), userInfoGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UserInfo), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/aaa/UserInfoTypes.go b/services/nsxt-mp/nsx/aaa/UserInfoTypes.go new file mode 100644 index 000000000..3804ec2f2 --- /dev/null +++ b/services/nsxt-mp/nsx/aaa/UserInfoTypes.go @@ -0,0 +1,68 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: UserInfo. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package aaa + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func userInfoGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["root_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["root_path"] = "RootPath" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func userInfoGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UserInfoBindingType) +} + +func userInfoGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["root_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["root_path"] = "RootPath" + paramsTypeMap["root_path"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["root_path"] = "root_path" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/aaa/user-info", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/aaa/vidm/GroupsClient.go b/services/nsxt-mp/nsx/aaa/vidm/GroupsClient.go new file mode 100644 index 000000000..8b9bdce59 --- /dev/null +++ b/services/nsxt-mp/nsx/aaa/vidm/GroupsClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Groups +// Used by client-side stubs. + +package vidm + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type GroupsClient interface { + + // Get all the User Groups where vIDM display name matches the search key case insensitively. The search key is checked to be a substring of display name. This is a non paginated API. This API will return as many results that vIDM returns to NSX during the search query. vIDM may not send all results at once so to zero in on the group of interest more characters need to be entered. + // + // @param searchStringParam Search string to search for. (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.VidmInfoListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(searchStringParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.VidmInfoListResult, error) +} + +type groupsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewGroupsClient(connector client.Connector) *groupsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.aaa.vidm.groups") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + gIface := groupsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &gIface +} + +func (gIface *groupsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := gIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (gIface *groupsClient) List(searchStringParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.VidmInfoListResult, error) { + typeConverter := gIface.connector.TypeConverter() + executionContext := gIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(groupsListInputType(), typeConverter) + sv.AddStructField("SearchString", searchStringParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.VidmInfoListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := groupsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := gIface.connector.GetApiProvider().Invoke("com.vmware.nsx.aaa.vidm.groups", "list", inputDataValue, executionContext) + var emptyOutput model.VidmInfoListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), groupsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.VidmInfoListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/aaa/vidm/GroupsTypes.go b/services/nsxt-mp/nsx/aaa/vidm/GroupsTypes.go new file mode 100644 index 000000000..c5acda0ff --- /dev/null +++ b/services/nsxt-mp/nsx/aaa/vidm/GroupsTypes.go @@ -0,0 +1,98 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Groups. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package vidm + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func groupsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["search_string"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["search_string"] = "SearchString" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func groupsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.VidmInfoListResultBindingType) +} + +func groupsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["search_string"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["search_string"] = "SearchString" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["search_string"] = bindings.NewStringType() + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["search_string"] = "search_string" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/aaa/vidm/groups", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/aaa/vidm/SearchClient.go b/services/nsxt-mp/nsx/aaa/vidm/SearchClient.go new file mode 100644 index 000000000..616997615 --- /dev/null +++ b/services/nsxt-mp/nsx/aaa/vidm/SearchClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Search +// Used by client-side stubs. + +package vidm + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SearchClient interface { + + // Get all the users and groups from vIDM matching the search key case insensitively. The search key is checked to be a substring of name or given name or family name of user and display name of group. This is a non paginated API. This API will return as many results that vIDM returns to NSX during the search query. vIDM may not send all results at once so to zero in on the user/group of interest more characters need to be entered. + // + // @param searchStringParam Search string to search for. (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.VidmInfoListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(searchStringParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.VidmInfoListResult, error) +} + +type searchClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSearchClient(connector client.Connector) *searchClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.aaa.vidm.search") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := searchClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *searchClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *searchClient) Create(searchStringParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.VidmInfoListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(searchCreateInputType(), typeConverter) + sv.AddStructField("SearchString", searchStringParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.VidmInfoListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := searchCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.aaa.vidm.search", "create", inputDataValue, executionContext) + var emptyOutput model.VidmInfoListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), searchCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.VidmInfoListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/aaa/vidm/SearchTypes.go b/services/nsxt-mp/nsx/aaa/vidm/SearchTypes.go new file mode 100644 index 000000000..875068ccc --- /dev/null +++ b/services/nsxt-mp/nsx/aaa/vidm/SearchTypes.go @@ -0,0 +1,98 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Search. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package vidm + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func searchCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["search_string"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["search_string"] = "SearchString" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func searchCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.VidmInfoListResultBindingType) +} + +func searchCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["search_string"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["search_string"] = "SearchString" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["search_string"] = bindings.NewStringType() + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["search_string"] = "search_string" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "POST", + "/api/v1/aaa/vidm/search", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/aaa/vidm/UsersClient.go b/services/nsxt-mp/nsx/aaa/vidm/UsersClient.go new file mode 100644 index 000000000..8d5ad7fd5 --- /dev/null +++ b/services/nsxt-mp/nsx/aaa/vidm/UsersClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Users +// Used by client-side stubs. + +package vidm + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UsersClient interface { + + // Get all the users from vIDM whose userName, givenName or familyName matches the search key case insensitively. The search key is checked to be a substring of name or given name or family name. This is a non paginated API. This API will return as many results that vIDM returns to NSX during the search query. vIDM may not send all results at once so to zero in on the user of interest more characters need to be entered. + // + // @param searchStringParam Search string to search for. (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.VidmInfoListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(searchStringParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.VidmInfoListResult, error) +} + +type usersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUsersClient(connector client.Connector) *usersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.aaa.vidm.users") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := usersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *usersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *usersClient) List(searchStringParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.VidmInfoListResult, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(usersListInputType(), typeConverter) + sv.AddStructField("SearchString", searchStringParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.VidmInfoListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := usersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.aaa.vidm.users", "list", inputDataValue, executionContext) + var emptyOutput model.VidmInfoListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), usersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.VidmInfoListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/aaa/vidm/UsersTypes.go b/services/nsxt-mp/nsx/aaa/vidm/UsersTypes.go new file mode 100644 index 000000000..dff406e6c --- /dev/null +++ b/services/nsxt-mp/nsx/aaa/vidm/UsersTypes.go @@ -0,0 +1,98 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Users. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package vidm + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func usersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["search_string"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["search_string"] = "SearchString" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func usersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.VidmInfoListResultBindingType) +} + +func usersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["search_string"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["search_string"] = "SearchString" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["search_string"] = bindings.NewStringType() + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["search_string"] = "search_string" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/aaa/vidm/users", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/aaa/vidm/VidmPackageTypes.go b/services/nsxt-mp/nsx/aaa/vidm/VidmPackageTypes.go new file mode 100644 index 000000000..726ec9c5a --- /dev/null +++ b/services/nsxt-mp/nsx/aaa/vidm/VidmPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.aaa.vidm. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package vidm diff --git a/services/nsxt-mp/nsx/administration/AdministrationPackageTypes.go b/services/nsxt-mp/nsx/administration/AdministrationPackageTypes.go new file mode 100644 index 000000000..ec13a2a50 --- /dev/null +++ b/services/nsxt-mp/nsx/administration/AdministrationPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.administration. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package administration diff --git a/services/nsxt-mp/nsx/administration/AuditLogsClient.go b/services/nsxt-mp/nsx/administration/AuditLogsClient.go new file mode 100644 index 000000000..e0df7e321 --- /dev/null +++ b/services/nsxt-mp/nsx/administration/AuditLogsClient.go @@ -0,0 +1,97 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: AuditLogs +// Used by client-side stubs. + +package administration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AuditLogsClient interface { + + // This API is executed on a manager node to display audit logs from all nodes inside the management plane cluster. An audit log collection will be triggered if the local master audit log is outdated. + // + // @param auditLogRequestParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param fieldsParam Fields to include in query results (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 100) + // @return com.vmware.nsx.model.AuditLogListResult + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error, Bad Gateway + // @throws NotFound Not Found + Create(auditLogRequestParam model.AuditLogRequest, cursorParam *int64, fieldsParam *string, pageSizeParam *int64) (model.AuditLogListResult, error) +} + +type auditLogsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAuditLogsClient(connector client.Connector) *auditLogsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.administration.audit_logs") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := auditLogsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *auditLogsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *auditLogsClient) Create(auditLogRequestParam model.AuditLogRequest, cursorParam *int64, fieldsParam *string, pageSizeParam *int64) (model.AuditLogListResult, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(auditLogsCreateInputType(), typeConverter) + sv.AddStructField("AuditLogRequest", auditLogRequestParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("Fields", fieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.AuditLogListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := auditLogsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.administration.audit_logs", "create", inputDataValue, executionContext) + var emptyOutput model.AuditLogListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), auditLogsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.AuditLogListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/administration/AuditLogsTypes.go b/services/nsxt-mp/nsx/administration/AuditLogsTypes.go new file mode 100644 index 000000000..cd040a673 --- /dev/null +++ b/services/nsxt-mp/nsx/administration/AuditLogsTypes.go @@ -0,0 +1,85 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: AuditLogs. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package administration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func auditLogsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["audit_log_request"] = bindings.NewReferenceType(model.AuditLogRequestBindingType) + fields["cursor"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["audit_log_request"] = "AuditLogRequest" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["fields"] = "Fields" + fieldNameMap["page_size"] = "PageSize" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func auditLogsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.AuditLogListResultBindingType) +} + +func auditLogsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["audit_log_request"] = bindings.NewReferenceType(model.AuditLogRequestBindingType) + fields["cursor"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["audit_log_request"] = "AuditLogRequest" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["fields"] = "Fields" + fieldNameMap["page_size"] = "PageSize" + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["audit_log_request"] = bindings.NewReferenceType(model.AuditLogRequestBindingType) + queryParams["cursor"] = "cursor" + queryParams["fields"] = "fields" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "audit_log_request", + "POST", + "/api/v1/administration/audit-logs", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/administration/SupportBundlesClient.go b/services/nsxt-mp/nsx/administration/SupportBundlesClient.go new file mode 100644 index 000000000..056c472d5 --- /dev/null +++ b/services/nsxt-mp/nsx/administration/SupportBundlesClient.go @@ -0,0 +1,129 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: SupportBundles +// Used by client-side stubs. + +package administration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SupportBundlesClient interface { + + // Collect support bundles from registered cluster and fabric nodes. + // + // @param supportBundleRequestParam (required) + // @param overrideAsyncResponseParam Override any existing support bundle async response (optional, default to false) + // @param requireDeleteOrOverrideAsyncResponseParam Suppress auto-deletion of generated support bundle (optional, default to false) + // @return com.vmware.nsx.model.SupportBundleResult + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error, Bad Gateway + // @throws NotFound Not Found + Collect(supportBundleRequestParam model.SupportBundleRequest, overrideAsyncResponseParam *bool, requireDeleteOrOverrideAsyncResponseParam *bool) (model.SupportBundleResult, error) + + // Delete existing support bundles waiting to be downloaded. + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Deleteasyncresponse() error +} + +type supportBundlesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSupportBundlesClient(connector client.Connector) *supportBundlesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.administration.support_bundles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "collect": core.NewMethodIdentifier(interfaceIdentifier, "collect"), + "deleteasyncresponse": core.NewMethodIdentifier(interfaceIdentifier, "deleteasyncresponse"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := supportBundlesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *supportBundlesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *supportBundlesClient) Collect(supportBundleRequestParam model.SupportBundleRequest, overrideAsyncResponseParam *bool, requireDeleteOrOverrideAsyncResponseParam *bool) (model.SupportBundleResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(supportBundlesCollectInputType(), typeConverter) + sv.AddStructField("SupportBundleRequest", supportBundleRequestParam) + sv.AddStructField("OverrideAsyncResponse", overrideAsyncResponseParam) + sv.AddStructField("RequireDeleteOrOverrideAsyncResponse", requireDeleteOrOverrideAsyncResponseParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SupportBundleResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := supportBundlesCollectRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.administration.support_bundles", "collect", inputDataValue, executionContext) + var emptyOutput model.SupportBundleResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), supportBundlesCollectOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SupportBundleResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *supportBundlesClient) Deleteasyncresponse() error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(supportBundlesDeleteasyncresponseInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := supportBundlesDeleteasyncresponseRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.administration.support_bundles", "deleteasyncresponse", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/administration/SupportBundlesTypes.go b/services/nsxt-mp/nsx/administration/SupportBundlesTypes.go new file mode 100644 index 000000000..90cd04509 --- /dev/null +++ b/services/nsxt-mp/nsx/administration/SupportBundlesTypes.go @@ -0,0 +1,122 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: SupportBundles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package administration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func supportBundlesCollectInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["support_bundle_request"] = bindings.NewReferenceType(model.SupportBundleRequestBindingType) + fields["override_async_response"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["require_delete_or_override_async_response"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["support_bundle_request"] = "SupportBundleRequest" + fieldNameMap["override_async_response"] = "OverrideAsyncResponse" + fieldNameMap["require_delete_or_override_async_response"] = "RequireDeleteOrOverrideAsyncResponse" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func supportBundlesCollectOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SupportBundleResultBindingType) +} + +func supportBundlesCollectRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["support_bundle_request"] = bindings.NewReferenceType(model.SupportBundleRequestBindingType) + fields["override_async_response"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["require_delete_or_override_async_response"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["support_bundle_request"] = "SupportBundleRequest" + fieldNameMap["override_async_response"] = "OverrideAsyncResponse" + fieldNameMap["require_delete_or_override_async_response"] = "RequireDeleteOrOverrideAsyncResponse" + paramsTypeMap["override_async_response"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["require_delete_or_override_async_response"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["support_bundle_request"] = bindings.NewReferenceType(model.SupportBundleRequestBindingType) + queryParams["override_async_response"] = "override_async_response" + queryParams["require_delete_or_override_async_response"] = "require_delete_or_override_async_response" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=collect", + "support_bundle_request", + "POST", + "/api/v1/administration/support-bundles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func supportBundlesDeleteasyncresponseInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func supportBundlesDeleteasyncresponseOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func supportBundlesDeleteasyncresponseRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=delete_async_response", + "", + "POST", + "/api/v1/administration/support-bundles", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/administration/support_bundles/DynamicContentFiltersClient.go b/services/nsxt-mp/nsx/administration/support_bundles/DynamicContentFiltersClient.go new file mode 100644 index 000000000..0d6f80d08 --- /dev/null +++ b/services/nsxt-mp/nsx/administration/support_bundles/DynamicContentFiltersClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: DynamicContentFilters +// Used by client-side stubs. + +package support_bundles + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type DynamicContentFiltersClient interface { + + // Get list of supported content filters that decide the contents of the support bundle. This depends on target form factor. + // + // @param scopeParam Restrict scope of dynamic content filters to report (optional) + // @return com.vmware.nsx.model.DynamicContentFilters + // @throws InvalidRequest Bad Request, Precondition Failed, Request Entity Too Large + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(scopeParam *string) (model.DynamicContentFilters, error) +} + +type dynamicContentFiltersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewDynamicContentFiltersClient(connector client.Connector) *dynamicContentFiltersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.administration.support_bundles.dynamic_content_filters") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + dIface := dynamicContentFiltersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &dIface +} + +func (dIface *dynamicContentFiltersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := dIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (dIface *dynamicContentFiltersClient) Get(scopeParam *string) (model.DynamicContentFilters, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(dynamicContentFiltersGetInputType(), typeConverter) + sv.AddStructField("Scope", scopeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DynamicContentFilters + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dynamicContentFiltersGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.administration.support_bundles.dynamic_content_filters", "get", inputDataValue, executionContext) + var emptyOutput model.DynamicContentFilters + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dynamicContentFiltersGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DynamicContentFilters), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/administration/support_bundles/DynamicContentFiltersTypes.go b/services/nsxt-mp/nsx/administration/support_bundles/DynamicContentFiltersTypes.go new file mode 100644 index 000000000..60c0650d8 --- /dev/null +++ b/services/nsxt-mp/nsx/administration/support_bundles/DynamicContentFiltersTypes.go @@ -0,0 +1,71 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: DynamicContentFilters. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package support_bundles + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``scope`` of method DynamicContentFilters#get. +const DynamicContentFilters_GET_SCOPE_NAPP = "NAPP" + +func dynamicContentFiltersGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["scope"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scope"] = "Scope" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dynamicContentFiltersGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DynamicContentFiltersBindingType) +} + +func dynamicContentFiltersGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["scope"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scope"] = "Scope" + paramsTypeMap["scope"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["scope"] = "scope" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/administration/support-bundles/dynamic-content-filters", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/administration/support_bundles/SupportBundlesPackageTypes.go b/services/nsxt-mp/nsx/administration/support_bundles/SupportBundlesPackageTypes.go new file mode 100644 index 000000000..59a9092f9 --- /dev/null +++ b/services/nsxt-mp/nsx/administration/support_bundles/SupportBundlesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.administration.support_bundles. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package support_bundles diff --git a/services/nsxt-mp/nsx/automatic_health_checks/AutomaticHealthChecksPackageTypes.go b/services/nsxt-mp/nsx/automatic_health_checks/AutomaticHealthChecksPackageTypes.go new file mode 100644 index 000000000..7313c09d1 --- /dev/null +++ b/services/nsxt-mp/nsx/automatic_health_checks/AutomaticHealthChecksPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.automatic_health_checks. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package automatic_health_checks diff --git a/services/nsxt-mp/nsx/automatic_health_checks/TransportZonesClient.go b/services/nsxt-mp/nsx/automatic_health_checks/TransportZonesClient.go new file mode 100644 index 000000000..1c15e5ac0 --- /dev/null +++ b/services/nsxt-mp/nsx/automatic_health_checks/TransportZonesClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: TransportZones +// Used by client-side stubs. + +package automatic_health_checks + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type TransportZonesClient interface { + + // Get health check performed by system automatically for specific transport zone. + // + // @param transportZoneIdParam (required) + // @return com.vmware.nsx.model.AutomaticHealthCheck + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(transportZoneIdParam string) (model.AutomaticHealthCheck, error) +} + +type transportZonesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewTransportZonesClient(connector client.Connector) *transportZonesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.automatic_health_checks.transport_zones") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + tIface := transportZonesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &tIface +} + +func (tIface *transportZonesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := tIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (tIface *transportZonesClient) Get(transportZoneIdParam string) (model.AutomaticHealthCheck, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportZonesGetInputType(), typeConverter) + sv.AddStructField("TransportZoneId", transportZoneIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.AutomaticHealthCheck + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportZonesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.automatic_health_checks.transport_zones", "get", inputDataValue, executionContext) + var emptyOutput model.AutomaticHealthCheck + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportZonesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.AutomaticHealthCheck), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/automatic_health_checks/TransportZonesTypes.go b/services/nsxt-mp/nsx/automatic_health_checks/TransportZonesTypes.go new file mode 100644 index 000000000..6c644104c --- /dev/null +++ b/services/nsxt-mp/nsx/automatic_health_checks/TransportZonesTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: TransportZones. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package automatic_health_checks + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func transportZonesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_zone_id"] = bindings.NewStringType() + fieldNameMap["transport_zone_id"] = "TransportZoneId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportZonesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.AutomaticHealthCheckBindingType) +} + +func transportZonesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_zone_id"] = bindings.NewStringType() + fieldNameMap["transport_zone_id"] = "TransportZoneId" + paramsTypeMap["transport_zone_id"] = bindings.NewStringType() + paramsTypeMap["transportZoneId"] = bindings.NewStringType() + pathParams["transport_zone_id"] = "transportZoneId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/automatic-health-checks/transport-zones/{transportZoneId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/bridge_endpoints/BridgeEndpointsPackageTypes.go b/services/nsxt-mp/nsx/bridge_endpoints/BridgeEndpointsPackageTypes.go new file mode 100644 index 000000000..0d568083d --- /dev/null +++ b/services/nsxt-mp/nsx/bridge_endpoints/BridgeEndpointsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.bridge_endpoints. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package bridge_endpoints diff --git a/services/nsxt-mp/nsx/bridge_endpoints/StatisticsClient.go b/services/nsxt-mp/nsx/bridge_endpoints/StatisticsClient.go new file mode 100644 index 000000000..068f59202 --- /dev/null +++ b/services/nsxt-mp/nsx/bridge_endpoints/StatisticsClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Statistics +// Used by client-side stubs. + +package bridge_endpoints + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatisticsClient interface { + + // Get the statistics for the Bridge Endpoint of the given Endpoint id (endpoint-id) + // + // @param endpointIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.BridgeEndpointStatistics + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(endpointIdParam string, sourceParam *string) (model.BridgeEndpointStatistics, error) +} + +type statisticsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatisticsClient(connector client.Connector) *statisticsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.bridge_endpoints.statistics") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statisticsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statisticsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statisticsClient) Get(endpointIdParam string, sourceParam *string) (model.BridgeEndpointStatistics, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statisticsGetInputType(), typeConverter) + sv.AddStructField("EndpointId", endpointIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BridgeEndpointStatistics + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statisticsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.bridge_endpoints.statistics", "get", inputDataValue, executionContext) + var emptyOutput model.BridgeEndpointStatistics + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statisticsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BridgeEndpointStatistics), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/bridge_endpoints/StatisticsTypes.go b/services/nsxt-mp/nsx/bridge_endpoints/StatisticsTypes.go new file mode 100644 index 000000000..63ca1dcb1 --- /dev/null +++ b/services/nsxt-mp/nsx/bridge_endpoints/StatisticsTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Statistics. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package bridge_endpoints + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Statistics#get. +const Statistics_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Statistics#get. +const Statistics_GET_SOURCE_CACHED = "cached" + +func statisticsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["endpoint_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["endpoint_id"] = "EndpointId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statisticsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BridgeEndpointStatisticsBindingType) +} + +func statisticsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["endpoint_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["endpoint_id"] = "EndpointId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["endpoint_id"] = bindings.NewStringType() + paramsTypeMap["endpointId"] = bindings.NewStringType() + pathParams["endpoint_id"] = "endpointId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/bridge-endpoints/{endpointId}/statistics", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/bridge_endpoints/StatusClient.go b/services/nsxt-mp/nsx/bridge_endpoints/StatusClient.go new file mode 100644 index 000000000..e67818fd6 --- /dev/null +++ b/services/nsxt-mp/nsx/bridge_endpoints/StatusClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package bridge_endpoints + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Get the status for the Bridge Endpoint of the given Endpoint id + // + // @param endpointIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.BridgeEndpointStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(endpointIdParam string, sourceParam *string) (model.BridgeEndpointStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.bridge_endpoints.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(endpointIdParam string, sourceParam *string) (model.BridgeEndpointStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("EndpointId", endpointIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BridgeEndpointStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.bridge_endpoints.status", "get", inputDataValue, executionContext) + var emptyOutput model.BridgeEndpointStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BridgeEndpointStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/bridge_endpoints/StatusTypes.go b/services/nsxt-mp/nsx/bridge_endpoints/StatusTypes.go new file mode 100644 index 000000000..1f357f3d4 --- /dev/null +++ b/services/nsxt-mp/nsx/bridge_endpoints/StatusTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package bridge_endpoints + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_CACHED = "cached" + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["endpoint_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["endpoint_id"] = "EndpointId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BridgeEndpointStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["endpoint_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["endpoint_id"] = "EndpointId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["endpoint_id"] = bindings.NewStringType() + paramsTypeMap["endpointId"] = bindings.NewStringType() + pathParams["endpoint_id"] = "endpointId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/bridge-endpoints/{endpointId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/capacity/CapacityPackageTypes.go b/services/nsxt-mp/nsx/capacity/CapacityPackageTypes.go new file mode 100644 index 000000000..251770bfb --- /dev/null +++ b/services/nsxt-mp/nsx/capacity/CapacityPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.capacity. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package capacity diff --git a/services/nsxt-mp/nsx/capacity/ThresholdClient.go b/services/nsxt-mp/nsx/capacity/ThresholdClient.go new file mode 100644 index 000000000..a4bd62996 --- /dev/null +++ b/services/nsxt-mp/nsx/capacity/ThresholdClient.go @@ -0,0 +1,130 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Threshold +// Used by client-side stubs. + +package capacity + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ThresholdClient interface { + + // Returns warning threshold(s) set for NSX Objects. + // @return com.vmware.nsx.model.CapacityThresholdList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.CapacityThresholdList, error) + + // Updates the warning threshold(s) for NSX Objects specified, and returns new threshold(s). Threshold list in the request must contain value for GLOBAL_DEFAULT threshold_type which represents global thresholds. + // + // @param capacityThresholdListParam (required) + // @return com.vmware.nsx.model.CapacityThresholdList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(capacityThresholdListParam model.CapacityThresholdList) (model.CapacityThresholdList, error) +} + +type thresholdClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewThresholdClient(connector client.Connector) *thresholdClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.capacity.threshold") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + tIface := thresholdClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &tIface +} + +func (tIface *thresholdClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := tIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (tIface *thresholdClient) Get() (model.CapacityThresholdList, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(thresholdGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CapacityThresholdList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := thresholdGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.capacity.threshold", "get", inputDataValue, executionContext) + var emptyOutput model.CapacityThresholdList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), thresholdGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CapacityThresholdList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *thresholdClient) Update(capacityThresholdListParam model.CapacityThresholdList) (model.CapacityThresholdList, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(thresholdUpdateInputType(), typeConverter) + sv.AddStructField("CapacityThresholdList", capacityThresholdListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CapacityThresholdList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := thresholdUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.capacity.threshold", "update", inputDataValue, executionContext) + var emptyOutput model.CapacityThresholdList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), thresholdUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CapacityThresholdList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/capacity/ThresholdTypes.go b/services/nsxt-mp/nsx/capacity/ThresholdTypes.go new file mode 100644 index 000000000..d03fb4a11 --- /dev/null +++ b/services/nsxt-mp/nsx/capacity/ThresholdTypes.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Threshold. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package capacity + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func thresholdGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func thresholdGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CapacityThresholdListBindingType) +} + +func thresholdGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/capacity/threshold", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func thresholdUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["capacity_threshold_list"] = bindings.NewReferenceType(model.CapacityThresholdListBindingType) + fieldNameMap["capacity_threshold_list"] = "CapacityThresholdList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func thresholdUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CapacityThresholdListBindingType) +} + +func thresholdUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["capacity_threshold_list"] = bindings.NewReferenceType(model.CapacityThresholdListBindingType) + fieldNameMap["capacity_threshold_list"] = "CapacityThresholdList" + paramsTypeMap["capacity_threshold_list"] = bindings.NewReferenceType(model.CapacityThresholdListBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "capacity_threshold_list", + "PUT", + "/api/v1/capacity/threshold", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/capacity/UsageClient.go b/services/nsxt-mp/nsx/capacity/UsageClient.go new file mode 100644 index 000000000..859a8d230 --- /dev/null +++ b/services/nsxt-mp/nsx/capacity/UsageClient.go @@ -0,0 +1,102 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Usage +// Used by client-side stubs. + +package capacity + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UsageClient interface { + + // Returns capacity usage data for NSX objects + // + // @param categoryParam (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param forceParam (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.CapacityUsageResponse + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(categoryParam *string, cursorParam *string, forceParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.CapacityUsageResponse, error) +} + +type usageClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUsageClient(connector client.Connector) *usageClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.capacity.usage") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := usageClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *usageClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *usageClient) Get(categoryParam *string, cursorParam *string, forceParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.CapacityUsageResponse, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(usageGetInputType(), typeConverter) + sv.AddStructField("Category", categoryParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("Force", forceParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CapacityUsageResponse + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := usageGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.capacity.usage", "get", inputDataValue, executionContext) + var emptyOutput model.CapacityUsageResponse + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), usageGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CapacityUsageResponse), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/capacity/UsageTypes.go b/services/nsxt-mp/nsx/capacity/UsageTypes.go new file mode 100644 index 000000000..5d47b8a9d --- /dev/null +++ b/services/nsxt-mp/nsx/capacity/UsageTypes.go @@ -0,0 +1,104 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Usage. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package capacity + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func usageGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["category"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["category"] = "Category" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["force"] = "Force" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func usageGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CapacityUsageResponseBindingType) +} + +func usageGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["category"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["category"] = "Category" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["force"] = "Force" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["category"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["force"] = "force" + queryParams["sort_by"] = "sort_by" + queryParams["category"] = "category" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/capacity/usage", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/ApiCertificateClient.go b/services/nsxt-mp/nsx/cluster/ApiCertificateClient.go new file mode 100644 index 000000000..272f1fd87 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/ApiCertificateClient.go @@ -0,0 +1,173 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ApiCertificate +// Used by client-side stubs. + +package cluster + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ApiCertificateClient interface { + + // Clears the certificate used for the MP cluster. This does not affect the certificate itself. This API is deprecated. Instead use the /api/v1/cluster/api-certificate?action=set_cluster_certificate API to set the cluster certificate to a different one. It just means that from now on, individual certificates will be used on each MP node. This affects all nodes in the cluster. + // + // @param certificateIdParam Certificate ID (required) + // @return com.vmware.nsx.model.ClusterCertificateId + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Clearclustercertificate(certificateIdParam string) (model.ClusterCertificateId, error) + + // Returns the ID of the certificate that is used as the cluster certificate for MP + // @return com.vmware.nsx.model.ClusterCertificateId + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.ClusterCertificateId, error) + + // Sets the certificate used for the MP cluster. This affects all nodes in the cluster. If the certificate used is a CA signed certificate,the request fails if the whole chain(leaf, intermediate, root) is not imported. + // + // @param certificateIdParam Certificate ID (required) + // @return com.vmware.nsx.model.ClusterCertificateId + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Setclustercertificate(certificateIdParam string) (model.ClusterCertificateId, error) +} + +type apiCertificateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewApiCertificateClient(connector client.Connector) *apiCertificateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.api_certificate") + methodIdentifiers := map[string]core.MethodIdentifier{ + "clearclustercertificate": core.NewMethodIdentifier(interfaceIdentifier, "clearclustercertificate"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "setclustercertificate": core.NewMethodIdentifier(interfaceIdentifier, "setclustercertificate"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := apiCertificateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *apiCertificateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *apiCertificateClient) Clearclustercertificate(certificateIdParam string) (model.ClusterCertificateId, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(apiCertificateClearclustercertificateInputType(), typeConverter) + sv.AddStructField("CertificateId", certificateIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterCertificateId + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := apiCertificateClearclustercertificateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.api_certificate", "clearclustercertificate", inputDataValue, executionContext) + var emptyOutput model.ClusterCertificateId + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), apiCertificateClearclustercertificateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterCertificateId), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (aIface *apiCertificateClient) Get() (model.ClusterCertificateId, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(apiCertificateGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterCertificateId + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := apiCertificateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.api_certificate", "get", inputDataValue, executionContext) + var emptyOutput model.ClusterCertificateId + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), apiCertificateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterCertificateId), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (aIface *apiCertificateClient) Setclustercertificate(certificateIdParam string) (model.ClusterCertificateId, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(apiCertificateSetclustercertificateInputType(), typeConverter) + sv.AddStructField("CertificateId", certificateIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterCertificateId + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := apiCertificateSetclustercertificateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.api_certificate", "setclustercertificate", inputDataValue, executionContext) + var emptyOutput model.ClusterCertificateId + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), apiCertificateSetclustercertificateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterCertificateId), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/ApiCertificateTypes.go b/services/nsxt-mp/nsx/cluster/ApiCertificateTypes.go new file mode 100644 index 000000000..31ec9e286 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/ApiCertificateTypes.go @@ -0,0 +1,160 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ApiCertificate. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package cluster + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func apiCertificateClearclustercertificateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate_id"] = bindings.NewStringType() + fieldNameMap["certificate_id"] = "CertificateId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func apiCertificateClearclustercertificateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterCertificateIdBindingType) +} + +func apiCertificateClearclustercertificateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["certificate_id"] = bindings.NewStringType() + fieldNameMap["certificate_id"] = "CertificateId" + paramsTypeMap["certificate_id"] = bindings.NewStringType() + queryParams["certificate_id"] = "certificate_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=clear_cluster_certificate", + "", + "POST", + "/api/v1/cluster/api-certificate", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func apiCertificateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func apiCertificateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterCertificateIdBindingType) +} + +func apiCertificateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/api-certificate", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func apiCertificateSetclustercertificateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate_id"] = bindings.NewStringType() + fieldNameMap["certificate_id"] = "CertificateId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func apiCertificateSetclustercertificateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterCertificateIdBindingType) +} + +func apiCertificateSetclustercertificateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["certificate_id"] = bindings.NewStringType() + fieldNameMap["certificate_id"] = "CertificateId" + paramsTypeMap["certificate_id"] = bindings.NewStringType() + queryParams["certificate_id"] = "certificate_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=set_cluster_certificate", + "", + "POST", + "/api/v1/cluster/api-certificate", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/ApiServiceClient.go b/services/nsxt-mp/nsx/cluster/ApiServiceClient.go new file mode 100644 index 000000000..19c34e009 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/ApiServiceClient.go @@ -0,0 +1,130 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ApiService +// Used by client-side stubs. + +package cluster + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ApiServiceClient interface { + + // Read the configuration of the NSX API service. + // @return com.vmware.nsx.model.ApiServiceConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.ApiServiceConfig, error) + + // Read the configuration of the NSX API service. Changes are applied to all nodes in the cluster. The API service on each node will restart after it is updated using this API. There may be a delay of up to a minute or so between the time this API call completes and when the new configuration goes into effect. + // + // @param apiServiceConfigParam (required) + // @return com.vmware.nsx.model.ApiServiceConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(apiServiceConfigParam model.ApiServiceConfig) (model.ApiServiceConfig, error) +} + +type apiServiceClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewApiServiceClient(connector client.Connector) *apiServiceClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.api_service") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := apiServiceClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *apiServiceClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *apiServiceClient) Get() (model.ApiServiceConfig, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(apiServiceGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ApiServiceConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := apiServiceGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.api_service", "get", inputDataValue, executionContext) + var emptyOutput model.ApiServiceConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), apiServiceGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ApiServiceConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (aIface *apiServiceClient) Update(apiServiceConfigParam model.ApiServiceConfig) (model.ApiServiceConfig, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(apiServiceUpdateInputType(), typeConverter) + sv.AddStructField("ApiServiceConfig", apiServiceConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ApiServiceConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := apiServiceUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.api_service", "update", inputDataValue, executionContext) + var emptyOutput model.ApiServiceConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), apiServiceUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ApiServiceConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/ApiServiceTypes.go b/services/nsxt-mp/nsx/cluster/ApiServiceTypes.go new file mode 100644 index 000000000..90284765a --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/ApiServiceTypes.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ApiService. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package cluster + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func apiServiceGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func apiServiceGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ApiServiceConfigBindingType) +} + +func apiServiceGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/api-service", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func apiServiceUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["api_service_config"] = bindings.NewReferenceType(model.ApiServiceConfigBindingType) + fieldNameMap["api_service_config"] = "ApiServiceConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func apiServiceUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ApiServiceConfigBindingType) +} + +func apiServiceUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["api_service_config"] = bindings.NewReferenceType(model.ApiServiceConfigBindingType) + fieldNameMap["api_service_config"] = "ApiServiceConfig" + paramsTypeMap["api_service_config"] = bindings.NewReferenceType(model.ApiServiceConfigBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "api_service_config", + "PUT", + "/api/v1/cluster/api-service", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/ApiVirtualIpClient.go b/services/nsxt-mp/nsx/cluster/ApiVirtualIpClient.go new file mode 100644 index 000000000..a8b84470b --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/ApiVirtualIpClient.go @@ -0,0 +1,171 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ApiVirtualIp +// Used by client-side stubs. + +package cluster + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ApiVirtualIpClient interface { + + // Clears the cluster virtual IP address. + // @return com.vmware.nsx.model.ClusterVirtualIpProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Clearvirtualip() (model.ClusterVirtualIpProperties, error) + + // Returns the configured cluster virtual IP address or null if not configured. + // @return com.vmware.nsx.model.ClusterVirtualIpProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.ClusterVirtualIpProperties, error) + + // Sets the cluster virtual IP address. Note, all nodes in the management cluster must be in the same subnet. If not, a 409 CONFLICT status is returned. + // + // @param ipAddressParam Virtual IP address, 0.0.0.0 if not configured (required) + // @return com.vmware.nsx.model.ClusterVirtualIpProperties + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Setvirtualip(ipAddressParam string) (model.ClusterVirtualIpProperties, error) +} + +type apiVirtualIpClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewApiVirtualIpClient(connector client.Connector) *apiVirtualIpClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.api_virtual_ip") + methodIdentifiers := map[string]core.MethodIdentifier{ + "clearvirtualip": core.NewMethodIdentifier(interfaceIdentifier, "clearvirtualip"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "setvirtualip": core.NewMethodIdentifier(interfaceIdentifier, "setvirtualip"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := apiVirtualIpClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *apiVirtualIpClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *apiVirtualIpClient) Clearvirtualip() (model.ClusterVirtualIpProperties, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(apiVirtualIpClearvirtualipInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterVirtualIpProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := apiVirtualIpClearvirtualipRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.api_virtual_ip", "clearvirtualip", inputDataValue, executionContext) + var emptyOutput model.ClusterVirtualIpProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), apiVirtualIpClearvirtualipOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterVirtualIpProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (aIface *apiVirtualIpClient) Get() (model.ClusterVirtualIpProperties, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(apiVirtualIpGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterVirtualIpProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := apiVirtualIpGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.api_virtual_ip", "get", inputDataValue, executionContext) + var emptyOutput model.ClusterVirtualIpProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), apiVirtualIpGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterVirtualIpProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (aIface *apiVirtualIpClient) Setvirtualip(ipAddressParam string) (model.ClusterVirtualIpProperties, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(apiVirtualIpSetvirtualipInputType(), typeConverter) + sv.AddStructField("IpAddress", ipAddressParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterVirtualIpProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := apiVirtualIpSetvirtualipRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.api_virtual_ip", "setvirtualip", inputDataValue, executionContext) + var emptyOutput model.ClusterVirtualIpProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), apiVirtualIpSetvirtualipOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterVirtualIpProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/ApiVirtualIpTypes.go b/services/nsxt-mp/nsx/cluster/ApiVirtualIpTypes.go new file mode 100644 index 000000000..74f6233bb --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/ApiVirtualIpTypes.go @@ -0,0 +1,154 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ApiVirtualIp. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package cluster + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func apiVirtualIpClearvirtualipInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func apiVirtualIpClearvirtualipOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterVirtualIpPropertiesBindingType) +} + +func apiVirtualIpClearvirtualipRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=clear_virtual_ip", + "", + "POST", + "/api/v1/cluster/api-virtual-ip", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func apiVirtualIpGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func apiVirtualIpGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterVirtualIpPropertiesBindingType) +} + +func apiVirtualIpGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/api-virtual-ip", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func apiVirtualIpSetvirtualipInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_address"] = bindings.NewStringType() + fieldNameMap["ip_address"] = "IpAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func apiVirtualIpSetvirtualipOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterVirtualIpPropertiesBindingType) +} + +func apiVirtualIpSetvirtualipRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ip_address"] = bindings.NewStringType() + fieldNameMap["ip_address"] = "IpAddress" + paramsTypeMap["ip_address"] = bindings.NewStringType() + queryParams["ip_address"] = "ip_address" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=set_virtual_ip", + "", + "POST", + "/api/v1/cluster/api-virtual-ip", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/BackupsClient.go b/services/nsxt-mp/nsx/cluster/BackupsClient.go new file mode 100644 index 000000000..bdfb099a5 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/BackupsClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Backups +// Used by client-side stubs. + +package cluster + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type BackupsClient interface { + + // Get SHA256 fingerprint of ECDSA key of remote server. The caller should independently verify that the key is trusted. + // + // @param remoteServerFingerprintRequestParam (required) + // @return com.vmware.nsx.model.RemoteServerFingerprint + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Retrievesshfingerprint(remoteServerFingerprintRequestParam model.RemoteServerFingerprintRequest) (model.RemoteServerFingerprint, error) +} + +type backupsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewBackupsClient(connector client.Connector) *backupsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.backups") + methodIdentifiers := map[string]core.MethodIdentifier{ + "retrievesshfingerprint": core.NewMethodIdentifier(interfaceIdentifier, "retrievesshfingerprint"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + bIface := backupsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &bIface +} + +func (bIface *backupsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := bIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (bIface *backupsClient) Retrievesshfingerprint(remoteServerFingerprintRequestParam model.RemoteServerFingerprintRequest) (model.RemoteServerFingerprint, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(backupsRetrievesshfingerprintInputType(), typeConverter) + sv.AddStructField("RemoteServerFingerprintRequest", remoteServerFingerprintRequestParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RemoteServerFingerprint + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := backupsRetrievesshfingerprintRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.backups", "retrievesshfingerprint", inputDataValue, executionContext) + var emptyOutput model.RemoteServerFingerprint + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), backupsRetrievesshfingerprintOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RemoteServerFingerprint), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/BackupsTypes.go b/services/nsxt-mp/nsx/cluster/BackupsTypes.go new file mode 100644 index 000000000..64ed6df68 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/BackupsTypes.go @@ -0,0 +1,67 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Backups. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package cluster + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func backupsRetrievesshfingerprintInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["remote_server_fingerprint_request"] = bindings.NewReferenceType(model.RemoteServerFingerprintRequestBindingType) + fieldNameMap["remote_server_fingerprint_request"] = "RemoteServerFingerprintRequest" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func backupsRetrievesshfingerprintOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RemoteServerFingerprintBindingType) +} + +func backupsRetrievesshfingerprintRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["remote_server_fingerprint_request"] = bindings.NewReferenceType(model.RemoteServerFingerprintRequestBindingType) + fieldNameMap["remote_server_fingerprint_request"] = "RemoteServerFingerprintRequest" + paramsTypeMap["remote_server_fingerprint_request"] = bindings.NewReferenceType(model.RemoteServerFingerprintRequestBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=retrieve_ssh_fingerprint", + "remote_server_fingerprint_request", + "POST", + "/api/v1/cluster/backups", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/ClusterPackageTypes.go b/services/nsxt-mp/nsx/cluster/ClusterPackageTypes.go new file mode 100644 index 000000000..7f6cdca4b --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/ClusterPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.cluster. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package cluster diff --git a/services/nsxt-mp/nsx/cluster/NodeClient.go b/services/nsxt-mp/nsx/cluster/NodeClient.go new file mode 100644 index 000000000..fd9d87a0c --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/NodeClient.go @@ -0,0 +1,79 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Node +// Used by client-side stubs. + +package cluster + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NodeClient interface { + + // Attempts to synchronize the repository partition on nsx manager. Repository partition contains packages required for the install and upgrade of nsx components.Normally there is no need to call this API explicitely by the user. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Reposync() error +} + +type nodeClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNodeClient(connector client.Connector) *nodeClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.node") + methodIdentifiers := map[string]core.MethodIdentifier{ + "reposync": core.NewMethodIdentifier(interfaceIdentifier, "reposync"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nodeClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nodeClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nodeClient) Reposync() error { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodeReposyncInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodeReposyncRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.node", "reposync", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/NodeTypes.go b/services/nsxt-mp/nsx/cluster/NodeTypes.go new file mode 100644 index 000000000..af871f587 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/NodeTypes.go @@ -0,0 +1,61 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Node. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package cluster + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "reflect" +) + +func nodeReposyncInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodeReposyncOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func nodeReposyncRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=repo_sync", + "", + "POST", + "/api/v1/cluster/node", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/NodesClient.go b/services/nsxt-mp/nsx/cluster/NodesClient.go new file mode 100644 index 000000000..87e2aea16 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/NodesClient.go @@ -0,0 +1,222 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Nodes +// Used by client-side stubs. + +package cluster + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NodesClient interface { + + // Add a new controller to the NSX cluster. Deprecated. Use POST /cluster?action=join_cluster to join a node to cluster. The controller comes with the new node. + // + // @param addClusterNodeSpecParam (required) + // @param actionParam (required) + // @return com.vmware.nsx.model.ClusterNodeConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(addClusterNodeSpecParam model.AddClusterNodeSpec, actionParam string) (model.ClusterNodeConfig, error) + + // Removes the specified controller from the NSX cluster. Before you can remove a controller from the cluster, you must shut down the controller service with the \"stop service controller\" command. Deprecated. Use POST /cluster/?action=remove_node to detach a node from cluster. The controller is removed with the node. + // + // @param nodeIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(nodeIdParam string) error + + // Returns information about the specified NSX cluster node. Deprecated. Use GET /cluster/ to get cluster node configuration. + // + // @param nodeIdParam (required) + // @return com.vmware.nsx.model.ClusterNodeConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nodeIdParam string) (model.ClusterNodeConfig, error) + + // Returns information about all NSX cluster nodes. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.ClusterNodeConfigListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ClusterNodeConfigListResult, error) +} + +type nodesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNodesClient(connector client.Connector) *nodesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.nodes") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nodesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nodesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nodesClient) Create(addClusterNodeSpecParam model.AddClusterNodeSpec, actionParam string) (model.ClusterNodeConfig, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodesCreateInputType(), typeConverter) + sv.AddStructField("AddClusterNodeSpec", addClusterNodeSpecParam) + sv.AddStructField("Action", actionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterNodeConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.nodes", "create", inputDataValue, executionContext) + var emptyOutput model.ClusterNodeConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nodesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterNodeConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nodesClient) Delete(nodeIdParam string) error { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodesDeleteInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.nodes", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (nIface *nodesClient) Get(nodeIdParam string) (model.ClusterNodeConfig, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodesGetInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterNodeConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.nodes", "get", inputDataValue, executionContext) + var emptyOutput model.ClusterNodeConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nodesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterNodeConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nodesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ClusterNodeConfigListResult, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterNodeConfigListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.nodes", "list", inputDataValue, executionContext) + var emptyOutput model.ClusterNodeConfigListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nodesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterNodeConfigListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/NodesTypes.go b/services/nsxt-mp/nsx/cluster/NodesTypes.go new file mode 100644 index 000000000..0e5e934eb --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/NodesTypes.go @@ -0,0 +1,249 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Nodes. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package cluster + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``action`` of method Nodes#create. +const Nodes_CREATE_ACTION_NODE = "add_cluster_node" + +func nodesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["add_cluster_node_spec"] = bindings.NewReferenceType(model.AddClusterNodeSpecBindingType) + fields["action"] = bindings.NewStringType() + fieldNameMap["add_cluster_node_spec"] = "AddClusterNodeSpec" + fieldNameMap["action"] = "Action" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterNodeConfigBindingType) +} + +func nodesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["add_cluster_node_spec"] = bindings.NewReferenceType(model.AddClusterNodeSpecBindingType) + fields["action"] = bindings.NewStringType() + fieldNameMap["add_cluster_node_spec"] = "AddClusterNodeSpec" + fieldNameMap["action"] = "Action" + paramsTypeMap["action"] = bindings.NewStringType() + paramsTypeMap["add_cluster_node_spec"] = bindings.NewReferenceType(model.AddClusterNodeSpecBindingType) + queryParams["action"] = "action" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "add_cluster_node_spec", + "POST", + "/api/v1/cluster/nodes", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nodesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func nodesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/cluster/nodes/{nodeId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nodesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterNodeConfigBindingType) +} + +func nodesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/nodes/{nodeId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nodesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterNodeConfigListResultBindingType) +} + +func nodesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/nodes", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/RestoreClient.go b/services/nsxt-mp/nsx/cluster/RestoreClient.go new file mode 100644 index 000000000..70f616767 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/RestoreClient.go @@ -0,0 +1,258 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Restore +// Used by client-side stubs. + +package cluster + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RestoreClient interface { + + // Advance any currently suspended restore operation. The operation might have been suspended because (1) the user had suspended it previously, or (2) the operation is waiting for user input, to be provided as a part of the POST request body. This operation is only valid when a GET cluster/restore/status returns a status with value SUSPENDED. Otherwise, a 409 response is returned. + // + // @param advanceClusterRestoreRequestParam (required) + // @return com.vmware.nsx.model.ClusterRestoreStatus + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Advance(advanceClusterRestoreRequestParam model.AdvanceClusterRestoreRequest) (model.ClusterRestoreStatus, error) + + // This operation is only valid when a restore is in suspended state. The UI user can cancel any restore operation when the restore is suspended either due to an error, or for a user input. The API user would need to monitor the progression of a restore by calling periodically \"/api/v1/cluster/restore/status\" API. The response object (ClusterRestoreStatus), contains a field \"endpoints\". The API user can cancel the restore process if 'cancel' action is shown in the endpoint field. This operation is only valid when a GET cluster/restore/status returns a status with value SUSPENDED. + // @return com.vmware.nsx.model.ClusterRestoreStatus + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Cancel() (model.ClusterRestoreStatus, error) + + // Retry any currently in-progress, failed restore operation. Only the last step of the multi-step restore operation would have failed,and only that step is retried. This operation is only valid when a GET cluster/restore/status returns a status with value FAILED. Otherwise, a 409 response is returned. + // @return com.vmware.nsx.model.ClusterRestoreStatus + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Retry() (model.ClusterRestoreStatus, error) + + // Start the restore of an NSX cluster, from some previously backed-up configuration. This operation is only valid when a GET cluster/restore/status returns a status with value NOT_STARTED. Otherwise, a 409 response is returned. + // + // @param initiateClusterRestoreRequestParam (required) + // @return com.vmware.nsx.model.ClusterRestoreStatus + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start(initiateClusterRestoreRequestParam model.InitiateClusterRestoreRequest) (model.ClusterRestoreStatus, error) + + // Suspend any currently running restore operation. The restore operation is made up of a number of steps. When this call is issued, any currently running step is allowed to finish (successfully or with errors), and the next step (and therefore the entire restore operation) is suspended until a subsequent resume or cancel call is issued. This operation is only valid when a GET cluster/restore/status returns a status with value RUNNING. Otherwise, a 409 response is returned. + // @return com.vmware.nsx.model.ClusterRestoreStatus + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Suspend() (model.ClusterRestoreStatus, error) +} + +type restoreClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRestoreClient(connector client.Connector) *restoreClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.restore") + methodIdentifiers := map[string]core.MethodIdentifier{ + "advance": core.NewMethodIdentifier(interfaceIdentifier, "advance"), + "cancel": core.NewMethodIdentifier(interfaceIdentifier, "cancel"), + "retry": core.NewMethodIdentifier(interfaceIdentifier, "retry"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "suspend": core.NewMethodIdentifier(interfaceIdentifier, "suspend"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := restoreClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *restoreClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *restoreClient) Advance(advanceClusterRestoreRequestParam model.AdvanceClusterRestoreRequest) (model.ClusterRestoreStatus, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(restoreAdvanceInputType(), typeConverter) + sv.AddStructField("AdvanceClusterRestoreRequest", advanceClusterRestoreRequestParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterRestoreStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := restoreAdvanceRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.restore", "advance", inputDataValue, executionContext) + var emptyOutput model.ClusterRestoreStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), restoreAdvanceOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterRestoreStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *restoreClient) Cancel() (model.ClusterRestoreStatus, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(restoreCancelInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterRestoreStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := restoreCancelRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.restore", "cancel", inputDataValue, executionContext) + var emptyOutput model.ClusterRestoreStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), restoreCancelOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterRestoreStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *restoreClient) Retry() (model.ClusterRestoreStatus, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(restoreRetryInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterRestoreStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := restoreRetryRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.restore", "retry", inputDataValue, executionContext) + var emptyOutput model.ClusterRestoreStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), restoreRetryOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterRestoreStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *restoreClient) Start(initiateClusterRestoreRequestParam model.InitiateClusterRestoreRequest) (model.ClusterRestoreStatus, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(restoreStartInputType(), typeConverter) + sv.AddStructField("InitiateClusterRestoreRequest", initiateClusterRestoreRequestParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterRestoreStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := restoreStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.restore", "start", inputDataValue, executionContext) + var emptyOutput model.ClusterRestoreStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), restoreStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterRestoreStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *restoreClient) Suspend() (model.ClusterRestoreStatus, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(restoreSuspendInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterRestoreStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := restoreSuspendRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.restore", "suspend", inputDataValue, executionContext) + var emptyOutput model.ClusterRestoreStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), restoreSuspendOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterRestoreStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/RestoreTypes.go b/services/nsxt-mp/nsx/cluster/RestoreTypes.go new file mode 100644 index 000000000..c709feff5 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/RestoreTypes.go @@ -0,0 +1,244 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Restore. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package cluster + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func restoreAdvanceInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["advance_cluster_restore_request"] = bindings.NewReferenceType(model.AdvanceClusterRestoreRequestBindingType) + fieldNameMap["advance_cluster_restore_request"] = "AdvanceClusterRestoreRequest" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func restoreAdvanceOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterRestoreStatusBindingType) +} + +func restoreAdvanceRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["advance_cluster_restore_request"] = bindings.NewReferenceType(model.AdvanceClusterRestoreRequestBindingType) + fieldNameMap["advance_cluster_restore_request"] = "AdvanceClusterRestoreRequest" + paramsTypeMap["advance_cluster_restore_request"] = bindings.NewReferenceType(model.AdvanceClusterRestoreRequestBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=advance", + "advance_cluster_restore_request", + "POST", + "/api/v1/cluster/restore", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func restoreCancelInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func restoreCancelOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterRestoreStatusBindingType) +} + +func restoreCancelRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=cancel", + "", + "POST", + "/api/v1/cluster/restore", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func restoreRetryInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func restoreRetryOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterRestoreStatusBindingType) +} + +func restoreRetryRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=retry", + "", + "POST", + "/api/v1/cluster/restore", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func restoreStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["initiate_cluster_restore_request"] = bindings.NewReferenceType(model.InitiateClusterRestoreRequestBindingType) + fieldNameMap["initiate_cluster_restore_request"] = "InitiateClusterRestoreRequest" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func restoreStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterRestoreStatusBindingType) +} + +func restoreStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["initiate_cluster_restore_request"] = bindings.NewReferenceType(model.InitiateClusterRestoreRequestBindingType) + fieldNameMap["initiate_cluster_restore_request"] = "InitiateClusterRestoreRequest" + paramsTypeMap["initiate_cluster_restore_request"] = bindings.NewReferenceType(model.InitiateClusterRestoreRequestBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "initiate_cluster_restore_request", + "POST", + "/api/v1/cluster/restore", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func restoreSuspendInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func restoreSuspendOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterRestoreStatusBindingType) +} + +func restoreSuspendRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=suspend", + "", + "POST", + "/api/v1/cluster/restore", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/StatusClient.go b/services/nsxt-mp/nsx/cluster/StatusClient.go new file mode 100644 index 000000000..44a7dfe64 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package cluster + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Returns status information for the NSX cluster control role and management role. + // @return com.vmware.nsx.model.ClusterStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.ClusterStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.ClusterStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.status", "get", inputDataValue, executionContext) + var emptyOutput model.ClusterStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/StatusTypes.go b/services/nsxt-mp/nsx/cluster/StatusTypes.go new file mode 100644 index 000000000..14d9f67f8 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package cluster + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/backups/BackupsPackageTypes.go b/services/nsxt-mp/nsx/cluster/backups/BackupsPackageTypes.go new file mode 100644 index 000000000..09f9a2478 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/backups/BackupsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.cluster.backups. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package backups diff --git a/services/nsxt-mp/nsx/cluster/backups/ConfigClient.go b/services/nsxt-mp/nsx/cluster/backups/ConfigClient.go new file mode 100644 index 000000000..f82a40424 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/backups/ConfigClient.go @@ -0,0 +1,134 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Config +// Used by client-side stubs. + +package backups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ConfigClient interface { + + // Get a configuration of a file server and timers for automated backup. Fields that contain secrets (password, passphrase) are not returned. + // @return com.vmware.nsx.model.BackupConfiguration + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.BackupConfiguration, error) + + // Configure file server and timers for automated backup. If secret fields are omitted (password, passphrase) then use the previously set value. + // + // @param backupConfigurationParam (required) + // @param frameTypeParam Frame type (optional, default to LOCAL_LOCAL_MANAGER) + // @param siteIdParam Site ID (optional, default to localhost) + // @return com.vmware.nsx.model.BackupConfiguration + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(backupConfigurationParam model.BackupConfiguration, frameTypeParam *string, siteIdParam *string) (model.BackupConfiguration, error) +} + +type configClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewConfigClient(connector client.Connector) *configClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.backups.config") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := configClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *configClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *configClient) Get() (model.BackupConfiguration, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(configGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BackupConfiguration + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := configGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.backups.config", "get", inputDataValue, executionContext) + var emptyOutput model.BackupConfiguration + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), configGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BackupConfiguration), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *configClient) Update(backupConfigurationParam model.BackupConfiguration, frameTypeParam *string, siteIdParam *string) (model.BackupConfiguration, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(configUpdateInputType(), typeConverter) + sv.AddStructField("BackupConfiguration", backupConfigurationParam) + sv.AddStructField("FrameType", frameTypeParam) + sv.AddStructField("SiteId", siteIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BackupConfiguration + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := configUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.backups.config", "update", inputDataValue, executionContext) + var emptyOutput model.BackupConfiguration + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), configUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BackupConfiguration), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/backups/ConfigTypes.go b/services/nsxt-mp/nsx/cluster/backups/ConfigTypes.go new file mode 100644 index 000000000..cae5edb4c --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/backups/ConfigTypes.go @@ -0,0 +1,134 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Config. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package backups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``frameType`` of method Config#update. +const Config_UPDATE_FRAME_TYPE_GLOBAL_MANAGER = "GLOBAL_MANAGER" + +// Possible value for ``frameType`` of method Config#update. +const Config_UPDATE_FRAME_TYPE_LOCAL_MANAGER = "LOCAL_MANAGER" + +// Possible value for ``frameType`` of method Config#update. +const Config_UPDATE_FRAME_TYPE_LOCAL_LOCAL_MANAGER = "LOCAL_LOCAL_MANAGER" + +// Possible value for ``frameType`` of method Config#update. +const Config_UPDATE_FRAME_TYPE_NSX_INTELLIGENCE = "NSX_INTELLIGENCE" + +func configGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func configGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BackupConfigurationBindingType) +} + +func configGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/backups/config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func configUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["backup_configuration"] = bindings.NewReferenceType(model.BackupConfigurationBindingType) + fields["frame_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["backup_configuration"] = "BackupConfiguration" + fieldNameMap["frame_type"] = "FrameType" + fieldNameMap["site_id"] = "SiteId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func configUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BackupConfigurationBindingType) +} + +func configUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["backup_configuration"] = bindings.NewReferenceType(model.BackupConfigurationBindingType) + fields["frame_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["backup_configuration"] = "BackupConfiguration" + fieldNameMap["frame_type"] = "FrameType" + fieldNameMap["site_id"] = "SiteId" + paramsTypeMap["frame_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["backup_configuration"] = bindings.NewReferenceType(model.BackupConfigurationBindingType) + queryParams["site_id"] = "site_id" + queryParams["frame_type"] = "frame_type" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "backup_configuration", + "PUT", + "/api/v1/cluster/backups/config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/backups/HistoryClient.go b/services/nsxt-mp/nsx/cluster/backups/HistoryClient.go new file mode 100644 index 000000000..be8c7a1f4 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/backups/HistoryClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: History +// Used by client-side stubs. + +package backups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type HistoryClient interface { + + // Get history of previous backup operations + // @return com.vmware.nsx.model.BackupOperationHistory + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.BackupOperationHistory, error) +} + +type historyClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewHistoryClient(connector client.Connector) *historyClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.backups.history") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + hIface := historyClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &hIface +} + +func (hIface *historyClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := hIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (hIface *historyClient) Get() (model.BackupOperationHistory, error) { + typeConverter := hIface.connector.TypeConverter() + executionContext := hIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(historyGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BackupOperationHistory + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := historyGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + hIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := hIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.backups.history", "get", inputDataValue, executionContext) + var emptyOutput model.BackupOperationHistory + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), historyGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BackupOperationHistory), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), hIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/backups/HistoryTypes.go b/services/nsxt-mp/nsx/cluster/backups/HistoryTypes.go new file mode 100644 index 000000000..575e9c1d5 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/backups/HistoryTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: History. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package backups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func historyGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func historyGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BackupOperationHistoryBindingType) +} + +func historyGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/backups/history", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/backups/OverviewClient.go b/services/nsxt-mp/nsx/cluster/backups/OverviewClient.go new file mode 100644 index 000000000..db51d745a --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/backups/OverviewClient.go @@ -0,0 +1,104 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Overview +// Used by client-side stubs. + +package backups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type OverviewClient interface { + + // Get a configuration of a file server, timers for automated backup, latest backup status, backups list for a site. Fields that contain secrets (password, passphrase) are not returned. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param frameTypeParam Frame type (optional, default to LOCAL_LOCAL_MANAGER) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param showBackupsListParam Need a list of backups (optional, default to true) + // @param siteIdParam UUID of the site (optional, default to localhost) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.BackupOverview + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, frameTypeParam *string, includedFieldsParam *string, pageSizeParam *int64, showBackupsListParam *bool, siteIdParam *string, sortAscendingParam *bool, sortByParam *string) (model.BackupOverview, error) +} + +type overviewClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewOverviewClient(connector client.Connector) *overviewClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.backups.overview") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + oIface := overviewClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &oIface +} + +func (oIface *overviewClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := oIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (oIface *overviewClient) List(cursorParam *string, frameTypeParam *string, includedFieldsParam *string, pageSizeParam *int64, showBackupsListParam *bool, siteIdParam *string, sortAscendingParam *bool, sortByParam *string) (model.BackupOverview, error) { + typeConverter := oIface.connector.TypeConverter() + executionContext := oIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(overviewListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("FrameType", frameTypeParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("ShowBackupsList", showBackupsListParam) + sv.AddStructField("SiteId", siteIdParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BackupOverview + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := overviewListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + oIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := oIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.backups.overview", "list", inputDataValue, executionContext) + var emptyOutput model.BackupOverview + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), overviewListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BackupOverview), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), oIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/backups/OverviewTypes.go b/services/nsxt-mp/nsx/cluster/backups/OverviewTypes.go new file mode 100644 index 000000000..7bb4f8d14 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/backups/OverviewTypes.go @@ -0,0 +1,122 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Overview. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package backups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``frameType`` of method Overview#list. +const Overview_LIST_FRAME_TYPE_GLOBAL_MANAGER = "GLOBAL_MANAGER" + +// Possible value for ``frameType`` of method Overview#list. +const Overview_LIST_FRAME_TYPE_LOCAL_MANAGER = "LOCAL_MANAGER" + +// Possible value for ``frameType`` of method Overview#list. +const Overview_LIST_FRAME_TYPE_LOCAL_LOCAL_MANAGER = "LOCAL_LOCAL_MANAGER" + +// Possible value for ``frameType`` of method Overview#list. +const Overview_LIST_FRAME_TYPE_NSX_INTELLIGENCE = "NSX_INTELLIGENCE" + +func overviewListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["frame_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["show_backups_list"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["frame_type"] = "FrameType" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["show_backups_list"] = "ShowBackupsList" + fieldNameMap["site_id"] = "SiteId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func overviewListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BackupOverviewBindingType) +} + +func overviewListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["frame_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["show_backups_list"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["frame_type"] = "FrameType" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["show_backups_list"] = "ShowBackupsList" + fieldNameMap["site_id"] = "SiteId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["frame_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["show_backups_list"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["site_id"] = "site_id" + queryParams["show_backups_list"] = "show_backups_list" + queryParams["sort_by"] = "sort_by" + queryParams["frame_type"] = "frame_type" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/backups/overview", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/backups/StatusClient.go b/services/nsxt-mp/nsx/cluster/backups/StatusClient.go new file mode 100644 index 000000000..2cee0de53 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/backups/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package backups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Get status of active backup operations + // @return com.vmware.nsx.model.CurrentBackupOperationStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.CurrentBackupOperationStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.backups.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.CurrentBackupOperationStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CurrentBackupOperationStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.backups.status", "get", inputDataValue, executionContext) + var emptyOutput model.CurrentBackupOperationStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CurrentBackupOperationStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/backups/StatusTypes.go b/services/nsxt-mp/nsx/cluster/backups/StatusTypes.go new file mode 100644 index 000000000..2180433ba --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/backups/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package backups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CurrentBackupOperationStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/backups/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/backups/UiFramesClient.go b/services/nsxt-mp/nsx/cluster/backups/UiFramesClient.go new file mode 100644 index 000000000..4943e95e8 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/backups/UiFramesClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Ui_frames +// Used by client-side stubs. + +package backups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type Ui_framesClient interface { + + // Returns list of backup frames and some metadata to be used by UI. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param uiTabTypeParam (optional, default to LOCAL_MANAGER_TAB) + // @return com.vmware.nsx.model.BackupUiFramesInfoList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, uiTabTypeParam *string) (model.BackupUiFramesInfoList, error) +} + +type ui_framesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUi_framesClient(connector client.Connector) *ui_framesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.backups.ui_frames") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := ui_framesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *ui_framesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *ui_framesClient) Get(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, uiTabTypeParam *string) (model.BackupUiFramesInfoList, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(uiFramesGetInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("UiTabType", uiTabTypeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BackupUiFramesInfoList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := uiFramesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.backups.ui_frames", "get", inputDataValue, executionContext) + var emptyOutput model.BackupUiFramesInfoList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), uiFramesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BackupUiFramesInfoList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/backups/UiFramesTypes.go b/services/nsxt-mp/nsx/cluster/backups/UiFramesTypes.go new file mode 100644 index 000000000..dc7d47110 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/backups/UiFramesTypes.go @@ -0,0 +1,104 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Ui_frames. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package backups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``uiTabType`` of method Ui_frames#get. +const UiFrames_GET_UI_TAB_TYPE_LOCAL_MANAGER_TAB = "LOCAL_MANAGER_TAB" + +// Possible value for ``uiTabType`` of method Ui_frames#get. +const UiFrames_GET_UI_TAB_TYPE_GLOBAL_MANAGER_TAB = "GLOBAL_MANAGER_TAB" + +func uiFramesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["ui_tab_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["ui_tab_type"] = "UiTabType" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func uiFramesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BackupUiFramesInfoListBindingType) +} + +func uiFramesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["ui_tab_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["ui_tab_type"] = "UiTabType" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["ui_tab_type"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["ui_tab_type"] = "ui_tab_type" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/backups/ui_frames", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/nodes/DeploymentsClient.go b/services/nsxt-mp/nsx/cluster/nodes/DeploymentsClient.go new file mode 100644 index 000000000..959514a89 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/nodes/DeploymentsClient.go @@ -0,0 +1,211 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Deployments +// Used by client-side stubs. + +package nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type DeploymentsClient interface { + + // Deploys a cluster node VM as specified by the deployment config. Once the VM is deployed and powered on, it will automatically join the existing cluster. + // + // @param addClusterNodeVMInfoParam (required) + // @return com.vmware.nsx.model.ClusterNodeVMDeploymentRequestList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(addClusterNodeVMInfoParam model.AddClusterNodeVMInfo) (model.ClusterNodeVMDeploymentRequestList, error) + + // Attempts to unregister and undeploy a specified auto-deployed cluster node VM. If it is a member of a cluster, then the VM will be automatically detached from the cluster before being unregistered and undeployed. Alternatively, if the original deployment attempt failed or the VM is not found, cleans up the deployment information associated with the deployment attempt. Note: If a VM has been successfully auto-deployed, then the associated deployment information will not be deleted unless and until the VM is successfully deleted. + // + // @param nodeIdParam (required) + // @param forceDeleteParam Delete by force (optional) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(nodeIdParam string, forceDeleteParam *bool) error + + // Returns deployment request information for a specific attempted deployment of a cluster node VM. + // + // @param nodeIdParam (required) + // @return com.vmware.nsx.model.ClusterNodeVMDeploymentRequest + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nodeIdParam string) (model.ClusterNodeVMDeploymentRequest, error) + + // Returns request information for every attempted deployment of a cluster node VM. + // @return com.vmware.nsx.model.ClusterNodeVMDeploymentRequestList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.ClusterNodeVMDeploymentRequestList, error) +} + +type deploymentsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewDeploymentsClient(connector client.Connector) *deploymentsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.nodes.deployments") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + dIface := deploymentsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &dIface +} + +func (dIface *deploymentsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := dIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (dIface *deploymentsClient) Create(addClusterNodeVMInfoParam model.AddClusterNodeVMInfo) (model.ClusterNodeVMDeploymentRequestList, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(deploymentsCreateInputType(), typeConverter) + sv.AddStructField("AddClusterNodeVMInfo", addClusterNodeVMInfoParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterNodeVMDeploymentRequestList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := deploymentsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.nodes.deployments", "create", inputDataValue, executionContext) + var emptyOutput model.ClusterNodeVMDeploymentRequestList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), deploymentsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterNodeVMDeploymentRequestList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *deploymentsClient) Delete(nodeIdParam string, forceDeleteParam *bool) error { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(deploymentsDeleteInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("ForceDelete", forceDeleteParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := deploymentsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.nodes.deployments", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *deploymentsClient) Get(nodeIdParam string) (model.ClusterNodeVMDeploymentRequest, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(deploymentsGetInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterNodeVMDeploymentRequest + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := deploymentsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.nodes.deployments", "get", inputDataValue, executionContext) + var emptyOutput model.ClusterNodeVMDeploymentRequest + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), deploymentsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterNodeVMDeploymentRequest), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *deploymentsClient) List() (model.ClusterNodeVMDeploymentRequestList, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(deploymentsListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterNodeVMDeploymentRequestList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := deploymentsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.nodes.deployments", "list", inputDataValue, executionContext) + var emptyOutput model.ClusterNodeVMDeploymentRequestList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), deploymentsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterNodeVMDeploymentRequestList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/nodes/DeploymentsTypes.go b/services/nsxt-mp/nsx/cluster/nodes/DeploymentsTypes.go new file mode 100644 index 000000000..a449423e0 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/nodes/DeploymentsTypes.go @@ -0,0 +1,216 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Deployments. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func deploymentsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["add_cluster_node_VM_info"] = bindings.NewReferenceType(model.AddClusterNodeVMInfoBindingType) + fieldNameMap["add_cluster_node_VM_info"] = "AddClusterNodeVMInfo" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func deploymentsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterNodeVMDeploymentRequestListBindingType) +} + +func deploymentsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["add_cluster_node_VM_info"] = bindings.NewReferenceType(model.AddClusterNodeVMInfoBindingType) + fieldNameMap["add_cluster_node_VM_info"] = "AddClusterNodeVMInfo" + paramsTypeMap["add_cluster_node_VM_info"] = bindings.NewReferenceType(model.AddClusterNodeVMInfoBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "add_cluster_node_VM_info", + "POST", + "/api/v1/cluster/nodes/deployments", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func deploymentsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fields["force_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["force_delete"] = "ForceDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func deploymentsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func deploymentsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fields["force_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["force_delete"] = "ForceDelete" + paramsTypeMap["force_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + queryParams["force_delete"] = "force_delete" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=delete", + "", + "POST", + "/api/v1/cluster/nodes/deployments/{nodeId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func deploymentsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func deploymentsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterNodeVMDeploymentRequestBindingType) +} + +func deploymentsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/nodes/deployments/{nodeId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func deploymentsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func deploymentsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterNodeVMDeploymentRequestListBindingType) +} + +func deploymentsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/nodes/deployments", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/nodes/NodesPackageTypes.go b/services/nsxt-mp/nsx/cluster/nodes/NodesPackageTypes.go new file mode 100644 index 000000000..dbec5dfa9 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/nodes/NodesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.cluster.nodes. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nodes diff --git a/services/nsxt-mp/nsx/cluster/nodes/StatusClient.go b/services/nsxt-mp/nsx/cluster/nodes/StatusClient.go new file mode 100644 index 000000000..0808dcd64 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/nodes/StatusClient.go @@ -0,0 +1,132 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read aggregated runtime status of cluster node. + // + // @param nodeIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.ClusterNodeStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nodeIdParam string, sourceParam *string) (model.ClusterNodeStatus, error) + + // Read aggregated runtime status of all cluster nodes. Deprecated. Use GET /cluster/status instead. + // @return com.vmware.nsx.model.ClustersAggregateInfo + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Getall() (model.ClustersAggregateInfo, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.nodes.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "getall": core.NewMethodIdentifier(interfaceIdentifier, "getall"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(nodeIdParam string, sourceParam *string) (model.ClusterNodeStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterNodeStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.nodes.status", "get", inputDataValue, executionContext) + var emptyOutput model.ClusterNodeStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterNodeStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statusClient) Getall() (model.ClustersAggregateInfo, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetallInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClustersAggregateInfo + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetallRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.nodes.status", "getall", inputDataValue, executionContext) + var emptyOutput model.ClustersAggregateInfo + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetallOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClustersAggregateInfo), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/nodes/StatusTypes.go b/services/nsxt-mp/nsx/cluster/nodes/StatusTypes.go new file mode 100644 index 000000000..2bd8b2ace --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/nodes/StatusTypes.go @@ -0,0 +1,124 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_CACHED = "cached" + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterNodeStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/nodes/{nodeId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statusGetallInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetallOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClustersAggregateInfoBindingType) +} + +func statusGetallRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/nodes/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/nodes/deployments/DeploymentsPackageTypes.go b/services/nsxt-mp/nsx/cluster/nodes/deployments/DeploymentsPackageTypes.go new file mode 100644 index 000000000..9448a4ced --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/nodes/deployments/DeploymentsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.cluster.nodes.deployments. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package deployments diff --git a/services/nsxt-mp/nsx/cluster/nodes/deployments/StatusClient.go b/services/nsxt-mp/nsx/cluster/nodes/deployments/StatusClient.go new file mode 100644 index 000000000..2e7128cd9 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/nodes/deployments/StatusClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package deployments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Returns the current deployment or undeployment status for a VM along with any other relevant current information, such as error messages. + // + // @param nodeIdParam (required) + // @return com.vmware.nsx.model.ClusterNodeVMDeploymentStatusReport + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nodeIdParam string) (model.ClusterNodeVMDeploymentStatusReport, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.nodes.deployments.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(nodeIdParam string) (model.ClusterNodeVMDeploymentStatusReport, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterNodeVMDeploymentStatusReport + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.nodes.deployments.status", "get", inputDataValue, executionContext) + var emptyOutput model.ClusterNodeVMDeploymentStatusReport + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterNodeVMDeploymentStatusReport), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/nodes/deployments/StatusTypes.go b/services/nsxt-mp/nsx/cluster/nodes/deployments/StatusTypes.go new file mode 100644 index 000000000..7639e71d4 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/nodes/deployments/StatusTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package deployments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterNodeVMDeploymentStatusReportBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/nodes/deployments/{nodeId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/nodes/network/InterfacesClient.go b/services/nsxt-mp/nsx/cluster/nodes/network/InterfacesClient.go new file mode 100644 index 000000000..d7be5e33d --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/nodes/network/InterfacesClient.go @@ -0,0 +1,139 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Interfaces +// Used by client-side stubs. + +package network + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type InterfacesClient interface { + + // Returns detailed information about the specified interface. Interface information includes MTU, broadcast and host IP addresses, link and admin status, MAC address, network mask, and the IP configuration method (static or DHCP). + // + // @param nodeIdParam (required) + // @param interfaceIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.NodeInterfaceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nodeIdParam string, interfaceIdParam string, sourceParam *string) (model.NodeInterfaceProperties, error) + + // Returns the number of interfaces on the node and detailed information about each interface. Interface information includes MTU, broadcast and host IP addresses, link and admin status, MAC address, network mask, and the IP configuration method (static or DHCP). + // + // @param nodeIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.NodeInterfacePropertiesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(nodeIdParam string, sourceParam *string) (model.NodeInterfacePropertiesListResult, error) +} + +type interfacesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewInterfacesClient(connector client.Connector) *interfacesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.nodes.network.interfaces") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := interfacesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *interfacesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *interfacesClient) Get(nodeIdParam string, interfaceIdParam string, sourceParam *string) (model.NodeInterfaceProperties, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(interfacesGetInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("InterfaceId", interfaceIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeInterfaceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := interfacesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.nodes.network.interfaces", "get", inputDataValue, executionContext) + var emptyOutput model.NodeInterfaceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), interfacesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeInterfaceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *interfacesClient) List(nodeIdParam string, sourceParam *string) (model.NodeInterfacePropertiesListResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(interfacesListInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeInterfacePropertiesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := interfacesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.nodes.network.interfaces", "list", inputDataValue, executionContext) + var emptyOutput model.NodeInterfacePropertiesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), interfacesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeInterfacePropertiesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/nodes/network/InterfacesTypes.go b/services/nsxt-mp/nsx/cluster/nodes/network/InterfacesTypes.go new file mode 100644 index 000000000..edd1034c8 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/nodes/network/InterfacesTypes.go @@ -0,0 +1,150 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Interfaces. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package network + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Interfaces#get. +const Interfaces_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Interfaces#get. +const Interfaces_GET_SOURCE_CACHED = "cached" + +// Possible value for ``source`` of method Interfaces#list. +const Interfaces_LIST_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Interfaces#list. +const Interfaces_LIST_SOURCE_CACHED = "cached" + +func interfacesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fields["interface_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["interface_id"] = "InterfaceId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func interfacesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeInterfacePropertiesBindingType) +} + +func interfacesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fields["interface_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["interface_id"] = "InterfaceId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["interface_id"] = bindings.NewStringType() + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + paramsTypeMap["interfaceId"] = bindings.NewStringType() + pathParams["interface_id"] = "interfaceId" + pathParams["node_id"] = "nodeId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/nodes/{nodeId}/network/interfaces/{interfaceId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func interfacesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func interfacesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeInterfacePropertiesListResultBindingType) +} + +func interfacesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/nodes/{nodeId}/network/interfaces", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/nodes/network/NetworkPackageTypes.go b/services/nsxt-mp/nsx/cluster/nodes/network/NetworkPackageTypes.go new file mode 100644 index 000000000..7911173c8 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/nodes/network/NetworkPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.cluster.nodes.network. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package network diff --git a/services/nsxt-mp/nsx/cluster/nodes/network/interfaces/InterfacesPackageTypes.go b/services/nsxt-mp/nsx/cluster/nodes/network/interfaces/InterfacesPackageTypes.go new file mode 100644 index 000000000..0c58f8054 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/nodes/network/interfaces/InterfacesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.cluster.nodes.network.interfaces. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package interfaces diff --git a/services/nsxt-mp/nsx/cluster/nodes/network/interfaces/StatsClient.go b/services/nsxt-mp/nsx/cluster/nodes/network/interfaces/StatsClient.go new file mode 100644 index 000000000..7597c60d0 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/nodes/network/interfaces/StatsClient.go @@ -0,0 +1,94 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Stats +// Used by client-side stubs. + +package interfaces + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatsClient interface { + + // On the specified interface, returns the number of received (rx), transmitted (tx), and dropped packets; the number of bytes and errors received and transmitted on the interface; and the number of detected collisions. + // + // @param nodeIdParam (required) + // @param interfaceIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.NodeInterfaceStatisticsProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nodeIdParam string, interfaceIdParam string, sourceParam *string) (model.NodeInterfaceStatisticsProperties, error) +} + +type statsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatsClient(connector client.Connector) *statsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.nodes.network.interfaces.stats") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statsClient) Get(nodeIdParam string, interfaceIdParam string, sourceParam *string) (model.NodeInterfaceStatisticsProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statsGetInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("InterfaceId", interfaceIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeInterfaceStatisticsProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.nodes.network.interfaces.stats", "get", inputDataValue, executionContext) + var emptyOutput model.NodeInterfaceStatisticsProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeInterfaceStatisticsProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/nodes/network/interfaces/StatsTypes.go b/services/nsxt-mp/nsx/cluster/nodes/network/interfaces/StatsTypes.go new file mode 100644 index 000000000..aedcb38ff --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/nodes/network/interfaces/StatsTypes.go @@ -0,0 +1,88 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Stats. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package interfaces + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Stats#get. +const Stats_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Stats#get. +const Stats_GET_SOURCE_CACHED = "cached" + +func statsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fields["interface_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["interface_id"] = "InterfaceId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeInterfaceStatisticsPropertiesBindingType) +} + +func statsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fields["interface_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["interface_id"] = "InterfaceId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["interface_id"] = bindings.NewStringType() + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + paramsTypeMap["interfaceId"] = bindings.NewStringType() + pathParams["interface_id"] = "interfaceId" + pathParams["node_id"] = "nodeId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/nodes/{nodeId}/network/interfaces/{interfaceId}/stats", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/nodes/repo_sync/RepoSyncPackageTypes.go b/services/nsxt-mp/nsx/cluster/nodes/repo_sync/RepoSyncPackageTypes.go new file mode 100644 index 000000000..8f8d69c12 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/nodes/repo_sync/RepoSyncPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.cluster.nodes.repo_sync. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package repo_sync diff --git a/services/nsxt-mp/nsx/cluster/nodes/repo_sync/StatusClient.go b/services/nsxt-mp/nsx/cluster/nodes/repo_sync/StatusClient.go new file mode 100644 index 000000000..493d93bcd --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/nodes/repo_sync/StatusClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package repo_sync + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Returns the synchronization status for the manager represented by given . + // + // @param nodeIdParam (required) + // @return com.vmware.nsx.model.RepoSyncStatusReport + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nodeIdParam string) (model.RepoSyncStatusReport, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.nodes.repo_sync.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(nodeIdParam string) (model.RepoSyncStatusReport, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RepoSyncStatusReport + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.nodes.repo_sync.status", "get", inputDataValue, executionContext) + var emptyOutput model.RepoSyncStatusReport + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RepoSyncStatusReport), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/nodes/repo_sync/StatusTypes.go b/services/nsxt-mp/nsx/cluster/nodes/repo_sync/StatusTypes.go new file mode 100644 index 000000000..7fb151671 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/nodes/repo_sync/StatusTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package repo_sync + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RepoSyncStatusReportBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/nodes/{nodeId}/repo_sync/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/restore/BackuptimestampsClient.go b/services/nsxt-mp/nsx/cluster/restore/BackuptimestampsClient.go new file mode 100644 index 000000000..57ca9310d --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/restore/BackuptimestampsClient.go @@ -0,0 +1,98 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Backuptimestamps +// Used by client-side stubs. + +package restore + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type BackuptimestampsClient interface { + + // Returns timestamps for all backup files that are available on the SFTP server. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.ClusterBackupInfoListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ClusterBackupInfoListResult, error) +} + +type backuptimestampsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewBackuptimestampsClient(connector client.Connector) *backuptimestampsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.restore.backuptimestamps") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + bIface := backuptimestampsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &bIface +} + +func (bIface *backuptimestampsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := bIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (bIface *backuptimestampsClient) Get(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ClusterBackupInfoListResult, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(backuptimestampsGetInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterBackupInfoListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := backuptimestampsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.restore.backuptimestamps", "get", inputDataValue, executionContext) + var emptyOutput model.ClusterBackupInfoListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), backuptimestampsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterBackupInfoListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/restore/BackuptimestampsTypes.go b/services/nsxt-mp/nsx/cluster/restore/BackuptimestampsTypes.go new file mode 100644 index 000000000..bb70da385 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/restore/BackuptimestampsTypes.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Backuptimestamps. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package restore + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func backuptimestampsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func backuptimestampsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterBackupInfoListResultBindingType) +} + +func backuptimestampsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/restore/backuptimestamps", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/restore/ConfigClient.go b/services/nsxt-mp/nsx/cluster/restore/ConfigClient.go new file mode 100644 index 000000000..38f638bf0 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/restore/ConfigClient.go @@ -0,0 +1,130 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Config +// Used by client-side stubs. + +package restore + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ConfigClient interface { + + // Deprecated. Please use API /cluster/backups/config, to get remote file server(where backuped-up files are stored) details durign restore. In older versions - Get configuration information for the file server used to store backed-up files. Fields that contain secrets (password, passphrase) are not returned. + // @return com.vmware.nsx.model.RestoreConfiguration + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.RestoreConfiguration, error) + + // Deprecated. Please use API /cluster/backups/config, to configure remote file server(where backed-up files are stored) details during restore. In older versions - Configure file server where the backed-up files used for the Restore operation are available. + // + // @param restoreConfigurationParam (required) + // @return com.vmware.nsx.model.RestoreConfiguration + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(restoreConfigurationParam model.RestoreConfiguration) (model.RestoreConfiguration, error) +} + +type configClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewConfigClient(connector client.Connector) *configClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.restore.config") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := configClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *configClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *configClient) Get() (model.RestoreConfiguration, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(configGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RestoreConfiguration + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := configGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.restore.config", "get", inputDataValue, executionContext) + var emptyOutput model.RestoreConfiguration + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), configGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RestoreConfiguration), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *configClient) Update(restoreConfigurationParam model.RestoreConfiguration) (model.RestoreConfiguration, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(configUpdateInputType(), typeConverter) + sv.AddStructField("RestoreConfiguration", restoreConfigurationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RestoreConfiguration + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := configUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.restore.config", "update", inputDataValue, executionContext) + var emptyOutput model.RestoreConfiguration + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), configUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RestoreConfiguration), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/restore/ConfigTypes.go b/services/nsxt-mp/nsx/cluster/restore/ConfigTypes.go new file mode 100644 index 000000000..208cc720c --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/restore/ConfigTypes.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Config. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package restore + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func configGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func configGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RestoreConfigurationBindingType) +} + +func configGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/restore/config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func configUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["restore_configuration"] = bindings.NewReferenceType(model.RestoreConfigurationBindingType) + fieldNameMap["restore_configuration"] = "RestoreConfiguration" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func configUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RestoreConfigurationBindingType) +} + +func configUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["restore_configuration"] = bindings.NewReferenceType(model.RestoreConfigurationBindingType) + fieldNameMap["restore_configuration"] = "RestoreConfiguration" + paramsTypeMap["restore_configuration"] = bindings.NewReferenceType(model.RestoreConfigurationBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "restore_configuration", + "PUT", + "/api/v1/cluster/restore/config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/restore/InstructionResourcesClient.go b/services/nsxt-mp/nsx/cluster/restore/InstructionResourcesClient.go new file mode 100644 index 000000000..68ef904a2 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/restore/InstructionResourcesClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: InstructionResources +// Used by client-side stubs. + +package restore + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type InstructionResourcesClient interface { + + // For restore operations requiring user input e.g. performing an action, accepting/rejecting an action, etc. the information to be conveyed to users is provided in this call. + // + // @param instructionIdParam Id of the instruction set whose instructions are to be returned (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.ActionableResourceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(instructionIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ActionableResourceListResult, error) +} + +type instructionResourcesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewInstructionResourcesClient(connector client.Connector) *instructionResourcesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.restore.instruction_resources") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := instructionResourcesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *instructionResourcesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *instructionResourcesClient) Get(instructionIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ActionableResourceListResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(instructionResourcesGetInputType(), typeConverter) + sv.AddStructField("InstructionId", instructionIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ActionableResourceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := instructionResourcesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.restore.instruction_resources", "get", inputDataValue, executionContext) + var emptyOutput model.ActionableResourceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), instructionResourcesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ActionableResourceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/restore/InstructionResourcesTypes.go b/services/nsxt-mp/nsx/cluster/restore/InstructionResourcesTypes.go new file mode 100644 index 000000000..69ddb9dc3 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/restore/InstructionResourcesTypes.go @@ -0,0 +1,98 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: InstructionResources. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package restore + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func instructionResourcesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["instruction_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["instruction_id"] = "InstructionId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func instructionResourcesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ActionableResourceListResultBindingType) +} + +func instructionResourcesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["instruction_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["instruction_id"] = "InstructionId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["instruction_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["instruction_id"] = "instruction_id" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/restore/instruction-resources", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/cluster/restore/RestorePackageTypes.go b/services/nsxt-mp/nsx/cluster/restore/RestorePackageTypes.go new file mode 100644 index 000000000..bc51f8616 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/restore/RestorePackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.cluster.restore. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package restore diff --git a/services/nsxt-mp/nsx/cluster/restore/StatusClient.go b/services/nsxt-mp/nsx/cluster/restore/StatusClient.go new file mode 100644 index 000000000..477dcf01e --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/restore/StatusClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package restore + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Returns status information for the specified NSX cluster restore request. + // + // @param restoreComponentParam (optional, default to LOCAL_MANAGER) + // @return com.vmware.nsx.model.ClusterRestoreStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(restoreComponentParam *string) (model.ClusterRestoreStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.cluster.restore.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(restoreComponentParam *string) (model.ClusterRestoreStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("RestoreComponent", restoreComponentParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ClusterRestoreStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.cluster.restore.status", "get", inputDataValue, executionContext) + var emptyOutput model.ClusterRestoreStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ClusterRestoreStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/cluster/restore/StatusTypes.go b/services/nsxt-mp/nsx/cluster/restore/StatusTypes.go new file mode 100644 index 000000000..290af7973 --- /dev/null +++ b/services/nsxt-mp/nsx/cluster/restore/StatusTypes.go @@ -0,0 +1,74 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package restore + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``restoreComponent`` of method Status#get. +const Status_GET_RESTORE_COMPONENT_LOCAL_MANAGER = "LOCAL_MANAGER" + +// Possible value for ``restoreComponent`` of method Status#get. +const Status_GET_RESTORE_COMPONENT_GLOBAL_MANAGER = "GLOBAL_MANAGER" + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["restore_component"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["restore_component"] = "RestoreComponent" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ClusterRestoreStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["restore_component"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["restore_component"] = "RestoreComponent" + paramsTypeMap["restore_component"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["restore_component"] = "restore_component" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/cluster/restore/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/configs/ConfigsPackageTypes.go b/services/nsxt-mp/nsx/configs/ConfigsPackageTypes.go new file mode 100644 index 000000000..43a2bf033 --- /dev/null +++ b/services/nsxt-mp/nsx/configs/ConfigsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.configs. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package configs diff --git a/services/nsxt-mp/nsx/configs/InventoryClient.go b/services/nsxt-mp/nsx/configs/InventoryClient.go new file mode 100644 index 000000000..c01053947 --- /dev/null +++ b/services/nsxt-mp/nsx/configs/InventoryClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Inventory +// Used by client-side stubs. + +package configs + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type InventoryClient interface { + + // Supports retrieving following configuration of inventory module 1. Soft limit on number of compute managers that can be registered. + // @return com.vmware.nsx.model.InventoryConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.InventoryConfig, error) +} + +type inventoryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewInventoryClient(connector client.Connector) *inventoryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.configs.inventory") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := inventoryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *inventoryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *inventoryClient) Get() (model.InventoryConfig, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(inventoryGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.InventoryConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := inventoryGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.configs.inventory", "get", inputDataValue, executionContext) + var emptyOutput model.InventoryConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), inventoryGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.InventoryConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/configs/InventoryTypes.go b/services/nsxt-mp/nsx/configs/InventoryTypes.go new file mode 100644 index 000000000..12ab10a57 --- /dev/null +++ b/services/nsxt-mp/nsx/configs/InventoryTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Inventory. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package configs + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func inventoryGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func inventoryGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.InventoryConfigBindingType) +} + +func inventoryGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/configs/inventory", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/configs/ManagementClient.go b/services/nsxt-mp/nsx/configs/ManagementClient.go new file mode 100644 index 000000000..f7fd831f0 --- /dev/null +++ b/services/nsxt-mp/nsx/configs/ManagementClient.go @@ -0,0 +1,130 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Management +// Used by client-side stubs. + +package configs + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ManagementClient interface { + + // Returns the NSX Management nodes global configuration. + // @return com.vmware.nsx.model.ManagementConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.ManagementConfig, error) + + // Modifies the NSX Management nodes global configuration. + // + // @param managementConfigParam (required) + // @return com.vmware.nsx.model.ManagementConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(managementConfigParam model.ManagementConfig) (model.ManagementConfig, error) +} + +type managementClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewManagementClient(connector client.Connector) *managementClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.configs.management") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := managementClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *managementClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *managementClient) Get() (model.ManagementConfig, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(managementGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ManagementConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := managementGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.configs.management", "get", inputDataValue, executionContext) + var emptyOutput model.ManagementConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), managementGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ManagementConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *managementClient) Update(managementConfigParam model.ManagementConfig) (model.ManagementConfig, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(managementUpdateInputType(), typeConverter) + sv.AddStructField("ManagementConfig", managementConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ManagementConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := managementUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.configs.management", "update", inputDataValue, executionContext) + var emptyOutput model.ManagementConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), managementUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ManagementConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/configs/ManagementTypes.go b/services/nsxt-mp/nsx/configs/ManagementTypes.go new file mode 100644 index 000000000..e410decd8 --- /dev/null +++ b/services/nsxt-mp/nsx/configs/ManagementTypes.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Management. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package configs + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func managementGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func managementGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ManagementConfigBindingType) +} + +func managementGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/configs/management", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func managementUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["management_config"] = bindings.NewReferenceType(model.ManagementConfigBindingType) + fieldNameMap["management_config"] = "ManagementConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func managementUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ManagementConfigBindingType) +} + +func managementUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["management_config"] = bindings.NewReferenceType(model.ManagementConfigBindingType) + fieldNameMap["management_config"] = "ManagementConfig" + paramsTypeMap["management_config"] = bindings.NewReferenceType(model.ManagementConfigBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "management_config", + "PUT", + "/api/v1/configs/management", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/configs/central_config/CentralConfigPackageTypes.go b/services/nsxt-mp/nsx/configs/central_config/CentralConfigPackageTypes.go new file mode 100644 index 000000000..13af4ab32 --- /dev/null +++ b/services/nsxt-mp/nsx/configs/central_config/CentralConfigPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.configs.central_config. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package central_config diff --git a/services/nsxt-mp/nsx/configs/central_config/NodeConfigProfilesClient.go b/services/nsxt-mp/nsx/configs/central_config/NodeConfigProfilesClient.go new file mode 100644 index 000000000..75125a1e6 --- /dev/null +++ b/services/nsxt-mp/nsx/configs/central_config/NodeConfigProfilesClient.go @@ -0,0 +1,177 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: NodeConfigProfiles +// Used by client-side stubs. + +package central_config + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NodeConfigProfilesClient interface { + + // Returns properties in specified Central Node Config profile. Sensitive data (like SNMP v2c community strings) are included only if query parameter \"show_sensitive_data\" is true. + // + // @param profileIdParam Central Node Config profile id (required) + // @param showSensitiveDataParam Show sensitive data in Central Node Config profile (optional, default to false) + // @return com.vmware.nsx.model.CentralNodeConfigProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(profileIdParam string, showSensitiveDataParam *bool) (model.CentralNodeConfigProfile, error) + + // Returns list of all Central Node Config profiles. + // @return com.vmware.nsx.model.CentralNodeConfigProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.CentralNodeConfigProfileListResult, error) + + // Updates properties in the specified Central Node Config profile. + // + // @param nodeConfigProfileIdParam (required) + // @param centralNodeConfigProfileParam (required) + // @return com.vmware.nsx.model.CentralNodeConfigProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(nodeConfigProfileIdParam string, centralNodeConfigProfileParam model.CentralNodeConfigProfile) (model.CentralNodeConfigProfile, error) +} + +type nodeConfigProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNodeConfigProfilesClient(connector client.Connector) *nodeConfigProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.configs.central_config.node_config_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nodeConfigProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nodeConfigProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nodeConfigProfilesClient) Get(profileIdParam string, showSensitiveDataParam *bool) (model.CentralNodeConfigProfile, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodeConfigProfilesGetInputType(), typeConverter) + sv.AddStructField("ProfileId", profileIdParam) + sv.AddStructField("ShowSensitiveData", showSensitiveDataParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CentralNodeConfigProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodeConfigProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.configs.central_config.node_config_profiles", "get", inputDataValue, executionContext) + var emptyOutput model.CentralNodeConfigProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nodeConfigProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CentralNodeConfigProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nodeConfigProfilesClient) List() (model.CentralNodeConfigProfileListResult, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodeConfigProfilesListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CentralNodeConfigProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodeConfigProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.configs.central_config.node_config_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.CentralNodeConfigProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nodeConfigProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CentralNodeConfigProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nodeConfigProfilesClient) Update(nodeConfigProfileIdParam string, centralNodeConfigProfileParam model.CentralNodeConfigProfile) (model.CentralNodeConfigProfile, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodeConfigProfilesUpdateInputType(), typeConverter) + sv.AddStructField("NodeConfigProfileId", nodeConfigProfileIdParam) + sv.AddStructField("CentralNodeConfigProfile", centralNodeConfigProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CentralNodeConfigProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodeConfigProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.configs.central_config.node_config_profiles", "update", inputDataValue, executionContext) + var emptyOutput model.CentralNodeConfigProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nodeConfigProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CentralNodeConfigProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/configs/central_config/NodeConfigProfilesTypes.go b/services/nsxt-mp/nsx/configs/central_config/NodeConfigProfilesTypes.go new file mode 100644 index 000000000..b8c52b814 --- /dev/null +++ b/services/nsxt-mp/nsx/configs/central_config/NodeConfigProfilesTypes.go @@ -0,0 +1,173 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: NodeConfigProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package central_config + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func nodeConfigProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["profile_id"] = bindings.NewStringType() + fields["show_sensitive_data"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["profile_id"] = "ProfileId" + fieldNameMap["show_sensitive_data"] = "ShowSensitiveData" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodeConfigProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CentralNodeConfigProfileBindingType) +} + +func nodeConfigProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["profile_id"] = bindings.NewStringType() + fields["show_sensitive_data"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["profile_id"] = "ProfileId" + fieldNameMap["show_sensitive_data"] = "ShowSensitiveData" + paramsTypeMap["profile_id"] = bindings.NewStringType() + paramsTypeMap["show_sensitive_data"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["profileId"] = bindings.NewStringType() + pathParams["profile_id"] = "profileId" + queryParams["show_sensitive_data"] = "show_sensitive_data" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/configs/central-config/node-config-profiles/{profileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nodeConfigProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodeConfigProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CentralNodeConfigProfileListResultBindingType) +} + +func nodeConfigProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/configs/central-config/node-config-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nodeConfigProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_config_profile_id"] = bindings.NewStringType() + fields["central_node_config_profile"] = bindings.NewReferenceType(model.CentralNodeConfigProfileBindingType) + fieldNameMap["node_config_profile_id"] = "NodeConfigProfileId" + fieldNameMap["central_node_config_profile"] = "CentralNodeConfigProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodeConfigProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CentralNodeConfigProfileBindingType) +} + +func nodeConfigProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_config_profile_id"] = bindings.NewStringType() + fields["central_node_config_profile"] = bindings.NewReferenceType(model.CentralNodeConfigProfileBindingType) + fieldNameMap["node_config_profile_id"] = "NodeConfigProfileId" + fieldNameMap["central_node_config_profile"] = "CentralNodeConfigProfile" + paramsTypeMap["central_node_config_profile"] = bindings.NewReferenceType(model.CentralNodeConfigProfileBindingType) + paramsTypeMap["node_config_profile_id"] = bindings.NewStringType() + paramsTypeMap["nodeConfigProfileId"] = bindings.NewStringType() + pathParams["node_config_profile_id"] = "nodeConfigProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "central_node_config_profile", + "PUT", + "/api/v1/configs/central-config/node-config-profiles/{nodeConfigProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/configs/node/ModeClient.go b/services/nsxt-mp/nsx/configs/node/ModeClient.go new file mode 100644 index 000000000..f9c0b9cfb --- /dev/null +++ b/services/nsxt-mp/nsx/configs/node/ModeClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Mode +// Used by client-side stubs. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ModeClient interface { + + // Currently only a switch from \"VMC_LOCAL\" to \"VMC\" is supported. Returns a new Node Mode, if the request successfuly changed it. Optionally provisions public oauth2 client info. + // + // @param switchingToVmcModeParametersParam (required) + // @return com.vmware.nsx.model.NodeMode + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(switchingToVmcModeParametersParam model.SwitchingToVmcModeParameters) (model.NodeMode, error) +} + +type modeClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewModeClient(connector client.Connector) *modeClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.configs.node.mode") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := modeClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *modeClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *modeClient) Create(switchingToVmcModeParametersParam model.SwitchingToVmcModeParameters) (model.NodeMode, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(modeCreateInputType(), typeConverter) + sv.AddStructField("SwitchingToVmcModeParameters", switchingToVmcModeParametersParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeMode + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := modeCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.configs.node.mode", "create", inputDataValue, executionContext) + var emptyOutput model.NodeMode + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), modeCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeMode), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/configs/node/ModeTypes.go b/services/nsxt-mp/nsx/configs/node/ModeTypes.go new file mode 100644 index 000000000..9e0f1213b --- /dev/null +++ b/services/nsxt-mp/nsx/configs/node/ModeTypes.go @@ -0,0 +1,67 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Mode. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func modeCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["switching_to_vmc_mode_parameters"] = bindings.NewReferenceType(model.SwitchingToVmcModeParametersBindingType) + fieldNameMap["switching_to_vmc_mode_parameters"] = "SwitchingToVmcModeParameters" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func modeCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeModeBindingType) +} + +func modeCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["switching_to_vmc_mode_parameters"] = bindings.NewReferenceType(model.SwitchingToVmcModeParametersBindingType) + fieldNameMap["switching_to_vmc_mode_parameters"] = "SwitchingToVmcModeParameters" + paramsTypeMap["switching_to_vmc_mode_parameters"] = bindings.NewReferenceType(model.SwitchingToVmcModeParametersBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "switching_to_vmc_mode_parameters", + "POST", + "/api/v1/configs/node/mode", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/configs/node/NodePackageTypes.go b/services/nsxt-mp/nsx/configs/node/NodePackageTypes.go new file mode 100644 index 000000000..ac942fab3 --- /dev/null +++ b/services/nsxt-mp/nsx/configs/node/NodePackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.configs.node. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package node diff --git a/services/nsxt-mp/nsx/dhcp/DhcpPackageTypes.go b/services/nsxt-mp/nsx/dhcp/DhcpPackageTypes.go new file mode 100644 index 000000000..d322e207a --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/DhcpPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.dhcp. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package dhcp diff --git a/services/nsxt-mp/nsx/dhcp/RelayProfilesClient.go b/services/nsxt-mp/nsx/dhcp/RelayProfilesClient.go new file mode 100644 index 000000000..d30c02dcb --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/RelayProfilesClient.go @@ -0,0 +1,265 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: RelayProfiles +// Used by client-side stubs. + +package dhcp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RelayProfilesClient interface { + + // Creates a dhcp relay profile. + // + // @param dhcpRelayProfileParam (required) + // @return com.vmware.nsx.model.DhcpRelayProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(dhcpRelayProfileParam model.DhcpRelayProfile) (model.DhcpRelayProfile, error) + + // Deletes the specified dhcp relay profile. + // + // @param relayProfileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(relayProfileIdParam string) error + + // Returns information about the specified dhcp relay profile. + // + // @param relayProfileIdParam (required) + // @return com.vmware.nsx.model.DhcpRelayProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(relayProfileIdParam string) (model.DhcpRelayProfile, error) + + // Returns information about all dhcp relay profiles. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.DhcpRelayProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DhcpRelayProfileListResult, error) + + // Modifies the specified dhcp relay profile. + // + // @param relayProfileIdParam (required) + // @param dhcpRelayProfileParam (required) + // @return com.vmware.nsx.model.DhcpRelayProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(relayProfileIdParam string, dhcpRelayProfileParam model.DhcpRelayProfile) (model.DhcpRelayProfile, error) +} + +type relayProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRelayProfilesClient(connector client.Connector) *relayProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.dhcp.relay_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := relayProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *relayProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *relayProfilesClient) Create(dhcpRelayProfileParam model.DhcpRelayProfile) (model.DhcpRelayProfile, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(relayProfilesCreateInputType(), typeConverter) + sv.AddStructField("DhcpRelayProfile", dhcpRelayProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpRelayProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := relayProfilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.relay_profiles", "create", inputDataValue, executionContext) + var emptyOutput model.DhcpRelayProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), relayProfilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpRelayProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *relayProfilesClient) Delete(relayProfileIdParam string) error { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(relayProfilesDeleteInputType(), typeConverter) + sv.AddStructField("RelayProfileId", relayProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := relayProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.relay_profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (rIface *relayProfilesClient) Get(relayProfileIdParam string) (model.DhcpRelayProfile, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(relayProfilesGetInputType(), typeConverter) + sv.AddStructField("RelayProfileId", relayProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpRelayProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := relayProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.relay_profiles", "get", inputDataValue, executionContext) + var emptyOutput model.DhcpRelayProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), relayProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpRelayProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *relayProfilesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DhcpRelayProfileListResult, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(relayProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpRelayProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := relayProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.relay_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.DhcpRelayProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), relayProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpRelayProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *relayProfilesClient) Update(relayProfileIdParam string, dhcpRelayProfileParam model.DhcpRelayProfile) (model.DhcpRelayProfile, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(relayProfilesUpdateInputType(), typeConverter) + sv.AddStructField("RelayProfileId", relayProfileIdParam) + sv.AddStructField("DhcpRelayProfile", dhcpRelayProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpRelayProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := relayProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.relay_profiles", "update", inputDataValue, executionContext) + var emptyOutput model.DhcpRelayProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), relayProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpRelayProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/dhcp/RelayProfilesTypes.go b/services/nsxt-mp/nsx/dhcp/RelayProfilesTypes.go new file mode 100644 index 000000000..ca10695f2 --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/RelayProfilesTypes.go @@ -0,0 +1,295 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: RelayProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package dhcp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func relayProfilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dhcp_relay_profile"] = bindings.NewReferenceType(model.DhcpRelayProfileBindingType) + fieldNameMap["dhcp_relay_profile"] = "DhcpRelayProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func relayProfilesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpRelayProfileBindingType) +} + +func relayProfilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dhcp_relay_profile"] = bindings.NewReferenceType(model.DhcpRelayProfileBindingType) + fieldNameMap["dhcp_relay_profile"] = "DhcpRelayProfile" + paramsTypeMap["dhcp_relay_profile"] = bindings.NewReferenceType(model.DhcpRelayProfileBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dhcp_relay_profile", + "POST", + "/api/v1/dhcp/relay-profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func relayProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["relay_profile_id"] = bindings.NewStringType() + fieldNameMap["relay_profile_id"] = "RelayProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func relayProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func relayProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["relay_profile_id"] = bindings.NewStringType() + fieldNameMap["relay_profile_id"] = "RelayProfileId" + paramsTypeMap["relay_profile_id"] = bindings.NewStringType() + paramsTypeMap["relayProfileId"] = bindings.NewStringType() + pathParams["relay_profile_id"] = "relayProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/dhcp/relay-profiles/{relayProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func relayProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["relay_profile_id"] = bindings.NewStringType() + fieldNameMap["relay_profile_id"] = "RelayProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func relayProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpRelayProfileBindingType) +} + +func relayProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["relay_profile_id"] = bindings.NewStringType() + fieldNameMap["relay_profile_id"] = "RelayProfileId" + paramsTypeMap["relay_profile_id"] = bindings.NewStringType() + paramsTypeMap["relayProfileId"] = bindings.NewStringType() + pathParams["relay_profile_id"] = "relayProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dhcp/relay-profiles/{relayProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func relayProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func relayProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpRelayProfileListResultBindingType) +} + +func relayProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dhcp/relay-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func relayProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["relay_profile_id"] = bindings.NewStringType() + fields["dhcp_relay_profile"] = bindings.NewReferenceType(model.DhcpRelayProfileBindingType) + fieldNameMap["relay_profile_id"] = "RelayProfileId" + fieldNameMap["dhcp_relay_profile"] = "DhcpRelayProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func relayProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpRelayProfileBindingType) +} + +func relayProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["relay_profile_id"] = bindings.NewStringType() + fields["dhcp_relay_profile"] = bindings.NewReferenceType(model.DhcpRelayProfileBindingType) + fieldNameMap["relay_profile_id"] = "RelayProfileId" + fieldNameMap["dhcp_relay_profile"] = "DhcpRelayProfile" + paramsTypeMap["relay_profile_id"] = bindings.NewStringType() + paramsTypeMap["dhcp_relay_profile"] = bindings.NewReferenceType(model.DhcpRelayProfileBindingType) + paramsTypeMap["relayProfileId"] = bindings.NewStringType() + pathParams["relay_profile_id"] = "relayProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dhcp_relay_profile", + "PUT", + "/api/v1/dhcp/relay-profiles/{relayProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/dhcp/RelaysClient.go b/services/nsxt-mp/nsx/dhcp/RelaysClient.go new file mode 100644 index 000000000..b2eb93d55 --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/RelaysClient.go @@ -0,0 +1,265 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Relays +// Used by client-side stubs. + +package dhcp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RelaysClient interface { + + // Creates a dhcp relay service. + // + // @param dhcpRelayServiceParam (required) + // @return com.vmware.nsx.model.DhcpRelayService + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(dhcpRelayServiceParam model.DhcpRelayService) (model.DhcpRelayService, error) + + // Deletes the specified dhcp relay service. + // + // @param relayIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(relayIdParam string) error + + // Returns the dhcp relay service information. + // + // @param relayIdParam (required) + // @return com.vmware.nsx.model.DhcpRelayService + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(relayIdParam string) (model.DhcpRelayService, error) + + // Returns information about all configured dhcp relay services. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.DhcpRelayServiceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DhcpRelayServiceListResult, error) + + // Modifies the specified dhcp relay service. + // + // @param relayIdParam (required) + // @param dhcpRelayServiceParam (required) + // @return com.vmware.nsx.model.DhcpRelayService + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(relayIdParam string, dhcpRelayServiceParam model.DhcpRelayService) (model.DhcpRelayService, error) +} + +type relaysClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRelaysClient(connector client.Connector) *relaysClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.dhcp.relays") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := relaysClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *relaysClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *relaysClient) Create(dhcpRelayServiceParam model.DhcpRelayService) (model.DhcpRelayService, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(relaysCreateInputType(), typeConverter) + sv.AddStructField("DhcpRelayService", dhcpRelayServiceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpRelayService + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := relaysCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.relays", "create", inputDataValue, executionContext) + var emptyOutput model.DhcpRelayService + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), relaysCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpRelayService), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *relaysClient) Delete(relayIdParam string) error { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(relaysDeleteInputType(), typeConverter) + sv.AddStructField("RelayId", relayIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := relaysDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.relays", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (rIface *relaysClient) Get(relayIdParam string) (model.DhcpRelayService, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(relaysGetInputType(), typeConverter) + sv.AddStructField("RelayId", relayIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpRelayService + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := relaysGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.relays", "get", inputDataValue, executionContext) + var emptyOutput model.DhcpRelayService + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), relaysGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpRelayService), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *relaysClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DhcpRelayServiceListResult, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(relaysListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpRelayServiceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := relaysListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.relays", "list", inputDataValue, executionContext) + var emptyOutput model.DhcpRelayServiceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), relaysListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpRelayServiceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *relaysClient) Update(relayIdParam string, dhcpRelayServiceParam model.DhcpRelayService) (model.DhcpRelayService, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(relaysUpdateInputType(), typeConverter) + sv.AddStructField("RelayId", relayIdParam) + sv.AddStructField("DhcpRelayService", dhcpRelayServiceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpRelayService + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := relaysUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.relays", "update", inputDataValue, executionContext) + var emptyOutput model.DhcpRelayService + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), relaysUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpRelayService), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/dhcp/RelaysTypes.go b/services/nsxt-mp/nsx/dhcp/RelaysTypes.go new file mode 100644 index 000000000..8d9c615e7 --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/RelaysTypes.go @@ -0,0 +1,295 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Relays. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package dhcp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func relaysCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dhcp_relay_service"] = bindings.NewReferenceType(model.DhcpRelayServiceBindingType) + fieldNameMap["dhcp_relay_service"] = "DhcpRelayService" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func relaysCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpRelayServiceBindingType) +} + +func relaysCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dhcp_relay_service"] = bindings.NewReferenceType(model.DhcpRelayServiceBindingType) + fieldNameMap["dhcp_relay_service"] = "DhcpRelayService" + paramsTypeMap["dhcp_relay_service"] = bindings.NewReferenceType(model.DhcpRelayServiceBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dhcp_relay_service", + "POST", + "/api/v1/dhcp/relays", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func relaysDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["relay_id"] = bindings.NewStringType() + fieldNameMap["relay_id"] = "RelayId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func relaysDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func relaysDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["relay_id"] = bindings.NewStringType() + fieldNameMap["relay_id"] = "RelayId" + paramsTypeMap["relay_id"] = bindings.NewStringType() + paramsTypeMap["relayId"] = bindings.NewStringType() + pathParams["relay_id"] = "relayId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/dhcp/relays/{relayId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func relaysGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["relay_id"] = bindings.NewStringType() + fieldNameMap["relay_id"] = "RelayId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func relaysGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpRelayServiceBindingType) +} + +func relaysGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["relay_id"] = bindings.NewStringType() + fieldNameMap["relay_id"] = "RelayId" + paramsTypeMap["relay_id"] = bindings.NewStringType() + paramsTypeMap["relayId"] = bindings.NewStringType() + pathParams["relay_id"] = "relayId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dhcp/relays/{relayId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func relaysListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func relaysListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpRelayServiceListResultBindingType) +} + +func relaysListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dhcp/relays", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func relaysUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["relay_id"] = bindings.NewStringType() + fields["dhcp_relay_service"] = bindings.NewReferenceType(model.DhcpRelayServiceBindingType) + fieldNameMap["relay_id"] = "RelayId" + fieldNameMap["dhcp_relay_service"] = "DhcpRelayService" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func relaysUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpRelayServiceBindingType) +} + +func relaysUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["relay_id"] = bindings.NewStringType() + fields["dhcp_relay_service"] = bindings.NewReferenceType(model.DhcpRelayServiceBindingType) + fieldNameMap["relay_id"] = "RelayId" + fieldNameMap["dhcp_relay_service"] = "DhcpRelayService" + paramsTypeMap["dhcp_relay_service"] = bindings.NewReferenceType(model.DhcpRelayServiceBindingType) + paramsTypeMap["relay_id"] = bindings.NewStringType() + paramsTypeMap["relayId"] = bindings.NewStringType() + pathParams["relay_id"] = "relayId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dhcp_relay_service", + "PUT", + "/api/v1/dhcp/relays/{relayId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/dhcp/ServerProfilesClient.go b/services/nsxt-mp/nsx/dhcp/ServerProfilesClient.go new file mode 100644 index 000000000..d12c63a13 --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/ServerProfilesClient.go @@ -0,0 +1,310 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ServerProfiles +// Used by client-side stubs. + +package dhcp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ServerProfilesClient interface { + + // Create a DHCP server profile. If no edge member is specified, edge members to run the dhcp servers will be auto-allocated from the edge cluster. + // + // @param dhcpProfileParam (required) + // @return com.vmware.nsx.model.DhcpProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(dhcpProfileParam model.DhcpProfile) (model.DhcpProfile, error) + + // Delete a DHCP server profile specified by the profile id. + // + // @param profileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(profileIdParam string) error + + // Return the DHCP profile specified by the profile id. + // + // @param profileIdParam (required) + // @return com.vmware.nsx.model.DhcpProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(profileIdParam string) (model.DhcpProfile, error) + + // Get a paginated list of DHCP server profiles. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.DhcpProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DhcpProfileListResult, error) + + // As changing edge-cluster-id of a DhcpProfile by a PUT is disallowed, this re-allocate API is used to modify the edge-cluster-id and members of a given DhcpProfile. Only the edge-cluster-id and the edge-cluster-member-indexes fields will be picked up by this re-allication API. The othere fields in the payload will be ignored. If the edge-cluster-id in the payload DhcpProfile is different from the current edge-cluster-id of the profile, the referencing DHCP server(s) will be re-allocated to the new edge cluster. If the edge-cluster-id is not changed, the referencing DHCP server(s) will be re-allocated to the given edge members in the edge cluster. In this case, this REST API will act same as that of updating a DhcpProfile. If the edge cluster member indexes are provided, they should exist in the given edge cluster. If the indexes are not specified in the DhcpProfile, edge members will be auto-allocated from the given edge cluster. Please note that re-allocating edge-cluster will cause lose of all exisitng DHCP lease information. This API is used only when loosing DHCP leases is not a real problem, e.g. cross-site migration or failover and all client hosts will be reboot and get new IP addresses. + // + // @param serverProfileIdParam (required) + // @param dhcpProfileParam (required) + // @return com.vmware.nsx.model.DhcpProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Reallocate(serverProfileIdParam string, dhcpProfileParam model.DhcpProfile) (model.DhcpProfile, error) + + // If both the edge_cluster_member_indexes in the DhcpProfile are changed in a same PUT API, e.g. change from [a,b] to [x,y], the current DHCP server leases will be lost, which could cause the network crash due to ip conflicts. Hence the suggestion is to change only one member index in one single update, e.g. from [a, b] to [a,y]. Please note, the edge_cluster_id in DhcpProfile can NOT be changed by this PUT operation because all existing DHCP leases will lost. If losing leases is not a problem, a dedicated re-allocation API is suggested to modify the edge-cluster-id, i.e. \"POST /api/v1/dhcp/dhcp-profiles/?action=reallocate\". Meanwhile, if the edge_cluster_member_indexes was specified currently but now is changed to none (not specified) via a PUT operation, the edge nodes will not be auto-selected from edge cluster. Instead, the previously-allocated edge nodes will continue to be used by the DHCP server. This is because changing both edge nodes of a DHCP server will lose all existing leases. In case re-allocation is required and leases lost is not a problem (or can be recovered), please invoke the reallocate API mentioned above with new DhcpProfile to accomplish the intent. + // + // @param profileIdParam (required) + // @param dhcpProfileParam (required) + // @return com.vmware.nsx.model.DhcpProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(profileIdParam string, dhcpProfileParam model.DhcpProfile) (model.DhcpProfile, error) +} + +type serverProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewServerProfilesClient(connector client.Connector) *serverProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.dhcp.server_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "reallocate": core.NewMethodIdentifier(interfaceIdentifier, "reallocate"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := serverProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *serverProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *serverProfilesClient) Create(dhcpProfileParam model.DhcpProfile) (model.DhcpProfile, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serverProfilesCreateInputType(), typeConverter) + sv.AddStructField("DhcpProfile", dhcpProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serverProfilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.server_profiles", "create", inputDataValue, executionContext) + var emptyOutput model.DhcpProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serverProfilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serverProfilesClient) Delete(profileIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serverProfilesDeleteInputType(), typeConverter) + sv.AddStructField("ProfileId", profileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serverProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.server_profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *serverProfilesClient) Get(profileIdParam string) (model.DhcpProfile, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serverProfilesGetInputType(), typeConverter) + sv.AddStructField("ProfileId", profileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serverProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.server_profiles", "get", inputDataValue, executionContext) + var emptyOutput model.DhcpProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serverProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serverProfilesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DhcpProfileListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serverProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serverProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.server_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.DhcpProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serverProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serverProfilesClient) Reallocate(serverProfileIdParam string, dhcpProfileParam model.DhcpProfile) (model.DhcpProfile, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serverProfilesReallocateInputType(), typeConverter) + sv.AddStructField("ServerProfileId", serverProfileIdParam) + sv.AddStructField("DhcpProfile", dhcpProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serverProfilesReallocateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.server_profiles", "reallocate", inputDataValue, executionContext) + var emptyOutput model.DhcpProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serverProfilesReallocateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serverProfilesClient) Update(profileIdParam string, dhcpProfileParam model.DhcpProfile) (model.DhcpProfile, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serverProfilesUpdateInputType(), typeConverter) + sv.AddStructField("ProfileId", profileIdParam) + sv.AddStructField("DhcpProfile", dhcpProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serverProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.server_profiles", "update", inputDataValue, executionContext) + var emptyOutput model.DhcpProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serverProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/dhcp/ServerProfilesTypes.go b/services/nsxt-mp/nsx/dhcp/ServerProfilesTypes.go new file mode 100644 index 000000000..cabcb26d8 --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/ServerProfilesTypes.go @@ -0,0 +1,350 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ServerProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package dhcp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func serverProfilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dhcp_profile"] = bindings.NewReferenceType(model.DhcpProfileBindingType) + fieldNameMap["dhcp_profile"] = "DhcpProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serverProfilesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpProfileBindingType) +} + +func serverProfilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dhcp_profile"] = bindings.NewReferenceType(model.DhcpProfileBindingType) + fieldNameMap["dhcp_profile"] = "DhcpProfile" + paramsTypeMap["dhcp_profile"] = bindings.NewReferenceType(model.DhcpProfileBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dhcp_profile", + "POST", + "/api/v1/dhcp/server-profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serverProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["profile_id"] = bindings.NewStringType() + fieldNameMap["profile_id"] = "ProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serverProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func serverProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["profile_id"] = bindings.NewStringType() + fieldNameMap["profile_id"] = "ProfileId" + paramsTypeMap["profile_id"] = bindings.NewStringType() + paramsTypeMap["profileId"] = bindings.NewStringType() + pathParams["profile_id"] = "profileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/dhcp/server-profiles/{profileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serverProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["profile_id"] = bindings.NewStringType() + fieldNameMap["profile_id"] = "ProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serverProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpProfileBindingType) +} + +func serverProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["profile_id"] = bindings.NewStringType() + fieldNameMap["profile_id"] = "ProfileId" + paramsTypeMap["profile_id"] = bindings.NewStringType() + paramsTypeMap["profileId"] = bindings.NewStringType() + pathParams["profile_id"] = "profileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dhcp/server-profiles/{profileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serverProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serverProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpProfileListResultBindingType) +} + +func serverProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dhcp/server-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serverProfilesReallocateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_profile_id"] = bindings.NewStringType() + fields["dhcp_profile"] = bindings.NewReferenceType(model.DhcpProfileBindingType) + fieldNameMap["server_profile_id"] = "ServerProfileId" + fieldNameMap["dhcp_profile"] = "DhcpProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serverProfilesReallocateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpProfileBindingType) +} + +func serverProfilesReallocateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_profile_id"] = bindings.NewStringType() + fields["dhcp_profile"] = bindings.NewReferenceType(model.DhcpProfileBindingType) + fieldNameMap["server_profile_id"] = "ServerProfileId" + fieldNameMap["dhcp_profile"] = "DhcpProfile" + paramsTypeMap["dhcp_profile"] = bindings.NewReferenceType(model.DhcpProfileBindingType) + paramsTypeMap["server_profile_id"] = bindings.NewStringType() + paramsTypeMap["serverProfileId"] = bindings.NewStringType() + pathParams["server_profile_id"] = "serverProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=reallocate", + "dhcp_profile", + "POST", + "/api/v1/dhcp/server-profiles/{serverProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serverProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["profile_id"] = bindings.NewStringType() + fields["dhcp_profile"] = bindings.NewReferenceType(model.DhcpProfileBindingType) + fieldNameMap["profile_id"] = "ProfileId" + fieldNameMap["dhcp_profile"] = "DhcpProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serverProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpProfileBindingType) +} + +func serverProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["profile_id"] = bindings.NewStringType() + fields["dhcp_profile"] = bindings.NewReferenceType(model.DhcpProfileBindingType) + fieldNameMap["profile_id"] = "ProfileId" + fieldNameMap["dhcp_profile"] = "DhcpProfile" + paramsTypeMap["dhcp_profile"] = bindings.NewReferenceType(model.DhcpProfileBindingType) + paramsTypeMap["profile_id"] = bindings.NewStringType() + paramsTypeMap["profileId"] = bindings.NewStringType() + pathParams["profile_id"] = "profileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dhcp_profile", + "PUT", + "/api/v1/dhcp/server-profiles/{profileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/dhcp/ServersClient.go b/services/nsxt-mp/nsx/dhcp/ServersClient.go new file mode 100644 index 000000000..90ca89a8f --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/ServersClient.go @@ -0,0 +1,265 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Servers +// Used by client-side stubs. + +package dhcp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ServersClient interface { + + // Create a logical DHCP server with v4 and/or v6 servers. + // + // @param logicalDhcpServerParam (required) + // @return com.vmware.nsx.model.LogicalDhcpServer + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(logicalDhcpServerParam model.LogicalDhcpServer) (model.LogicalDhcpServer, error) + + // Delete a logical DHCP server specified by server id. + // + // @param serverIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(serverIdParam string) error + + // Retrieve a logical DHCP server specified by server id. + // + // @param serverIdParam (required) + // @return com.vmware.nsx.model.LogicalDhcpServer + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serverIdParam string) (model.LogicalDhcpServer, error) + + // List logical DHCP servers with pagination support. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.LogicalDhcpServerListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LogicalDhcpServerListResult, error) + + // Update a logical DHCP server with new configurations. + // + // @param serverIdParam (required) + // @param logicalDhcpServerParam (required) + // @return com.vmware.nsx.model.LogicalDhcpServer + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(serverIdParam string, logicalDhcpServerParam model.LogicalDhcpServer) (model.LogicalDhcpServer, error) +} + +type serversClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewServersClient(connector client.Connector) *serversClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.dhcp.servers") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := serversClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *serversClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *serversClient) Create(logicalDhcpServerParam model.LogicalDhcpServer) (model.LogicalDhcpServer, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serversCreateInputType(), typeConverter) + sv.AddStructField("LogicalDhcpServer", logicalDhcpServerParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalDhcpServer + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serversCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers", "create", inputDataValue, executionContext) + var emptyOutput model.LogicalDhcpServer + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serversCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalDhcpServer), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serversClient) Delete(serverIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serversDeleteInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serversDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *serversClient) Get(serverIdParam string) (model.LogicalDhcpServer, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serversGetInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalDhcpServer + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serversGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers", "get", inputDataValue, executionContext) + var emptyOutput model.LogicalDhcpServer + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serversGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalDhcpServer), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serversClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LogicalDhcpServerListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serversListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalDhcpServerListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serversListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers", "list", inputDataValue, executionContext) + var emptyOutput model.LogicalDhcpServerListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serversListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalDhcpServerListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serversClient) Update(serverIdParam string, logicalDhcpServerParam model.LogicalDhcpServer) (model.LogicalDhcpServer, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serversUpdateInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("LogicalDhcpServer", logicalDhcpServerParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalDhcpServer + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serversUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers", "update", inputDataValue, executionContext) + var emptyOutput model.LogicalDhcpServer + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serversUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalDhcpServer), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/dhcp/ServersTypes.go b/services/nsxt-mp/nsx/dhcp/ServersTypes.go new file mode 100644 index 000000000..3e7f78482 --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/ServersTypes.go @@ -0,0 +1,295 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Servers. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package dhcp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func serversCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_dhcp_server"] = bindings.NewReferenceType(model.LogicalDhcpServerBindingType) + fieldNameMap["logical_dhcp_server"] = "LogicalDhcpServer" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serversCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalDhcpServerBindingType) +} + +func serversCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_dhcp_server"] = bindings.NewReferenceType(model.LogicalDhcpServerBindingType) + fieldNameMap["logical_dhcp_server"] = "LogicalDhcpServer" + paramsTypeMap["logical_dhcp_server"] = bindings.NewReferenceType(model.LogicalDhcpServerBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "logical_dhcp_server", + "POST", + "/api/v1/dhcp/servers", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serversDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serversDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func serversDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + pathParams["server_id"] = "serverId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/dhcp/servers/{serverId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serversGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serversGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalDhcpServerBindingType) +} + +func serversGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + pathParams["server_id"] = "serverId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dhcp/servers/{serverId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serversListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serversListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalDhcpServerListResultBindingType) +} + +func serversListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dhcp/servers", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serversUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["logical_dhcp_server"] = bindings.NewReferenceType(model.LogicalDhcpServerBindingType) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["logical_dhcp_server"] = "LogicalDhcpServer" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serversUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalDhcpServerBindingType) +} + +func serversUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["logical_dhcp_server"] = bindings.NewReferenceType(model.LogicalDhcpServerBindingType) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["logical_dhcp_server"] = "LogicalDhcpServer" + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["logical_dhcp_server"] = bindings.NewReferenceType(model.LogicalDhcpServerBindingType) + paramsTypeMap["serverId"] = bindings.NewStringType() + pathParams["server_id"] = "serverId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "logical_dhcp_server", + "PUT", + "/api/v1/dhcp/servers/{serverId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/dhcp/servers/IpPoolsClient.go b/services/nsxt-mp/nsx/dhcp/servers/IpPoolsClient.go new file mode 100644 index 000000000..8840f38e9 --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/IpPoolsClient.go @@ -0,0 +1,275 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: IpPools +// Used by client-side stubs. + +package servers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type IpPoolsClient interface { + + // Create an ip pool for a local DHCP server + // + // @param serverIdParam (required) + // @param dhcpIpPoolParam (required) + // @return com.vmware.nsx.model.DhcpIpPool + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(serverIdParam string, dhcpIpPoolParam model.DhcpIpPool) (model.DhcpIpPool, error) + + // Delete a specific ip pool of a given logical DHCP server. + // + // @param serverIdParam (required) + // @param poolIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(serverIdParam string, poolIdParam string) error + + // Return a specific ip pool of a given logical DHCP server. + // + // @param serverIdParam (required) + // @param poolIdParam (required) + // @return com.vmware.nsx.model.DhcpIpPool + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serverIdParam string, poolIdParam string) (model.DhcpIpPool, error) + + // List the ip pools of a logical DHCP server with pagination support. + // + // @param serverIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.DhcpIpPoolListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(serverIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DhcpIpPoolListResult, error) + + // Update a specific ip pool of a given logical DHCP server. + // + // @param serverIdParam (required) + // @param poolIdParam (required) + // @param dhcpIpPoolParam (required) + // @return com.vmware.nsx.model.DhcpIpPool + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(serverIdParam string, poolIdParam string, dhcpIpPoolParam model.DhcpIpPool) (model.DhcpIpPool, error) +} + +type ipPoolsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewIpPoolsClient(connector client.Connector) *ipPoolsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.dhcp.servers.ip_pools") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := ipPoolsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *ipPoolsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *ipPoolsClient) Create(serverIdParam string, dhcpIpPoolParam model.DhcpIpPool) (model.DhcpIpPool, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipPoolsCreateInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("DhcpIpPool", dhcpIpPoolParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpIpPool + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipPoolsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.ip_pools", "create", inputDataValue, executionContext) + var emptyOutput model.DhcpIpPool + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipPoolsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpIpPool), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipPoolsClient) Delete(serverIdParam string, poolIdParam string) error { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipPoolsDeleteInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("PoolId", poolIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipPoolsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.ip_pools", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *ipPoolsClient) Get(serverIdParam string, poolIdParam string) (model.DhcpIpPool, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipPoolsGetInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("PoolId", poolIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpIpPool + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipPoolsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.ip_pools", "get", inputDataValue, executionContext) + var emptyOutput model.DhcpIpPool + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipPoolsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpIpPool), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipPoolsClient) List(serverIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DhcpIpPoolListResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipPoolsListInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpIpPoolListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipPoolsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.ip_pools", "list", inputDataValue, executionContext) + var emptyOutput model.DhcpIpPoolListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipPoolsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpIpPoolListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipPoolsClient) Update(serverIdParam string, poolIdParam string, dhcpIpPoolParam model.DhcpIpPool) (model.DhcpIpPool, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipPoolsUpdateInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("PoolId", poolIdParam) + sv.AddStructField("DhcpIpPool", dhcpIpPoolParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpIpPool + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipPoolsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.ip_pools", "update", inputDataValue, executionContext) + var emptyOutput model.DhcpIpPool + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipPoolsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpIpPool), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/dhcp/servers/IpPoolsTypes.go b/services/nsxt-mp/nsx/dhcp/servers/IpPoolsTypes.go new file mode 100644 index 000000000..092dfba6a --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/IpPoolsTypes.go @@ -0,0 +1,330 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: IpPools. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package servers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func ipPoolsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["dhcp_ip_pool"] = bindings.NewReferenceType(model.DhcpIpPoolBindingType) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["dhcp_ip_pool"] = "DhcpIpPool" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipPoolsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpIpPoolBindingType) +} + +func ipPoolsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["dhcp_ip_pool"] = bindings.NewReferenceType(model.DhcpIpPoolBindingType) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["dhcp_ip_pool"] = "DhcpIpPool" + paramsTypeMap["dhcp_ip_pool"] = bindings.NewReferenceType(model.DhcpIpPoolBindingType) + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + pathParams["server_id"] = "serverId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dhcp_ip_pool", + "POST", + "/api/v1/dhcp/servers/{serverId}/ip-pools", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipPoolsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["pool_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["pool_id"] = "PoolId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipPoolsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipPoolsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["pool_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["pool_id"] = "PoolId" + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + pathParams["server_id"] = "serverId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/dhcp/servers/{serverId}/ip-pools/{poolId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipPoolsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["pool_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["pool_id"] = "PoolId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipPoolsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpIpPoolBindingType) +} + +func ipPoolsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["pool_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["pool_id"] = "PoolId" + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + pathParams["server_id"] = "serverId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dhcp/servers/{serverId}/ip-pools/{poolId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipPoolsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipPoolsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpIpPoolListResultBindingType) +} + +func ipPoolsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["serverId"] = bindings.NewStringType() + pathParams["server_id"] = "serverId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dhcp/servers/{serverId}/ip-pools", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipPoolsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["pool_id"] = bindings.NewStringType() + fields["dhcp_ip_pool"] = bindings.NewReferenceType(model.DhcpIpPoolBindingType) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["dhcp_ip_pool"] = "DhcpIpPool" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipPoolsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpIpPoolBindingType) +} + +func ipPoolsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["pool_id"] = bindings.NewStringType() + fields["dhcp_ip_pool"] = bindings.NewReferenceType(model.DhcpIpPoolBindingType) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["dhcp_ip_pool"] = "DhcpIpPool" + paramsTypeMap["dhcp_ip_pool"] = bindings.NewReferenceType(model.DhcpIpPoolBindingType) + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + pathParams["server_id"] = "serverId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dhcp_ip_pool", + "PUT", + "/api/v1/dhcp/servers/{serverId}/ip-pools/{poolId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/dhcp/servers/Ipv6IpPoolsClient.go b/services/nsxt-mp/nsx/dhcp/servers/Ipv6IpPoolsClient.go new file mode 100644 index 000000000..46b12ffac --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/Ipv6IpPoolsClient.go @@ -0,0 +1,275 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Ipv6IpPools +// Used by client-side stubs. + +package servers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type Ipv6IpPoolsClient interface { + + // Create an ip pool for a local DHCP IPv6 server + // + // @param serverIdParam (required) + // @param dhcpV6IpPoolParam (required) + // @return com.vmware.nsx.model.DhcpV6IpPool + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(serverIdParam string, dhcpV6IpPoolParam model.DhcpV6IpPool) (model.DhcpV6IpPool, error) + + // Delete a specific ip pool of a given logical DHCP IPv6 server. + // + // @param serverIdParam (required) + // @param poolIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(serverIdParam string, poolIdParam string) error + + // Return a specific ip pool of a given logical DHCP IPv6 server. + // + // @param serverIdParam (required) + // @param poolIdParam (required) + // @return com.vmware.nsx.model.DhcpV6IpPool + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serverIdParam string, poolIdParam string) (model.DhcpV6IpPool, error) + + // List the ip pools of a logical DHCP IPv6 server with pagination support. + // + // @param serverIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.DhcpV6IpPoolListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(serverIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DhcpV6IpPoolListResult, error) + + // Update a specific ip pool of a given logical DHCP IPv6 server. + // + // @param serverIdParam (required) + // @param poolIdParam (required) + // @param dhcpV6IpPoolParam (required) + // @return com.vmware.nsx.model.DhcpV6IpPool + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(serverIdParam string, poolIdParam string, dhcpV6IpPoolParam model.DhcpV6IpPool) (model.DhcpV6IpPool, error) +} + +type ipv6IpPoolsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewIpv6IpPoolsClient(connector client.Connector) *ipv6IpPoolsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.dhcp.servers.ipv6_ip_pools") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := ipv6IpPoolsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *ipv6IpPoolsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *ipv6IpPoolsClient) Create(serverIdParam string, dhcpV6IpPoolParam model.DhcpV6IpPool) (model.DhcpV6IpPool, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipv6IpPoolsCreateInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("DhcpV6IpPool", dhcpV6IpPoolParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpV6IpPool + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipv6IpPoolsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.ipv6_ip_pools", "create", inputDataValue, executionContext) + var emptyOutput model.DhcpV6IpPool + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipv6IpPoolsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpV6IpPool), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipv6IpPoolsClient) Delete(serverIdParam string, poolIdParam string) error { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipv6IpPoolsDeleteInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("PoolId", poolIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipv6IpPoolsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.ipv6_ip_pools", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *ipv6IpPoolsClient) Get(serverIdParam string, poolIdParam string) (model.DhcpV6IpPool, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipv6IpPoolsGetInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("PoolId", poolIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpV6IpPool + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipv6IpPoolsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.ipv6_ip_pools", "get", inputDataValue, executionContext) + var emptyOutput model.DhcpV6IpPool + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipv6IpPoolsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpV6IpPool), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipv6IpPoolsClient) List(serverIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DhcpV6IpPoolListResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipv6IpPoolsListInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpV6IpPoolListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipv6IpPoolsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.ipv6_ip_pools", "list", inputDataValue, executionContext) + var emptyOutput model.DhcpV6IpPoolListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipv6IpPoolsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpV6IpPoolListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipv6IpPoolsClient) Update(serverIdParam string, poolIdParam string, dhcpV6IpPoolParam model.DhcpV6IpPool) (model.DhcpV6IpPool, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipv6IpPoolsUpdateInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("PoolId", poolIdParam) + sv.AddStructField("DhcpV6IpPool", dhcpV6IpPoolParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpV6IpPool + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipv6IpPoolsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.ipv6_ip_pools", "update", inputDataValue, executionContext) + var emptyOutput model.DhcpV6IpPool + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipv6IpPoolsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpV6IpPool), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/dhcp/servers/Ipv6IpPoolsTypes.go b/services/nsxt-mp/nsx/dhcp/servers/Ipv6IpPoolsTypes.go new file mode 100644 index 000000000..58931d27c --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/Ipv6IpPoolsTypes.go @@ -0,0 +1,330 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Ipv6IpPools. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package servers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func ipv6IpPoolsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["dhcp_v6_ip_pool"] = bindings.NewReferenceType(model.DhcpV6IpPoolBindingType) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["dhcp_v6_ip_pool"] = "DhcpV6IpPool" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipv6IpPoolsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpV6IpPoolBindingType) +} + +func ipv6IpPoolsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["dhcp_v6_ip_pool"] = bindings.NewReferenceType(model.DhcpV6IpPoolBindingType) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["dhcp_v6_ip_pool"] = "DhcpV6IpPool" + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["dhcp_v6_ip_pool"] = bindings.NewReferenceType(model.DhcpV6IpPoolBindingType) + paramsTypeMap["serverId"] = bindings.NewStringType() + pathParams["server_id"] = "serverId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dhcp_v6_ip_pool", + "POST", + "/api/v1/dhcp/servers/{serverId}/ipv6-ip-pools", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipv6IpPoolsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["pool_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["pool_id"] = "PoolId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipv6IpPoolsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipv6IpPoolsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["pool_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["pool_id"] = "PoolId" + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + pathParams["server_id"] = "serverId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/dhcp/servers/{serverId}/ipv6-ip-pools/{poolId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipv6IpPoolsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["pool_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["pool_id"] = "PoolId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipv6IpPoolsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpV6IpPoolBindingType) +} + +func ipv6IpPoolsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["pool_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["pool_id"] = "PoolId" + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + pathParams["server_id"] = "serverId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dhcp/servers/{serverId}/ipv6-ip-pools/{poolId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipv6IpPoolsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipv6IpPoolsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpV6IpPoolListResultBindingType) +} + +func ipv6IpPoolsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["serverId"] = bindings.NewStringType() + pathParams["server_id"] = "serverId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dhcp/servers/{serverId}/ipv6-ip-pools", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipv6IpPoolsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["pool_id"] = bindings.NewStringType() + fields["dhcp_v6_ip_pool"] = bindings.NewReferenceType(model.DhcpV6IpPoolBindingType) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["dhcp_v6_ip_pool"] = "DhcpV6IpPool" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipv6IpPoolsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpV6IpPoolBindingType) +} + +func ipv6IpPoolsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["pool_id"] = bindings.NewStringType() + fields["dhcp_v6_ip_pool"] = bindings.NewReferenceType(model.DhcpV6IpPoolBindingType) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["dhcp_v6_ip_pool"] = "DhcpV6IpPool" + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["dhcp_v6_ip_pool"] = bindings.NewReferenceType(model.DhcpV6IpPoolBindingType) + paramsTypeMap["serverId"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + pathParams["server_id"] = "serverId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dhcp_v6_ip_pool", + "PUT", + "/api/v1/dhcp/servers/{serverId}/ipv6-ip-pools/{poolId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/dhcp/servers/Ipv6StaticBindingsClient.go b/services/nsxt-mp/nsx/dhcp/servers/Ipv6StaticBindingsClient.go new file mode 100644 index 000000000..8a99d6e0a --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/Ipv6StaticBindingsClient.go @@ -0,0 +1,275 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Ipv6StaticBindings +// Used by client-side stubs. + +package servers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type Ipv6StaticBindingsClient interface { + + // Create a static binding for a logical DHCP IPv6 server. + // + // @param serverIdParam (required) + // @param dhcpV6StaticBindingParam (required) + // @return com.vmware.nsx.model.DhcpV6StaticBinding + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(serverIdParam string, dhcpV6StaticBindingParam model.DhcpV6StaticBinding) (model.DhcpV6StaticBinding, error) + + // Delete a specific static binding of a given logical DHCP IPv6 server. + // + // @param serverIdParam (required) + // @param bindingIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(serverIdParam string, bindingIdParam string) error + + // Return a specific static binding of a given logical DHCP IPv6 server. + // + // @param serverIdParam (required) + // @param bindingIdParam (required) + // @return com.vmware.nsx.model.DhcpV6StaticBinding + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serverIdParam string, bindingIdParam string) (model.DhcpV6StaticBinding, error) + + // Return a paginated list of a static bindings of a given logical DHCP IPv6 server. + // + // @param serverIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.DhcpV6StaticBindingListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(serverIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DhcpV6StaticBindingListResult, error) + + // Update a specific static binding of a given local DHCP IPv6 server. + // + // @param serverIdParam (required) + // @param bindingIdParam (required) + // @param dhcpV6StaticBindingParam (required) + // @return com.vmware.nsx.model.DhcpV6StaticBinding + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(serverIdParam string, bindingIdParam string, dhcpV6StaticBindingParam model.DhcpV6StaticBinding) (model.DhcpV6StaticBinding, error) +} + +type ipv6StaticBindingsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewIpv6StaticBindingsClient(connector client.Connector) *ipv6StaticBindingsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.dhcp.servers.ipv6_static_bindings") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := ipv6StaticBindingsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *ipv6StaticBindingsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *ipv6StaticBindingsClient) Create(serverIdParam string, dhcpV6StaticBindingParam model.DhcpV6StaticBinding) (model.DhcpV6StaticBinding, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipv6StaticBindingsCreateInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("DhcpV6StaticBinding", dhcpV6StaticBindingParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpV6StaticBinding + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipv6StaticBindingsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.ipv6_static_bindings", "create", inputDataValue, executionContext) + var emptyOutput model.DhcpV6StaticBinding + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipv6StaticBindingsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpV6StaticBinding), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipv6StaticBindingsClient) Delete(serverIdParam string, bindingIdParam string) error { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipv6StaticBindingsDeleteInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("BindingId", bindingIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipv6StaticBindingsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.ipv6_static_bindings", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *ipv6StaticBindingsClient) Get(serverIdParam string, bindingIdParam string) (model.DhcpV6StaticBinding, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipv6StaticBindingsGetInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("BindingId", bindingIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpV6StaticBinding + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipv6StaticBindingsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.ipv6_static_bindings", "get", inputDataValue, executionContext) + var emptyOutput model.DhcpV6StaticBinding + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipv6StaticBindingsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpV6StaticBinding), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipv6StaticBindingsClient) List(serverIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DhcpV6StaticBindingListResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipv6StaticBindingsListInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpV6StaticBindingListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipv6StaticBindingsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.ipv6_static_bindings", "list", inputDataValue, executionContext) + var emptyOutput model.DhcpV6StaticBindingListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipv6StaticBindingsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpV6StaticBindingListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipv6StaticBindingsClient) Update(serverIdParam string, bindingIdParam string, dhcpV6StaticBindingParam model.DhcpV6StaticBinding) (model.DhcpV6StaticBinding, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipv6StaticBindingsUpdateInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("BindingId", bindingIdParam) + sv.AddStructField("DhcpV6StaticBinding", dhcpV6StaticBindingParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpV6StaticBinding + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipv6StaticBindingsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.ipv6_static_bindings", "update", inputDataValue, executionContext) + var emptyOutput model.DhcpV6StaticBinding + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipv6StaticBindingsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpV6StaticBinding), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/dhcp/servers/Ipv6StaticBindingsTypes.go b/services/nsxt-mp/nsx/dhcp/servers/Ipv6StaticBindingsTypes.go new file mode 100644 index 000000000..2fc54a7b1 --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/Ipv6StaticBindingsTypes.go @@ -0,0 +1,330 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Ipv6StaticBindings. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package servers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func ipv6StaticBindingsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["dhcp_v6_static_binding"] = bindings.NewReferenceType(model.DhcpV6StaticBindingBindingType) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["dhcp_v6_static_binding"] = "DhcpV6StaticBinding" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipv6StaticBindingsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpV6StaticBindingBindingType) +} + +func ipv6StaticBindingsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["dhcp_v6_static_binding"] = bindings.NewReferenceType(model.DhcpV6StaticBindingBindingType) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["dhcp_v6_static_binding"] = "DhcpV6StaticBinding" + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["dhcp_v6_static_binding"] = bindings.NewReferenceType(model.DhcpV6StaticBindingBindingType) + paramsTypeMap["serverId"] = bindings.NewStringType() + pathParams["server_id"] = "serverId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dhcp_v6_static_binding", + "POST", + "/api/v1/dhcp/servers/{serverId}/ipv6-static-bindings", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipv6StaticBindingsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["binding_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["binding_id"] = "BindingId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipv6StaticBindingsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipv6StaticBindingsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["binding_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["binding_id"] = "BindingId" + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["binding_id"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + paramsTypeMap["bindingId"] = bindings.NewStringType() + pathParams["binding_id"] = "bindingId" + pathParams["server_id"] = "serverId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/dhcp/servers/{serverId}/ipv6-static-bindings/{bindingId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipv6StaticBindingsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["binding_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["binding_id"] = "BindingId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipv6StaticBindingsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpV6StaticBindingBindingType) +} + +func ipv6StaticBindingsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["binding_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["binding_id"] = "BindingId" + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["binding_id"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + paramsTypeMap["bindingId"] = bindings.NewStringType() + pathParams["binding_id"] = "bindingId" + pathParams["server_id"] = "serverId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dhcp/servers/{serverId}/ipv6-static-bindings/{bindingId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipv6StaticBindingsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipv6StaticBindingsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpV6StaticBindingListResultBindingType) +} + +func ipv6StaticBindingsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["serverId"] = bindings.NewStringType() + pathParams["server_id"] = "serverId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dhcp/servers/{serverId}/ipv6-static-bindings", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipv6StaticBindingsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["binding_id"] = bindings.NewStringType() + fields["dhcp_v6_static_binding"] = bindings.NewReferenceType(model.DhcpV6StaticBindingBindingType) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["binding_id"] = "BindingId" + fieldNameMap["dhcp_v6_static_binding"] = "DhcpV6StaticBinding" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipv6StaticBindingsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpV6StaticBindingBindingType) +} + +func ipv6StaticBindingsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["binding_id"] = bindings.NewStringType() + fields["dhcp_v6_static_binding"] = bindings.NewReferenceType(model.DhcpV6StaticBindingBindingType) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["binding_id"] = "BindingId" + fieldNameMap["dhcp_v6_static_binding"] = "DhcpV6StaticBinding" + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["binding_id"] = bindings.NewStringType() + paramsTypeMap["dhcp_v6_static_binding"] = bindings.NewReferenceType(model.DhcpV6StaticBindingBindingType) + paramsTypeMap["serverId"] = bindings.NewStringType() + paramsTypeMap["bindingId"] = bindings.NewStringType() + pathParams["binding_id"] = "bindingId" + pathParams["server_id"] = "serverId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dhcp_v6_static_binding", + "PUT", + "/api/v1/dhcp/servers/{serverId}/ipv6-static-bindings/{bindingId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/dhcp/servers/LeasesClient.go b/services/nsxt-mp/nsx/dhcp/servers/LeasesClient.go new file mode 100644 index 000000000..9a9a9d5a3 --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/LeasesClient.go @@ -0,0 +1,136 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Leases +// Used by client-side stubs. + +package servers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type LeasesClient interface { + + // Delete a single DHCP lease entry specified by ip and mac. The DHCP server matches the DHCP lease with the given ip address and the mac address. The matched lease entry will be deleted. If no lease matches, the request is ignored. The DHCP lease to be deleted will be removed by the system from both active and standby node. The system will report error if the DHCP lease could not be removed from both nodes. If the DHCP lease could not be removed on either node, please check the DHCP server status. Once the DHCP server status is UP, please invoke the deletion API again to ensure the lease gets deleted from both nodes. + // + // @param serverIdParam (required) + // @param ipParam IPv4 or IPv6 address (required) + // @param macParam MAC Address (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(serverIdParam string, ipParam string, macParam string) error + + // Get specific leases of a given dhcp server. As a dhcp server could manage millions of leases, the API has to limit the number of the returned leases via two mutually-excluded request parameters, i.e. \"pool_id\" and \"address\". Either a \"pool_id\" or an \"address\" can be provided, but not both in a same call. If a \"pool_id\" is specified, the leases of the specific pool are returned. If an \"address\" is specified, only the lease(s) represented y this address is(are) returned. The \"address\" can be a single IP, an ip-range, or a mac address. + // + // @param serverIdParam (required) + // @param addressParam can be an ip address, or an ip range, or a mac address (optional) + // @param poolIdParam The uuid of dhcp ip pool (optional) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.DhcpLeases + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(serverIdParam string, addressParam *string, poolIdParam *string, sourceParam *string) (model.DhcpLeases, error) +} + +type leasesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewLeasesClient(connector client.Connector) *leasesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.dhcp.servers.leases") + methodIdentifiers := map[string]core.MethodIdentifier{ + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + lIface := leasesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &lIface +} + +func (lIface *leasesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := lIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (lIface *leasesClient) Delete(serverIdParam string, ipParam string, macParam string) error { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(leasesDeleteInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("Ip", ipParam) + sv.AddStructField("Mac", macParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := leasesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.leases", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (lIface *leasesClient) List(serverIdParam string, addressParam *string, poolIdParam *string, sourceParam *string) (model.DhcpLeases, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(leasesListInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("Address", addressParam) + sv.AddStructField("PoolId", poolIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpLeases + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := leasesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.leases", "list", inputDataValue, executionContext) + var emptyOutput model.DhcpLeases + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), leasesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpLeases), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/dhcp/servers/LeasesTypes.go b/services/nsxt-mp/nsx/dhcp/servers/LeasesTypes.go new file mode 100644 index 000000000..5151d0c20 --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/LeasesTypes.go @@ -0,0 +1,155 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Leases. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package servers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Leases#list. +const Leases_LIST_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Leases#list. +const Leases_LIST_SOURCE_CACHED = "cached" + +func leasesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["ip"] = bindings.NewStringType() + fields["mac"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["ip"] = "Ip" + fieldNameMap["mac"] = "Mac" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func leasesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func leasesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["ip"] = bindings.NewStringType() + fields["mac"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["ip"] = "Ip" + fieldNameMap["mac"] = "Mac" + paramsTypeMap["mac"] = bindings.NewStringType() + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["ip"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + pathParams["server_id"] = "serverId" + queryParams["ip"] = "ip" + queryParams["mac"] = "mac" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/dhcp/servers/{serverId}/leases", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func leasesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["address"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["pool_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["address"] = "Address" + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func leasesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpLeasesBindingType) +} + +func leasesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["address"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["pool_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["address"] = "Address" + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["pool_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["address"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["serverId"] = bindings.NewStringType() + pathParams["server_id"] = "serverId" + queryParams["address"] = "address" + queryParams["source"] = "source" + queryParams["pool_id"] = "pool_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dhcp/servers/{serverId}/leases", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/dhcp/servers/ServersPackageTypes.go b/services/nsxt-mp/nsx/dhcp/servers/ServersPackageTypes.go new file mode 100644 index 000000000..a93916f66 --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/ServersPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.dhcp.servers. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package servers diff --git a/services/nsxt-mp/nsx/dhcp/servers/StateClient.go b/services/nsxt-mp/nsx/dhcp/servers/StateClient.go new file mode 100644 index 000000000..a47bfe046 --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/StateClient.go @@ -0,0 +1,94 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: State +// Used by client-side stubs. + +package servers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StateClient interface { + + // Return realized state information of a dhcp server. After a dhcp server is created or updated, you can invoke this API to get the realization information of the server. + // + // @param serverIdParam (required) + // @param barrierIdParam (optional) + // @param requestIdParam Realization request ID (optional) + // @return com.vmware.nsx.model.ConfigurationState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serverIdParam string, barrierIdParam *int64, requestIdParam *string) (model.ConfigurationState, error) +} + +type stateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStateClient(connector client.Connector) *stateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.dhcp.servers.state") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := stateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *stateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *stateClient) Get(serverIdParam string, barrierIdParam *int64, requestIdParam *string) (model.ConfigurationState, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(stateGetInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("BarrierId", barrierIdParam) + sv.AddStructField("RequestId", requestIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ConfigurationState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.state", "get", inputDataValue, executionContext) + var emptyOutput model.ConfigurationState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ConfigurationState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/dhcp/servers/StateTypes.go b/services/nsxt-mp/nsx/dhcp/servers/StateTypes.go new file mode 100644 index 000000000..aa0b0c36a --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/StateTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: State. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package servers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func stateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["barrier_id"] = "BarrierId" + fieldNameMap["request_id"] = "RequestId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ConfigurationStateBindingType) +} + +func stateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["barrier_id"] = "BarrierId" + fieldNameMap["request_id"] = "RequestId" + paramsTypeMap["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + pathParams["server_id"] = "serverId" + queryParams["barrier_id"] = "barrier_id" + queryParams["request_id"] = "request_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dhcp/servers/{serverId}/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/dhcp/servers/StaticBindingsClient.go b/services/nsxt-mp/nsx/dhcp/servers/StaticBindingsClient.go new file mode 100644 index 000000000..1f560df9f --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/StaticBindingsClient.go @@ -0,0 +1,275 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: StaticBindings +// Used by client-side stubs. + +package servers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StaticBindingsClient interface { + + // Create a static binding for a logical DHCP server. + // + // @param serverIdParam (required) + // @param dhcpStaticBindingParam (required) + // @return com.vmware.nsx.model.DhcpStaticBinding + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(serverIdParam string, dhcpStaticBindingParam model.DhcpStaticBinding) (model.DhcpStaticBinding, error) + + // Delete a specific static binding of a given logical DHCP server. + // + // @param serverIdParam (required) + // @param bindingIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(serverIdParam string, bindingIdParam string) error + + // Return a specific static binding of a given logical DHCP server. + // + // @param serverIdParam (required) + // @param bindingIdParam (required) + // @return com.vmware.nsx.model.DhcpStaticBinding + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serverIdParam string, bindingIdParam string) (model.DhcpStaticBinding, error) + + // Return a paginated list of a static bindings of a given logical DHCP server. + // + // @param serverIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.DhcpStaticBindingListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(serverIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DhcpStaticBindingListResult, error) + + // Update a specific static binding of a given local DHCP server. + // + // @param serverIdParam (required) + // @param bindingIdParam (required) + // @param dhcpStaticBindingParam (required) + // @return com.vmware.nsx.model.DhcpStaticBinding + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(serverIdParam string, bindingIdParam string, dhcpStaticBindingParam model.DhcpStaticBinding) (model.DhcpStaticBinding, error) +} + +type staticBindingsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStaticBindingsClient(connector client.Connector) *staticBindingsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.dhcp.servers.static_bindings") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := staticBindingsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *staticBindingsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *staticBindingsClient) Create(serverIdParam string, dhcpStaticBindingParam model.DhcpStaticBinding) (model.DhcpStaticBinding, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(staticBindingsCreateInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("DhcpStaticBinding", dhcpStaticBindingParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpStaticBinding + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := staticBindingsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.static_bindings", "create", inputDataValue, executionContext) + var emptyOutput model.DhcpStaticBinding + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), staticBindingsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpStaticBinding), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *staticBindingsClient) Delete(serverIdParam string, bindingIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(staticBindingsDeleteInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("BindingId", bindingIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := staticBindingsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.static_bindings", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *staticBindingsClient) Get(serverIdParam string, bindingIdParam string) (model.DhcpStaticBinding, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(staticBindingsGetInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("BindingId", bindingIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpStaticBinding + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := staticBindingsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.static_bindings", "get", inputDataValue, executionContext) + var emptyOutput model.DhcpStaticBinding + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), staticBindingsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpStaticBinding), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *staticBindingsClient) List(serverIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DhcpStaticBindingListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(staticBindingsListInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpStaticBindingListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := staticBindingsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.static_bindings", "list", inputDataValue, executionContext) + var emptyOutput model.DhcpStaticBindingListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), staticBindingsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpStaticBindingListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *staticBindingsClient) Update(serverIdParam string, bindingIdParam string, dhcpStaticBindingParam model.DhcpStaticBinding) (model.DhcpStaticBinding, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(staticBindingsUpdateInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("BindingId", bindingIdParam) + sv.AddStructField("DhcpStaticBinding", dhcpStaticBindingParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpStaticBinding + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := staticBindingsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.static_bindings", "update", inputDataValue, executionContext) + var emptyOutput model.DhcpStaticBinding + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), staticBindingsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpStaticBinding), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/dhcp/servers/StaticBindingsTypes.go b/services/nsxt-mp/nsx/dhcp/servers/StaticBindingsTypes.go new file mode 100644 index 000000000..912c25938 --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/StaticBindingsTypes.go @@ -0,0 +1,330 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: StaticBindings. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package servers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func staticBindingsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["dhcp_static_binding"] = bindings.NewReferenceType(model.DhcpStaticBindingBindingType) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["dhcp_static_binding"] = "DhcpStaticBinding" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func staticBindingsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpStaticBindingBindingType) +} + +func staticBindingsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["dhcp_static_binding"] = bindings.NewReferenceType(model.DhcpStaticBindingBindingType) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["dhcp_static_binding"] = "DhcpStaticBinding" + paramsTypeMap["dhcp_static_binding"] = bindings.NewReferenceType(model.DhcpStaticBindingBindingType) + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + pathParams["server_id"] = "serverId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dhcp_static_binding", + "POST", + "/api/v1/dhcp/servers/{serverId}/static-bindings", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func staticBindingsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["binding_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["binding_id"] = "BindingId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func staticBindingsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func staticBindingsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["binding_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["binding_id"] = "BindingId" + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["binding_id"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + paramsTypeMap["bindingId"] = bindings.NewStringType() + pathParams["binding_id"] = "bindingId" + pathParams["server_id"] = "serverId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/dhcp/servers/{serverId}/static-bindings/{bindingId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func staticBindingsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["binding_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["binding_id"] = "BindingId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func staticBindingsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpStaticBindingBindingType) +} + +func staticBindingsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["binding_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["binding_id"] = "BindingId" + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["binding_id"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + paramsTypeMap["bindingId"] = bindings.NewStringType() + pathParams["binding_id"] = "bindingId" + pathParams["server_id"] = "serverId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dhcp/servers/{serverId}/static-bindings/{bindingId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func staticBindingsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func staticBindingsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpStaticBindingListResultBindingType) +} + +func staticBindingsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["serverId"] = bindings.NewStringType() + pathParams["server_id"] = "serverId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dhcp/servers/{serverId}/static-bindings", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func staticBindingsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["binding_id"] = bindings.NewStringType() + fields["dhcp_static_binding"] = bindings.NewReferenceType(model.DhcpStaticBindingBindingType) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["binding_id"] = "BindingId" + fieldNameMap["dhcp_static_binding"] = "DhcpStaticBinding" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func staticBindingsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpStaticBindingBindingType) +} + +func staticBindingsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["binding_id"] = bindings.NewStringType() + fields["dhcp_static_binding"] = bindings.NewReferenceType(model.DhcpStaticBindingBindingType) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["binding_id"] = "BindingId" + fieldNameMap["dhcp_static_binding"] = "DhcpStaticBinding" + paramsTypeMap["dhcp_static_binding"] = bindings.NewReferenceType(model.DhcpStaticBindingBindingType) + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["binding_id"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + paramsTypeMap["bindingId"] = bindings.NewStringType() + pathParams["binding_id"] = "bindingId" + pathParams["server_id"] = "serverId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dhcp_static_binding", + "PUT", + "/api/v1/dhcp/servers/{serverId}/static-bindings/{bindingId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/dhcp/servers/StatisticsClient.go b/services/nsxt-mp/nsx/dhcp/servers/StatisticsClient.go new file mode 100644 index 000000000..3a9545ab3 --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/StatisticsClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Statistics +// Used by client-side stubs. + +package servers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatisticsClient interface { + + // Returns the statistics of the given dhcp server. + // + // @param serverIdParam (required) + // @return com.vmware.nsx.model.DhcpStatistics + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serverIdParam string) (model.DhcpStatistics, error) +} + +type statisticsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatisticsClient(connector client.Connector) *statisticsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.dhcp.servers.statistics") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statisticsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statisticsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statisticsClient) Get(serverIdParam string) (model.DhcpStatistics, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statisticsGetInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpStatistics + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statisticsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.statistics", "get", inputDataValue, executionContext) + var emptyOutput model.DhcpStatistics + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statisticsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpStatistics), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/dhcp/servers/StatisticsTypes.go b/services/nsxt-mp/nsx/dhcp/servers/StatisticsTypes.go new file mode 100644 index 000000000..406699090 --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/StatisticsTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Statistics. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package servers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statisticsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statisticsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpStatisticsBindingType) +} + +func statisticsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + pathParams["server_id"] = "serverId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dhcp/servers/{serverId}/statistics", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/dhcp/servers/StatusClient.go b/services/nsxt-mp/nsx/dhcp/servers/StatusClient.go new file mode 100644 index 000000000..c4fa77454 --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/StatusClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package servers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Returns the service status of the given dhcp server. + // + // @param serverIdParam (required) + // @return com.vmware.nsx.model.DhcpServerStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serverIdParam string) (model.DhcpServerStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.dhcp.servers.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(serverIdParam string) (model.DhcpServerStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DhcpServerStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.status", "get", inputDataValue, executionContext) + var emptyOutput model.DhcpServerStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DhcpServerStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/dhcp/servers/StatusTypes.go b/services/nsxt-mp/nsx/dhcp/servers/StatusTypes.go new file mode 100644 index 000000000..318cbc570 --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/StatusTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package servers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DhcpServerStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fieldNameMap["server_id"] = "ServerId" + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + pathParams["server_id"] = "serverId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dhcp/servers/{serverId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/dhcp/servers/ip_pools/IpPoolsPackageTypes.go b/services/nsxt-mp/nsx/dhcp/servers/ip_pools/IpPoolsPackageTypes.go new file mode 100644 index 000000000..6d03e8aab --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/ip_pools/IpPoolsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.dhcp.servers.ip_pools. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ip_pools diff --git a/services/nsxt-mp/nsx/dhcp/servers/ip_pools/StateClient.go b/services/nsxt-mp/nsx/dhcp/servers/ip_pools/StateClient.go new file mode 100644 index 000000000..5404ea326 --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/ip_pools/StateClient.go @@ -0,0 +1,96 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: State +// Used by client-side stubs. + +package ip_pools + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StateClient interface { + + // Return realized state information of a dhcp ip pool. After a dhcp ip pool is created or updated, you can invoke this API to get the realization information of the ip pool. + // + // @param serverIdParam (required) + // @param poolIdParam (required) + // @param barrierIdParam (optional) + // @param requestIdParam Realization request ID (optional) + // @return com.vmware.nsx.model.ConfigurationState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serverIdParam string, poolIdParam string, barrierIdParam *int64, requestIdParam *string) (model.ConfigurationState, error) +} + +type stateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStateClient(connector client.Connector) *stateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.dhcp.servers.ip_pools.state") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := stateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *stateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *stateClient) Get(serverIdParam string, poolIdParam string, barrierIdParam *int64, requestIdParam *string) (model.ConfigurationState, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(stateGetInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("PoolId", poolIdParam) + sv.AddStructField("BarrierId", barrierIdParam) + sv.AddStructField("RequestId", requestIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ConfigurationState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.ip_pools.state", "get", inputDataValue, executionContext) + var emptyOutput model.ConfigurationState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ConfigurationState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/dhcp/servers/ip_pools/StateTypes.go b/services/nsxt-mp/nsx/dhcp/servers/ip_pools/StateTypes.go new file mode 100644 index 000000000..47fb19821 --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/ip_pools/StateTypes.go @@ -0,0 +1,88 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: State. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ip_pools + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func stateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["pool_id"] = bindings.NewStringType() + fields["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["barrier_id"] = "BarrierId" + fieldNameMap["request_id"] = "RequestId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ConfigurationStateBindingType) +} + +func stateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["pool_id"] = bindings.NewStringType() + fields["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["barrier_id"] = "BarrierId" + fieldNameMap["request_id"] = "RequestId" + paramsTypeMap["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + pathParams["server_id"] = "serverId" + queryParams["barrier_id"] = "barrier_id" + queryParams["request_id"] = "request_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dhcp/servers/{serverId}/ip-pools/{poolId}/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/dhcp/servers/static_bindings/StateClient.go b/services/nsxt-mp/nsx/dhcp/servers/static_bindings/StateClient.go new file mode 100644 index 000000000..516c75b41 --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/static_bindings/StateClient.go @@ -0,0 +1,96 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: State +// Used by client-side stubs. + +package static_bindings + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StateClient interface { + + // Return realized state information of a dhcp static binding. After a dhcp static binding is created or updated, you can invoke this API to get the realization information of the static binding. + // + // @param serverIdParam (required) + // @param bindingIdParam (required) + // @param barrierIdParam (optional) + // @param requestIdParam Realization request ID (optional) + // @return com.vmware.nsx.model.ConfigurationState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serverIdParam string, bindingIdParam string, barrierIdParam *int64, requestIdParam *string) (model.ConfigurationState, error) +} + +type stateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStateClient(connector client.Connector) *stateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.dhcp.servers.static_bindings.state") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := stateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *stateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *stateClient) Get(serverIdParam string, bindingIdParam string, barrierIdParam *int64, requestIdParam *string) (model.ConfigurationState, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(stateGetInputType(), typeConverter) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("BindingId", bindingIdParam) + sv.AddStructField("BarrierId", barrierIdParam) + sv.AddStructField("RequestId", requestIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ConfigurationState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dhcp.servers.static_bindings.state", "get", inputDataValue, executionContext) + var emptyOutput model.ConfigurationState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ConfigurationState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/dhcp/servers/static_bindings/StateTypes.go b/services/nsxt-mp/nsx/dhcp/servers/static_bindings/StateTypes.go new file mode 100644 index 000000000..76aa13df2 --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/static_bindings/StateTypes.go @@ -0,0 +1,88 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: State. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package static_bindings + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func stateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_id"] = bindings.NewStringType() + fields["binding_id"] = bindings.NewStringType() + fields["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["binding_id"] = "BindingId" + fieldNameMap["barrier_id"] = "BarrierId" + fieldNameMap["request_id"] = "RequestId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ConfigurationStateBindingType) +} + +func stateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_id"] = bindings.NewStringType() + fields["binding_id"] = bindings.NewStringType() + fields["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["binding_id"] = "BindingId" + fieldNameMap["barrier_id"] = "BarrierId" + fieldNameMap["request_id"] = "RequestId" + paramsTypeMap["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["binding_id"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + paramsTypeMap["bindingId"] = bindings.NewStringType() + pathParams["binding_id"] = "bindingId" + pathParams["server_id"] = "serverId" + queryParams["barrier_id"] = "barrier_id" + queryParams["request_id"] = "request_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dhcp/servers/{serverId}/static-bindings/{bindingId}/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/dhcp/servers/static_bindings/StaticBindingsPackageTypes.go b/services/nsxt-mp/nsx/dhcp/servers/static_bindings/StaticBindingsPackageTypes.go new file mode 100644 index 000000000..5429259dd --- /dev/null +++ b/services/nsxt-mp/nsx/dhcp/servers/static_bindings/StaticBindingsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.dhcp.servers.static_bindings. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package static_bindings diff --git a/services/nsxt-mp/nsx/directory/DirectoryPackageTypes.go b/services/nsxt-mp/nsx/directory/DirectoryPackageTypes.go new file mode 100644 index 000000000..29bf42de2 --- /dev/null +++ b/services/nsxt-mp/nsx/directory/DirectoryPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.directory. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package directory diff --git a/services/nsxt-mp/nsx/directory/DomainSizeClient.go b/services/nsxt-mp/nsx/directory/DomainSizeClient.go new file mode 100644 index 000000000..5e7c33e27 --- /dev/null +++ b/services/nsxt-mp/nsx/directory/DomainSizeClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: DomainSize +// Used by client-side stubs. + +package directory + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type DomainSizeClient interface { + + // This call scans the size of a directory domain. It may be very | expensive to run this call in some AD domain deployments. Please | use it with caution. + // + // @param directoryDomainParam (required) + // The parameter must contain all the properties defined in model.DirectoryDomain. + // @return com.vmware.nsx.model.DirectoryDomainSize + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(directoryDomainParam *data.StructValue) (model.DirectoryDomainSize, error) +} + +type domainSizeClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewDomainSizeClient(connector client.Connector) *domainSizeClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.directory.domain_size") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + dIface := domainSizeClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &dIface +} + +func (dIface *domainSizeClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := dIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (dIface *domainSizeClient) Create(directoryDomainParam *data.StructValue) (model.DirectoryDomainSize, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(domainSizeCreateInputType(), typeConverter) + sv.AddStructField("DirectoryDomain", directoryDomainParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DirectoryDomainSize + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := domainSizeCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.directory.domain_size", "create", inputDataValue, executionContext) + var emptyOutput model.DirectoryDomainSize + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), domainSizeCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DirectoryDomainSize), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/directory/DomainSizeTypes.go b/services/nsxt-mp/nsx/directory/DomainSizeTypes.go new file mode 100644 index 000000000..5a6456d2f --- /dev/null +++ b/services/nsxt-mp/nsx/directory/DomainSizeTypes.go @@ -0,0 +1,67 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: DomainSize. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package directory + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func domainSizeCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["directory_domain"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.DirectoryDomainBindingType)}, bindings.REST) + fieldNameMap["directory_domain"] = "DirectoryDomain" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func domainSizeCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DirectoryDomainSizeBindingType) +} + +func domainSizeCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["directory_domain"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.DirectoryDomainBindingType)}, bindings.REST) + fieldNameMap["directory_domain"] = "DirectoryDomain" + paramsTypeMap["directory_domain"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.DirectoryDomainBindingType)}, bindings.REST) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "directory_domain", + "POST", + "/api/v1/directory/domain-size", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/directory/DomainsClient.go b/services/nsxt-mp/nsx/directory/DomainsClient.go new file mode 100644 index 000000000..9202c7827 --- /dev/null +++ b/services/nsxt-mp/nsx/directory/DomainsClient.go @@ -0,0 +1,313 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Domains +// Used by client-side stubs. + +package directory + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type DomainsClient interface { + + // Create a directory domain + // + // @param directoryDomainParam (required) + // The parameter must contain all the properties defined in model.DirectoryDomain. + // @return com.vmware.nsx.model.DirectoryDomain + // The return value will contain all the properties defined in model.DirectoryDomain. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(directoryDomainParam *data.StructValue) (*data.StructValue, error) + + // Invoke full sync or delta sync for a specific domain, with additional delay in seconds if needed. Stop sync will try to stop any pending sync if any to return to idle state. + // + // @param domainIdParam Directory domain identifier (required) + // @param actionParam Sync type requested (required) + // @param delayParam Request to execute the sync with some delay in seconds (optional, default to 0) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create0(domainIdParam string, actionParam string, delayParam *int64) error + + // Delete a specific domain with given identifier + // + // @param domainIdParam Directory domain identifier (required) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(domainIdParam string, forceParam *bool) error + + // Get a specific domain with given identifier + // + // @param domainIdParam Directory domain identifier (required) + // @return com.vmware.nsx.model.DirectoryDomain + // The return value will contain all the properties defined in model.DirectoryDomain. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(domainIdParam string) (*data.StructValue, error) + + // List all configured domains + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.DirectoryDomainListResults + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DirectoryDomainListResults, error) + + // Update to any field in the directory domain will trigger a full sync + // + // @param domainIdParam Directory domain identifier (required) + // @param directoryDomainParam (required) + // The parameter must contain all the properties defined in model.DirectoryDomain. + // @return com.vmware.nsx.model.DirectoryDomain + // The return value will contain all the properties defined in model.DirectoryDomain. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(domainIdParam string, directoryDomainParam *data.StructValue) (*data.StructValue, error) +} + +type domainsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewDomainsClient(connector client.Connector) *domainsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.directory.domains") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "create_0": core.NewMethodIdentifier(interfaceIdentifier, "create_0"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + dIface := domainsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &dIface +} + +func (dIface *domainsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := dIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (dIface *domainsClient) Create(directoryDomainParam *data.StructValue) (*data.StructValue, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(domainsCreateInputType(), typeConverter) + sv.AddStructField("DirectoryDomain", directoryDomainParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := domainsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.directory.domains", "create", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), domainsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *domainsClient) Create0(domainIdParam string, actionParam string, delayParam *int64) error { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(domainsCreate0InputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("Action", actionParam) + sv.AddStructField("Delay", delayParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := domainsCreate0RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.directory.domains", "create_0", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *domainsClient) Delete(domainIdParam string, forceParam *bool) error { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(domainsDeleteInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := domainsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.directory.domains", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *domainsClient) Get(domainIdParam string) (*data.StructValue, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(domainsGetInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := domainsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.directory.domains", "get", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), domainsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *domainsClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DirectoryDomainListResults, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(domainsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DirectoryDomainListResults + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := domainsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.directory.domains", "list", inputDataValue, executionContext) + var emptyOutput model.DirectoryDomainListResults + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), domainsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DirectoryDomainListResults), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *domainsClient) Update(domainIdParam string, directoryDomainParam *data.StructValue) (*data.StructValue, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(domainsUpdateInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("DirectoryDomain", directoryDomainParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := domainsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.directory.domains", "update", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), domainsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/directory/DomainsTypes.go b/services/nsxt-mp/nsx/directory/DomainsTypes.go new file mode 100644 index 000000000..74b35c781 --- /dev/null +++ b/services/nsxt-mp/nsx/directory/DomainsTypes.go @@ -0,0 +1,372 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Domains. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package directory + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``action`` of method Domains#create0. +const Domains_CREATE_0_ACTION_FULL_SYNC = "FULL_SYNC" + +// Possible value for ``action`` of method Domains#create0. +const Domains_CREATE_0_ACTION_DELTA_SYNC = "DELTA_SYNC" + +// Possible value for ``action`` of method Domains#create0. +const Domains_CREATE_0_ACTION_STOP_SYNC = "STOP_SYNC" + +func domainsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["directory_domain"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.DirectoryDomainBindingType)}, bindings.REST) + fieldNameMap["directory_domain"] = "DirectoryDomain" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func domainsCreateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.DirectoryDomainBindingType)}, bindings.REST) +} + +func domainsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["directory_domain"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.DirectoryDomainBindingType)}, bindings.REST) + fieldNameMap["directory_domain"] = "DirectoryDomain" + paramsTypeMap["directory_domain"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.DirectoryDomainBindingType)}, bindings.REST) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "directory_domain", + "POST", + "/api/v1/directory/domains", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func domainsCreate0InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["action"] = bindings.NewStringType() + fields["delay"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["action"] = "Action" + fieldNameMap["delay"] = "Delay" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func domainsCreate0OutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func domainsCreate0RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["action"] = bindings.NewStringType() + fields["delay"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["action"] = "Action" + fieldNameMap["delay"] = "Delay" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["action"] = bindings.NewStringType() + paramsTypeMap["delay"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["domainId"] = bindings.NewStringType() + pathParams["domain_id"] = "domainId" + queryParams["delay"] = "delay" + queryParams["action"] = "action" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "POST", + "/api/v1/directory/domains/{domainId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func domainsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func domainsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func domainsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["force"] = "Force" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["domainId"] = bindings.NewStringType() + pathParams["domain_id"] = "domainId" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/directory/domains/{domainId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func domainsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func domainsGetOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.DirectoryDomainBindingType)}, bindings.REST) +} + +func domainsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/directory/domains/{domainId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func domainsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func domainsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DirectoryDomainListResultsBindingType) +} + +func domainsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/directory/domains", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func domainsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["directory_domain"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.DirectoryDomainBindingType)}, bindings.REST) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["directory_domain"] = "DirectoryDomain" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func domainsUpdateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.DirectoryDomainBindingType)}, bindings.REST) +} + +func domainsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["directory_domain"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.DirectoryDomainBindingType)}, bindings.REST) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["directory_domain"] = "DirectoryDomain" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["directory_domain"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.DirectoryDomainBindingType)}, bindings.REST) + paramsTypeMap["domainId"] = bindings.NewStringType() + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "directory_domain", + "PUT", + "/api/v1/directory/domains/{domainId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/directory/LdapServerClient.go b/services/nsxt-mp/nsx/directory/LdapServerClient.go new file mode 100644 index 000000000..c69e20aa1 --- /dev/null +++ b/services/nsxt-mp/nsx/directory/LdapServerClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: LdapServer +// Used by client-side stubs. + +package directory + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type LdapServerClient interface { + + // This API tests a LDAP server connectivity before the actual domain or LDAP server is configured. If the connectivity is good, the response will be HTTP status 200. Otherwise the response will be HTTP status 500 and corresponding error message will be returned. + // + // @param directoryLdapServerParam (required) + // @param actionParam LDAP server test requested (required) + // @return com.vmware.nsx.model.DirectoryLdapServerStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(directoryLdapServerParam model.DirectoryLdapServer, actionParam string) (model.DirectoryLdapServerStatus, error) +} + +type ldapServerClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewLdapServerClient(connector client.Connector) *ldapServerClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.directory.ldap_server") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + lIface := ldapServerClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &lIface +} + +func (lIface *ldapServerClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := lIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (lIface *ldapServerClient) Create(directoryLdapServerParam model.DirectoryLdapServer, actionParam string) (model.DirectoryLdapServerStatus, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ldapServerCreateInputType(), typeConverter) + sv.AddStructField("DirectoryLdapServer", directoryLdapServerParam) + sv.AddStructField("Action", actionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DirectoryLdapServerStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ldapServerCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.directory.ldap_server", "create", inputDataValue, executionContext) + var emptyOutput model.DirectoryLdapServerStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ldapServerCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DirectoryLdapServerStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/directory/LdapServerTypes.go b/services/nsxt-mp/nsx/directory/LdapServerTypes.go new file mode 100644 index 000000000..bd3145385 --- /dev/null +++ b/services/nsxt-mp/nsx/directory/LdapServerTypes.go @@ -0,0 +1,76 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: LdapServer. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package directory + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``action`` of method LdapServer#create. +const LdapServer_CREATE_ACTION_CONNECTIVITY = "CONNECTIVITY" + +func ldapServerCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["directory_ldap_server"] = bindings.NewReferenceType(model.DirectoryLdapServerBindingType) + fields["action"] = bindings.NewStringType() + fieldNameMap["directory_ldap_server"] = "DirectoryLdapServer" + fieldNameMap["action"] = "Action" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ldapServerCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DirectoryLdapServerStatusBindingType) +} + +func ldapServerCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["directory_ldap_server"] = bindings.NewReferenceType(model.DirectoryLdapServerBindingType) + fields["action"] = bindings.NewStringType() + fieldNameMap["directory_ldap_server"] = "DirectoryLdapServer" + fieldNameMap["action"] = "Action" + paramsTypeMap["action"] = bindings.NewStringType() + paramsTypeMap["directory_ldap_server"] = bindings.NewReferenceType(model.DirectoryLdapServerBindingType) + queryParams["action"] = "action" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "directory_ldap_server", + "POST", + "/api/v1/directory/ldap-server", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/directory/OrgUnitsClient.go b/services/nsxt-mp/nsx/directory/OrgUnitsClient.go new file mode 100644 index 000000000..71cbf4027 --- /dev/null +++ b/services/nsxt-mp/nsx/directory/OrgUnitsClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: OrgUnits +// Used by client-side stubs. + +package directory + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type OrgUnitsClient interface { + + // Fetch all organization units for a LDAP server. + // + // @param directoryLdapServerParam (required) + // @return com.vmware.nsx.model.DirectoryOrgUnitListResults + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(directoryLdapServerParam model.DirectoryLdapServer) (model.DirectoryOrgUnitListResults, error) +} + +type orgUnitsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewOrgUnitsClient(connector client.Connector) *orgUnitsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.directory.org_units") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + oIface := orgUnitsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &oIface +} + +func (oIface *orgUnitsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := oIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (oIface *orgUnitsClient) Create(directoryLdapServerParam model.DirectoryLdapServer) (model.DirectoryOrgUnitListResults, error) { + typeConverter := oIface.connector.TypeConverter() + executionContext := oIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(orgUnitsCreateInputType(), typeConverter) + sv.AddStructField("DirectoryLdapServer", directoryLdapServerParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DirectoryOrgUnitListResults + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := orgUnitsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + oIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := oIface.connector.GetApiProvider().Invoke("com.vmware.nsx.directory.org_units", "create", inputDataValue, executionContext) + var emptyOutput model.DirectoryOrgUnitListResults + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), orgUnitsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DirectoryOrgUnitListResults), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), oIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/directory/OrgUnitsTypes.go b/services/nsxt-mp/nsx/directory/OrgUnitsTypes.go new file mode 100644 index 000000000..2df04747e --- /dev/null +++ b/services/nsxt-mp/nsx/directory/OrgUnitsTypes.go @@ -0,0 +1,67 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: OrgUnits. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package directory + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func orgUnitsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["directory_ldap_server"] = bindings.NewReferenceType(model.DirectoryLdapServerBindingType) + fieldNameMap["directory_ldap_server"] = "DirectoryLdapServer" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func orgUnitsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DirectoryOrgUnitListResultsBindingType) +} + +func orgUnitsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["directory_ldap_server"] = bindings.NewReferenceType(model.DirectoryLdapServerBindingType) + fieldNameMap["directory_ldap_server"] = "DirectoryLdapServer" + paramsTypeMap["directory_ldap_server"] = bindings.NewReferenceType(model.DirectoryLdapServerBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "directory_ldap_server", + "POST", + "/api/v1/directory/org-units", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/directory/domains/DomainsPackageTypes.go b/services/nsxt-mp/nsx/directory/domains/DomainsPackageTypes.go new file mode 100644 index 000000000..664ac9353 --- /dev/null +++ b/services/nsxt-mp/nsx/directory/domains/DomainsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.directory.domains. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package domains diff --git a/services/nsxt-mp/nsx/directory/domains/GroupsClient.go b/services/nsxt-mp/nsx/directory/domains/GroupsClient.go new file mode 100644 index 000000000..4e5b46443 --- /dev/null +++ b/services/nsxt-mp/nsx/directory/domains/GroupsClient.go @@ -0,0 +1,102 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Groups +// Used by client-side stubs. + +package domains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type GroupsClient interface { + + // Search for directory groups within a domain based on the substring of a distinguished name. (e.g. CN=User,DC=acme,DC=com) The search filter pattern can optionally support multiple (up to 100 maximum) search pattern separated by '|' (url encoded %7C). In this case, the search results will be returned as the union of all matching criteria. (e.g. CN=Ann,CN=Users,DC=acme,DC=com|CN=Bob,CN=Users,DC=acme,DC=com) + // + // @param domainIdParam Directory domain identifier (required) + // @param filterValueParam Name search filter value (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.DirectoryGroupListResults + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(domainIdParam string, filterValueParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DirectoryGroupListResults, error) +} + +type groupsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewGroupsClient(connector client.Connector) *groupsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.directory.domains.groups") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + gIface := groupsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &gIface +} + +func (gIface *groupsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := gIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (gIface *groupsClient) List(domainIdParam string, filterValueParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DirectoryGroupListResults, error) { + typeConverter := gIface.connector.TypeConverter() + executionContext := gIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(groupsListInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("FilterValue", filterValueParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DirectoryGroupListResults + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := groupsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := gIface.connector.GetApiProvider().Invoke("com.vmware.nsx.directory.domains.groups", "list", inputDataValue, executionContext) + var emptyOutput model.DirectoryGroupListResults + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), groupsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DirectoryGroupListResults), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/directory/domains/GroupsTypes.go b/services/nsxt-mp/nsx/directory/domains/GroupsTypes.go new file mode 100644 index 000000000..4d70fa8f0 --- /dev/null +++ b/services/nsxt-mp/nsx/directory/domains/GroupsTypes.go @@ -0,0 +1,105 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Groups. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package domains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func groupsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["filter_value"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["filter_value"] = "FilterValue" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func groupsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DirectoryGroupListResultsBindingType) +} + +func groupsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["filter_value"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["filter_value"] = "FilterValue" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["filter_value"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["domainId"] = bindings.NewStringType() + pathParams["domain_id"] = "domainId" + queryParams["cursor"] = "cursor" + queryParams["filter_value"] = "filter_value" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/directory/domains/{domainId}/groups", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/directory/domains/LdapServersClient.go b/services/nsxt-mp/nsx/directory/domains/LdapServersClient.go new file mode 100644 index 000000000..572011d62 --- /dev/null +++ b/services/nsxt-mp/nsx/directory/domains/LdapServersClient.go @@ -0,0 +1,315 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: LdapServers +// Used by client-side stubs. + +package domains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type LdapServersClient interface { + + // More than one LDAP server can be created and only one LDAP server is used to synchronize directory objects. If more than one LDAP server is configured, NSX will try all the servers until it is able to successfully connect to one. + // + // @param domainIdParam Directory domain identifier (required) + // @param directoryLdapServerParam (required) + // @return com.vmware.nsx.model.DirectoryLdapServer + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(domainIdParam string, directoryLdapServerParam model.DirectoryLdapServer) (model.DirectoryLdapServer, error) + + // The API tests a LDAP server connection for an already configured domain. If the connection is successful, the response will be HTTP status 200. Otherwise the response will be HTTP status 500 and corresponding error message will be returned. + // + // @param domainIdParam Directory domain identifier (required) + // @param serverIdParam LDAP server identifier (required) + // @param actionParam LDAP server test requested (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create0(domainIdParam string, serverIdParam string, actionParam string) error + + // Delete a LDAP server for directory domain + // + // @param domainIdParam Directory domain identifier (required) + // @param serverIdParam LDAP server identifier (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(domainIdParam string, serverIdParam string) error + + // Get a specific LDAP server for a given directory domain + // + // @param domainIdParam Directory domain identifier (required) + // @param serverIdParam LDAP server identifier (required) + // @return com.vmware.nsx.model.DirectoryLdapServer + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(domainIdParam string, serverIdParam string) (model.DirectoryLdapServer, error) + + // List all configured domain LDAP servers + // + // @param domainIdParam Directory domain identifier (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.DirectoryLdapServerListResults + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(domainIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DirectoryLdapServerListResults, error) + + // Update a LDAP server for directory domain + // + // @param domainIdParam Directory domain identifier (required) + // @param serverIdParam LDAP server identifier (required) + // @param directoryLdapServerParam (required) + // @return com.vmware.nsx.model.DirectoryLdapServer + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(domainIdParam string, serverIdParam string, directoryLdapServerParam model.DirectoryLdapServer) (model.DirectoryLdapServer, error) +} + +type ldapServersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewLdapServersClient(connector client.Connector) *ldapServersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.directory.domains.ldap_servers") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "create_0": core.NewMethodIdentifier(interfaceIdentifier, "create_0"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + lIface := ldapServersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &lIface +} + +func (lIface *ldapServersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := lIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (lIface *ldapServersClient) Create(domainIdParam string, directoryLdapServerParam model.DirectoryLdapServer) (model.DirectoryLdapServer, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ldapServersCreateInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("DirectoryLdapServer", directoryLdapServerParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DirectoryLdapServer + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ldapServersCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.directory.domains.ldap_servers", "create", inputDataValue, executionContext) + var emptyOutput model.DirectoryLdapServer + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ldapServersCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DirectoryLdapServer), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *ldapServersClient) Create0(domainIdParam string, serverIdParam string, actionParam string) error { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ldapServersCreate0InputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("Action", actionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ldapServersCreate0RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.directory.domains.ldap_servers", "create_0", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (lIface *ldapServersClient) Delete(domainIdParam string, serverIdParam string) error { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ldapServersDeleteInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("ServerId", serverIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ldapServersDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.directory.domains.ldap_servers", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (lIface *ldapServersClient) Get(domainIdParam string, serverIdParam string) (model.DirectoryLdapServer, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ldapServersGetInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("ServerId", serverIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DirectoryLdapServer + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ldapServersGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.directory.domains.ldap_servers", "get", inputDataValue, executionContext) + var emptyOutput model.DirectoryLdapServer + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ldapServersGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DirectoryLdapServer), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *ldapServersClient) List(domainIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DirectoryLdapServerListResults, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ldapServersListInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DirectoryLdapServerListResults + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ldapServersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.directory.domains.ldap_servers", "list", inputDataValue, executionContext) + var emptyOutput model.DirectoryLdapServerListResults + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ldapServersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DirectoryLdapServerListResults), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *ldapServersClient) Update(domainIdParam string, serverIdParam string, directoryLdapServerParam model.DirectoryLdapServer) (model.DirectoryLdapServer, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ldapServersUpdateInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("ServerId", serverIdParam) + sv.AddStructField("DirectoryLdapServer", directoryLdapServerParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DirectoryLdapServer + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ldapServersUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.directory.domains.ldap_servers", "update", inputDataValue, executionContext) + var emptyOutput model.DirectoryLdapServer + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ldapServersUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DirectoryLdapServer), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/directory/domains/LdapServersTypes.go b/services/nsxt-mp/nsx/directory/domains/LdapServersTypes.go new file mode 100644 index 000000000..e59bcf921 --- /dev/null +++ b/services/nsxt-mp/nsx/directory/domains/LdapServersTypes.go @@ -0,0 +1,396 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: LdapServers. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package domains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``action`` of method LdapServers#create0. +const LdapServers_CREATE_0_ACTION_CONNECTIVITY = "CONNECTIVITY" + +func ldapServersCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["directory_ldap_server"] = bindings.NewReferenceType(model.DirectoryLdapServerBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["directory_ldap_server"] = "DirectoryLdapServer" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ldapServersCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DirectoryLdapServerBindingType) +} + +func ldapServersCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["directory_ldap_server"] = bindings.NewReferenceType(model.DirectoryLdapServerBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["directory_ldap_server"] = "DirectoryLdapServer" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["directory_ldap_server"] = bindings.NewReferenceType(model.DirectoryLdapServerBindingType) + paramsTypeMap["domainId"] = bindings.NewStringType() + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "directory_ldap_server", + "POST", + "/api/v1/directory/domains/{domainId}/ldap-servers", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ldapServersCreate0InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["server_id"] = bindings.NewStringType() + fields["action"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["action"] = "Action" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ldapServersCreate0OutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ldapServersCreate0RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["server_id"] = bindings.NewStringType() + fields["action"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["action"] = "Action" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["action"] = bindings.NewStringType() + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + pathParams["server_id"] = "serverId" + pathParams["domain_id"] = "domainId" + queryParams["action"] = "action" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "POST", + "/api/v1/directory/domains/{domainId}/ldap-servers/{serverId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ldapServersDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["server_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["server_id"] = "ServerId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ldapServersDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ldapServersDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["server_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["server_id"] = "ServerId" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + pathParams["server_id"] = "serverId" + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/directory/domains/{domainId}/ldap-servers/{serverId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ldapServersGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["server_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["server_id"] = "ServerId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ldapServersGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DirectoryLdapServerBindingType) +} + +func ldapServersGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["server_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["server_id"] = "ServerId" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + pathParams["server_id"] = "serverId" + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/directory/domains/{domainId}/ldap-servers/{serverId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ldapServersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ldapServersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DirectoryLdapServerListResultsBindingType) +} + +func ldapServersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["domainId"] = bindings.NewStringType() + pathParams["domain_id"] = "domainId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/directory/domains/{domainId}/ldap-servers", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ldapServersUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["server_id"] = bindings.NewStringType() + fields["directory_ldap_server"] = bindings.NewReferenceType(model.DirectoryLdapServerBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["directory_ldap_server"] = "DirectoryLdapServer" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ldapServersUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DirectoryLdapServerBindingType) +} + +func ldapServersUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["server_id"] = bindings.NewStringType() + fields["directory_ldap_server"] = bindings.NewReferenceType(model.DirectoryLdapServerBindingType) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["server_id"] = "ServerId" + fieldNameMap["directory_ldap_server"] = "DirectoryLdapServer" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["directory_ldap_server"] = bindings.NewReferenceType(model.DirectoryLdapServerBindingType) + paramsTypeMap["server_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["serverId"] = bindings.NewStringType() + pathParams["server_id"] = "serverId" + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "directory_ldap_server", + "PUT", + "/api/v1/directory/domains/{domainId}/ldap-servers/{serverId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/directory/domains/OrgUnitsClient.go b/services/nsxt-mp/nsx/directory/domains/OrgUnitsClient.go new file mode 100644 index 000000000..9d1030d75 --- /dev/null +++ b/services/nsxt-mp/nsx/directory/domains/OrgUnitsClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: OrgUnits +// Used by client-side stubs. + +package domains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type OrgUnitsClient interface { + + // Fetch all organization units for a Directory domain. + // + // @param domainIdParam Directory domain identifier (required) + // @return com.vmware.nsx.model.DirectoryOrgUnitListResults + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(domainIdParam string) (model.DirectoryOrgUnitListResults, error) +} + +type orgUnitsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewOrgUnitsClient(connector client.Connector) *orgUnitsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.directory.domains.org_units") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + oIface := orgUnitsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &oIface +} + +func (oIface *orgUnitsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := oIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (oIface *orgUnitsClient) Create(domainIdParam string) (model.DirectoryOrgUnitListResults, error) { + typeConverter := oIface.connector.TypeConverter() + executionContext := oIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(orgUnitsCreateInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DirectoryOrgUnitListResults + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := orgUnitsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + oIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := oIface.connector.GetApiProvider().Invoke("com.vmware.nsx.directory.domains.org_units", "create", inputDataValue, executionContext) + var emptyOutput model.DirectoryOrgUnitListResults + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), orgUnitsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DirectoryOrgUnitListResults), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), oIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/directory/domains/OrgUnitsTypes.go b/services/nsxt-mp/nsx/directory/domains/OrgUnitsTypes.go new file mode 100644 index 000000000..fb78d22e2 --- /dev/null +++ b/services/nsxt-mp/nsx/directory/domains/OrgUnitsTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: OrgUnits. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package domains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func orgUnitsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func orgUnitsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DirectoryOrgUnitListResultsBindingType) +} + +func orgUnitsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "POST", + "/api/v1/directory/domains/{domainId}/org-units", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/directory/domains/SyncStatsClient.go b/services/nsxt-mp/nsx/directory/domains/SyncStatsClient.go new file mode 100644 index 000000000..986dd1d41 --- /dev/null +++ b/services/nsxt-mp/nsx/directory/domains/SyncStatsClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: SyncStats +// Used by client-side stubs. + +package domains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SyncStatsClient interface { + + // Get domain sync statistics for the given identifier + // + // @param domainIdParam Directory domain identifier (required) + // @return com.vmware.nsx.model.DirectoryDomainSyncStats + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(domainIdParam string) (model.DirectoryDomainSyncStats, error) +} + +type syncStatsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSyncStatsClient(connector client.Connector) *syncStatsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.directory.domains.sync_stats") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := syncStatsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *syncStatsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *syncStatsClient) Get(domainIdParam string) (model.DirectoryDomainSyncStats, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(syncStatsGetInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DirectoryDomainSyncStats + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := syncStatsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.directory.domains.sync_stats", "get", inputDataValue, executionContext) + var emptyOutput model.DirectoryDomainSyncStats + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), syncStatsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DirectoryDomainSyncStats), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/directory/domains/SyncStatsTypes.go b/services/nsxt-mp/nsx/directory/domains/SyncStatsTypes.go new file mode 100644 index 000000000..4628d34c5 --- /dev/null +++ b/services/nsxt-mp/nsx/directory/domains/SyncStatsTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: SyncStats. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package domains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func syncStatsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func syncStatsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DirectoryDomainSyncStatsBindingType) +} + +func syncStatsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fieldNameMap["domain_id"] = "DomainId" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["domainId"] = bindings.NewStringType() + pathParams["domain_id"] = "domainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/directory/domains/{domainId}/sync-stats", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/directory/domains/groups/GroupsPackageTypes.go b/services/nsxt-mp/nsx/directory/domains/groups/GroupsPackageTypes.go new file mode 100644 index 000000000..0039ff901 --- /dev/null +++ b/services/nsxt-mp/nsx/directory/domains/groups/GroupsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.directory.domains.groups. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package groups diff --git a/services/nsxt-mp/nsx/directory/domains/groups/MemberGroupsClient.go b/services/nsxt-mp/nsx/directory/domains/groups/MemberGroupsClient.go new file mode 100644 index 000000000..04126ed07 --- /dev/null +++ b/services/nsxt-mp/nsx/directory/domains/groups/MemberGroupsClient.go @@ -0,0 +1,102 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MemberGroups +// Used by client-side stubs. + +package groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MemberGroupsClient interface { + + // A member group could be either direct member of the group specified by group_id or nested member of it. Both direct member groups and nested member groups are returned. + // + // @param domainIdParam Directory domain identifier (required) + // @param groupIdParam Directory group identifier (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.DirectoryGroupMemberListResults + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(domainIdParam string, groupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DirectoryGroupMemberListResults, error) +} + +type memberGroupsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMemberGroupsClient(connector client.Connector) *memberGroupsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.directory.domains.groups.member_groups") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := memberGroupsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *memberGroupsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *memberGroupsClient) List(domainIdParam string, groupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DirectoryGroupMemberListResults, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(memberGroupsListInputType(), typeConverter) + sv.AddStructField("DomainId", domainIdParam) + sv.AddStructField("GroupId", groupIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DirectoryGroupMemberListResults + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := memberGroupsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.directory.domains.groups.member_groups", "list", inputDataValue, executionContext) + var emptyOutput model.DirectoryGroupMemberListResults + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), memberGroupsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DirectoryGroupMemberListResults), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/directory/domains/groups/MemberGroupsTypes.go b/services/nsxt-mp/nsx/directory/domains/groups/MemberGroupsTypes.go new file mode 100644 index 000000000..fe9e12fa8 --- /dev/null +++ b/services/nsxt-mp/nsx/directory/domains/groups/MemberGroupsTypes.go @@ -0,0 +1,106 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MemberGroups. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func memberGroupsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_id"] = bindings.NewStringType() + fields["group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func memberGroupsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DirectoryGroupMemberListResultsBindingType) +} + +func memberGroupsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["domain_id"] = bindings.NewStringType() + fields["group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_id"] = "DomainId" + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["domain_id"] = bindings.NewStringType() + paramsTypeMap["group_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["domainId"] = bindings.NewStringType() + paramsTypeMap["groupId"] = bindings.NewStringType() + pathParams["group_id"] = "groupId" + pathParams["domain_id"] = "domainId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/directory/domains/{domainId}/groups/{groupId}/member-groups", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/dns/DnsPackageTypes.go b/services/nsxt-mp/nsx/dns/DnsPackageTypes.go new file mode 100644 index 000000000..c2a96e6bc --- /dev/null +++ b/services/nsxt-mp/nsx/dns/DnsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.dns. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package dns diff --git a/services/nsxt-mp/nsx/dns/ForwardersClient.go b/services/nsxt-mp/nsx/dns/ForwardersClient.go new file mode 100644 index 000000000..fd811a630 --- /dev/null +++ b/services/nsxt-mp/nsx/dns/ForwardersClient.go @@ -0,0 +1,373 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Forwarders +// Used by client-side stubs. + +package dns + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ForwardersClient interface { + + // Clear the current cache of the DNS forwarder. + // + // @param forwarderIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Clearcache(forwarderIdParam string) error + + // Create a DNS forwader upon a logical router. There is only one DNS forwarder can be created upon a given logical router. + // + // @param dnsForwarderParam (required) + // @return com.vmware.nsx.model.DnsForwarder + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(dnsForwarderParam model.DnsForwarder) (model.DnsForwarder, error) + + // Delete a specific DNS forwarder. + // + // @param forwarderIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(forwarderIdParam string) error + + // Disable the DNS forwarder if the forwarder is currently enbled. If the DNS forwarder is already disabled, the forwarder will not be re-disabled. Please note, once a DNS forwarder is disabled then enabled, the previous DNS forwarder statistics counters will be reset. + // + // @param forwarderIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Disable(forwarderIdParam string) error + + // Enable the DNS forwarder if the forwarder is currently disabled. If the DNS forwarder is already enabled, the forwarder will not be re-enabled. Please note, once a DNS forwarder is disabled then enabled, the previous DNS forwarder statistics counters will be reset. + // + // @param forwarderIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Enable(forwarderIdParam string) error + + // Retrieve a DNS forwarder. + // + // @param forwarderIdParam (required) + // @return com.vmware.nsx.model.DnsForwarder + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(forwarderIdParam string) (model.DnsForwarder, error) + + // Get a paginated list of DNS forwarders. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.DnsForwarderListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DnsForwarderListResult, error) + + // Update a specific DNS forwarder. + // + // @param forwarderIdParam (required) + // @param dnsForwarderParam (required) + // @return com.vmware.nsx.model.DnsForwarder + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(forwarderIdParam string, dnsForwarderParam model.DnsForwarder) (model.DnsForwarder, error) +} + +type forwardersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewForwardersClient(connector client.Connector) *forwardersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.dns.forwarders") + methodIdentifiers := map[string]core.MethodIdentifier{ + "clearcache": core.NewMethodIdentifier(interfaceIdentifier, "clearcache"), + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "disable": core.NewMethodIdentifier(interfaceIdentifier, "disable"), + "enable": core.NewMethodIdentifier(interfaceIdentifier, "enable"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + fIface := forwardersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &fIface +} + +func (fIface *forwardersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := fIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (fIface *forwardersClient) Clearcache(forwarderIdParam string) error { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(forwardersClearcacheInputType(), typeConverter) + sv.AddStructField("ForwarderId", forwarderIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := forwardersClearcacheRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dns.forwarders", "clearcache", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (fIface *forwardersClient) Create(dnsForwarderParam model.DnsForwarder) (model.DnsForwarder, error) { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(forwardersCreateInputType(), typeConverter) + sv.AddStructField("DnsForwarder", dnsForwarderParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DnsForwarder + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := forwardersCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dns.forwarders", "create", inputDataValue, executionContext) + var emptyOutput model.DnsForwarder + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), forwardersCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DnsForwarder), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (fIface *forwardersClient) Delete(forwarderIdParam string) error { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(forwardersDeleteInputType(), typeConverter) + sv.AddStructField("ForwarderId", forwarderIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := forwardersDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dns.forwarders", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (fIface *forwardersClient) Disable(forwarderIdParam string) error { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(forwardersDisableInputType(), typeConverter) + sv.AddStructField("ForwarderId", forwarderIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := forwardersDisableRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dns.forwarders", "disable", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (fIface *forwardersClient) Enable(forwarderIdParam string) error { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(forwardersEnableInputType(), typeConverter) + sv.AddStructField("ForwarderId", forwarderIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := forwardersEnableRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dns.forwarders", "enable", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (fIface *forwardersClient) Get(forwarderIdParam string) (model.DnsForwarder, error) { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(forwardersGetInputType(), typeConverter) + sv.AddStructField("ForwarderId", forwarderIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DnsForwarder + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := forwardersGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dns.forwarders", "get", inputDataValue, executionContext) + var emptyOutput model.DnsForwarder + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), forwardersGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DnsForwarder), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (fIface *forwardersClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DnsForwarderListResult, error) { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(forwardersListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DnsForwarderListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := forwardersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dns.forwarders", "list", inputDataValue, executionContext) + var emptyOutput model.DnsForwarderListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), forwardersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DnsForwarderListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (fIface *forwardersClient) Update(forwarderIdParam string, dnsForwarderParam model.DnsForwarder) (model.DnsForwarder, error) { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(forwardersUpdateInputType(), typeConverter) + sv.AddStructField("ForwarderId", forwarderIdParam) + sv.AddStructField("DnsForwarder", dnsForwarderParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DnsForwarder + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := forwardersUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dns.forwarders", "update", inputDataValue, executionContext) + var emptyOutput model.DnsForwarder + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), forwardersUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DnsForwarder), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/dns/ForwardersTypes.go b/services/nsxt-mp/nsx/dns/ForwardersTypes.go new file mode 100644 index 000000000..e9e23d196 --- /dev/null +++ b/services/nsxt-mp/nsx/dns/ForwardersTypes.go @@ -0,0 +1,445 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Forwarders. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package dns + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func forwardersClearcacheInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["forwarder_id"] = bindings.NewStringType() + fieldNameMap["forwarder_id"] = "ForwarderId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func forwardersClearcacheOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func forwardersClearcacheRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["forwarder_id"] = bindings.NewStringType() + fieldNameMap["forwarder_id"] = "ForwarderId" + paramsTypeMap["forwarder_id"] = bindings.NewStringType() + paramsTypeMap["forwarderId"] = bindings.NewStringType() + pathParams["forwarder_id"] = "forwarderId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=clear_cache", + "", + "POST", + "/api/v1/dns/forwarders/{forwarderId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func forwardersCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dns_forwarder"] = bindings.NewReferenceType(model.DnsForwarderBindingType) + fieldNameMap["dns_forwarder"] = "DnsForwarder" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func forwardersCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DnsForwarderBindingType) +} + +func forwardersCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dns_forwarder"] = bindings.NewReferenceType(model.DnsForwarderBindingType) + fieldNameMap["dns_forwarder"] = "DnsForwarder" + paramsTypeMap["dns_forwarder"] = bindings.NewReferenceType(model.DnsForwarderBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dns_forwarder", + "POST", + "/api/v1/dns/forwarders", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func forwardersDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["forwarder_id"] = bindings.NewStringType() + fieldNameMap["forwarder_id"] = "ForwarderId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func forwardersDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func forwardersDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["forwarder_id"] = bindings.NewStringType() + fieldNameMap["forwarder_id"] = "ForwarderId" + paramsTypeMap["forwarder_id"] = bindings.NewStringType() + paramsTypeMap["forwarderId"] = bindings.NewStringType() + pathParams["forwarder_id"] = "forwarderId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/dns/forwarders/{forwarderId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func forwardersDisableInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["forwarder_id"] = bindings.NewStringType() + fieldNameMap["forwarder_id"] = "ForwarderId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func forwardersDisableOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func forwardersDisableRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["forwarder_id"] = bindings.NewStringType() + fieldNameMap["forwarder_id"] = "ForwarderId" + paramsTypeMap["forwarder_id"] = bindings.NewStringType() + paramsTypeMap["forwarderId"] = bindings.NewStringType() + pathParams["forwarder_id"] = "forwarderId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=disable", + "", + "POST", + "/api/v1/dns/forwarders/{forwarderId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func forwardersEnableInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["forwarder_id"] = bindings.NewStringType() + fieldNameMap["forwarder_id"] = "ForwarderId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func forwardersEnableOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func forwardersEnableRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["forwarder_id"] = bindings.NewStringType() + fieldNameMap["forwarder_id"] = "ForwarderId" + paramsTypeMap["forwarder_id"] = bindings.NewStringType() + paramsTypeMap["forwarderId"] = bindings.NewStringType() + pathParams["forwarder_id"] = "forwarderId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=enable", + "", + "POST", + "/api/v1/dns/forwarders/{forwarderId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func forwardersGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["forwarder_id"] = bindings.NewStringType() + fieldNameMap["forwarder_id"] = "ForwarderId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func forwardersGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DnsForwarderBindingType) +} + +func forwardersGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["forwarder_id"] = bindings.NewStringType() + fieldNameMap["forwarder_id"] = "ForwarderId" + paramsTypeMap["forwarder_id"] = bindings.NewStringType() + paramsTypeMap["forwarderId"] = bindings.NewStringType() + pathParams["forwarder_id"] = "forwarderId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dns/forwarders/{forwarderId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func forwardersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func forwardersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DnsForwarderListResultBindingType) +} + +func forwardersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dns/forwarders", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func forwardersUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["forwarder_id"] = bindings.NewStringType() + fields["dns_forwarder"] = bindings.NewReferenceType(model.DnsForwarderBindingType) + fieldNameMap["forwarder_id"] = "ForwarderId" + fieldNameMap["dns_forwarder"] = "DnsForwarder" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func forwardersUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DnsForwarderBindingType) +} + +func forwardersUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["forwarder_id"] = bindings.NewStringType() + fields["dns_forwarder"] = bindings.NewReferenceType(model.DnsForwarderBindingType) + fieldNameMap["forwarder_id"] = "ForwarderId" + fieldNameMap["dns_forwarder"] = "DnsForwarder" + paramsTypeMap["dns_forwarder"] = bindings.NewReferenceType(model.DnsForwarderBindingType) + paramsTypeMap["forwarder_id"] = bindings.NewStringType() + paramsTypeMap["forwarderId"] = bindings.NewStringType() + pathParams["forwarder_id"] = "forwarderId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "dns_forwarder", + "PUT", + "/api/v1/dns/forwarders/{forwarderId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/dns/forwarders/FailedQueriesClient.go b/services/nsxt-mp/nsx/dns/forwarders/FailedQueriesClient.go new file mode 100644 index 000000000..c65bca9aa --- /dev/null +++ b/services/nsxt-mp/nsx/dns/forwarders/FailedQueriesClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: FailedQueries +// Used by client-side stubs. + +package forwarders + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type FailedQueriesClient interface { + + // Return the given count of recent failed DNS queries from DNS forwarder. Since the DNS forwarder is running in Acitve/Standby HA mode on transport nodes, the given count of queries will be returned from each nodes. Hence the total queries returned could be doubled. If no count is specified, 100 recent failed queries are returned. If the recent failures is less than the given count, all the failures will be returned. The maximum count is 1,000. + // + // @param forwarderIdParam (required) + // @param countParam The count of the failed DNS queries (optional, default to 100) + // @return com.vmware.nsx.model.DnsFailedQueries + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(forwarderIdParam string, countParam *int64) (model.DnsFailedQueries, error) +} + +type failedQueriesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewFailedQueriesClient(connector client.Connector) *failedQueriesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.dns.forwarders.failed_queries") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + fIface := failedQueriesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &fIface +} + +func (fIface *failedQueriesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := fIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (fIface *failedQueriesClient) Get(forwarderIdParam string, countParam *int64) (model.DnsFailedQueries, error) { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(failedQueriesGetInputType(), typeConverter) + sv.AddStructField("ForwarderId", forwarderIdParam) + sv.AddStructField("Count", countParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DnsFailedQueries + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := failedQueriesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dns.forwarders.failed_queries", "get", inputDataValue, executionContext) + var emptyOutput model.DnsFailedQueries + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), failedQueriesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DnsFailedQueries), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/dns/forwarders/FailedQueriesTypes.go b/services/nsxt-mp/nsx/dns/forwarders/FailedQueriesTypes.go new file mode 100644 index 000000000..3b7921a37 --- /dev/null +++ b/services/nsxt-mp/nsx/dns/forwarders/FailedQueriesTypes.go @@ -0,0 +1,75 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: FailedQueries. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package forwarders + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func failedQueriesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["forwarder_id"] = bindings.NewStringType() + fields["count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["forwarder_id"] = "ForwarderId" + fieldNameMap["count"] = "Count" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func failedQueriesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DnsFailedQueriesBindingType) +} + +func failedQueriesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["forwarder_id"] = bindings.NewStringType() + fields["count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["forwarder_id"] = "ForwarderId" + fieldNameMap["count"] = "Count" + paramsTypeMap["count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["forwarder_id"] = bindings.NewStringType() + paramsTypeMap["forwarderId"] = bindings.NewStringType() + pathParams["forwarder_id"] = "forwarderId" + queryParams["count"] = "count" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dns/forwarders/{forwarderId}/failed-queries", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/dns/forwarders/ForwardersPackageTypes.go b/services/nsxt-mp/nsx/dns/forwarders/ForwardersPackageTypes.go new file mode 100644 index 000000000..011bc3d8d --- /dev/null +++ b/services/nsxt-mp/nsx/dns/forwarders/ForwardersPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.dns.forwarders. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package forwarders diff --git a/services/nsxt-mp/nsx/dns/forwarders/NslookupClient.go b/services/nsxt-mp/nsx/dns/forwarders/NslookupClient.go new file mode 100644 index 000000000..782dd69c4 --- /dev/null +++ b/services/nsxt-mp/nsx/dns/forwarders/NslookupClient.go @@ -0,0 +1,96 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Nslookup +// Used by client-side stubs. + +package forwarders + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NslookupClient interface { + + // Query the nameserver for an ip-address or a FQDN of the given an address optionally using an specified DNS server. If the address is a fqdn, nslookup will resolve ip-address with it. If the address is an ip-address, do a reverse lookup and answer fqdn(s). + // + // @param forwarderIdParam (required) + // @param addressParam IP address or FQDN for nslookup (optional) + // @param serverIpParam IPv4 address (optional) + // @param sourceIpParam IPv4 address (optional) + // @return com.vmware.nsx.model.DnsAnswer + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(forwarderIdParam string, addressParam *string, serverIpParam *string, sourceIpParam *string) (model.DnsAnswer, error) +} + +type nslookupClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNslookupClient(connector client.Connector) *nslookupClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.dns.forwarders.nslookup") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nslookupClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nslookupClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nslookupClient) Get(forwarderIdParam string, addressParam *string, serverIpParam *string, sourceIpParam *string) (model.DnsAnswer, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nslookupGetInputType(), typeConverter) + sv.AddStructField("ForwarderId", forwarderIdParam) + sv.AddStructField("Address", addressParam) + sv.AddStructField("ServerIp", serverIpParam) + sv.AddStructField("SourceIp", sourceIpParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DnsAnswer + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nslookupGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dns.forwarders.nslookup", "get", inputDataValue, executionContext) + var emptyOutput model.DnsAnswer + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nslookupGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DnsAnswer), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/dns/forwarders/NslookupTypes.go b/services/nsxt-mp/nsx/dns/forwarders/NslookupTypes.go new file mode 100644 index 000000000..5c269c427 --- /dev/null +++ b/services/nsxt-mp/nsx/dns/forwarders/NslookupTypes.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Nslookup. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package forwarders + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func nslookupGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["forwarder_id"] = bindings.NewStringType() + fields["address"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["server_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["forwarder_id"] = "ForwarderId" + fieldNameMap["address"] = "Address" + fieldNameMap["server_ip"] = "ServerIp" + fieldNameMap["source_ip"] = "SourceIp" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nslookupGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DnsAnswerBindingType) +} + +func nslookupGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["forwarder_id"] = bindings.NewStringType() + fields["address"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["server_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["forwarder_id"] = "ForwarderId" + fieldNameMap["address"] = "Address" + fieldNameMap["server_ip"] = "ServerIp" + fieldNameMap["source_ip"] = "SourceIp" + paramsTypeMap["server_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["source_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["forwarder_id"] = bindings.NewStringType() + paramsTypeMap["address"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["forwarderId"] = bindings.NewStringType() + pathParams["forwarder_id"] = "forwarderId" + queryParams["address"] = "address" + queryParams["server_ip"] = "server_ip" + queryParams["source_ip"] = "source_ip" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dns/forwarders/{forwarderId}/nslookup", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/dns/forwarders/StateClient.go b/services/nsxt-mp/nsx/dns/forwarders/StateClient.go new file mode 100644 index 000000000..2e479fa88 --- /dev/null +++ b/services/nsxt-mp/nsx/dns/forwarders/StateClient.go @@ -0,0 +1,94 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: State +// Used by client-side stubs. + +package forwarders + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StateClient interface { + + // Return the realized state information of a DNS forwarder. After a DNS forwarder was created or updated, you can invoke this API to check the realization state of the forwarder. + // + // @param forwarderIdParam (required) + // @param barrierIdParam (optional) + // @param requestIdParam Realization request ID (optional) + // @return com.vmware.nsx.model.ConfigurationState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(forwarderIdParam string, barrierIdParam *int64, requestIdParam *string) (model.ConfigurationState, error) +} + +type stateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStateClient(connector client.Connector) *stateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.dns.forwarders.state") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := stateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *stateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *stateClient) Get(forwarderIdParam string, barrierIdParam *int64, requestIdParam *string) (model.ConfigurationState, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(stateGetInputType(), typeConverter) + sv.AddStructField("ForwarderId", forwarderIdParam) + sv.AddStructField("BarrierId", barrierIdParam) + sv.AddStructField("RequestId", requestIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ConfigurationState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dns.forwarders.state", "get", inputDataValue, executionContext) + var emptyOutput model.ConfigurationState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ConfigurationState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/dns/forwarders/StateTypes.go b/services/nsxt-mp/nsx/dns/forwarders/StateTypes.go new file mode 100644 index 000000000..5c87f6a78 --- /dev/null +++ b/services/nsxt-mp/nsx/dns/forwarders/StateTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: State. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package forwarders + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func stateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["forwarder_id"] = bindings.NewStringType() + fields["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["forwarder_id"] = "ForwarderId" + fieldNameMap["barrier_id"] = "BarrierId" + fieldNameMap["request_id"] = "RequestId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ConfigurationStateBindingType) +} + +func stateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["forwarder_id"] = bindings.NewStringType() + fields["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["forwarder_id"] = "ForwarderId" + fieldNameMap["barrier_id"] = "BarrierId" + fieldNameMap["request_id"] = "RequestId" + paramsTypeMap["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["forwarder_id"] = bindings.NewStringType() + paramsTypeMap["forwarderId"] = bindings.NewStringType() + pathParams["forwarder_id"] = "forwarderId" + queryParams["barrier_id"] = "barrier_id" + queryParams["request_id"] = "request_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dns/forwarders/{forwarderId}/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/dns/forwarders/StatisticsClient.go b/services/nsxt-mp/nsx/dns/forwarders/StatisticsClient.go new file mode 100644 index 000000000..1c9c97697 --- /dev/null +++ b/services/nsxt-mp/nsx/dns/forwarders/StatisticsClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Statistics +// Used by client-side stubs. + +package forwarders + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatisticsClient interface { + + // Returns the statistics of the given dns forwarder specified by forwarder id. + // + // @param forwarderIdParam (required) + // @return com.vmware.nsx.model.DnsForwarderStatistics + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(forwarderIdParam string) (model.DnsForwarderStatistics, error) +} + +type statisticsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatisticsClient(connector client.Connector) *statisticsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.dns.forwarders.statistics") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statisticsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statisticsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statisticsClient) Get(forwarderIdParam string) (model.DnsForwarderStatistics, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statisticsGetInputType(), typeConverter) + sv.AddStructField("ForwarderId", forwarderIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DnsForwarderStatistics + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statisticsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dns.forwarders.statistics", "get", inputDataValue, executionContext) + var emptyOutput model.DnsForwarderStatistics + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statisticsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DnsForwarderStatistics), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/dns/forwarders/StatisticsTypes.go b/services/nsxt-mp/nsx/dns/forwarders/StatisticsTypes.go new file mode 100644 index 000000000..46226ad37 --- /dev/null +++ b/services/nsxt-mp/nsx/dns/forwarders/StatisticsTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Statistics. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package forwarders + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statisticsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["forwarder_id"] = bindings.NewStringType() + fieldNameMap["forwarder_id"] = "ForwarderId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statisticsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DnsForwarderStatisticsBindingType) +} + +func statisticsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["forwarder_id"] = bindings.NewStringType() + fieldNameMap["forwarder_id"] = "ForwarderId" + paramsTypeMap["forwarder_id"] = bindings.NewStringType() + paramsTypeMap["forwarderId"] = bindings.NewStringType() + pathParams["forwarder_id"] = "forwarderId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dns/forwarders/{forwarderId}/statistics", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/dns/forwarders/StatusClient.go b/services/nsxt-mp/nsx/dns/forwarders/StatusClient.go new file mode 100644 index 000000000..c070753cd --- /dev/null +++ b/services/nsxt-mp/nsx/dns/forwarders/StatusClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package forwarders + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Returns the current status of the given DNS forwarder. + // + // @param forwarderIdParam (required) + // @return com.vmware.nsx.model.DnsForwarderStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(forwarderIdParam string) (model.DnsForwarderStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.dns.forwarders.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(forwarderIdParam string) (model.DnsForwarderStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("ForwarderId", forwarderIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DnsForwarderStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.dns.forwarders.status", "get", inputDataValue, executionContext) + var emptyOutput model.DnsForwarderStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DnsForwarderStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/dns/forwarders/StatusTypes.go b/services/nsxt-mp/nsx/dns/forwarders/StatusTypes.go new file mode 100644 index 000000000..93065b33c --- /dev/null +++ b/services/nsxt-mp/nsx/dns/forwarders/StatusTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package forwarders + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["forwarder_id"] = bindings.NewStringType() + fieldNameMap["forwarder_id"] = "ForwarderId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DnsForwarderStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["forwarder_id"] = bindings.NewStringType() + fieldNameMap["forwarder_id"] = "ForwarderId" + paramsTypeMap["forwarder_id"] = bindings.NewStringType() + paramsTypeMap["forwarderId"] = bindings.NewStringType() + pathParams["forwarder_id"] = "forwarderId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/dns/forwarders/{forwarderId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/edge_clusters/AllocationStatusClient.go b/services/nsxt-mp/nsx/edge_clusters/AllocationStatusClient.go new file mode 100644 index 000000000..9424c0c69 --- /dev/null +++ b/services/nsxt-mp/nsx/edge_clusters/AllocationStatusClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: AllocationStatus +// Used by client-side stubs. + +package edge_clusters + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AllocationStatusClient interface { + + // Returns the allocation details of cluster and its members. Lists the edge node members, active and standby services of each node, utilization details of configured sub-pools. These allocation details can be monitored by customers to trigger migration of certain service contexts to different edge nodes, to balance the utilization of edge node resources. + // + // @param edgeClusterIdParam (required) + // @return com.vmware.nsx.model.EdgeClusterAllocationStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(edgeClusterIdParam string) (model.EdgeClusterAllocationStatus, error) +} + +type allocationStatusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAllocationStatusClient(connector client.Connector) *allocationStatusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.edge_clusters.allocation_status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := allocationStatusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *allocationStatusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *allocationStatusClient) Get(edgeClusterIdParam string) (model.EdgeClusterAllocationStatus, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(allocationStatusGetInputType(), typeConverter) + sv.AddStructField("EdgeClusterId", edgeClusterIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EdgeClusterAllocationStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := allocationStatusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.edge_clusters.allocation_status", "get", inputDataValue, executionContext) + var emptyOutput model.EdgeClusterAllocationStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), allocationStatusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EdgeClusterAllocationStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/edge_clusters/AllocationStatusTypes.go b/services/nsxt-mp/nsx/edge_clusters/AllocationStatusTypes.go new file mode 100644 index 000000000..8db472c8c --- /dev/null +++ b/services/nsxt-mp/nsx/edge_clusters/AllocationStatusTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: AllocationStatus. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package edge_clusters + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func allocationStatusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["edge_cluster_id"] = bindings.NewStringType() + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func allocationStatusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EdgeClusterAllocationStatusBindingType) +} + +func allocationStatusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["edge_cluster_id"] = bindings.NewStringType() + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + paramsTypeMap["edge_cluster_id"] = bindings.NewStringType() + paramsTypeMap["edgeClusterId"] = bindings.NewStringType() + pathParams["edge_cluster_id"] = "edgeClusterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/edge-clusters/{edgeClusterId}/allocation-status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/edge_clusters/EdgeClustersPackageTypes.go b/services/nsxt-mp/nsx/edge_clusters/EdgeClustersPackageTypes.go new file mode 100644 index 000000000..6bc5597ca --- /dev/null +++ b/services/nsxt-mp/nsx/edge_clusters/EdgeClustersPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.edge_clusters. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package edge_clusters diff --git a/services/nsxt-mp/nsx/edge_clusters/StateClient.go b/services/nsxt-mp/nsx/edge_clusters/StateClient.go new file mode 100644 index 000000000..d8f1b5ee6 --- /dev/null +++ b/services/nsxt-mp/nsx/edge_clusters/StateClient.go @@ -0,0 +1,94 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: State +// Used by client-side stubs. + +package edge_clusters + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StateClient interface { + + // Return realized state information of a edge cluster. Any configuration update that affects the edge cluster can use this API to get its realized state by passing a request_id returned by the configuration change operation. e.g. Update configuration of edge cluster. + // + // @param edgeClusterIdParam (required) + // @param barrierIdParam (optional) + // @param requestIdParam Realization request ID (optional) + // @return com.vmware.nsx.model.EdgeClusterState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(edgeClusterIdParam string, barrierIdParam *int64, requestIdParam *string) (model.EdgeClusterState, error) +} + +type stateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStateClient(connector client.Connector) *stateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.edge_clusters.state") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := stateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *stateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *stateClient) Get(edgeClusterIdParam string, barrierIdParam *int64, requestIdParam *string) (model.EdgeClusterState, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(stateGetInputType(), typeConverter) + sv.AddStructField("EdgeClusterId", edgeClusterIdParam) + sv.AddStructField("BarrierId", barrierIdParam) + sv.AddStructField("RequestId", requestIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EdgeClusterState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.edge_clusters.state", "get", inputDataValue, executionContext) + var emptyOutput model.EdgeClusterState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EdgeClusterState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/edge_clusters/StateTypes.go b/services/nsxt-mp/nsx/edge_clusters/StateTypes.go new file mode 100644 index 000000000..7e93df842 --- /dev/null +++ b/services/nsxt-mp/nsx/edge_clusters/StateTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: State. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package edge_clusters + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func stateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["edge_cluster_id"] = bindings.NewStringType() + fields["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + fieldNameMap["barrier_id"] = "BarrierId" + fieldNameMap["request_id"] = "RequestId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EdgeClusterStateBindingType) +} + +func stateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["edge_cluster_id"] = bindings.NewStringType() + fields["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + fieldNameMap["barrier_id"] = "BarrierId" + fieldNameMap["request_id"] = "RequestId" + paramsTypeMap["edge_cluster_id"] = bindings.NewStringType() + paramsTypeMap["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["edgeClusterId"] = bindings.NewStringType() + pathParams["edge_cluster_id"] = "edgeClusterId" + queryParams["barrier_id"] = "barrier_id" + queryParams["request_id"] = "request_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/edge-clusters/{edgeClusterId}/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/edge_clusters/StatusClient.go b/services/nsxt-mp/nsx/edge_clusters/StatusClient.go new file mode 100644 index 000000000..4d991887b --- /dev/null +++ b/services/nsxt-mp/nsx/edge_clusters/StatusClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package edge_clusters + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Returns the aggregated status for the Edge cluster along with status of all edge nodes in the cluster. Query parameter \"source=realtime\" is the only supported source. + // + // @param edgeClusterIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.EdgeClusterStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(edgeClusterIdParam string, sourceParam *string) (model.EdgeClusterStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.edge_clusters.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(edgeClusterIdParam string, sourceParam *string) (model.EdgeClusterStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("EdgeClusterId", edgeClusterIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EdgeClusterStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.edge_clusters.status", "get", inputDataValue, executionContext) + var emptyOutput model.EdgeClusterStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EdgeClusterStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/edge_clusters/StatusTypes.go b/services/nsxt-mp/nsx/edge_clusters/StatusTypes.go new file mode 100644 index 000000000..8d416cc95 --- /dev/null +++ b/services/nsxt-mp/nsx/edge_clusters/StatusTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package edge_clusters + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_CACHED = "cached" + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["edge_cluster_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EdgeClusterStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["edge_cluster_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + fieldNameMap["source"] = "Source" + paramsTypeMap["edge_cluster_id"] = bindings.NewStringType() + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["edgeClusterId"] = bindings.NewStringType() + pathParams["edge_cluster_id"] = "edgeClusterId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/edge-clusters/{edgeClusterId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/edge_clusters/inter_site/InterSitePackageTypes.go b/services/nsxt-mp/nsx/edge_clusters/inter_site/InterSitePackageTypes.go new file mode 100644 index 000000000..a3f1ec20d --- /dev/null +++ b/services/nsxt-mp/nsx/edge_clusters/inter_site/InterSitePackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.edge_clusters.inter_site. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package inter_site diff --git a/services/nsxt-mp/nsx/edge_clusters/inter_site/StatusClient.go b/services/nsxt-mp/nsx/edge_clusters/inter_site/StatusClient.go new file mode 100644 index 000000000..bbea4af00 --- /dev/null +++ b/services/nsxt-mp/nsx/edge_clusters/inter_site/StatusClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package inter_site + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Returns the aggregated status for the Edge cluster along with status of all edge nodes in the cluster. It always returns cached response. + // + // @param edgeClusterIdParam (required) + // @return com.vmware.nsx.model.EdgeClusterInterSiteStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(edgeClusterIdParam string) (model.EdgeClusterInterSiteStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.edge_clusters.inter_site.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(edgeClusterIdParam string) (model.EdgeClusterInterSiteStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("EdgeClusterId", edgeClusterIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EdgeClusterInterSiteStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.edge_clusters.inter_site.status", "get", inputDataValue, executionContext) + var emptyOutput model.EdgeClusterInterSiteStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EdgeClusterInterSiteStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/edge_clusters/inter_site/StatusTypes.go b/services/nsxt-mp/nsx/edge_clusters/inter_site/StatusTypes.go new file mode 100644 index 000000000..e8b869323 --- /dev/null +++ b/services/nsxt-mp/nsx/edge_clusters/inter_site/StatusTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package inter_site + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["edge_cluster_id"] = bindings.NewStringType() + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EdgeClusterInterSiteStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["edge_cluster_id"] = bindings.NewStringType() + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + paramsTypeMap["edge_cluster_id"] = bindings.NewStringType() + paramsTypeMap["edgeClusterId"] = bindings.NewStringType() + pathParams["edge_cluster_id"] = "edgeClusterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/edge-clusters/{edgeClusterId}/inter-site/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/eula/AcceptClient.go b/services/nsxt-mp/nsx/eula/AcceptClient.go new file mode 100644 index 000000000..267456378 --- /dev/null +++ b/services/nsxt-mp/nsx/eula/AcceptClient.go @@ -0,0 +1,79 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Accept +// Used by client-side stubs. + +package eula + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AcceptClient interface { + + // Accept end user license agreement + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create() error +} + +type acceptClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAcceptClient(connector client.Connector) *acceptClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.eula.accept") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := acceptClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *acceptClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *acceptClient) Create() error { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(acceptCreateInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := acceptCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.eula.accept", "create", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/eula/AcceptTypes.go b/services/nsxt-mp/nsx/eula/AcceptTypes.go new file mode 100644 index 000000000..490be913e --- /dev/null +++ b/services/nsxt-mp/nsx/eula/AcceptTypes.go @@ -0,0 +1,61 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Accept. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package eula + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "reflect" +) + +func acceptCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func acceptCreateOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func acceptCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "POST", + "/api/v1/eula/accept", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/eula/AcceptanceClient.go b/services/nsxt-mp/nsx/eula/AcceptanceClient.go new file mode 100644 index 000000000..13736d804 --- /dev/null +++ b/services/nsxt-mp/nsx/eula/AcceptanceClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Acceptance +// Used by client-side stubs. + +package eula + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AcceptanceClient interface { + + // Return the acceptance status of end user license agreement + // @return com.vmware.nsx.model.EULAAcceptance + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.EULAAcceptance, error) +} + +type acceptanceClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAcceptanceClient(connector client.Connector) *acceptanceClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.eula.acceptance") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := acceptanceClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *acceptanceClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *acceptanceClient) Get() (model.EULAAcceptance, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(acceptanceGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EULAAcceptance + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := acceptanceGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.eula.acceptance", "get", inputDataValue, executionContext) + var emptyOutput model.EULAAcceptance + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), acceptanceGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EULAAcceptance), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/eula/AcceptanceTypes.go b/services/nsxt-mp/nsx/eula/AcceptanceTypes.go new file mode 100644 index 000000000..da661caaa --- /dev/null +++ b/services/nsxt-mp/nsx/eula/AcceptanceTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Acceptance. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package eula + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func acceptanceGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func acceptanceGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EULAAcceptanceBindingType) +} + +func acceptanceGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/eula/acceptance", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/eula/ContentClient.go b/services/nsxt-mp/nsx/eula/ContentClient.go new file mode 100644 index 000000000..098bce67d --- /dev/null +++ b/services/nsxt-mp/nsx/eula/ContentClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Content +// Used by client-side stubs. + +package eula + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ContentClient interface { + + // Return the content of end user license agreement in the specified format. By default, it's pure string without line break + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param valueFormatParam End User License Agreement content output format (optional) + // @return com.vmware.nsx.model.EULAContent + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, valueFormatParam *string) (model.EULAContent, error) +} + +type contentClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewContentClient(connector client.Connector) *contentClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.eula.content") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := contentClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *contentClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *contentClient) Get(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, valueFormatParam *string) (model.EULAContent, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(contentGetInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("ValueFormat", valueFormatParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EULAContent + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := contentGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.eula.content", "get", inputDataValue, executionContext) + var emptyOutput model.EULAContent + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), contentGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EULAContent), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/eula/ContentTypes.go b/services/nsxt-mp/nsx/eula/ContentTypes.go new file mode 100644 index 000000000..d714625fc --- /dev/null +++ b/services/nsxt-mp/nsx/eula/ContentTypes.go @@ -0,0 +1,98 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Content. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package eula + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func contentGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["value_format"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["value_format"] = "ValueFormat" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func contentGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EULAContentBindingType) +} + +func contentGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["value_format"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["value_format"] = "ValueFormat" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["value_format"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["value_format"] = "value_format" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/eula/content", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/eula/EulaPackageTypes.go b/services/nsxt-mp/nsx/eula/EulaPackageTypes.go new file mode 100644 index 000000000..e76c1b835 --- /dev/null +++ b/services/nsxt-mp/nsx/eula/EulaPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.eula. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package eula diff --git a/services/nsxt-mp/nsx/fabric/CloudNativeServiceInstancesClient.go b/services/nsxt-mp/nsx/fabric/CloudNativeServiceInstancesClient.go new file mode 100644 index 000000000..fc6ebf4ba --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/CloudNativeServiceInstancesClient.go @@ -0,0 +1,147 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: CloudNativeServiceInstances +// Used by client-side stubs. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type CloudNativeServiceInstancesClient interface { + + // Returns information about a particular cloud native service instance by external-id. + // + // @param externalIdParam (required) + // @return com.vmware.nsx.model.CloudNativeServiceInstance + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(externalIdParam string) (model.CloudNativeServiceInstance, error) + + // Returns information about all cloud native service instances. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param displayNameParam Display Name of the cloud native service instance (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param serviceTypeParam Type of cloud native service; possible values are ELB, RDS (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param sourceParam NSX node id of the public cloud gateway that reported the service instance (optional) + // @return com.vmware.nsx.model.CloudNativeServiceInstanceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, displayNameParam *string, includedFieldsParam *string, pageSizeParam *int64, serviceTypeParam *string, sortAscendingParam *bool, sortByParam *string, sourceParam *string) (model.CloudNativeServiceInstanceListResult, error) +} + +type cloudNativeServiceInstancesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewCloudNativeServiceInstancesClient(connector client.Connector) *cloudNativeServiceInstancesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.fabric.cloud_native_service_instances") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := cloudNativeServiceInstancesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *cloudNativeServiceInstancesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *cloudNativeServiceInstancesClient) Get(externalIdParam string) (model.CloudNativeServiceInstance, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(cloudNativeServiceInstancesGetInputType(), typeConverter) + sv.AddStructField("ExternalId", externalIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CloudNativeServiceInstance + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := cloudNativeServiceInstancesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.cloud_native_service_instances", "get", inputDataValue, executionContext) + var emptyOutput model.CloudNativeServiceInstance + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), cloudNativeServiceInstancesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CloudNativeServiceInstance), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *cloudNativeServiceInstancesClient) List(cursorParam *string, displayNameParam *string, includedFieldsParam *string, pageSizeParam *int64, serviceTypeParam *string, sortAscendingParam *bool, sortByParam *string, sourceParam *string) (model.CloudNativeServiceInstanceListResult, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(cloudNativeServiceInstancesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("DisplayName", displayNameParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("ServiceType", serviceTypeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CloudNativeServiceInstanceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := cloudNativeServiceInstancesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.cloud_native_service_instances", "list", inputDataValue, executionContext) + var emptyOutput model.CloudNativeServiceInstanceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), cloudNativeServiceInstancesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CloudNativeServiceInstanceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/fabric/CloudNativeServiceInstancesTypes.go b/services/nsxt-mp/nsx/fabric/CloudNativeServiceInstancesTypes.go new file mode 100644 index 000000000..153c71b3c --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/CloudNativeServiceInstancesTypes.go @@ -0,0 +1,160 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: CloudNativeServiceInstances. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func cloudNativeServiceInstancesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["external_id"] = bindings.NewStringType() + fieldNameMap["external_id"] = "ExternalId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func cloudNativeServiceInstancesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CloudNativeServiceInstanceBindingType) +} + +func cloudNativeServiceInstancesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["external_id"] = bindings.NewStringType() + fieldNameMap["external_id"] = "ExternalId" + paramsTypeMap["external_id"] = bindings.NewStringType() + paramsTypeMap["externalId"] = bindings.NewStringType() + pathParams["external_id"] = "externalId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/cloud-native-service-instances/{externalId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func cloudNativeServiceInstancesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["service_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["display_name"] = "DisplayName" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["service_type"] = "ServiceType" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func cloudNativeServiceInstancesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CloudNativeServiceInstanceListResultBindingType) +} + +func cloudNativeServiceInstancesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["service_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["display_name"] = "DisplayName" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["service_type"] = "ServiceType" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["service_type"] = "service_type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["source"] = "source" + queryParams["display_name"] = "display_name" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/cloud-native-service-instances", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/fabric/ComputeCollectionsClient.go b/services/nsxt-mp/nsx/fabric/ComputeCollectionsClient.go new file mode 100644 index 000000000..d4aa8a7b4 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/ComputeCollectionsClient.go @@ -0,0 +1,195 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ComputeCollections +// Used by client-side stubs. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ComputeCollectionsClient interface { + + // Perform action specific to NSX on the compute-collection. cc-ext-id should be of type VC_Cluster. + // + // @param ccExtIdParam (required) + // @param actionParam Supported actions on compute-collection (optional) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(ccExtIdParam string, actionParam *string) error + + // Returns information about a specific compute collection. + // + // @param ccExtIdParam (required) + // @return com.vmware.nsx.model.ComputeCollection + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ccExtIdParam string) (model.ComputeCollection, error) + + // Returns information about all compute collections. + // + // @param cmLocalIdParam Local Id of the compute collection in the Compute Manager (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param discoveredNodeIdParam Id of the discovered node which belongs to this Compute Collection (optional) + // @param displayNameParam Name of the ComputeCollection in source compute manager (optional) + // @param externalIdParam External ID of the ComputeCollection in the source Compute manager, e.g. mo-ref in VC (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param nodeIdParam Id of the fabric node created from a discovered node belonging to this Compute Collection (optional) + // @param originIdParam Id of the compute manager from where this Compute Collection was discovered (optional) + // @param originTypeParam ComputeCollection type like VC_Cluster. Here the Compute Manager type prefix would help in differentiating similar named Compute Collection types from different Compute Managers (optional) + // @param ownerIdParam Id of the owner of compute collection in the Compute Manager (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.ComputeCollectionListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cmLocalIdParam *string, cursorParam *string, discoveredNodeIdParam *string, displayNameParam *string, externalIdParam *string, includedFieldsParam *string, nodeIdParam *string, originIdParam *string, originTypeParam *string, ownerIdParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ComputeCollectionListResult, error) +} + +type computeCollectionsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewComputeCollectionsClient(connector client.Connector) *computeCollectionsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.fabric.compute_collections") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := computeCollectionsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *computeCollectionsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *computeCollectionsClient) Create(ccExtIdParam string, actionParam *string) error { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(computeCollectionsCreateInputType(), typeConverter) + sv.AddStructField("CcExtId", ccExtIdParam) + sv.AddStructField("Action", actionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := computeCollectionsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.compute_collections", "create", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *computeCollectionsClient) Get(ccExtIdParam string) (model.ComputeCollection, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(computeCollectionsGetInputType(), typeConverter) + sv.AddStructField("CcExtId", ccExtIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ComputeCollection + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := computeCollectionsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.compute_collections", "get", inputDataValue, executionContext) + var emptyOutput model.ComputeCollection + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), computeCollectionsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ComputeCollection), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *computeCollectionsClient) List(cmLocalIdParam *string, cursorParam *string, discoveredNodeIdParam *string, displayNameParam *string, externalIdParam *string, includedFieldsParam *string, nodeIdParam *string, originIdParam *string, originTypeParam *string, ownerIdParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ComputeCollectionListResult, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(computeCollectionsListInputType(), typeConverter) + sv.AddStructField("CmLocalId", cmLocalIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("DiscoveredNodeId", discoveredNodeIdParam) + sv.AddStructField("DisplayName", displayNameParam) + sv.AddStructField("ExternalId", externalIdParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("OriginId", originIdParam) + sv.AddStructField("OriginType", originTypeParam) + sv.AddStructField("OwnerId", ownerIdParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ComputeCollectionListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := computeCollectionsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.compute_collections", "list", inputDataValue, executionContext) + var emptyOutput model.ComputeCollectionListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), computeCollectionsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ComputeCollectionListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/fabric/ComputeCollectionsTypes.go b/services/nsxt-mp/nsx/fabric/ComputeCollectionsTypes.go new file mode 100644 index 000000000..38f3e1cb6 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/ComputeCollectionsTypes.go @@ -0,0 +1,249 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ComputeCollections. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``action`` of method ComputeCollections#create. +const ComputeCollections_CREATE_ACTION_NSX = "remove_nsx" + +func computeCollectionsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cc_ext_id"] = bindings.NewStringType() + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cc_ext_id"] = "CcExtId" + fieldNameMap["action"] = "Action" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func computeCollectionsCreateOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func computeCollectionsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cc_ext_id"] = bindings.NewStringType() + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cc_ext_id"] = "CcExtId" + fieldNameMap["action"] = "Action" + paramsTypeMap["action"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cc_ext_id"] = bindings.NewStringType() + paramsTypeMap["ccExtId"] = bindings.NewStringType() + pathParams["cc_ext_id"] = "ccExtId" + queryParams["action"] = "action" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "POST", + "/api/v1/fabric/compute-collections/{ccExtId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func computeCollectionsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cc_ext_id"] = bindings.NewStringType() + fieldNameMap["cc_ext_id"] = "CcExtId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func computeCollectionsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ComputeCollectionBindingType) +} + +func computeCollectionsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cc_ext_id"] = bindings.NewStringType() + fieldNameMap["cc_ext_id"] = "CcExtId" + paramsTypeMap["cc_ext_id"] = bindings.NewStringType() + paramsTypeMap["ccExtId"] = bindings.NewStringType() + pathParams["cc_ext_id"] = "ccExtId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/compute-collections/{ccExtId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func computeCollectionsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cm_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["discovered_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["origin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["origin_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["owner_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cm_local_id"] = "CmLocalId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["discovered_node_id"] = "DiscoveredNodeId" + fieldNameMap["display_name"] = "DisplayName" + fieldNameMap["external_id"] = "ExternalId" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["origin_id"] = "OriginId" + fieldNameMap["origin_type"] = "OriginType" + fieldNameMap["owner_id"] = "OwnerId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func computeCollectionsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ComputeCollectionListResultBindingType) +} + +func computeCollectionsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cm_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["discovered_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["origin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["origin_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["owner_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cm_local_id"] = "CmLocalId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["discovered_node_id"] = "DiscoveredNodeId" + fieldNameMap["display_name"] = "DisplayName" + fieldNameMap["external_id"] = "ExternalId" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["origin_id"] = "OriginId" + fieldNameMap["origin_type"] = "OriginType" + fieldNameMap["owner_id"] = "OwnerId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["origin_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["origin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["owner_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cm_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["discovered_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["cm_local_id"] = "cm_local_id" + queryParams["owner_id"] = "owner_id" + queryParams["external_id"] = "external_id" + queryParams["origin_id"] = "origin_id" + queryParams["sort_by"] = "sort_by" + queryParams["display_name"] = "display_name" + queryParams["origin_type"] = "origin_type" + queryParams["discovered_node_id"] = "discovered_node_id" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["node_id"] = "node_id" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/compute-collections", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/fabric/ComputeManagersClient.go b/services/nsxt-mp/nsx/fabric/ComputeManagersClient.go new file mode 100644 index 000000000..7a8f1e36e --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/ComputeManagersClient.go @@ -0,0 +1,269 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ComputeManagers +// Used by client-side stubs. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ComputeManagersClient interface { + + // Registers compute manager with NSX. Inventory service will collect data from the registered compute manager + // + // @param computeManagerParam (required) + // @return com.vmware.nsx.model.ComputeManager + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(computeManagerParam model.ComputeManager) (model.ComputeManager, error) + + // Unregisters a specified compute manager + // + // @param computeManagerIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(computeManagerIdParam string) error + + // Returns information about a specific compute manager + // + // @param computeManagerIdParam (required) + // @return com.vmware.nsx.model.ComputeManager + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(computeManagerIdParam string) (model.ComputeManager, error) + + // Returns information about all compute managers. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param originTypeParam Compute manager type like vCenter (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param serverParam IP address or hostname of compute manager (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.ComputeManagerListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, originTypeParam *string, pageSizeParam *int64, serverParam *string, sortAscendingParam *bool, sortByParam *string) (model.ComputeManagerListResult, error) + + // Updates a specified compute manager + // + // @param computeManagerIdParam (required) + // @param computeManagerParam (required) + // @return com.vmware.nsx.model.ComputeManager + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(computeManagerIdParam string, computeManagerParam model.ComputeManager) (model.ComputeManager, error) +} + +type computeManagersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewComputeManagersClient(connector client.Connector) *computeManagersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.fabric.compute_managers") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := computeManagersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *computeManagersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *computeManagersClient) Create(computeManagerParam model.ComputeManager) (model.ComputeManager, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(computeManagersCreateInputType(), typeConverter) + sv.AddStructField("ComputeManager", computeManagerParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ComputeManager + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := computeManagersCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.compute_managers", "create", inputDataValue, executionContext) + var emptyOutput model.ComputeManager + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), computeManagersCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ComputeManager), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *computeManagersClient) Delete(computeManagerIdParam string) error { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(computeManagersDeleteInputType(), typeConverter) + sv.AddStructField("ComputeManagerId", computeManagerIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := computeManagersDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.compute_managers", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *computeManagersClient) Get(computeManagerIdParam string) (model.ComputeManager, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(computeManagersGetInputType(), typeConverter) + sv.AddStructField("ComputeManagerId", computeManagerIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ComputeManager + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := computeManagersGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.compute_managers", "get", inputDataValue, executionContext) + var emptyOutput model.ComputeManager + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), computeManagersGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ComputeManager), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *computeManagersClient) List(cursorParam *string, includedFieldsParam *string, originTypeParam *string, pageSizeParam *int64, serverParam *string, sortAscendingParam *bool, sortByParam *string) (model.ComputeManagerListResult, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(computeManagersListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("OriginType", originTypeParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("Server", serverParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ComputeManagerListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := computeManagersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.compute_managers", "list", inputDataValue, executionContext) + var emptyOutput model.ComputeManagerListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), computeManagersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ComputeManagerListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *computeManagersClient) Update(computeManagerIdParam string, computeManagerParam model.ComputeManager) (model.ComputeManager, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(computeManagersUpdateInputType(), typeConverter) + sv.AddStructField("ComputeManagerId", computeManagerIdParam) + sv.AddStructField("ComputeManager", computeManagerParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ComputeManager + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := computeManagersUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.compute_managers", "update", inputDataValue, executionContext) + var emptyOutput model.ComputeManager + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), computeManagersUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ComputeManager), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/fabric/ComputeManagersTypes.go b/services/nsxt-mp/nsx/fabric/ComputeManagersTypes.go new file mode 100644 index 000000000..7b01dbf85 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/ComputeManagersTypes.go @@ -0,0 +1,307 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ComputeManagers. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func computeManagersCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["compute_manager"] = bindings.NewReferenceType(model.ComputeManagerBindingType) + fieldNameMap["compute_manager"] = "ComputeManager" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func computeManagersCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ComputeManagerBindingType) +} + +func computeManagersCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["compute_manager"] = bindings.NewReferenceType(model.ComputeManagerBindingType) + fieldNameMap["compute_manager"] = "ComputeManager" + paramsTypeMap["compute_manager"] = bindings.NewReferenceType(model.ComputeManagerBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "compute_manager", + "POST", + "/api/v1/fabric/compute-managers", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func computeManagersDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["compute_manager_id"] = bindings.NewStringType() + fieldNameMap["compute_manager_id"] = "ComputeManagerId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func computeManagersDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func computeManagersDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["compute_manager_id"] = bindings.NewStringType() + fieldNameMap["compute_manager_id"] = "ComputeManagerId" + paramsTypeMap["compute_manager_id"] = bindings.NewStringType() + paramsTypeMap["computeManagerId"] = bindings.NewStringType() + pathParams["compute_manager_id"] = "computeManagerId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/fabric/compute-managers/{computeManagerId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func computeManagersGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["compute_manager_id"] = bindings.NewStringType() + fieldNameMap["compute_manager_id"] = "ComputeManagerId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func computeManagersGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ComputeManagerBindingType) +} + +func computeManagersGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["compute_manager_id"] = bindings.NewStringType() + fieldNameMap["compute_manager_id"] = "ComputeManagerId" + paramsTypeMap["compute_manager_id"] = bindings.NewStringType() + paramsTypeMap["computeManagerId"] = bindings.NewStringType() + pathParams["compute_manager_id"] = "computeManagerId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/compute-managers/{computeManagerId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func computeManagersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["origin_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["server"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["origin_type"] = "OriginType" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["server"] = "Server" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func computeManagersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ComputeManagerListResultBindingType) +} + +func computeManagersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["origin_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["server"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["origin_type"] = "OriginType" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["server"] = "Server" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["origin_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["server"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["server"] = "server" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["origin_type"] = "origin_type" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/compute-managers", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func computeManagersUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["compute_manager_id"] = bindings.NewStringType() + fields["compute_manager"] = bindings.NewReferenceType(model.ComputeManagerBindingType) + fieldNameMap["compute_manager_id"] = "ComputeManagerId" + fieldNameMap["compute_manager"] = "ComputeManager" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func computeManagersUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ComputeManagerBindingType) +} + +func computeManagersUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["compute_manager_id"] = bindings.NewStringType() + fields["compute_manager"] = bindings.NewReferenceType(model.ComputeManagerBindingType) + fieldNameMap["compute_manager_id"] = "ComputeManagerId" + fieldNameMap["compute_manager"] = "ComputeManager" + paramsTypeMap["compute_manager_id"] = bindings.NewStringType() + paramsTypeMap["compute_manager"] = bindings.NewReferenceType(model.ComputeManagerBindingType) + paramsTypeMap["computeManagerId"] = bindings.NewStringType() + pathParams["compute_manager_id"] = "computeManagerId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "compute_manager", + "PUT", + "/api/v1/fabric/compute-managers/{computeManagerId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/fabric/ContainerApplicationInstancesClient.go b/services/nsxt-mp/nsx/fabric/ContainerApplicationInstancesClient.go new file mode 100644 index 000000000..0f575f332 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/ContainerApplicationInstancesClient.go @@ -0,0 +1,149 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ContainerApplicationInstances +// Used by client-side stubs. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ContainerApplicationInstancesClient interface { + + // Returns information about a specific container application instance. + // + // @param containerApplicationInstanceIdParam (required) + // @return com.vmware.nsx.model.ContainerApplicationInstance + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(containerApplicationInstanceIdParam string) (model.ContainerApplicationInstance, error) + + // Returns information about all container application instance. + // + // @param containerApplicationIdParam Identifier of the container application (optional) + // @param containerClusterIdParam Identifier of the container cluster (optional) + // @param containerProjectIdParam Identifier of the container project (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param scopeIdParam Scope id for container cluster (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.ContainerApplicationInstanceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(containerApplicationIdParam *string, containerClusterIdParam *string, containerProjectIdParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, scopeIdParam *string, sortAscendingParam *bool, sortByParam *string) (model.ContainerApplicationInstanceListResult, error) +} + +type containerApplicationInstancesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewContainerApplicationInstancesClient(connector client.Connector) *containerApplicationInstancesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.fabric.container_application_instances") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := containerApplicationInstancesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *containerApplicationInstancesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *containerApplicationInstancesClient) Get(containerApplicationInstanceIdParam string) (model.ContainerApplicationInstance, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(containerApplicationInstancesGetInputType(), typeConverter) + sv.AddStructField("ContainerApplicationInstanceId", containerApplicationInstanceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ContainerApplicationInstance + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := containerApplicationInstancesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.container_application_instances", "get", inputDataValue, executionContext) + var emptyOutput model.ContainerApplicationInstance + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), containerApplicationInstancesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ContainerApplicationInstance), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *containerApplicationInstancesClient) List(containerApplicationIdParam *string, containerClusterIdParam *string, containerProjectIdParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, scopeIdParam *string, sortAscendingParam *bool, sortByParam *string) (model.ContainerApplicationInstanceListResult, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(containerApplicationInstancesListInputType(), typeConverter) + sv.AddStructField("ContainerApplicationId", containerApplicationIdParam) + sv.AddStructField("ContainerClusterId", containerClusterIdParam) + sv.AddStructField("ContainerProjectId", containerProjectIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("ScopeId", scopeIdParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ContainerApplicationInstanceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := containerApplicationInstancesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.container_application_instances", "list", inputDataValue, executionContext) + var emptyOutput model.ContainerApplicationInstanceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), containerApplicationInstancesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ContainerApplicationInstanceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/fabric/ContainerApplicationInstancesTypes.go b/services/nsxt-mp/nsx/fabric/ContainerApplicationInstancesTypes.go new file mode 100644 index 000000000..2436d462f --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/ContainerApplicationInstancesTypes.go @@ -0,0 +1,166 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ContainerApplicationInstances. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func containerApplicationInstancesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_application_instance_id"] = bindings.NewStringType() + fieldNameMap["container_application_instance_id"] = "ContainerApplicationInstanceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func containerApplicationInstancesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ContainerApplicationInstanceBindingType) +} + +func containerApplicationInstancesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["container_application_instance_id"] = bindings.NewStringType() + fieldNameMap["container_application_instance_id"] = "ContainerApplicationInstanceId" + paramsTypeMap["container_application_instance_id"] = bindings.NewStringType() + paramsTypeMap["containerApplicationInstanceId"] = bindings.NewStringType() + pathParams["container_application_instance_id"] = "containerApplicationInstanceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/container-application-instances/{containerApplicationInstanceId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func containerApplicationInstancesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_application_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["container_project_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["scope_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_application_id"] = "ContainerApplicationId" + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fieldNameMap["container_project_id"] = "ContainerProjectId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["scope_id"] = "ScopeId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func containerApplicationInstancesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ContainerApplicationInstanceListResultBindingType) +} + +func containerApplicationInstancesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["container_application_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["container_project_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["scope_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_application_id"] = "ContainerApplicationId" + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fieldNameMap["container_project_id"] = "ContainerProjectId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["scope_id"] = "ScopeId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["scope_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["container_project_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["container_application_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["container_project_id"] = "container_project_id" + queryParams["container_cluster_id"] = "container_cluster_id" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["scope_id"] = "scope_id" + queryParams["container_application_id"] = "container_application_id" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/container-application-instances", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/fabric/ContainerApplicationsClient.go b/services/nsxt-mp/nsx/fabric/ContainerApplicationsClient.go new file mode 100644 index 000000000..38dc6e57d --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/ContainerApplicationsClient.go @@ -0,0 +1,147 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ContainerApplications +// Used by client-side stubs. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ContainerApplicationsClient interface { + + // Returns information about a specific Container Application within a project. + // + // @param containerApplicationIdParam (required) + // @return com.vmware.nsx.model.ContainerApplication + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(containerApplicationIdParam string) (model.ContainerApplication, error) + + // Returns information about all Container Applications. + // + // @param containerClusterIdParam Identifier of the container cluster (optional) + // @param containerProjectIdParam Identifier of the container project (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param scopeIdParam Scope id for container cluster (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.ContainerApplicationListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(containerClusterIdParam *string, containerProjectIdParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, scopeIdParam *string, sortAscendingParam *bool, sortByParam *string) (model.ContainerApplicationListResult, error) +} + +type containerApplicationsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewContainerApplicationsClient(connector client.Connector) *containerApplicationsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.fabric.container_applications") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := containerApplicationsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *containerApplicationsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *containerApplicationsClient) Get(containerApplicationIdParam string) (model.ContainerApplication, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(containerApplicationsGetInputType(), typeConverter) + sv.AddStructField("ContainerApplicationId", containerApplicationIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ContainerApplication + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := containerApplicationsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.container_applications", "get", inputDataValue, executionContext) + var emptyOutput model.ContainerApplication + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), containerApplicationsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ContainerApplication), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *containerApplicationsClient) List(containerClusterIdParam *string, containerProjectIdParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, scopeIdParam *string, sortAscendingParam *bool, sortByParam *string) (model.ContainerApplicationListResult, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(containerApplicationsListInputType(), typeConverter) + sv.AddStructField("ContainerClusterId", containerClusterIdParam) + sv.AddStructField("ContainerProjectId", containerProjectIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("ScopeId", scopeIdParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ContainerApplicationListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := containerApplicationsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.container_applications", "list", inputDataValue, executionContext) + var emptyOutput model.ContainerApplicationListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), containerApplicationsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ContainerApplicationListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/fabric/ContainerApplicationsTypes.go b/services/nsxt-mp/nsx/fabric/ContainerApplicationsTypes.go new file mode 100644 index 000000000..a8971e048 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/ContainerApplicationsTypes.go @@ -0,0 +1,160 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ContainerApplications. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func containerApplicationsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_application_id"] = bindings.NewStringType() + fieldNameMap["container_application_id"] = "ContainerApplicationId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func containerApplicationsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ContainerApplicationBindingType) +} + +func containerApplicationsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["container_application_id"] = bindings.NewStringType() + fieldNameMap["container_application_id"] = "ContainerApplicationId" + paramsTypeMap["container_application_id"] = bindings.NewStringType() + paramsTypeMap["containerApplicationId"] = bindings.NewStringType() + pathParams["container_application_id"] = "containerApplicationId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/container-applications/{containerApplicationId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func containerApplicationsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["container_project_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["scope_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fieldNameMap["container_project_id"] = "ContainerProjectId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["scope_id"] = "ScopeId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func containerApplicationsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ContainerApplicationListResultBindingType) +} + +func containerApplicationsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["container_project_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["scope_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fieldNameMap["container_project_id"] = "ContainerProjectId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["scope_id"] = "ScopeId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["scope_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["container_project_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["container_project_id"] = "container_project_id" + queryParams["container_cluster_id"] = "container_cluster_id" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["scope_id"] = "scope_id" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/container-applications", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/fabric/ContainerClusterNodesClient.go b/services/nsxt-mp/nsx/fabric/ContainerClusterNodesClient.go new file mode 100644 index 000000000..44bdbd571 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/ContainerClusterNodesClient.go @@ -0,0 +1,145 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ContainerClusterNodes +// Used by client-side stubs. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ContainerClusterNodesClient interface { + + // Returns information about a specific container cluster node. + // + // @param containerClusterNodeIdParam (required) + // @return com.vmware.nsx.model.ContainerClusterNode + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(containerClusterNodeIdParam string) (model.ContainerClusterNode, error) + + // Returns information about all container cluster nodes. + // + // @param containerClusterIdParam Identifier of the container cluster (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param scopeIdParam Scope id for container cluster (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.ContainerClusterNodeListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(containerClusterIdParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, scopeIdParam *string, sortAscendingParam *bool, sortByParam *string) (model.ContainerClusterNodeListResult, error) +} + +type containerClusterNodesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewContainerClusterNodesClient(connector client.Connector) *containerClusterNodesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.fabric.container_cluster_nodes") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := containerClusterNodesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *containerClusterNodesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *containerClusterNodesClient) Get(containerClusterNodeIdParam string) (model.ContainerClusterNode, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(containerClusterNodesGetInputType(), typeConverter) + sv.AddStructField("ContainerClusterNodeId", containerClusterNodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ContainerClusterNode + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := containerClusterNodesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.container_cluster_nodes", "get", inputDataValue, executionContext) + var emptyOutput model.ContainerClusterNode + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), containerClusterNodesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ContainerClusterNode), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *containerClusterNodesClient) List(containerClusterIdParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, scopeIdParam *string, sortAscendingParam *bool, sortByParam *string) (model.ContainerClusterNodeListResult, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(containerClusterNodesListInputType(), typeConverter) + sv.AddStructField("ContainerClusterId", containerClusterIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("ScopeId", scopeIdParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ContainerClusterNodeListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := containerClusterNodesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.container_cluster_nodes", "list", inputDataValue, executionContext) + var emptyOutput model.ContainerClusterNodeListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), containerClusterNodesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ContainerClusterNodeListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/fabric/ContainerClusterNodesTypes.go b/services/nsxt-mp/nsx/fabric/ContainerClusterNodesTypes.go new file mode 100644 index 000000000..e58bcae3f --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/ContainerClusterNodesTypes.go @@ -0,0 +1,154 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ContainerClusterNodes. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func containerClusterNodesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_cluster_node_id"] = bindings.NewStringType() + fieldNameMap["container_cluster_node_id"] = "ContainerClusterNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func containerClusterNodesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ContainerClusterNodeBindingType) +} + +func containerClusterNodesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["container_cluster_node_id"] = bindings.NewStringType() + fieldNameMap["container_cluster_node_id"] = "ContainerClusterNodeId" + paramsTypeMap["container_cluster_node_id"] = bindings.NewStringType() + paramsTypeMap["containerClusterNodeId"] = bindings.NewStringType() + pathParams["container_cluster_node_id"] = "containerClusterNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/container-cluster-nodes/{containerClusterNodeId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func containerClusterNodesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["scope_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["scope_id"] = "ScopeId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func containerClusterNodesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ContainerClusterNodeListResultBindingType) +} + +func containerClusterNodesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["scope_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["scope_id"] = "ScopeId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["scope_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["container_cluster_id"] = "container_cluster_id" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["scope_id"] = "scope_id" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/container-cluster-nodes", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/fabric/ContainerClustersClient.go b/services/nsxt-mp/nsx/fabric/ContainerClustersClient.go new file mode 100644 index 000000000..3307852a5 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/ContainerClustersClient.go @@ -0,0 +1,147 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ContainerClusters +// Used by client-side stubs. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ContainerClustersClient interface { + + // Returns information about a specific container cluster + // + // @param containerClusterIdParam (required) + // @return com.vmware.nsx.model.ContainerCluster + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(containerClusterIdParam string) (model.ContainerCluster, error) + + // Returns information about all Container Clusters. + // + // @param clusterTypeParam Type of container cluster (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param infraTypeParam Type of infrastructure (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param scopeIdParam Scope id for container cluster (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.ContainerClusterListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(clusterTypeParam *string, cursorParam *string, includedFieldsParam *string, infraTypeParam *string, pageSizeParam *int64, scopeIdParam *string, sortAscendingParam *bool, sortByParam *string) (model.ContainerClusterListResult, error) +} + +type containerClustersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewContainerClustersClient(connector client.Connector) *containerClustersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.fabric.container_clusters") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := containerClustersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *containerClustersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *containerClustersClient) Get(containerClusterIdParam string) (model.ContainerCluster, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(containerClustersGetInputType(), typeConverter) + sv.AddStructField("ContainerClusterId", containerClusterIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ContainerCluster + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := containerClustersGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.container_clusters", "get", inputDataValue, executionContext) + var emptyOutput model.ContainerCluster + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), containerClustersGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ContainerCluster), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *containerClustersClient) List(clusterTypeParam *string, cursorParam *string, includedFieldsParam *string, infraTypeParam *string, pageSizeParam *int64, scopeIdParam *string, sortAscendingParam *bool, sortByParam *string) (model.ContainerClusterListResult, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(containerClustersListInputType(), typeConverter) + sv.AddStructField("ClusterType", clusterTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("InfraType", infraTypeParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("ScopeId", scopeIdParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ContainerClusterListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := containerClustersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.container_clusters", "list", inputDataValue, executionContext) + var emptyOutput model.ContainerClusterListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), containerClustersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ContainerClusterListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/fabric/ContainerClustersTypes.go b/services/nsxt-mp/nsx/fabric/ContainerClustersTypes.go new file mode 100644 index 000000000..65e1d9b60 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/ContainerClustersTypes.go @@ -0,0 +1,226 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ContainerClusters. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``clusterType`` of method ContainerClusters#list. +const ContainerClusters_LIST_CLUSTER_TYPE_PAS = "PAS" + +// Possible value for ``clusterType`` of method ContainerClusters#list. +const ContainerClusters_LIST_CLUSTER_TYPE_PKS = "PKS" + +// Possible value for ``clusterType`` of method ContainerClusters#list. +const ContainerClusters_LIST_CLUSTER_TYPE_KUBERNETES = "Kubernetes" + +// Possible value for ``clusterType`` of method ContainerClusters#list. +const ContainerClusters_LIST_CLUSTER_TYPE_OPENSHIFT = "Openshift" + +// Possible value for ``clusterType`` of method ContainerClusters#list. +const ContainerClusters_LIST_CLUSTER_TYPE_WCP = "WCP" + +// Possible value for ``clusterType`` of method ContainerClusters#list. +const ContainerClusters_LIST_CLUSTER_TYPE_WCP_GUEST = "WCP_Guest" + +// Possible value for ``clusterType`` of method ContainerClusters#list. +const ContainerClusters_LIST_CLUSTER_TYPE_AKS = "AKS" + +// Possible value for ``clusterType`` of method ContainerClusters#list. +const ContainerClusters_LIST_CLUSTER_TYPE_EKS = "EKS" + +// Possible value for ``clusterType`` of method ContainerClusters#list. +const ContainerClusters_LIST_CLUSTER_TYPE_TKGM = "TKGm" + +// Possible value for ``clusterType`` of method ContainerClusters#list. +const ContainerClusters_LIST_CLUSTER_TYPE_TKGI = "TKGi" + +// Possible value for ``clusterType`` of method ContainerClusters#list. +const ContainerClusters_LIST_CLUSTER_TYPE_GKE = "GKE" + +// Possible value for ``clusterType`` of method ContainerClusters#list. +const ContainerClusters_LIST_CLUSTER_TYPE_GARDENER = "Gardener" + +// Possible value for ``clusterType`` of method ContainerClusters#list. +const ContainerClusters_LIST_CLUSTER_TYPE_RANCHER = "Rancher" + +// Possible value for ``clusterType`` of method ContainerClusters#list. +const ContainerClusters_LIST_CLUSTER_TYPE_TAS = "TAS" + +// Possible value for ``clusterType`` of method ContainerClusters#list. +const ContainerClusters_LIST_CLUSTER_TYPE_OTHER = "Other" + +// Possible value for ``infraType`` of method ContainerClusters#list. +const ContainerClusters_LIST_INFRA_TYPE_VSPHERE = "vSphere" + +// Possible value for ``infraType`` of method ContainerClusters#list. +const ContainerClusters_LIST_INFRA_TYPE_AWS = "AWS" + +// Possible value for ``infraType`` of method ContainerClusters#list. +const ContainerClusters_LIST_INFRA_TYPE_AZURE = "Azure" + +// Possible value for ``infraType`` of method ContainerClusters#list. +const ContainerClusters_LIST_INFRA_TYPE_GOOGLE = "Google" + +// Possible value for ``infraType`` of method ContainerClusters#list. +const ContainerClusters_LIST_INFRA_TYPE_VMC = "VMC" + +// Possible value for ``infraType`` of method ContainerClusters#list. +const ContainerClusters_LIST_INFRA_TYPE_KVM = "KVM" + +// Possible value for ``infraType`` of method ContainerClusters#list. +const ContainerClusters_LIST_INFRA_TYPE_BAREMETAL = "Baremetal" + +func containerClustersGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_cluster_id"] = bindings.NewStringType() + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func containerClustersGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ContainerClusterBindingType) +} + +func containerClustersGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["container_cluster_id"] = bindings.NewStringType() + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + paramsTypeMap["container_cluster_id"] = bindings.NewStringType() + paramsTypeMap["containerClusterId"] = bindings.NewStringType() + pathParams["container_cluster_id"] = "containerClusterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/container-clusters/{containerClusterId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func containerClustersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cluster_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["infra_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["scope_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cluster_type"] = "ClusterType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["infra_type"] = "InfraType" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["scope_id"] = "ScopeId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func containerClustersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ContainerClusterListResultBindingType) +} + +func containerClustersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cluster_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["infra_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["scope_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cluster_type"] = "ClusterType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["infra_type"] = "InfraType" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["scope_id"] = "ScopeId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["cluster_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["infra_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["scope_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["infra_type"] = "infra_type" + queryParams["scope_id"] = "scope_id" + queryParams["cluster_type"] = "cluster_type" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/container-clusters", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/fabric/ContainerIngressPoliciesClient.go b/services/nsxt-mp/nsx/fabric/ContainerIngressPoliciesClient.go new file mode 100644 index 000000000..ef8e5743e --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/ContainerIngressPoliciesClient.go @@ -0,0 +1,147 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ContainerIngressPolicies +// Used by client-side stubs. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ContainerIngressPoliciesClient interface { + + // Returns information about a specific ingress policy. + // + // @param ingressPolicyIdParam (required) + // @return com.vmware.nsx.model.ContainerIngressPolicy + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ingressPolicyIdParam string) (model.ContainerIngressPolicy, error) + + // Returns information about all ingress policies. + // + // @param containerClusterIdParam Identifier of the container cluster (optional) + // @param containerProjectIdParam Identifier of the container project (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param scopeIdParam Scope id for container cluster (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.ContainerIngressPolicyListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(containerClusterIdParam *string, containerProjectIdParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, scopeIdParam *string, sortAscendingParam *bool, sortByParam *string) (model.ContainerIngressPolicyListResult, error) +} + +type containerIngressPoliciesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewContainerIngressPoliciesClient(connector client.Connector) *containerIngressPoliciesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.fabric.container_ingress_policies") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := containerIngressPoliciesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *containerIngressPoliciesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *containerIngressPoliciesClient) Get(ingressPolicyIdParam string) (model.ContainerIngressPolicy, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(containerIngressPoliciesGetInputType(), typeConverter) + sv.AddStructField("IngressPolicyId", ingressPolicyIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ContainerIngressPolicy + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := containerIngressPoliciesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.container_ingress_policies", "get", inputDataValue, executionContext) + var emptyOutput model.ContainerIngressPolicy + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), containerIngressPoliciesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ContainerIngressPolicy), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *containerIngressPoliciesClient) List(containerClusterIdParam *string, containerProjectIdParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, scopeIdParam *string, sortAscendingParam *bool, sortByParam *string) (model.ContainerIngressPolicyListResult, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(containerIngressPoliciesListInputType(), typeConverter) + sv.AddStructField("ContainerClusterId", containerClusterIdParam) + sv.AddStructField("ContainerProjectId", containerProjectIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("ScopeId", scopeIdParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ContainerIngressPolicyListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := containerIngressPoliciesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.container_ingress_policies", "list", inputDataValue, executionContext) + var emptyOutput model.ContainerIngressPolicyListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), containerIngressPoliciesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ContainerIngressPolicyListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/fabric/ContainerIngressPoliciesTypes.go b/services/nsxt-mp/nsx/fabric/ContainerIngressPoliciesTypes.go new file mode 100644 index 000000000..99f60a57d --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/ContainerIngressPoliciesTypes.go @@ -0,0 +1,160 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ContainerIngressPolicies. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func containerIngressPoliciesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ingress_policy_id"] = bindings.NewStringType() + fieldNameMap["ingress_policy_id"] = "IngressPolicyId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func containerIngressPoliciesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ContainerIngressPolicyBindingType) +} + +func containerIngressPoliciesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ingress_policy_id"] = bindings.NewStringType() + fieldNameMap["ingress_policy_id"] = "IngressPolicyId" + paramsTypeMap["ingress_policy_id"] = bindings.NewStringType() + paramsTypeMap["ingressPolicyId"] = bindings.NewStringType() + pathParams["ingress_policy_id"] = "ingressPolicyId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/container-ingress-policies/{ingressPolicyId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func containerIngressPoliciesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["container_project_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["scope_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fieldNameMap["container_project_id"] = "ContainerProjectId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["scope_id"] = "ScopeId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func containerIngressPoliciesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ContainerIngressPolicyListResultBindingType) +} + +func containerIngressPoliciesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["container_project_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["scope_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fieldNameMap["container_project_id"] = "ContainerProjectId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["scope_id"] = "ScopeId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["scope_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["container_project_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["container_project_id"] = "container_project_id" + queryParams["container_cluster_id"] = "container_cluster_id" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["scope_id"] = "scope_id" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/container-ingress-policies", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/fabric/ContainerNetworkPoliciesClient.go b/services/nsxt-mp/nsx/fabric/ContainerNetworkPoliciesClient.go new file mode 100644 index 000000000..a0fc85c0f --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/ContainerNetworkPoliciesClient.go @@ -0,0 +1,147 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ContainerNetworkPolicies +// Used by client-side stubs. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ContainerNetworkPoliciesClient interface { + + // Returns information about a specific network policy. + // + // @param networkPolicyIdParam (required) + // @return com.vmware.nsx.model.ContainerNetworkPolicy + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(networkPolicyIdParam string) (model.ContainerNetworkPolicy, error) + + // Returns information about all network policies. + // + // @param containerClusterIdParam Identifier of the container cluster (optional) + // @param containerProjectIdParam Identifier of the container project (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param scopeIdParam Scope id for container cluster (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.ContainerNetworkPolicyListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(containerClusterIdParam *string, containerProjectIdParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, scopeIdParam *string, sortAscendingParam *bool, sortByParam *string) (model.ContainerNetworkPolicyListResult, error) +} + +type containerNetworkPoliciesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewContainerNetworkPoliciesClient(connector client.Connector) *containerNetworkPoliciesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.fabric.container_network_policies") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := containerNetworkPoliciesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *containerNetworkPoliciesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *containerNetworkPoliciesClient) Get(networkPolicyIdParam string) (model.ContainerNetworkPolicy, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(containerNetworkPoliciesGetInputType(), typeConverter) + sv.AddStructField("NetworkPolicyId", networkPolicyIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ContainerNetworkPolicy + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := containerNetworkPoliciesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.container_network_policies", "get", inputDataValue, executionContext) + var emptyOutput model.ContainerNetworkPolicy + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), containerNetworkPoliciesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ContainerNetworkPolicy), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *containerNetworkPoliciesClient) List(containerClusterIdParam *string, containerProjectIdParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, scopeIdParam *string, sortAscendingParam *bool, sortByParam *string) (model.ContainerNetworkPolicyListResult, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(containerNetworkPoliciesListInputType(), typeConverter) + sv.AddStructField("ContainerClusterId", containerClusterIdParam) + sv.AddStructField("ContainerProjectId", containerProjectIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("ScopeId", scopeIdParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ContainerNetworkPolicyListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := containerNetworkPoliciesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.container_network_policies", "list", inputDataValue, executionContext) + var emptyOutput model.ContainerNetworkPolicyListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), containerNetworkPoliciesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ContainerNetworkPolicyListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/fabric/ContainerNetworkPoliciesTypes.go b/services/nsxt-mp/nsx/fabric/ContainerNetworkPoliciesTypes.go new file mode 100644 index 000000000..a2db39cae --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/ContainerNetworkPoliciesTypes.go @@ -0,0 +1,160 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ContainerNetworkPolicies. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func containerNetworkPoliciesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["network_policy_id"] = bindings.NewStringType() + fieldNameMap["network_policy_id"] = "NetworkPolicyId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func containerNetworkPoliciesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ContainerNetworkPolicyBindingType) +} + +func containerNetworkPoliciesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["network_policy_id"] = bindings.NewStringType() + fieldNameMap["network_policy_id"] = "NetworkPolicyId" + paramsTypeMap["network_policy_id"] = bindings.NewStringType() + paramsTypeMap["networkPolicyId"] = bindings.NewStringType() + pathParams["network_policy_id"] = "networkPolicyId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/container-network-policies/{networkPolicyId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func containerNetworkPoliciesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["container_project_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["scope_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fieldNameMap["container_project_id"] = "ContainerProjectId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["scope_id"] = "ScopeId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func containerNetworkPoliciesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ContainerNetworkPolicyListResultBindingType) +} + +func containerNetworkPoliciesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["container_project_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["scope_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fieldNameMap["container_project_id"] = "ContainerProjectId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["scope_id"] = "ScopeId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["scope_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["container_project_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["container_project_id"] = "container_project_id" + queryParams["container_cluster_id"] = "container_cluster_id" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["scope_id"] = "scope_id" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/container-network-policies", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/fabric/ContainerProjectsClient.go b/services/nsxt-mp/nsx/fabric/ContainerProjectsClient.go new file mode 100644 index 000000000..6a08d951e --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/ContainerProjectsClient.go @@ -0,0 +1,145 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ContainerProjects +// Used by client-side stubs. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ContainerProjectsClient interface { + + // Returns information about a specific project + // + // @param containerProjectIdParam (required) + // @return com.vmware.nsx.model.ContainerProject + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(containerProjectIdParam string) (model.ContainerProject, error) + + // Returns information about all container projects + // + // @param containerClusterIdParam Identifier of the container cluster (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param scopeIdParam Scope id for container cluster (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.ContainerProjectListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(containerClusterIdParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, scopeIdParam *string, sortAscendingParam *bool, sortByParam *string) (model.ContainerProjectListResult, error) +} + +type containerProjectsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewContainerProjectsClient(connector client.Connector) *containerProjectsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.fabric.container_projects") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := containerProjectsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *containerProjectsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *containerProjectsClient) Get(containerProjectIdParam string) (model.ContainerProject, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(containerProjectsGetInputType(), typeConverter) + sv.AddStructField("ContainerProjectId", containerProjectIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ContainerProject + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := containerProjectsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.container_projects", "get", inputDataValue, executionContext) + var emptyOutput model.ContainerProject + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), containerProjectsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ContainerProject), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *containerProjectsClient) List(containerClusterIdParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, scopeIdParam *string, sortAscendingParam *bool, sortByParam *string) (model.ContainerProjectListResult, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(containerProjectsListInputType(), typeConverter) + sv.AddStructField("ContainerClusterId", containerClusterIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("ScopeId", scopeIdParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ContainerProjectListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := containerProjectsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.container_projects", "list", inputDataValue, executionContext) + var emptyOutput model.ContainerProjectListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), containerProjectsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ContainerProjectListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/fabric/ContainerProjectsTypes.go b/services/nsxt-mp/nsx/fabric/ContainerProjectsTypes.go new file mode 100644 index 000000000..00c5b8ca3 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/ContainerProjectsTypes.go @@ -0,0 +1,154 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ContainerProjects. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func containerProjectsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_project_id"] = bindings.NewStringType() + fieldNameMap["container_project_id"] = "ContainerProjectId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func containerProjectsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ContainerProjectBindingType) +} + +func containerProjectsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["container_project_id"] = bindings.NewStringType() + fieldNameMap["container_project_id"] = "ContainerProjectId" + paramsTypeMap["container_project_id"] = bindings.NewStringType() + paramsTypeMap["containerProjectId"] = bindings.NewStringType() + pathParams["container_project_id"] = "containerProjectId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/container-projects/{containerProjectId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func containerProjectsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["scope_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["scope_id"] = "ScopeId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func containerProjectsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ContainerProjectListResultBindingType) +} + +func containerProjectsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["scope_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["scope_id"] = "ScopeId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["scope_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["container_cluster_id"] = "container_cluster_id" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["scope_id"] = "scope_id" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/container-projects", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/fabric/DiscoveredNodesClient.go b/services/nsxt-mp/nsx/fabric/DiscoveredNodesClient.go new file mode 100644 index 000000000..537b4eb35 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/DiscoveredNodesClient.go @@ -0,0 +1,247 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: DiscoveredNodes +// Used by client-side stubs. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type DiscoveredNodesClient interface { + + // NSX components are installaed on host and transport node is created with given configurations. + // + // @param nodeExtIdParam (required) + // @param transportNodeParam (required) + // @return com.vmware.nsx.model.TransportNode + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Createtransportnode(nodeExtIdParam string, transportNodeParam model.TransportNode) (model.TransportNode, error) + + // Returns information about a specific discovered node. + // + // @param nodeExtIdParam (required) + // @return com.vmware.nsx.model.DiscoveredNode + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nodeExtIdParam string) (model.DiscoveredNode, error) + + // Returns information about all discovered nodes. + // + // @param cmLocalIdParam Local Id of the discovered node in the Compute Manager (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param displayNameParam Display name of discovered node (optional) + // @param externalIdParam External id of the discovered node, ex. a mo-ref from VC (optional) + // @param hasParentParam Discovered node has a parent compute collection or is a standalone host (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param ipAddressParam IP address of the discovered node (optional) + // @param nodeIdParam Id of the fabric node created from the discovered node (optional) + // @param nodeTypeParam Discovered Node type like HostNode (optional) + // @param originIdParam Id of the compute manager from where this node was discovered (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param parentComputeCollectionParam External id of the compute collection to which this node belongs (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.DiscoveredNodeListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cmLocalIdParam *string, cursorParam *string, displayNameParam *string, externalIdParam *string, hasParentParam *string, includedFieldsParam *string, ipAddressParam *string, nodeIdParam *string, nodeTypeParam *string, originIdParam *string, pageSizeParam *int64, parentComputeCollectionParam *string, sortAscendingParam *bool, sortByParam *string) (model.DiscoveredNodeListResult, error) + + // When transport node profile (TNP) is applied to a cluster, if any validation fails (e.g. VMs running on host) then transport node (TN) is not created. In that case after the required action is taken (e.g. VMs powered off), you can call this API to try to create TN for that discovered node. Do not call this API if Transport Node already exists for the discovered node. In that case use API on transport node. /transport-nodes/?action=restore_cluster_config + // + // @param nodeExtIdParam (required) + // @return com.vmware.nsx.model.TransportNode + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Reapplyclusterconfig(nodeExtIdParam string) (model.TransportNode, error) +} + +type discoveredNodesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewDiscoveredNodesClient(connector client.Connector) *discoveredNodesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.fabric.discovered_nodes") + methodIdentifiers := map[string]core.MethodIdentifier{ + "createtransportnode": core.NewMethodIdentifier(interfaceIdentifier, "createtransportnode"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "reapplyclusterconfig": core.NewMethodIdentifier(interfaceIdentifier, "reapplyclusterconfig"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + dIface := discoveredNodesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &dIface +} + +func (dIface *discoveredNodesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := dIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (dIface *discoveredNodesClient) Createtransportnode(nodeExtIdParam string, transportNodeParam model.TransportNode) (model.TransportNode, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(discoveredNodesCreatetransportnodeInputType(), typeConverter) + sv.AddStructField("NodeExtId", nodeExtIdParam) + sv.AddStructField("TransportNode", transportNodeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportNode + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := discoveredNodesCreatetransportnodeRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.discovered_nodes", "createtransportnode", inputDataValue, executionContext) + var emptyOutput model.TransportNode + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), discoveredNodesCreatetransportnodeOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportNode), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *discoveredNodesClient) Get(nodeExtIdParam string) (model.DiscoveredNode, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(discoveredNodesGetInputType(), typeConverter) + sv.AddStructField("NodeExtId", nodeExtIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DiscoveredNode + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := discoveredNodesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.discovered_nodes", "get", inputDataValue, executionContext) + var emptyOutput model.DiscoveredNode + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), discoveredNodesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DiscoveredNode), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *discoveredNodesClient) List(cmLocalIdParam *string, cursorParam *string, displayNameParam *string, externalIdParam *string, hasParentParam *string, includedFieldsParam *string, ipAddressParam *string, nodeIdParam *string, nodeTypeParam *string, originIdParam *string, pageSizeParam *int64, parentComputeCollectionParam *string, sortAscendingParam *bool, sortByParam *string) (model.DiscoveredNodeListResult, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(discoveredNodesListInputType(), typeConverter) + sv.AddStructField("CmLocalId", cmLocalIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("DisplayName", displayNameParam) + sv.AddStructField("ExternalId", externalIdParam) + sv.AddStructField("HasParent", hasParentParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("IpAddress", ipAddressParam) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("NodeType", nodeTypeParam) + sv.AddStructField("OriginId", originIdParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("ParentComputeCollection", parentComputeCollectionParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DiscoveredNodeListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := discoveredNodesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.discovered_nodes", "list", inputDataValue, executionContext) + var emptyOutput model.DiscoveredNodeListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), discoveredNodesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DiscoveredNodeListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *discoveredNodesClient) Reapplyclusterconfig(nodeExtIdParam string) (model.TransportNode, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(discoveredNodesReapplyclusterconfigInputType(), typeConverter) + sv.AddStructField("NodeExtId", nodeExtIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportNode + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := discoveredNodesReapplyclusterconfigRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.discovered_nodes", "reapplyclusterconfig", inputDataValue, executionContext) + var emptyOutput model.TransportNode + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), discoveredNodesReapplyclusterconfigOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportNode), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/fabric/DiscoveredNodesTypes.go b/services/nsxt-mp/nsx/fabric/DiscoveredNodesTypes.go new file mode 100644 index 000000000..89db89305 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/DiscoveredNodesTypes.go @@ -0,0 +1,307 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: DiscoveredNodes. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``hasParent`` of method DiscoveredNodes#list. +const DiscoveredNodes_LIST_HAS_PARENT_TRUE = "true" + +// Possible value for ``hasParent`` of method DiscoveredNodes#list. +const DiscoveredNodes_LIST_HAS_PARENT_FALSE = "false" + +func discoveredNodesCreatetransportnodeInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_ext_id"] = bindings.NewStringType() + fields["transport_node"] = bindings.NewReferenceType(model.TransportNodeBindingType) + fieldNameMap["node_ext_id"] = "NodeExtId" + fieldNameMap["transport_node"] = "TransportNode" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func discoveredNodesCreatetransportnodeOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportNodeBindingType) +} + +func discoveredNodesCreatetransportnodeRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_ext_id"] = bindings.NewStringType() + fields["transport_node"] = bindings.NewReferenceType(model.TransportNodeBindingType) + fieldNameMap["node_ext_id"] = "NodeExtId" + fieldNameMap["transport_node"] = "TransportNode" + paramsTypeMap["transport_node"] = bindings.NewReferenceType(model.TransportNodeBindingType) + paramsTypeMap["node_ext_id"] = bindings.NewStringType() + paramsTypeMap["nodeExtId"] = bindings.NewStringType() + pathParams["node_ext_id"] = "nodeExtId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=create_transport_node", + "transport_node", + "POST", + "/api/v1/fabric/discovered-nodes/{nodeExtId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func discoveredNodesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_ext_id"] = bindings.NewStringType() + fieldNameMap["node_ext_id"] = "NodeExtId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func discoveredNodesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DiscoveredNodeBindingType) +} + +func discoveredNodesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_ext_id"] = bindings.NewStringType() + fieldNameMap["node_ext_id"] = "NodeExtId" + paramsTypeMap["node_ext_id"] = bindings.NewStringType() + paramsTypeMap["nodeExtId"] = bindings.NewStringType() + pathParams["node_ext_id"] = "nodeExtId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/discovered-nodes/{nodeExtId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func discoveredNodesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cm_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["has_parent"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["origin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["parent_compute_collection"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cm_local_id"] = "CmLocalId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["display_name"] = "DisplayName" + fieldNameMap["external_id"] = "ExternalId" + fieldNameMap["has_parent"] = "HasParent" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["ip_address"] = "IpAddress" + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["node_type"] = "NodeType" + fieldNameMap["origin_id"] = "OriginId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["parent_compute_collection"] = "ParentComputeCollection" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func discoveredNodesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DiscoveredNodeListResultBindingType) +} + +func discoveredNodesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cm_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["has_parent"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["origin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["parent_compute_collection"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cm_local_id"] = "CmLocalId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["display_name"] = "DisplayName" + fieldNameMap["external_id"] = "ExternalId" + fieldNameMap["has_parent"] = "HasParent" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["ip_address"] = "IpAddress" + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["node_type"] = "NodeType" + fieldNameMap["origin_id"] = "OriginId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["parent_compute_collection"] = "ParentComputeCollection" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["origin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["parent_compute_collection"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cm_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["has_parent"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["cm_local_id"] = "cm_local_id" + queryParams["has_parent"] = "has_parent" + queryParams["external_id"] = "external_id" + queryParams["origin_id"] = "origin_id" + queryParams["ip_address"] = "ip_address" + queryParams["sort_by"] = "sort_by" + queryParams["display_name"] = "display_name" + queryParams["node_type"] = "node_type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["parent_compute_collection"] = "parent_compute_collection" + queryParams["node_id"] = "node_id" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/discovered-nodes", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func discoveredNodesReapplyclusterconfigInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_ext_id"] = bindings.NewStringType() + fieldNameMap["node_ext_id"] = "NodeExtId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func discoveredNodesReapplyclusterconfigOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportNodeBindingType) +} + +func discoveredNodesReapplyclusterconfigRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_ext_id"] = bindings.NewStringType() + fieldNameMap["node_ext_id"] = "NodeExtId" + paramsTypeMap["node_ext_id"] = bindings.NewStringType() + paramsTypeMap["nodeExtId"] = bindings.NewStringType() + pathParams["node_ext_id"] = "nodeExtId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=reapply_cluster_config", + "", + "POST", + "/api/v1/fabric/discovered-nodes/{nodeExtId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/fabric/FabricPackageTypes.go b/services/nsxt-mp/nsx/fabric/FabricPackageTypes.go new file mode 100644 index 000000000..69d40e736 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/FabricPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.fabric. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package fabric diff --git a/services/nsxt-mp/nsx/fabric/OstypesClient.go b/services/nsxt-mp/nsx/fabric/OstypesClient.go new file mode 100644 index 000000000..140f5ddb3 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/OstypesClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Ostypes +// Used by client-side stubs. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type OstypesClient interface { + + // Returns names of all supported host OS. + // @return com.vmware.nsx.model.SupportedHostOSListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.SupportedHostOSListResult, error) +} + +type ostypesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewOstypesClient(connector client.Connector) *ostypesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.fabric.ostypes") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + oIface := ostypesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &oIface +} + +func (oIface *ostypesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := oIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (oIface *ostypesClient) List() (model.SupportedHostOSListResult, error) { + typeConverter := oIface.connector.TypeConverter() + executionContext := oIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ostypesListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SupportedHostOSListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ostypesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + oIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := oIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.ostypes", "list", inputDataValue, executionContext) + var emptyOutput model.SupportedHostOSListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ostypesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SupportedHostOSListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), oIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/fabric/OstypesTypes.go b/services/nsxt-mp/nsx/fabric/OstypesTypes.go new file mode 100644 index 000000000..6e234fd47 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/OstypesTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Ostypes. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func ostypesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ostypesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SupportedHostOSListResultBindingType) +} + +func ostypesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/ostypes", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/fabric/PhysicalServersClient.go b/services/nsxt-mp/nsx/fabric/PhysicalServersClient.go new file mode 100644 index 000000000..e04f2b492 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/PhysicalServersClient.go @@ -0,0 +1,145 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: PhysicalServers +// Used by client-side stubs. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type PhysicalServersClient interface { + + // Returns information about physical/bare metal server based on given transport node id. + // + // @param physicalServerIdParam (required) + // @return com.vmware.nsx.model.PhysicalServer + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(physicalServerIdParam string) (model.PhysicalServer, error) + + // Returns information of all physical/bare metal servers registered as TN. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param displayNameParam Display Name of the physical server (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param osTypeParam OS type of the physical server (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.PhysicalServerListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, displayNameParam *string, includedFieldsParam *string, osTypeParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PhysicalServerListResult, error) +} + +type physicalServersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewPhysicalServersClient(connector client.Connector) *physicalServersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.fabric.physical_servers") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + pIface := physicalServersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &pIface +} + +func (pIface *physicalServersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := pIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (pIface *physicalServersClient) Get(physicalServerIdParam string) (model.PhysicalServer, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(physicalServersGetInputType(), typeConverter) + sv.AddStructField("PhysicalServerId", physicalServerIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PhysicalServer + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := physicalServersGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.physical_servers", "get", inputDataValue, executionContext) + var emptyOutput model.PhysicalServer + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), physicalServersGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PhysicalServer), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *physicalServersClient) List(cursorParam *string, displayNameParam *string, includedFieldsParam *string, osTypeParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.PhysicalServerListResult, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(physicalServersListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("DisplayName", displayNameParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("OsType", osTypeParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PhysicalServerListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := physicalServersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.physical_servers", "list", inputDataValue, executionContext) + var emptyOutput model.PhysicalServerListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), physicalServersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PhysicalServerListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/fabric/PhysicalServersTypes.go b/services/nsxt-mp/nsx/fabric/PhysicalServersTypes.go new file mode 100644 index 000000000..e1548cc11 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/PhysicalServersTypes.go @@ -0,0 +1,172 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: PhysicalServers. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``osType`` of method PhysicalServers#list. +const PhysicalServers_LIST_OS_TYPE_RHELSERVER = "RHELSERVER" + +// Possible value for ``osType`` of method PhysicalServers#list. +const PhysicalServers_LIST_OS_TYPE_UBUNTUSERVER = "UBUNTUSERVER" + +// Possible value for ``osType`` of method PhysicalServers#list. +const PhysicalServers_LIST_OS_TYPE_CENTOSSERVER = "CENTOSSERVER" + +// Possible value for ``osType`` of method PhysicalServers#list. +const PhysicalServers_LIST_OS_TYPE_SLESSERVER = "SLESSERVER" + +// Possible value for ``osType`` of method PhysicalServers#list. +const PhysicalServers_LIST_OS_TYPE_WINDOWSSERVER = "WINDOWSSERVER" + +// Possible value for ``osType`` of method PhysicalServers#list. +const PhysicalServers_LIST_OS_TYPE_OELSERVER = "OELSERVER" + +func physicalServersGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["physical_server_id"] = bindings.NewStringType() + fieldNameMap["physical_server_id"] = "PhysicalServerId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func physicalServersGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PhysicalServerBindingType) +} + +func physicalServersGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["physical_server_id"] = bindings.NewStringType() + fieldNameMap["physical_server_id"] = "PhysicalServerId" + paramsTypeMap["physical_server_id"] = bindings.NewStringType() + paramsTypeMap["physicalServerId"] = bindings.NewStringType() + pathParams["physical_server_id"] = "physicalServerId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/physical-servers/{physicalServerId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func physicalServersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["os_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["display_name"] = "DisplayName" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["os_type"] = "OsType" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func physicalServersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PhysicalServerListResultBindingType) +} + +func physicalServersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["os_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["display_name"] = "DisplayName" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["os_type"] = "OsType" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["os_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["os_type"] = "os_type" + queryParams["sort_by"] = "sort_by" + queryParams["display_name"] = "display_name" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/physical-servers", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/fabric/VifsClient.go b/services/nsxt-mp/nsx/fabric/VifsClient.go new file mode 100644 index 000000000..03dea6528 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/VifsClient.go @@ -0,0 +1,106 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Vifs +// Used by client-side stubs. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type VifsClient interface { + + // Returns information about all VIFs. A virtual network interface aggregates network interfaces into a logical interface unit that is indistinuishable from a physical network interface. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param hostIdParam Id of the host where this vif is located. (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param lportAttachmentIdParam LPort Attachment Id of the virtual network interface. (optional) + // @param ownerVmIdParam External id of the virtual machine. (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param vmIdParam Internal identifier of the virtual machine. (optional) + // @return com.vmware.nsx.model.VirtualNetworkInterfaceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, hostIdParam *string, includedFieldsParam *string, lportAttachmentIdParam *string, ownerVmIdParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, vmIdParam *string) (model.VirtualNetworkInterfaceListResult, error) +} + +type vifsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewVifsClient(connector client.Connector) *vifsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.fabric.vifs") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + vIface := vifsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &vIface +} + +func (vIface *vifsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := vIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (vIface *vifsClient) List(cursorParam *string, hostIdParam *string, includedFieldsParam *string, lportAttachmentIdParam *string, ownerVmIdParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, vmIdParam *string) (model.VirtualNetworkInterfaceListResult, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(vifsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("HostId", hostIdParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("LportAttachmentId", lportAttachmentIdParam) + sv.AddStructField("OwnerVmId", ownerVmIdParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("VmId", vmIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.VirtualNetworkInterfaceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := vifsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.vifs", "list", inputDataValue, executionContext) + var emptyOutput model.VirtualNetworkInterfaceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), vifsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.VirtualNetworkInterfaceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/fabric/VifsTypes.go b/services/nsxt-mp/nsx/fabric/VifsTypes.go new file mode 100644 index 000000000..0564bcb47 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/VifsTypes.go @@ -0,0 +1,116 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Vifs. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func vifsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["host_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["lport_attachment_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["owner_vm_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["vm_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["host_id"] = "HostId" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["lport_attachment_id"] = "LportAttachmentId" + fieldNameMap["owner_vm_id"] = "OwnerVmId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["vm_id"] = "VmId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func vifsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.VirtualNetworkInterfaceListResultBindingType) +} + +func vifsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["host_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["lport_attachment_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["owner_vm_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["vm_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["host_id"] = "HostId" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["lport_attachment_id"] = "LportAttachmentId" + fieldNameMap["owner_vm_id"] = "OwnerVmId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["vm_id"] = "VmId" + paramsTypeMap["lport_attachment_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["vm_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["host_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["owner_vm_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["vm_id"] = "vm_id" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["owner_vm_id"] = "owner_vm_id" + queryParams["sort_by"] = "sort_by" + queryParams["lport_attachment_id"] = "lport_attachment_id" + queryParams["host_id"] = "host_id" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/vifs", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/fabric/VirtualMachinesClient.go b/services/nsxt-mp/nsx/fabric/VirtualMachinesClient.go new file mode 100644 index 000000000..fa23a44c6 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/VirtualMachinesClient.go @@ -0,0 +1,214 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: VirtualMachines +// Used by client-side stubs. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type VirtualMachinesClient interface { + + // Perform action on a specific virtual machine. External id of the virtual machine needs to be provided in the request body. Some of the actions that can be performed are update tags, add tags, remove tags. To add tags to existing list of tag, use action parameter add_tags. To remove tags from existing list of tag, use action parameter remove_tags. To replace existing tags with new tags, use action parameter update_tags. To clear all tags, provide an empty list and action parameter as update_tags. The vmw-async: True HTTP header cannot be used with this API. + // + // @param virtualMachineTagUpdateParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Addtags(virtualMachineTagUpdateParam model.VirtualMachineTagUpdate) error + + // Returns information about all virtual machines. If you have not added NSX tags on the VM or removed all the NSX tags that were earlier added to the VM, then tags property is not returned in the API response. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param displayNameParam Display Name of the virtual machine (optional) + // @param excludeVmTypeParam VM types to be excluded (optional) + // @param externalIdParam External id of the virtual machine (optional) + // @param hostIdParam Id of the host where this vif is located (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.VirtualMachineListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, displayNameParam *string, excludeVmTypeParam *string, externalIdParam *string, hostIdParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.VirtualMachineListResult, error) + + // Perform action on a specific virtual machine. External id of the virtual machine needs to be provided in the request body. Some of the actions that can be performed are update tags, add tags, remove tags. To add tags to existing list of tag, use action parameter add_tags. To remove tags from existing list of tag, use action parameter remove_tags. To replace existing tags with new tags, use action parameter update_tags. To clear all tags, provide an empty list and action parameter as update_tags. The vmw-async: True HTTP header cannot be used with this API. + // + // @param virtualMachineTagUpdateParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Removetags(virtualMachineTagUpdateParam model.VirtualMachineTagUpdate) error + + // Perform action on a specific virtual machine. External id of the virtual machine needs to be provided in the request body. Some of the actions that can be performed are update tags, add tags, remove tags. To add tags to existing list of tag, use action parameter add_tags. To remove tags from existing list of tag, use action parameter remove_tags. To replace existing tags with new tags, use action parameter update_tags. To clear all tags, provide an empty list and action parameter as update_tags. The vmw-async: True HTTP header cannot be used with this API. + // + // @param virtualMachineTagUpdateParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Updatetags(virtualMachineTagUpdateParam model.VirtualMachineTagUpdate) error +} + +type virtualMachinesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewVirtualMachinesClient(connector client.Connector) *virtualMachinesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.fabric.virtual_machines") + methodIdentifiers := map[string]core.MethodIdentifier{ + "addtags": core.NewMethodIdentifier(interfaceIdentifier, "addtags"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "removetags": core.NewMethodIdentifier(interfaceIdentifier, "removetags"), + "updatetags": core.NewMethodIdentifier(interfaceIdentifier, "updatetags"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + vIface := virtualMachinesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &vIface +} + +func (vIface *virtualMachinesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := vIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (vIface *virtualMachinesClient) Addtags(virtualMachineTagUpdateParam model.VirtualMachineTagUpdate) error { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(virtualMachinesAddtagsInputType(), typeConverter) + sv.AddStructField("VirtualMachineTagUpdate", virtualMachineTagUpdateParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := virtualMachinesAddtagsRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.virtual_machines", "addtags", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (vIface *virtualMachinesClient) List(cursorParam *string, displayNameParam *string, excludeVmTypeParam *string, externalIdParam *string, hostIdParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.VirtualMachineListResult, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(virtualMachinesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("DisplayName", displayNameParam) + sv.AddStructField("ExcludeVmType", excludeVmTypeParam) + sv.AddStructField("ExternalId", externalIdParam) + sv.AddStructField("HostId", hostIdParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.VirtualMachineListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := virtualMachinesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.virtual_machines", "list", inputDataValue, executionContext) + var emptyOutput model.VirtualMachineListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), virtualMachinesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.VirtualMachineListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (vIface *virtualMachinesClient) Removetags(virtualMachineTagUpdateParam model.VirtualMachineTagUpdate) error { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(virtualMachinesRemovetagsInputType(), typeConverter) + sv.AddStructField("VirtualMachineTagUpdate", virtualMachineTagUpdateParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := virtualMachinesRemovetagsRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.virtual_machines", "removetags", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (vIface *virtualMachinesClient) Updatetags(virtualMachineTagUpdateParam model.VirtualMachineTagUpdate) error { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(virtualMachinesUpdatetagsInputType(), typeConverter) + sv.AddStructField("VirtualMachineTagUpdate", virtualMachineTagUpdateParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := virtualMachinesUpdatetagsRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.virtual_machines", "updatetags", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/fabric/VirtualMachinesTypes.go b/services/nsxt-mp/nsx/fabric/VirtualMachinesTypes.go new file mode 100644 index 000000000..423d8e8fb --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/VirtualMachinesTypes.go @@ -0,0 +1,260 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: VirtualMachines. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func virtualMachinesAddtagsInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["virtual_machine_tag_update"] = bindings.NewReferenceType(model.VirtualMachineTagUpdateBindingType) + fieldNameMap["virtual_machine_tag_update"] = "VirtualMachineTagUpdate" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func virtualMachinesAddtagsOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func virtualMachinesAddtagsRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["virtual_machine_tag_update"] = bindings.NewReferenceType(model.VirtualMachineTagUpdateBindingType) + fieldNameMap["virtual_machine_tag_update"] = "VirtualMachineTagUpdate" + paramsTypeMap["virtual_machine_tag_update"] = bindings.NewReferenceType(model.VirtualMachineTagUpdateBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=add_tags", + "virtual_machine_tag_update", + "POST", + "/api/v1/fabric/virtual-machines", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func virtualMachinesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["exclude_vm_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["host_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["display_name"] = "DisplayName" + fieldNameMap["exclude_vm_type"] = "ExcludeVmType" + fieldNameMap["external_id"] = "ExternalId" + fieldNameMap["host_id"] = "HostId" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func virtualMachinesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.VirtualMachineListResultBindingType) +} + +func virtualMachinesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["exclude_vm_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["host_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["display_name"] = "DisplayName" + fieldNameMap["exclude_vm_type"] = "ExcludeVmType" + fieldNameMap["external_id"] = "ExternalId" + fieldNameMap["host_id"] = "HostId" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["exclude_vm_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["host_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["exclude_vm_type"] = "exclude_vm_type" + queryParams["external_id"] = "external_id" + queryParams["sort_by"] = "sort_by" + queryParams["display_name"] = "display_name" + queryParams["host_id"] = "host_id" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/virtual-machines", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func virtualMachinesRemovetagsInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["virtual_machine_tag_update"] = bindings.NewReferenceType(model.VirtualMachineTagUpdateBindingType) + fieldNameMap["virtual_machine_tag_update"] = "VirtualMachineTagUpdate" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func virtualMachinesRemovetagsOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func virtualMachinesRemovetagsRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["virtual_machine_tag_update"] = bindings.NewReferenceType(model.VirtualMachineTagUpdateBindingType) + fieldNameMap["virtual_machine_tag_update"] = "VirtualMachineTagUpdate" + paramsTypeMap["virtual_machine_tag_update"] = bindings.NewReferenceType(model.VirtualMachineTagUpdateBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=remove_tags", + "virtual_machine_tag_update", + "POST", + "/api/v1/fabric/virtual-machines", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func virtualMachinesUpdatetagsInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["virtual_machine_tag_update"] = bindings.NewReferenceType(model.VirtualMachineTagUpdateBindingType) + fieldNameMap["virtual_machine_tag_update"] = "VirtualMachineTagUpdate" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func virtualMachinesUpdatetagsOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func virtualMachinesUpdatetagsRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["virtual_machine_tag_update"] = bindings.NewReferenceType(model.VirtualMachineTagUpdateBindingType) + fieldNameMap["virtual_machine_tag_update"] = "VirtualMachineTagUpdate" + paramsTypeMap["virtual_machine_tag_update"] = bindings.NewReferenceType(model.VirtualMachineTagUpdateBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=update_tags", + "virtual_machine_tag_update", + "POST", + "/api/v1/fabric/virtual-machines", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/fabric/VirtualSwitchesClient.go b/services/nsxt-mp/nsx/fabric/VirtualSwitchesClient.go new file mode 100644 index 000000000..765817786 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/VirtualSwitchesClient.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: VirtualSwitches +// Used by client-side stubs. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type VirtualSwitchesClient interface { + + // Returns information about all virtual switches based on the request parameters. + // + // @param cmLocalIdParam Local Id of the virtual switch (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param discoveredNodeIdParam Discovered node ID (optional) + // @param displayNameParam Display name of the virtual switch (optional) + // @param externalIdParam External id of the virtual switch (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param originIdParam ID of the compute manager (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param uuidParam UUID of the switch (optional) + // @return com.vmware.nsx.model.VirtualSwitchListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cmLocalIdParam *string, cursorParam *string, discoveredNodeIdParam *string, displayNameParam *string, externalIdParam *string, includedFieldsParam *string, originIdParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, uuidParam *string) (model.VirtualSwitchListResult, error) +} + +type virtualSwitchesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewVirtualSwitchesClient(connector client.Connector) *virtualSwitchesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.fabric.virtual_switches") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + vIface := virtualSwitchesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &vIface +} + +func (vIface *virtualSwitchesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := vIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (vIface *virtualSwitchesClient) List(cmLocalIdParam *string, cursorParam *string, discoveredNodeIdParam *string, displayNameParam *string, externalIdParam *string, includedFieldsParam *string, originIdParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, uuidParam *string) (model.VirtualSwitchListResult, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(virtualSwitchesListInputType(), typeConverter) + sv.AddStructField("CmLocalId", cmLocalIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("DiscoveredNodeId", discoveredNodeIdParam) + sv.AddStructField("DisplayName", displayNameParam) + sv.AddStructField("ExternalId", externalIdParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("OriginId", originIdParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Uuid", uuidParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.VirtualSwitchListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := virtualSwitchesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.virtual_switches", "list", inputDataValue, executionContext) + var emptyOutput model.VirtualSwitchListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), virtualSwitchesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.VirtualSwitchListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/fabric/VirtualSwitchesTypes.go b/services/nsxt-mp/nsx/fabric/VirtualSwitchesTypes.go new file mode 100644 index 000000000..0a4603042 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/VirtualSwitchesTypes.go @@ -0,0 +1,128 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: VirtualSwitches. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package fabric + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func virtualSwitchesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cm_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["discovered_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["origin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cm_local_id"] = "CmLocalId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["discovered_node_id"] = "DiscoveredNodeId" + fieldNameMap["display_name"] = "DisplayName" + fieldNameMap["external_id"] = "ExternalId" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["origin_id"] = "OriginId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["uuid"] = "Uuid" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func virtualSwitchesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.VirtualSwitchListResultBindingType) +} + +func virtualSwitchesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cm_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["discovered_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["origin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cm_local_id"] = "CmLocalId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["discovered_node_id"] = "DiscoveredNodeId" + fieldNameMap["display_name"] = "DisplayName" + fieldNameMap["external_id"] = "ExternalId" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["origin_id"] = "OriginId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["uuid"] = "Uuid" + paramsTypeMap["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["discovered_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["origin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cm_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["cm_local_id"] = "cm_local_id" + queryParams["discovered_node_id"] = "discovered_node_id" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["external_id"] = "external_id" + queryParams["origin_id"] = "origin_id" + queryParams["sort_by"] = "sort_by" + queryParams["display_name"] = "display_name" + queryParams["uuid"] = "uuid" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/virtual-switches", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/fabric/compute_collections/ComputeCollectionsPackageTypes.go b/services/nsxt-mp/nsx/fabric/compute_collections/ComputeCollectionsPackageTypes.go new file mode 100644 index 000000000..6edae1be6 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/compute_collections/ComputeCollectionsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.fabric.compute_collections. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package compute_collections diff --git a/services/nsxt-mp/nsx/fabric/compute_collections/MemberStatusClient.go b/services/nsxt-mp/nsx/fabric/compute_collections/MemberStatusClient.go new file mode 100644 index 000000000..5fd551202 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/compute_collections/MemberStatusClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MemberStatus +// Used by client-side stubs. + +package compute_collections + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MemberStatusClient interface { + + // Get status of member host nodes of the compute-collection. Only nsx prepared host nodes in the specified compute-collection are included in the response. cc-ext-id should be of type VC_Cluster. + // + // @param ccExtIdParam (required) + // @return com.vmware.nsx.model.HostNodeStatusListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(ccExtIdParam string) (model.HostNodeStatusListResult, error) +} + +type memberStatusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMemberStatusClient(connector client.Connector) *memberStatusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.fabric.compute_collections.member_status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := memberStatusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *memberStatusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *memberStatusClient) List(ccExtIdParam string) (model.HostNodeStatusListResult, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(memberStatusListInputType(), typeConverter) + sv.AddStructField("CcExtId", ccExtIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.HostNodeStatusListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := memberStatusListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.compute_collections.member_status", "list", inputDataValue, executionContext) + var emptyOutput model.HostNodeStatusListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), memberStatusListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.HostNodeStatusListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/fabric/compute_collections/MemberStatusTypes.go b/services/nsxt-mp/nsx/fabric/compute_collections/MemberStatusTypes.go new file mode 100644 index 000000000..05fceffb1 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/compute_collections/MemberStatusTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MemberStatus. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package compute_collections + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func memberStatusListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cc_ext_id"] = bindings.NewStringType() + fieldNameMap["cc_ext_id"] = "CcExtId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func memberStatusListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.HostNodeStatusListResultBindingType) +} + +func memberStatusListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cc_ext_id"] = bindings.NewStringType() + fieldNameMap["cc_ext_id"] = "CcExtId" + paramsTypeMap["cc_ext_id"] = bindings.NewStringType() + paramsTypeMap["ccExtId"] = bindings.NewStringType() + pathParams["cc_ext_id"] = "ccExtId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/compute-collections/{ccExtId}/member-status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/fabric/compute_collections/network/NetworkPackageTypes.go b/services/nsxt-mp/nsx/fabric/compute_collections/network/NetworkPackageTypes.go new file mode 100644 index 000000000..6791bfbeb --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/compute_collections/network/NetworkPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.fabric.compute_collections.network. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package network diff --git a/services/nsxt-mp/nsx/fabric/compute_collections/network/PhysicalInterfacesClient.go b/services/nsxt-mp/nsx/fabric/compute_collections/network/PhysicalInterfacesClient.go new file mode 100644 index 000000000..815ac0d22 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/compute_collections/network/PhysicalInterfacesClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: PhysicalInterfaces +// Used by client-side stubs. + +package network + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type PhysicalInterfacesClient interface { + + // Returns list of physical network interfaces for all discovered nodes in compute collection. Interface information includes PNIC name, hostswitch name it's attached to(if any) and MAC address. + // + // @param ccExtIdParam (required) + // @return com.vmware.nsx.model.ComputeCollectionNetworkInterfacesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(ccExtIdParam string) (model.ComputeCollectionNetworkInterfacesListResult, error) +} + +type physicalInterfacesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewPhysicalInterfacesClient(connector client.Connector) *physicalInterfacesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.fabric.compute_collections.network.physical_interfaces") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + pIface := physicalInterfacesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &pIface +} + +func (pIface *physicalInterfacesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := pIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (pIface *physicalInterfacesClient) List(ccExtIdParam string) (model.ComputeCollectionNetworkInterfacesListResult, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(physicalInterfacesListInputType(), typeConverter) + sv.AddStructField("CcExtId", ccExtIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ComputeCollectionNetworkInterfacesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := physicalInterfacesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.compute_collections.network.physical_interfaces", "list", inputDataValue, executionContext) + var emptyOutput model.ComputeCollectionNetworkInterfacesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), physicalInterfacesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ComputeCollectionNetworkInterfacesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/fabric/compute_collections/network/PhysicalInterfacesTypes.go b/services/nsxt-mp/nsx/fabric/compute_collections/network/PhysicalInterfacesTypes.go new file mode 100644 index 000000000..a3bac247f --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/compute_collections/network/PhysicalInterfacesTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: PhysicalInterfaces. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package network + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func physicalInterfacesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cc_ext_id"] = bindings.NewStringType() + fieldNameMap["cc_ext_id"] = "CcExtId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func physicalInterfacesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ComputeCollectionNetworkInterfacesListResultBindingType) +} + +func physicalInterfacesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cc_ext_id"] = bindings.NewStringType() + fieldNameMap["cc_ext_id"] = "CcExtId" + paramsTypeMap["cc_ext_id"] = bindings.NewStringType() + paramsTypeMap["ccExtId"] = bindings.NewStringType() + pathParams["cc_ext_id"] = "ccExtId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/compute-collections/{ccExtId}/network/physical-interfaces", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/fabric/compute_managers/ComputeManagersPackageTypes.go b/services/nsxt-mp/nsx/fabric/compute_managers/ComputeManagersPackageTypes.go new file mode 100644 index 000000000..3b1857794 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/compute_managers/ComputeManagersPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.fabric.compute_managers. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package compute_managers diff --git a/services/nsxt-mp/nsx/fabric/compute_managers/StateClient.go b/services/nsxt-mp/nsx/fabric/compute_managers/StateClient.go new file mode 100644 index 000000000..e8ea66323 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/compute_managers/StateClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: State +// Used by client-side stubs. + +package compute_managers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StateClient interface { + + // Get the realized state of a compute manager + // + // @param computeManagerIdParam (required) + // @return com.vmware.nsx.model.ConfigurationState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(computeManagerIdParam string) (model.ConfigurationState, error) +} + +type stateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStateClient(connector client.Connector) *stateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.fabric.compute_managers.state") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := stateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *stateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *stateClient) Get(computeManagerIdParam string) (model.ConfigurationState, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(stateGetInputType(), typeConverter) + sv.AddStructField("ComputeManagerId", computeManagerIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ConfigurationState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.compute_managers.state", "get", inputDataValue, executionContext) + var emptyOutput model.ConfigurationState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ConfigurationState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/fabric/compute_managers/StateTypes.go b/services/nsxt-mp/nsx/fabric/compute_managers/StateTypes.go new file mode 100644 index 000000000..13645055c --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/compute_managers/StateTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: State. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package compute_managers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func stateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["compute_manager_id"] = bindings.NewStringType() + fieldNameMap["compute_manager_id"] = "ComputeManagerId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ConfigurationStateBindingType) +} + +func stateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["compute_manager_id"] = bindings.NewStringType() + fieldNameMap["compute_manager_id"] = "ComputeManagerId" + paramsTypeMap["compute_manager_id"] = bindings.NewStringType() + paramsTypeMap["computeManagerId"] = bindings.NewStringType() + pathParams["compute_manager_id"] = "computeManagerId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/compute-managers/{computeManagerId}/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/fabric/compute_managers/StatusClient.go b/services/nsxt-mp/nsx/fabric/compute_managers/StatusClient.go new file mode 100644 index 000000000..ca0bb4b55 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/compute_managers/StatusClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package compute_managers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Returns connection and version information about a compute manager + // + // @param computeManagerIdParam (required) + // @return com.vmware.nsx.model.ComputeManagerStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(computeManagerIdParam string) (model.ComputeManagerStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.fabric.compute_managers.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(computeManagerIdParam string) (model.ComputeManagerStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("ComputeManagerId", computeManagerIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ComputeManagerStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.compute_managers.status", "get", inputDataValue, executionContext) + var emptyOutput model.ComputeManagerStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ComputeManagerStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/fabric/compute_managers/StatusTypes.go b/services/nsxt-mp/nsx/fabric/compute_managers/StatusTypes.go new file mode 100644 index 000000000..8fc5519b8 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/compute_managers/StatusTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package compute_managers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["compute_manager_id"] = bindings.NewStringType() + fieldNameMap["compute_manager_id"] = "ComputeManagerId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ComputeManagerStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["compute_manager_id"] = bindings.NewStringType() + fieldNameMap["compute_manager_id"] = "ComputeManagerId" + paramsTypeMap["compute_manager_id"] = bindings.NewStringType() + paramsTypeMap["computeManagerId"] = bindings.NewStringType() + pathParams["compute_manager_id"] = "computeManagerId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/compute-managers/{computeManagerId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/fabric/nodes/network/InterfacesClient.go b/services/nsxt-mp/nsx/fabric/nodes/network/InterfacesClient.go new file mode 100644 index 000000000..2f5c7bc78 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/nodes/network/InterfacesClient.go @@ -0,0 +1,94 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Interfaces +// Used by client-side stubs. + +package network + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type InterfacesClient interface { + + // Returns the number of interfaces on the node and detailed information about each interface. Interface information includes MTU, broadcast and host IP addresses, link and admin status, MAC address, network mask, and the IP configuration method (static or DHCP). This api is deprecated. Please use Transport Node API GET /transport-nodes//network/interfaces to list node network interfaces for the corresponding TN. + // + // @param nodeIdParam (required) + // @param adminStatusParam Admin status of the interface (optional) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.NodeInterfacePropertiesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(nodeIdParam string, adminStatusParam *string, sourceParam *string) (model.NodeInterfacePropertiesListResult, error) +} + +type interfacesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewInterfacesClient(connector client.Connector) *interfacesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.fabric.nodes.network.interfaces") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := interfacesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *interfacesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *interfacesClient) List(nodeIdParam string, adminStatusParam *string, sourceParam *string) (model.NodeInterfacePropertiesListResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(interfacesListInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("AdminStatus", adminStatusParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeInterfacePropertiesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := interfacesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.nodes.network.interfaces", "list", inputDataValue, executionContext) + var emptyOutput model.NodeInterfacePropertiesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), interfacesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeInterfacePropertiesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/fabric/nodes/network/InterfacesTypes.go b/services/nsxt-mp/nsx/fabric/nodes/network/InterfacesTypes.go new file mode 100644 index 000000000..84222323e --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/nodes/network/InterfacesTypes.go @@ -0,0 +1,93 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Interfaces. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package network + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``adminStatus`` of method Interfaces#list. +const Interfaces_LIST_ADMIN_STATUS_UP = "UP" + +// Possible value for ``adminStatus`` of method Interfaces#list. +const Interfaces_LIST_ADMIN_STATUS_DOWN = "DOWN" + +// Possible value for ``source`` of method Interfaces#list. +const Interfaces_LIST_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Interfaces#list. +const Interfaces_LIST_SOURCE_CACHED = "cached" + +func interfacesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fields["admin_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["admin_status"] = "AdminStatus" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func interfacesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeInterfacePropertiesListResultBindingType) +} + +func interfacesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fields["admin_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["admin_status"] = "AdminStatus" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["admin_status"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + queryParams["admin_status"] = "admin_status" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/nodes/{nodeId}/network/interfaces", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/fabric/nodes/network/NetworkPackageTypes.go b/services/nsxt-mp/nsx/fabric/nodes/network/NetworkPackageTypes.go new file mode 100644 index 000000000..92a1f19cf --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/nodes/network/NetworkPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.fabric.nodes.network. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package network diff --git a/services/nsxt-mp/nsx/fabric/virtual_machines/ToolsInfoClient.go b/services/nsxt-mp/nsx/fabric/virtual_machines/ToolsInfoClient.go new file mode 100644 index 000000000..f81fa690b --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/virtual_machines/ToolsInfoClient.go @@ -0,0 +1,98 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ToolsInfo +// Used by client-side stubs. + +package virtual_machines + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ToolsInfoClient interface { + + // This API returns the list of tools and agents installed in VMs. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.VmToolsInfoListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.VmToolsInfoListResult, error) +} + +type toolsInfoClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewToolsInfoClient(connector client.Connector) *toolsInfoClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.fabric.virtual_machines.tools_info") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + tIface := toolsInfoClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &tIface +} + +func (tIface *toolsInfoClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := tIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (tIface *toolsInfoClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.VmToolsInfoListResult, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(toolsInfoListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.VmToolsInfoListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := toolsInfoListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.fabric.virtual_machines.tools_info", "list", inputDataValue, executionContext) + var emptyOutput model.VmToolsInfoListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), toolsInfoListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.VmToolsInfoListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/fabric/virtual_machines/ToolsInfoTypes.go b/services/nsxt-mp/nsx/fabric/virtual_machines/ToolsInfoTypes.go new file mode 100644 index 000000000..c8c7c513e --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/virtual_machines/ToolsInfoTypes.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ToolsInfo. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package virtual_machines + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func toolsInfoListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func toolsInfoListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.VmToolsInfoListResultBindingType) +} + +func toolsInfoListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/fabric/virtual-machines/tools-info", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/fabric/virtual_machines/VirtualMachinesPackageTypes.go b/services/nsxt-mp/nsx/fabric/virtual_machines/VirtualMachinesPackageTypes.go new file mode 100644 index 000000000..932b05667 --- /dev/null +++ b/services/nsxt-mp/nsx/fabric/virtual_machines/VirtualMachinesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.fabric.virtual_machines. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package virtual_machines diff --git a/services/nsxt-mp/nsx/firewall/ExcludelistClient.go b/services/nsxt-mp/nsx/firewall/ExcludelistClient.go new file mode 100644 index 000000000..bd14bdfc9 --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/ExcludelistClient.go @@ -0,0 +1,267 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Excludelist +// Used by client-side stubs. + +package firewall + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ExcludelistClient interface { + + // Add a new object in the exclude list. + // + // @param resourceReferenceParam (required) + // @return com.vmware.nsx.model.ResourceReference + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Addmember(resourceReferenceParam model.ResourceReference) (model.ResourceReference, error) + + // Check if the object a member of the exclude list + // + // @param objectIdParam identifier of the object (required) + // @param deepCheckParam Check all parents (optional, default to false) + // @param objectTypeParam Object type of an entity (optional) + // @return com.vmware.nsx.model.ResourceReference + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Checkifexists(objectIdParam string, deepCheckParam *bool, objectTypeParam *string) (model.ResourceReference, error) + + // Get list of entities in exclude list. + // @return com.vmware.nsx.model.ExcludeList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.ExcludeList, error) + + // Remove an existing object from the exclude list. + // + // @param objectIdParam identifier of the object (required) + // @param deepCheckParam Check all parents (optional, default to false) + // @param objectTypeParam Object type of an entity (optional) + // @return com.vmware.nsx.model.ResourceReference + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Removemember(objectIdParam string, deepCheckParam *bool, objectTypeParam *string) (model.ResourceReference, error) + + // Modify exclude list. + // + // @param excludeListParam (required) + // @return com.vmware.nsx.model.ExcludeList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(excludeListParam model.ExcludeList) (model.ExcludeList, error) +} + +type excludelistClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewExcludelistClient(connector client.Connector) *excludelistClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.firewall.excludelist") + methodIdentifiers := map[string]core.MethodIdentifier{ + "addmember": core.NewMethodIdentifier(interfaceIdentifier, "addmember"), + "checkifexists": core.NewMethodIdentifier(interfaceIdentifier, "checkifexists"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "removemember": core.NewMethodIdentifier(interfaceIdentifier, "removemember"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + eIface := excludelistClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &eIface +} + +func (eIface *excludelistClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := eIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (eIface *excludelistClient) Addmember(resourceReferenceParam model.ResourceReference) (model.ResourceReference, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(excludelistAddmemberInputType(), typeConverter) + sv.AddStructField("ResourceReference", resourceReferenceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ResourceReference + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := excludelistAddmemberRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.excludelist", "addmember", inputDataValue, executionContext) + var emptyOutput model.ResourceReference + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), excludelistAddmemberOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ResourceReference), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *excludelistClient) Checkifexists(objectIdParam string, deepCheckParam *bool, objectTypeParam *string) (model.ResourceReference, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(excludelistCheckifexistsInputType(), typeConverter) + sv.AddStructField("ObjectId", objectIdParam) + sv.AddStructField("DeepCheck", deepCheckParam) + sv.AddStructField("ObjectType", objectTypeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ResourceReference + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := excludelistCheckifexistsRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.excludelist", "checkifexists", inputDataValue, executionContext) + var emptyOutput model.ResourceReference + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), excludelistCheckifexistsOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ResourceReference), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *excludelistClient) Get() (model.ExcludeList, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(excludelistGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ExcludeList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := excludelistGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.excludelist", "get", inputDataValue, executionContext) + var emptyOutput model.ExcludeList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), excludelistGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ExcludeList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *excludelistClient) Removemember(objectIdParam string, deepCheckParam *bool, objectTypeParam *string) (model.ResourceReference, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(excludelistRemovememberInputType(), typeConverter) + sv.AddStructField("ObjectId", objectIdParam) + sv.AddStructField("DeepCheck", deepCheckParam) + sv.AddStructField("ObjectType", objectTypeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ResourceReference + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := excludelistRemovememberRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.excludelist", "removemember", inputDataValue, executionContext) + var emptyOutput model.ResourceReference + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), excludelistRemovememberOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ResourceReference), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *excludelistClient) Update(excludeListParam model.ExcludeList) (model.ExcludeList, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(excludelistUpdateInputType(), typeConverter) + sv.AddStructField("ExcludeList", excludeListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ExcludeList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := excludelistUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.excludelist", "update", inputDataValue, executionContext) + var emptyOutput model.ExcludeList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), excludelistUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ExcludeList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/firewall/ExcludelistTypes.go b/services/nsxt-mp/nsx/firewall/ExcludelistTypes.go new file mode 100644 index 000000000..7ab6fbfc0 --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/ExcludelistTypes.go @@ -0,0 +1,298 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Excludelist. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package firewall + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``objectType`` of method Excludelist#checkifexists. +const Excludelist_CHECKIFEXISTS_OBJECT_TYPE_NSGROUP = "NSGroup" + +// Possible value for ``objectType`` of method Excludelist#checkifexists. +const Excludelist_CHECKIFEXISTS_OBJECT_TYPE_LOGICALPORT = "LogicalPort" + +// Possible value for ``objectType`` of method Excludelist#checkifexists. +const Excludelist_CHECKIFEXISTS_OBJECT_TYPE_LOGICALSWITCH = "LogicalSwitch" + +// Possible value for ``objectType`` of method Excludelist#removemember. +const Excludelist_REMOVEMEMBER_OBJECT_TYPE_NSGROUP = "NSGroup" + +// Possible value for ``objectType`` of method Excludelist#removemember. +const Excludelist_REMOVEMEMBER_OBJECT_TYPE_LOGICALPORT = "LogicalPort" + +// Possible value for ``objectType`` of method Excludelist#removemember. +const Excludelist_REMOVEMEMBER_OBJECT_TYPE_LOGICALSWITCH = "LogicalSwitch" + +func excludelistAddmemberInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_reference"] = bindings.NewReferenceType(model.ResourceReferenceBindingType) + fieldNameMap["resource_reference"] = "ResourceReference" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func excludelistAddmemberOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ResourceReferenceBindingType) +} + +func excludelistAddmemberRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["resource_reference"] = bindings.NewReferenceType(model.ResourceReferenceBindingType) + fieldNameMap["resource_reference"] = "ResourceReference" + paramsTypeMap["resource_reference"] = bindings.NewReferenceType(model.ResourceReferenceBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=add_member", + "resource_reference", + "POST", + "/api/v1/firewall/excludelist", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func excludelistCheckifexistsInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["object_id"] = bindings.NewStringType() + fields["deep_check"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["object_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["object_id"] = "ObjectId" + fieldNameMap["deep_check"] = "DeepCheck" + fieldNameMap["object_type"] = "ObjectType" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func excludelistCheckifexistsOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ResourceReferenceBindingType) +} + +func excludelistCheckifexistsRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["object_id"] = bindings.NewStringType() + fields["deep_check"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["object_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["object_id"] = "ObjectId" + fieldNameMap["deep_check"] = "DeepCheck" + fieldNameMap["object_type"] = "ObjectType" + paramsTypeMap["object_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["object_id"] = bindings.NewStringType() + paramsTypeMap["deep_check"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["deep_check"] = "deep_check" + queryParams["object_type"] = "object_type" + queryParams["object_id"] = "object_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=check_if_exists", + "", + "POST", + "/api/v1/firewall/excludelist", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func excludelistGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func excludelistGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ExcludeListBindingType) +} + +func excludelistGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/firewall/excludelist", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func excludelistRemovememberInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["object_id"] = bindings.NewStringType() + fields["deep_check"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["object_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["object_id"] = "ObjectId" + fieldNameMap["deep_check"] = "DeepCheck" + fieldNameMap["object_type"] = "ObjectType" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func excludelistRemovememberOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ResourceReferenceBindingType) +} + +func excludelistRemovememberRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["object_id"] = bindings.NewStringType() + fields["deep_check"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["object_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["object_id"] = "ObjectId" + fieldNameMap["deep_check"] = "DeepCheck" + fieldNameMap["object_type"] = "ObjectType" + paramsTypeMap["object_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["object_id"] = bindings.NewStringType() + paramsTypeMap["deep_check"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["deep_check"] = "deep_check" + queryParams["object_type"] = "object_type" + queryParams["object_id"] = "object_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=remove_member", + "", + "POST", + "/api/v1/firewall/excludelist", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func excludelistUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["exclude_list"] = bindings.NewReferenceType(model.ExcludeListBindingType) + fieldNameMap["exclude_list"] = "ExcludeList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func excludelistUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ExcludeListBindingType) +} + +func excludelistUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["exclude_list"] = bindings.NewReferenceType(model.ExcludeListBindingType) + fieldNameMap["exclude_list"] = "ExcludeList" + paramsTypeMap["exclude_list"] = bindings.NewReferenceType(model.ExcludeListBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "exclude_list", + "PUT", + "/api/v1/firewall/excludelist", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/firewall/FirewallPackageTypes.go b/services/nsxt-mp/nsx/firewall/FirewallPackageTypes.go new file mode 100644 index 000000000..46a342fbe --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/FirewallPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.firewall. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package firewall diff --git a/services/nsxt-mp/nsx/firewall/ProfilesClient.go b/services/nsxt-mp/nsx/firewall/ProfilesClient.go new file mode 100644 index 000000000..2253c6246 --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/ProfilesClient.go @@ -0,0 +1,273 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Profiles +// Used by client-side stubs. + +package firewall + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ProfilesClient interface { + + // Create a firewall profile with values provided. It creates profile based resource_type in the payload. + // + // @param baseFirewallProfileParam (required) + // The parameter must contain all the properties defined in model.BaseFirewallProfile. + // @return com.vmware.nsx.model.BaseFirewallProfile + // The return value will contain all the properties defined in model.BaseFirewallProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(baseFirewallProfileParam *data.StructValue) (*data.StructValue, error) + + // Deletes a firewall profile. + // + // @param profileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(profileIdParam string) error + + // Return firewall session timer profile. + // + // @param profileIdParam (required) + // @return com.vmware.nsx.model.BaseFirewallProfile + // The return value will contain all the properties defined in model.BaseFirewallProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(profileIdParam string) (*data.StructValue, error) + + // List all the firewall profiles available by requested resource_type. + // + // @param resourceTypeParam Profile resource type (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.FirewallProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(resourceTypeParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.FirewallProfileListResult, error) + + // Update user configurable properties of firewall profile. + // + // @param profileIdParam (required) + // @param baseFirewallProfileParam (required) + // The parameter must contain all the properties defined in model.BaseFirewallProfile. + // @return com.vmware.nsx.model.BaseFirewallProfile + // The return value will contain all the properties defined in model.BaseFirewallProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(profileIdParam string, baseFirewallProfileParam *data.StructValue) (*data.StructValue, error) +} + +type profilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewProfilesClient(connector client.Connector) *profilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.firewall.profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + pIface := profilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &pIface +} + +func (pIface *profilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := pIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (pIface *profilesClient) Create(baseFirewallProfileParam *data.StructValue) (*data.StructValue, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(profilesCreateInputType(), typeConverter) + sv.AddStructField("BaseFirewallProfile", baseFirewallProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := profilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.profiles", "create", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), profilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *profilesClient) Delete(profileIdParam string) error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(profilesDeleteInputType(), typeConverter) + sv.AddStructField("ProfileId", profileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := profilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *profilesClient) Get(profileIdParam string) (*data.StructValue, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(profilesGetInputType(), typeConverter) + sv.AddStructField("ProfileId", profileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := profilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.profiles", "get", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), profilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *profilesClient) List(resourceTypeParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.FirewallProfileListResult, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(profilesListInputType(), typeConverter) + sv.AddStructField("ResourceType", resourceTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := profilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.profiles", "list", inputDataValue, executionContext) + var emptyOutput model.FirewallProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), profilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *profilesClient) Update(profileIdParam string, baseFirewallProfileParam *data.StructValue) (*data.StructValue, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(profilesUpdateInputType(), typeConverter) + sv.AddStructField("ProfileId", profileIdParam) + sv.AddStructField("BaseFirewallProfile", baseFirewallProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := profilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.profiles", "update", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), profilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/firewall/ProfilesTypes.go b/services/nsxt-mp/nsx/firewall/ProfilesTypes.go new file mode 100644 index 000000000..622f8048c --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/ProfilesTypes.go @@ -0,0 +1,301 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Profiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package firewall + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func profilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["base_firewall_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseFirewallProfileBindingType)}, bindings.REST) + fieldNameMap["base_firewall_profile"] = "BaseFirewallProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func profilesCreateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseFirewallProfileBindingType)}, bindings.REST) +} + +func profilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["base_firewall_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseFirewallProfileBindingType)}, bindings.REST) + fieldNameMap["base_firewall_profile"] = "BaseFirewallProfile" + paramsTypeMap["base_firewall_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseFirewallProfileBindingType)}, bindings.REST) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "base_firewall_profile", + "POST", + "/api/v1/firewall/profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func profilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["profile_id"] = bindings.NewStringType() + fieldNameMap["profile_id"] = "ProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func profilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func profilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["profile_id"] = bindings.NewStringType() + fieldNameMap["profile_id"] = "ProfileId" + paramsTypeMap["profile_id"] = bindings.NewStringType() + paramsTypeMap["profileId"] = bindings.NewStringType() + pathParams["profile_id"] = "profileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/firewall/profiles/{profileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func profilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["profile_id"] = bindings.NewStringType() + fieldNameMap["profile_id"] = "ProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func profilesGetOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseFirewallProfileBindingType)}, bindings.REST) +} + +func profilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["profile_id"] = bindings.NewStringType() + fieldNameMap["profile_id"] = "ProfileId" + paramsTypeMap["profile_id"] = bindings.NewStringType() + paramsTypeMap["profileId"] = bindings.NewStringType() + pathParams["profile_id"] = "profileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/firewall/profiles/{profileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func profilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_type"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func profilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallProfileListResultBindingType) +} + +func profilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["resource_type"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["resource_type"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["resource_type"] = "resource_type" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/firewall/profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func profilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["profile_id"] = bindings.NewStringType() + fields["base_firewall_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseFirewallProfileBindingType)}, bindings.REST) + fieldNameMap["profile_id"] = "ProfileId" + fieldNameMap["base_firewall_profile"] = "BaseFirewallProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func profilesUpdateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseFirewallProfileBindingType)}, bindings.REST) +} + +func profilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["profile_id"] = bindings.NewStringType() + fields["base_firewall_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseFirewallProfileBindingType)}, bindings.REST) + fieldNameMap["profile_id"] = "ProfileId" + fieldNameMap["base_firewall_profile"] = "BaseFirewallProfile" + paramsTypeMap["base_firewall_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseFirewallProfileBindingType)}, bindings.REST) + paramsTypeMap["profile_id"] = bindings.NewStringType() + paramsTypeMap["profileId"] = bindings.NewStringType() + pathParams["profile_id"] = "profileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "base_firewall_profile", + "PUT", + "/api/v1/firewall/profiles/{profileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/firewall/RulesClient.go b/services/nsxt-mp/nsx/firewall/RulesClient.go new file mode 100644 index 000000000..cbcdb0fe5 --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/RulesClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Rules +// Used by client-side stubs. + +package firewall + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RulesClient interface { + + // Return existing firewall rule information. + // + // @param ruleIdParam (required) + // @return com.vmware.nsx.model.FirewallRule + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ruleIdParam string) (model.FirewallRule, error) +} + +type rulesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRulesClient(connector client.Connector) *rulesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.firewall.rules") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := rulesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *rulesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *rulesClient) Get(ruleIdParam string) (model.FirewallRule, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesGetInputType(), typeConverter) + sv.AddStructField("RuleId", ruleIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallRule + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.rules", "get", inputDataValue, executionContext) + var emptyOutput model.FirewallRule + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallRule), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/firewall/RulesTypes.go b/services/nsxt-mp/nsx/firewall/RulesTypes.go new file mode 100644 index 000000000..5b2a17e8d --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/RulesTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Rules. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package firewall + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func rulesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rule_id"] = bindings.NewStringType() + fieldNameMap["rule_id"] = "RuleId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallRuleBindingType) +} + +func rulesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["rule_id"] = bindings.NewStringType() + fieldNameMap["rule_id"] = "RuleId" + paramsTypeMap["rule_id"] = bindings.NewStringType() + paramsTypeMap["ruleId"] = bindings.NewStringType() + pathParams["rule_id"] = "ruleId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/firewall/rules/{ruleId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/firewall/SectionsClient.go b/services/nsxt-mp/nsx/firewall/SectionsClient.go new file mode 100644 index 000000000..2dea68e34 --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/SectionsClient.go @@ -0,0 +1,626 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Sections +// Used by client-side stubs. + +package firewall + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SectionsClient interface { + + // Creates new empty firewall section in the system. + // + // @param firewallSectionParam (required) + // @param idParam Identifier of the anchor rule or section. This is a required field in case operation like 'insert_before' and 'insert_after'. (optional) + // @param operationParam Operation (optional, default to insert_top) + // @return com.vmware.nsx.model.FirewallSection + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(firewallSectionParam model.FirewallSection, idParam *string, operationParam *string) (model.FirewallSection, error) + + // Creates a new firewall section with rules. The limit on the number of rules is defined by maxItems in collection types for FirewallRule (FirewallRuleXXXList types). When invoked on a section with a large number of rules, this API is supported only at low rates of invocation (not more than 4-5 times per minute). The typical latency of this API with about 1024 rules is about 4-5 seconds. This API should not be invoked with large payloads at automation speeds. More than 50 rules with a large number of rule references is not supported. Instead, to create sections, use: POST /api/v1/firewall/sections To create rules, use: POST /api/v1/firewall/sections//rules + // + // @param firewallSectionRuleListParam (required) + // @param idParam Identifier of the anchor rule or section. This is a required field in case operation like 'insert_before' and 'insert_after'. (optional) + // @param operationParam Operation (optional, default to insert_top) + // @return com.vmware.nsx.model.FirewallSectionRuleList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Createwithrules(firewallSectionRuleListParam model.FirewallSectionRuleList, idParam *string, operationParam *string) (model.FirewallSectionRuleList, error) + + // Removes firewall section from the system. Firewall section with rules can only be deleted by passing \"cascade=true\" parameter. + // + // @param sectionIdParam (required) + // @param cascadeParam Flag to cascade delete of this object to all it's child objects. (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(sectionIdParam string, cascadeParam *bool) error + + // Returns information about firewall section for the identifier. + // + // @param sectionIdParam (required) + // @return com.vmware.nsx.model.FirewallSection + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(sectionIdParam string) (model.FirewallSection, error) + + // List all firewall section in paginated form. A default page size is limited to 1000 firewall sections. By default list of section is filtered by LAYER3 type. + // + // @param appliedTosParam AppliedTo's referenced by this section or section's Distributed Service Rules . (optional) + // @param contextProfilesParam Limits results to sections having rules with specific Context Profiles. (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param deepSearchParam Toggle to search with direct or indirect references. (optional, default to false) + // @param destinationsParam Destinations referenced by this section's Distributed Service Rules . (optional) + // @param enforcedOnParam Type of attachment for logical port; for query only. (optional) + // @param excludeAppliedToTypeParam Resource type valid for use as AppliedTo filter in section API (optional) + // @param extendedSourcesParam Limits results to sections having rules with specific Extended Sources. (optional) + // @param filterTypeParam Filter type (optional, default to FILTER) + // @param includeAppliedToTypeParam Resource type valid for use as AppliedTo filter in section API (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param lockedParam Limit results to sections which are locked/unlocked (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param searchInvalidReferencesParam Return invalid references in results. (optional, default to false) + // @param searchScopeParam Limit result to sections of a specific enforcement point (optional) + // @param servicesParam NSService referenced by this section's Distributed Service Rules . (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param sourcesParam Sources referenced by this section's Distributed Service Rules . (optional) + // @param type_Param Section Type (optional, default to LAYER3) + // @return com.vmware.nsx.model.FirewallSectionListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(appliedTosParam *string, contextProfilesParam *string, cursorParam *string, deepSearchParam *bool, destinationsParam *string, enforcedOnParam *string, excludeAppliedToTypeParam *string, extendedSourcesParam *string, filterTypeParam *string, includeAppliedToTypeParam *string, includedFieldsParam *string, lockedParam *bool, pageSizeParam *int64, searchInvalidReferencesParam *bool, searchScopeParam *string, servicesParam *string, sortAscendingParam *bool, sortByParam *string, sourcesParam *string, type_Param *string) (model.FirewallSectionListResult, error) + + // Returns firewall section information with rules for a section identifier. When invoked on a section with a large number of rules, this API is supported only at low rates of invocation (not more than 4-5 times per minute). The typical latency of this API with about 1024 rules is about 4-5 seconds. This API should not be invoked with large payloads at automation speeds. More than 50 rules with a large number rule references is not supported. Instead, to read firewall rules, use: GET /api/v1/firewall/sections//rules with the appropriate page_size. + // + // @param sectionIdParam (required) + // @return com.vmware.nsx.model.FirewallSectionRuleList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Listwithrules(sectionIdParam string) (model.FirewallSectionRuleList, error) + + // Lock a section. + // + // @param sectionIdParam (required) + // @param firewallSectionLockParam (required) + // @return com.vmware.nsx.model.FirewallSection + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws ResourceBusy Locked + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Lock(sectionIdParam string, firewallSectionLockParam model.FirewallSectionLock) (model.FirewallSection, error) + + // Modifies an existing firewall section along with its relative position among other firewall sections in the system. Simultaneous update (modify) operations on same section are not allowed to prevent overwriting stale contents to firewall section. If a concurrent update is performed, HTTP response code 409 will be returned to the client operating on stale data. That client should retrieve the firewall section again and re-apply its update. + // + // @param sectionIdParam (required) + // @param firewallSectionParam (required) + // @param idParam Identifier of the anchor rule or section. This is a required field in case operation like 'insert_before' and 'insert_after'. (optional) + // @param operationParam Operation (optional, default to insert_top) + // @return com.vmware.nsx.model.FirewallSection + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Revise(sectionIdParam string, firewallSectionParam model.FirewallSection, idParam *string, operationParam *string) (model.FirewallSection, error) + + // Modifies an existing firewall section along with its relative position among other firewall sections with rules. When invoked on a large number of rules, this API is supported only at low rates of invocation (not more than 2 times per minute). The typical latency of this API with about 1024 rules is about 15 seconds in a cluster setup. This API should not be invoked with large payloads at automation speeds. Instead, to move a section above or below another section, use: POST /api/v1/firewall/sections/?action=revise To modify rules, use: PUT /api/v1/firewall/sections//rules/ Simultaneous update (modify) operations on same section are not allowed to prevent overwriting stale contents to firewall section. If a concurrent update is performed, HTTP response code 409 will be returned to the client operating on stale data. That client should retrieve the firewall section again and re-apply its update. + // + // @param sectionIdParam (required) + // @param firewallSectionRuleListParam (required) + // @param idParam Identifier of the anchor rule or section. This is a required field in case operation like 'insert_before' and 'insert_after'. (optional) + // @param operationParam Operation (optional, default to insert_top) + // @return com.vmware.nsx.model.FirewallSectionRuleList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Revisewithrules(sectionIdParam string, firewallSectionRuleListParam model.FirewallSectionRuleList, idParam *string, operationParam *string) (model.FirewallSectionRuleList, error) + + // Unlock a section. + // + // @param sectionIdParam (required) + // @param firewallSectionLockParam (required) + // @return com.vmware.nsx.model.FirewallSection + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws ResourceBusy Locked + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Unlock(sectionIdParam string, firewallSectionLockParam model.FirewallSectionLock) (model.FirewallSection, error) + + // Modifies the specified section, but does not modify the section's associated rules. Simultaneous update (modify) operations on same section are not allowed to prevent overwriting stale contents to firewall section. If a concurrent update is performed, HTTP response code 409 will be returned to the client operating on stale data. That client should retrieve the firewall section again and re-apply its update. + // + // @param sectionIdParam (required) + // @param firewallSectionParam (required) + // @return com.vmware.nsx.model.FirewallSection + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(sectionIdParam string, firewallSectionParam model.FirewallSection) (model.FirewallSection, error) + + // Modifies existing firewall section along with its association with rules. When invoked on a large number of rules, this API is supported only at low rates of invocation (not more than 2 times per minute). The typical latency of this API with about 1024 rules is about 15 seconds in a cluster setup. This API should not be invoked with large payloads at automation speeds. Instead, to update rule content, use: PUT /api/v1/firewall/sections//rules/ Simultaneous update (modify) operations on same section are not allowed to prevent overwriting stale contents to firewall section. If a concurrent update is performed, HTTP response code 409 will be returned to the client operating on stale data. That client should retrieve the firewall section again and re-apply its update. + // + // @param sectionIdParam (required) + // @param firewallSectionRuleListParam (required) + // @return com.vmware.nsx.model.FirewallSectionRuleList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Updatewithrules(sectionIdParam string, firewallSectionRuleListParam model.FirewallSectionRuleList) (model.FirewallSectionRuleList, error) +} + +type sectionsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSectionsClient(connector client.Connector) *sectionsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.firewall.sections") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "createwithrules": core.NewMethodIdentifier(interfaceIdentifier, "createwithrules"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "listwithrules": core.NewMethodIdentifier(interfaceIdentifier, "listwithrules"), + "lock": core.NewMethodIdentifier(interfaceIdentifier, "lock"), + "revise": core.NewMethodIdentifier(interfaceIdentifier, "revise"), + "revisewithrules": core.NewMethodIdentifier(interfaceIdentifier, "revisewithrules"), + "unlock": core.NewMethodIdentifier(interfaceIdentifier, "unlock"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + "updatewithrules": core.NewMethodIdentifier(interfaceIdentifier, "updatewithrules"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := sectionsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *sectionsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *sectionsClient) Create(firewallSectionParam model.FirewallSection, idParam *string, operationParam *string) (model.FirewallSection, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sectionsCreateInputType(), typeConverter) + sv.AddStructField("FirewallSection", firewallSectionParam) + sv.AddStructField("Id", idParam) + sv.AddStructField("Operation", operationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallSection + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sectionsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections", "create", inputDataValue, executionContext) + var emptyOutput model.FirewallSection + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sectionsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallSection), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sectionsClient) Createwithrules(firewallSectionRuleListParam model.FirewallSectionRuleList, idParam *string, operationParam *string) (model.FirewallSectionRuleList, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sectionsCreatewithrulesInputType(), typeConverter) + sv.AddStructField("FirewallSectionRuleList", firewallSectionRuleListParam) + sv.AddStructField("Id", idParam) + sv.AddStructField("Operation", operationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallSectionRuleList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sectionsCreatewithrulesRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections", "createwithrules", inputDataValue, executionContext) + var emptyOutput model.FirewallSectionRuleList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sectionsCreatewithrulesOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallSectionRuleList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sectionsClient) Delete(sectionIdParam string, cascadeParam *bool) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sectionsDeleteInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("Cascade", cascadeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sectionsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *sectionsClient) Get(sectionIdParam string) (model.FirewallSection, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sectionsGetInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallSection + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sectionsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections", "get", inputDataValue, executionContext) + var emptyOutput model.FirewallSection + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sectionsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallSection), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sectionsClient) List(appliedTosParam *string, contextProfilesParam *string, cursorParam *string, deepSearchParam *bool, destinationsParam *string, enforcedOnParam *string, excludeAppliedToTypeParam *string, extendedSourcesParam *string, filterTypeParam *string, includeAppliedToTypeParam *string, includedFieldsParam *string, lockedParam *bool, pageSizeParam *int64, searchInvalidReferencesParam *bool, searchScopeParam *string, servicesParam *string, sortAscendingParam *bool, sortByParam *string, sourcesParam *string, type_Param *string) (model.FirewallSectionListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sectionsListInputType(), typeConverter) + sv.AddStructField("AppliedTos", appliedTosParam) + sv.AddStructField("ContextProfiles", contextProfilesParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("DeepSearch", deepSearchParam) + sv.AddStructField("Destinations", destinationsParam) + sv.AddStructField("EnforcedOn", enforcedOnParam) + sv.AddStructField("ExcludeAppliedToType", excludeAppliedToTypeParam) + sv.AddStructField("ExtendedSources", extendedSourcesParam) + sv.AddStructField("FilterType", filterTypeParam) + sv.AddStructField("IncludeAppliedToType", includeAppliedToTypeParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("Locked", lockedParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SearchInvalidReferences", searchInvalidReferencesParam) + sv.AddStructField("SearchScope", searchScopeParam) + sv.AddStructField("Services", servicesParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Sources", sourcesParam) + sv.AddStructField("Type_", type_Param) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallSectionListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sectionsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections", "list", inputDataValue, executionContext) + var emptyOutput model.FirewallSectionListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sectionsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallSectionListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sectionsClient) Listwithrules(sectionIdParam string) (model.FirewallSectionRuleList, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sectionsListwithrulesInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallSectionRuleList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sectionsListwithrulesRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections", "listwithrules", inputDataValue, executionContext) + var emptyOutput model.FirewallSectionRuleList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sectionsListwithrulesOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallSectionRuleList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sectionsClient) Lock(sectionIdParam string, firewallSectionLockParam model.FirewallSectionLock) (model.FirewallSection, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sectionsLockInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("FirewallSectionLock", firewallSectionLockParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallSection + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sectionsLockRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections", "lock", inputDataValue, executionContext) + var emptyOutput model.FirewallSection + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sectionsLockOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallSection), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sectionsClient) Revise(sectionIdParam string, firewallSectionParam model.FirewallSection, idParam *string, operationParam *string) (model.FirewallSection, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sectionsReviseInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("FirewallSection", firewallSectionParam) + sv.AddStructField("Id", idParam) + sv.AddStructField("Operation", operationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallSection + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sectionsReviseRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections", "revise", inputDataValue, executionContext) + var emptyOutput model.FirewallSection + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sectionsReviseOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallSection), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sectionsClient) Revisewithrules(sectionIdParam string, firewallSectionRuleListParam model.FirewallSectionRuleList, idParam *string, operationParam *string) (model.FirewallSectionRuleList, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sectionsRevisewithrulesInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("FirewallSectionRuleList", firewallSectionRuleListParam) + sv.AddStructField("Id", idParam) + sv.AddStructField("Operation", operationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallSectionRuleList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sectionsRevisewithrulesRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections", "revisewithrules", inputDataValue, executionContext) + var emptyOutput model.FirewallSectionRuleList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sectionsRevisewithrulesOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallSectionRuleList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sectionsClient) Unlock(sectionIdParam string, firewallSectionLockParam model.FirewallSectionLock) (model.FirewallSection, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sectionsUnlockInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("FirewallSectionLock", firewallSectionLockParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallSection + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sectionsUnlockRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections", "unlock", inputDataValue, executionContext) + var emptyOutput model.FirewallSection + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sectionsUnlockOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallSection), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sectionsClient) Update(sectionIdParam string, firewallSectionParam model.FirewallSection) (model.FirewallSection, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sectionsUpdateInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("FirewallSection", firewallSectionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallSection + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sectionsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections", "update", inputDataValue, executionContext) + var emptyOutput model.FirewallSection + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sectionsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallSection), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sectionsClient) Updatewithrules(sectionIdParam string, firewallSectionRuleListParam model.FirewallSectionRuleList) (model.FirewallSectionRuleList, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sectionsUpdatewithrulesInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("FirewallSectionRuleList", firewallSectionRuleListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallSectionRuleList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sectionsUpdatewithrulesRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections", "updatewithrules", inputDataValue, executionContext) + var emptyOutput model.FirewallSectionRuleList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sectionsUpdatewithrulesOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallSectionRuleList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/firewall/SectionsTypes.go b/services/nsxt-mp/nsx/firewall/SectionsTypes.go new file mode 100644 index 000000000..8cac68c60 --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/SectionsTypes.go @@ -0,0 +1,917 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Sections. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package firewall + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``operation`` of method Sections#create. +const Sections_CREATE_OPERATION_TOP = "insert_top" + +// Possible value for ``operation`` of method Sections#create. +const Sections_CREATE_OPERATION_BOTTOM = "insert_bottom" + +// Possible value for ``operation`` of method Sections#create. +const Sections_CREATE_OPERATION_AFTER = "insert_after" + +// Possible value for ``operation`` of method Sections#create. +const Sections_CREATE_OPERATION_BEFORE = "insert_before" + +// Possible value for ``operation`` of method Sections#createwithrules. +const Sections_CREATEWITHRULES_OPERATION_TOP = "insert_top" + +// Possible value for ``operation`` of method Sections#createwithrules. +const Sections_CREATEWITHRULES_OPERATION_BOTTOM = "insert_bottom" + +// Possible value for ``operation`` of method Sections#createwithrules. +const Sections_CREATEWITHRULES_OPERATION_AFTER = "insert_after" + +// Possible value for ``operation`` of method Sections#createwithrules. +const Sections_CREATEWITHRULES_OPERATION_BEFORE = "insert_before" + +// Possible value for ``enforcedOn`` of method Sections#list. +const Sections_LIST_ENFORCED_ON_VIF = "VIF" + +// Possible value for ``enforcedOn`` of method Sections#list. +const Sections_LIST_ENFORCED_ON_LOGICALROUTER = "LOGICALROUTER" + +// Possible value for ``enforcedOn`` of method Sections#list. +const Sections_LIST_ENFORCED_ON_BRIDGEENDPOINT = "BRIDGEENDPOINT" + +// Possible value for ``enforcedOn`` of method Sections#list. +const Sections_LIST_ENFORCED_ON_DHCP_SERVICE = "DHCP_SERVICE" + +// Possible value for ``enforcedOn`` of method Sections#list. +const Sections_LIST_ENFORCED_ON_METADATA_PROXY = "METADATA_PROXY" + +// Possible value for ``enforcedOn`` of method Sections#list. +const Sections_LIST_ENFORCED_ON_L2VPN_SESSION = "L2VPN_SESSION" + +// Possible value for ``enforcedOn`` of method Sections#list. +const Sections_LIST_ENFORCED_ON_NONE = "NONE" + +// Possible value for ``excludeAppliedToType`` of method Sections#list. +const Sections_LIST_EXCLUDE_APPLIED_TO_TYPE_NSGROUP = "NSGroup" + +// Possible value for ``excludeAppliedToType`` of method Sections#list. +const Sections_LIST_EXCLUDE_APPLIED_TO_TYPE_LOGICALSWITCH = "LogicalSwitch" + +// Possible value for ``excludeAppliedToType`` of method Sections#list. +const Sections_LIST_EXCLUDE_APPLIED_TO_TYPE_LOGICALROUTER = "LogicalRouter" + +// Possible value for ``excludeAppliedToType`` of method Sections#list. +const Sections_LIST_EXCLUDE_APPLIED_TO_TYPE_LOGICALPORT = "LogicalPort" + +// Possible value for ``filterType`` of method Sections#list. +const Sections_LIST_FILTER_TYPE_FILTER = "FILTER" + +// Possible value for ``filterType`` of method Sections#list. +const Sections_LIST_FILTER_TYPE_SEARCH = "SEARCH" + +// Possible value for ``includeAppliedToType`` of method Sections#list. +const Sections_LIST_INCLUDE_APPLIED_TO_TYPE_NSGROUP = "NSGroup" + +// Possible value for ``includeAppliedToType`` of method Sections#list. +const Sections_LIST_INCLUDE_APPLIED_TO_TYPE_LOGICALSWITCH = "LogicalSwitch" + +// Possible value for ``includeAppliedToType`` of method Sections#list. +const Sections_LIST_INCLUDE_APPLIED_TO_TYPE_LOGICALROUTER = "LogicalRouter" + +// Possible value for ``includeAppliedToType`` of method Sections#list. +const Sections_LIST_INCLUDE_APPLIED_TO_TYPE_LOGICALPORT = "LogicalPort" + +// Possible value for ``type`` of method Sections#list. +const Sections_LIST_TYPE_LAYER2 = "LAYER2" + +// Possible value for ``type`` of method Sections#list. +const Sections_LIST_TYPE_LAYER3 = "LAYER3" + +// Possible value for ``operation`` of method Sections#revise. +const Sections_REVISE_OPERATION_TOP = "insert_top" + +// Possible value for ``operation`` of method Sections#revise. +const Sections_REVISE_OPERATION_BOTTOM = "insert_bottom" + +// Possible value for ``operation`` of method Sections#revise. +const Sections_REVISE_OPERATION_AFTER = "insert_after" + +// Possible value for ``operation`` of method Sections#revise. +const Sections_REVISE_OPERATION_BEFORE = "insert_before" + +// Possible value for ``operation`` of method Sections#revisewithrules. +const Sections_REVISEWITHRULES_OPERATION_TOP = "insert_top" + +// Possible value for ``operation`` of method Sections#revisewithrules. +const Sections_REVISEWITHRULES_OPERATION_BOTTOM = "insert_bottom" + +// Possible value for ``operation`` of method Sections#revisewithrules. +const Sections_REVISEWITHRULES_OPERATION_AFTER = "insert_after" + +// Possible value for ``operation`` of method Sections#revisewithrules. +const Sections_REVISEWITHRULES_OPERATION_BEFORE = "insert_before" + +func sectionsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["firewall_section"] = bindings.NewReferenceType(model.FirewallSectionBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["firewall_section"] = "FirewallSection" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sectionsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallSectionBindingType) +} + +func sectionsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["firewall_section"] = bindings.NewReferenceType(model.FirewallSectionBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["firewall_section"] = "FirewallSection" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + paramsTypeMap["id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["firewall_section"] = bindings.NewReferenceType(model.FirewallSectionBindingType) + queryParams["id"] = "id" + queryParams["operation"] = "operation" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "firewall_section", + "POST", + "/api/v1/firewall/sections", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sectionsCreatewithrulesInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["firewall_section_rule_list"] = bindings.NewReferenceType(model.FirewallSectionRuleListBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["firewall_section_rule_list"] = "FirewallSectionRuleList" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sectionsCreatewithrulesOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallSectionRuleListBindingType) +} + +func sectionsCreatewithrulesRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["firewall_section_rule_list"] = bindings.NewReferenceType(model.FirewallSectionRuleListBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["firewall_section_rule_list"] = "FirewallSectionRuleList" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + paramsTypeMap["id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["firewall_section_rule_list"] = bindings.NewReferenceType(model.FirewallSectionRuleListBindingType) + paramsTypeMap["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["id"] = "id" + queryParams["operation"] = "operation" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=create_with_rules", + "firewall_section_rule_list", + "POST", + "/api/v1/firewall/sections", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sectionsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["cascade"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["cascade"] = "Cascade" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sectionsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func sectionsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["cascade"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["cascade"] = "Cascade" + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["cascade"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + queryParams["cascade"] = "cascade" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/firewall/sections/{sectionId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sectionsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fieldNameMap["section_id"] = "SectionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sectionsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallSectionBindingType) +} + +func sectionsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fieldNameMap["section_id"] = "SectionId" + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/firewall/sections/{sectionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sectionsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["applied_tos"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["context_profiles"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["deep_search"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["destinations"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforced_on"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["exclude_applied_to_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["extended_sources"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["filter_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_applied_to_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["locked"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["search_invalid_references"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["search_scope"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["services"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sources"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["applied_tos"] = "AppliedTos" + fieldNameMap["context_profiles"] = "ContextProfiles" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["deep_search"] = "DeepSearch" + fieldNameMap["destinations"] = "Destinations" + fieldNameMap["enforced_on"] = "EnforcedOn" + fieldNameMap["exclude_applied_to_type"] = "ExcludeAppliedToType" + fieldNameMap["extended_sources"] = "ExtendedSources" + fieldNameMap["filter_type"] = "FilterType" + fieldNameMap["include_applied_to_type"] = "IncludeAppliedToType" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["locked"] = "Locked" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["search_invalid_references"] = "SearchInvalidReferences" + fieldNameMap["search_scope"] = "SearchScope" + fieldNameMap["services"] = "Services" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["sources"] = "Sources" + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sectionsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallSectionListResultBindingType) +} + +func sectionsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["applied_tos"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["context_profiles"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["deep_search"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["destinations"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["enforced_on"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["exclude_applied_to_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["extended_sources"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["filter_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_applied_to_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["locked"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["search_invalid_references"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["search_scope"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["services"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sources"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["applied_tos"] = "AppliedTos" + fieldNameMap["context_profiles"] = "ContextProfiles" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["deep_search"] = "DeepSearch" + fieldNameMap["destinations"] = "Destinations" + fieldNameMap["enforced_on"] = "EnforcedOn" + fieldNameMap["exclude_applied_to_type"] = "ExcludeAppliedToType" + fieldNameMap["extended_sources"] = "ExtendedSources" + fieldNameMap["filter_type"] = "FilterType" + fieldNameMap["include_applied_to_type"] = "IncludeAppliedToType" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["locked"] = "Locked" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["search_invalid_references"] = "SearchInvalidReferences" + fieldNameMap["search_scope"] = "SearchScope" + fieldNameMap["services"] = "Services" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["sources"] = "Sources" + fieldNameMap["type"] = "Type_" + paramsTypeMap["sources"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["exclude_applied_to_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["enforced_on"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["include_applied_to_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["destinations"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["context_profiles"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["filter_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["search_scope"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["extended_sources"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["applied_tos"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["search_invalid_references"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["services"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["locked"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["deep_search"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sources"] = "sources" + queryParams["deep_search"] = "deep_search" + queryParams["destinations"] = "destinations" + queryParams["exclude_applied_to_type"] = "exclude_applied_to_type" + queryParams["include_applied_to_type"] = "include_applied_to_type" + queryParams["context_profiles"] = "context_profiles" + queryParams["services"] = "services" + queryParams["sort_by"] = "sort_by" + queryParams["search_scope"] = "search_scope" + queryParams["type"] = "type" + queryParams["extended_sources"] = "extended_sources" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["filter_type"] = "filter_type" + queryParams["included_fields"] = "included_fields" + queryParams["applied_tos"] = "applied_tos" + queryParams["enforced_on"] = "enforced_on" + queryParams["locked"] = "locked" + queryParams["search_invalid_references"] = "search_invalid_references" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/firewall/sections", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sectionsListwithrulesInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fieldNameMap["section_id"] = "SectionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sectionsListwithrulesOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallSectionRuleListBindingType) +} + +func sectionsListwithrulesRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fieldNameMap["section_id"] = "SectionId" + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=list_with_rules", + "", + "POST", + "/api/v1/firewall/sections/{sectionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sectionsLockInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["firewall_section_lock"] = bindings.NewReferenceType(model.FirewallSectionLockBindingType) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["firewall_section_lock"] = "FirewallSectionLock" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sectionsLockOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallSectionBindingType) +} + +func sectionsLockRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["firewall_section_lock"] = bindings.NewReferenceType(model.FirewallSectionLockBindingType) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["firewall_section_lock"] = "FirewallSectionLock" + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["firewall_section_lock"] = bindings.NewReferenceType(model.FirewallSectionLockBindingType) + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=lock", + "firewall_section_lock", + "POST", + "/api/v1/firewall/sections/{sectionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.resource_busy": 500, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sectionsReviseInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["firewall_section"] = bindings.NewReferenceType(model.FirewallSectionBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["firewall_section"] = "FirewallSection" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sectionsReviseOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallSectionBindingType) +} + +func sectionsReviseRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["firewall_section"] = bindings.NewReferenceType(model.FirewallSectionBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["firewall_section"] = "FirewallSection" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + paramsTypeMap["id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["firewall_section"] = bindings.NewReferenceType(model.FirewallSectionBindingType) + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + queryParams["id"] = "id" + queryParams["operation"] = "operation" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=revise", + "firewall_section", + "POST", + "/api/v1/firewall/sections/{sectionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sectionsRevisewithrulesInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["firewall_section_rule_list"] = bindings.NewReferenceType(model.FirewallSectionRuleListBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["firewall_section_rule_list"] = "FirewallSectionRuleList" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sectionsRevisewithrulesOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallSectionRuleListBindingType) +} + +func sectionsRevisewithrulesRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["firewall_section_rule_list"] = bindings.NewReferenceType(model.FirewallSectionRuleListBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["firewall_section_rule_list"] = "FirewallSectionRuleList" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + paramsTypeMap["id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["firewall_section_rule_list"] = bindings.NewReferenceType(model.FirewallSectionRuleListBindingType) + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + queryParams["id"] = "id" + queryParams["operation"] = "operation" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=revise_with_rules", + "firewall_section_rule_list", + "POST", + "/api/v1/firewall/sections/{sectionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sectionsUnlockInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["firewall_section_lock"] = bindings.NewReferenceType(model.FirewallSectionLockBindingType) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["firewall_section_lock"] = "FirewallSectionLock" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sectionsUnlockOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallSectionBindingType) +} + +func sectionsUnlockRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["firewall_section_lock"] = bindings.NewReferenceType(model.FirewallSectionLockBindingType) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["firewall_section_lock"] = "FirewallSectionLock" + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["firewall_section_lock"] = bindings.NewReferenceType(model.FirewallSectionLockBindingType) + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=unlock", + "firewall_section_lock", + "POST", + "/api/v1/firewall/sections/{sectionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.resource_busy": 500, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sectionsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["firewall_section"] = bindings.NewReferenceType(model.FirewallSectionBindingType) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["firewall_section"] = "FirewallSection" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sectionsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallSectionBindingType) +} + +func sectionsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["firewall_section"] = bindings.NewReferenceType(model.FirewallSectionBindingType) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["firewall_section"] = "FirewallSection" + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["firewall_section"] = bindings.NewReferenceType(model.FirewallSectionBindingType) + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "firewall_section", + "PUT", + "/api/v1/firewall/sections/{sectionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sectionsUpdatewithrulesInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["firewall_section_rule_list"] = bindings.NewReferenceType(model.FirewallSectionRuleListBindingType) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["firewall_section_rule_list"] = "FirewallSectionRuleList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sectionsUpdatewithrulesOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallSectionRuleListBindingType) +} + +func sectionsUpdatewithrulesRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["firewall_section_rule_list"] = bindings.NewReferenceType(model.FirewallSectionRuleListBindingType) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["firewall_section_rule_list"] = "FirewallSectionRuleList" + paramsTypeMap["firewall_section_rule_list"] = bindings.NewReferenceType(model.FirewallSectionRuleListBindingType) + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=update_with_rules", + "firewall_section_rule_list", + "POST", + "/api/v1/firewall/sections/{sectionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/firewall/StatsClient.go b/services/nsxt-mp/nsx/firewall/StatsClient.go new file mode 100644 index 000000000..aa9a4f0cc --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/StatsClient.go @@ -0,0 +1,82 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Stats +// Used by client-side stubs. + +package firewall + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatsClient interface { + + // Sets firewall rule statistics counter to zero. This operation is supported for given category, for example: L3DFW i.e. for all layer3 firewall (transport nodes only) rules or L3EDGE i.e. for all layer3 edge firewall (edge nodes only) rules or L3BRIDGEPORT i.e. for all layer3 bridge port firewall (bridge ports only) rules. + // + // @param categoryParam Aggregation statistic category (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Reset(categoryParam string) error +} + +type statsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatsClient(connector client.Connector) *statsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.firewall.stats") + methodIdentifiers := map[string]core.MethodIdentifier{ + "reset": core.NewMethodIdentifier(interfaceIdentifier, "reset"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statsClient) Reset(categoryParam string) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statsResetInputType(), typeConverter) + sv.AddStructField("Category", categoryParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statsResetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.stats", "reset", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/firewall/StatsTypes.go b/services/nsxt-mp/nsx/firewall/StatsTypes.go new file mode 100644 index 000000000..afc741c2d --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/StatsTypes.go @@ -0,0 +1,76 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Stats. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package firewall + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "reflect" +) + +// Possible value for ``category`` of method Stats#reset. +const Stats_RESET_CATEGORY_L3DFW = "L3DFW" + +// Possible value for ``category`` of method Stats#reset. +const Stats_RESET_CATEGORY_L3EDGE = "L3EDGE" + +// Possible value for ``category`` of method Stats#reset. +const Stats_RESET_CATEGORY_L3BRIDGEPORT = "L3BRIDGEPORT" + +func statsResetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["category"] = bindings.NewStringType() + fieldNameMap["category"] = "Category" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statsResetOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func statsResetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["category"] = bindings.NewStringType() + fieldNameMap["category"] = "Category" + paramsTypeMap["category"] = bindings.NewStringType() + queryParams["category"] = "category" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=reset", + "", + "POST", + "/api/v1/firewall/stats", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/firewall/StatusClient.go b/services/nsxt-mp/nsx/firewall/StatusClient.go new file mode 100644 index 000000000..54afa7ea1 --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/StatusClient.go @@ -0,0 +1,310 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package firewall + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Disable firewall on target resource in dfw context + // + // @param contextTypeParam (required) + // @param idParam (required) + // @return com.vmware.nsx.model.TargetResourceStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Disablefirewall(contextTypeParam string, idParam string) (model.TargetResourceStatus, error) + + // Enable firewall on target resource in dfw context + // + // @param contextTypeParam (required) + // @param idParam (required) + // @return com.vmware.nsx.model.TargetResourceStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Enablefirewall(contextTypeParam string, idParam string) (model.TargetResourceStatus, error) + + // Get firewall global status for dfw context + // + // @param contextTypeParam (required) + // @return com.vmware.nsx.model.FirewallStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(contextTypeParam string) (model.FirewallStatus, error) + + // Get firewall status for target resource in dfw context + // + // @param contextTypeParam (required) + // @param idParam (required) + // @return com.vmware.nsx.model.TargetResourceStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get0(contextTypeParam string, idParam string) (model.TargetResourceStatus, error) + + // List all firewall status for supported contexts + // @return com.vmware.nsx.model.FirewallStatusListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.FirewallStatusListResult, error) + + // Update global firewall status for dfw context + // + // @param contextTypeParam (required) + // @param firewallStatusParam (required) + // @return com.vmware.nsx.model.FirewallStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(contextTypeParam string, firewallStatusParam model.FirewallStatus) (model.FirewallStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.firewall.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "disablefirewall": core.NewMethodIdentifier(interfaceIdentifier, "disablefirewall"), + "enablefirewall": core.NewMethodIdentifier(interfaceIdentifier, "enablefirewall"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "get_0": core.NewMethodIdentifier(interfaceIdentifier, "get_0"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Disablefirewall(contextTypeParam string, idParam string) (model.TargetResourceStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusDisablefirewallInputType(), typeConverter) + sv.AddStructField("ContextType", contextTypeParam) + sv.AddStructField("Id", idParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TargetResourceStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusDisablefirewallRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.status", "disablefirewall", inputDataValue, executionContext) + var emptyOutput model.TargetResourceStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusDisablefirewallOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TargetResourceStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statusClient) Enablefirewall(contextTypeParam string, idParam string) (model.TargetResourceStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusEnablefirewallInputType(), typeConverter) + sv.AddStructField("ContextType", contextTypeParam) + sv.AddStructField("Id", idParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TargetResourceStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusEnablefirewallRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.status", "enablefirewall", inputDataValue, executionContext) + var emptyOutput model.TargetResourceStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusEnablefirewallOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TargetResourceStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statusClient) Get(contextTypeParam string) (model.FirewallStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("ContextType", contextTypeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.status", "get", inputDataValue, executionContext) + var emptyOutput model.FirewallStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statusClient) Get0(contextTypeParam string, idParam string) (model.TargetResourceStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGet0InputType(), typeConverter) + sv.AddStructField("ContextType", contextTypeParam) + sv.AddStructField("Id", idParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TargetResourceStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGet0RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.status", "get_0", inputDataValue, executionContext) + var emptyOutput model.TargetResourceStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGet0OutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TargetResourceStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statusClient) List() (model.FirewallStatusListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallStatusListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.status", "list", inputDataValue, executionContext) + var emptyOutput model.FirewallStatusListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallStatusListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statusClient) Update(contextTypeParam string, firewallStatusParam model.FirewallStatus) (model.FirewallStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusUpdateInputType(), typeConverter) + sv.AddStructField("ContextType", contextTypeParam) + sv.AddStructField("FirewallStatus", firewallStatusParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.status", "update", inputDataValue, executionContext) + var emptyOutput model.FirewallStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/firewall/StatusTypes.go b/services/nsxt-mp/nsx/firewall/StatusTypes.go new file mode 100644 index 000000000..d2acd7bf0 --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/StatusTypes.go @@ -0,0 +1,338 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package firewall + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusDisablefirewallInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["context_type"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["context_type"] = "ContextType" + fieldNameMap["id"] = "Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusDisablefirewallOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TargetResourceStatusBindingType) +} + +func statusDisablefirewallRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["context_type"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["context_type"] = "ContextType" + fieldNameMap["id"] = "Id" + paramsTypeMap["context_type"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + paramsTypeMap["contextType"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + pathParams["context_type"] = "contextType" + pathParams["id"] = "id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=disable_firewall", + "", + "POST", + "/api/v1/firewall/status/{contextType}/{id}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statusEnablefirewallInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["context_type"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["context_type"] = "ContextType" + fieldNameMap["id"] = "Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusEnablefirewallOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TargetResourceStatusBindingType) +} + +func statusEnablefirewallRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["context_type"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["context_type"] = "ContextType" + fieldNameMap["id"] = "Id" + paramsTypeMap["context_type"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + paramsTypeMap["contextType"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + pathParams["context_type"] = "contextType" + pathParams["id"] = "id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=enable_firewall", + "", + "POST", + "/api/v1/firewall/status/{contextType}/{id}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["context_type"] = bindings.NewStringType() + fieldNameMap["context_type"] = "ContextType" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["context_type"] = bindings.NewStringType() + fieldNameMap["context_type"] = "ContextType" + paramsTypeMap["context_type"] = bindings.NewStringType() + paramsTypeMap["contextType"] = bindings.NewStringType() + pathParams["context_type"] = "contextType" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/firewall/status/{contextType}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statusGet0InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["context_type"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["context_type"] = "ContextType" + fieldNameMap["id"] = "Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGet0OutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TargetResourceStatusBindingType) +} + +func statusGet0RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["context_type"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["context_type"] = "ContextType" + fieldNameMap["id"] = "Id" + paramsTypeMap["context_type"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + paramsTypeMap["contextType"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + pathParams["context_type"] = "contextType" + pathParams["id"] = "id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/firewall/status/{contextType}/{id}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statusListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallStatusListResultBindingType) +} + +func statusListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/firewall/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statusUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["context_type"] = bindings.NewStringType() + fields["firewall_status"] = bindings.NewReferenceType(model.FirewallStatusBindingType) + fieldNameMap["context_type"] = "ContextType" + fieldNameMap["firewall_status"] = "FirewallStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallStatusBindingType) +} + +func statusUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["context_type"] = bindings.NewStringType() + fields["firewall_status"] = bindings.NewReferenceType(model.FirewallStatusBindingType) + fieldNameMap["context_type"] = "ContextType" + fieldNameMap["firewall_status"] = "FirewallStatus" + paramsTypeMap["firewall_status"] = bindings.NewReferenceType(model.FirewallStatusBindingType) + paramsTypeMap["context_type"] = bindings.NewStringType() + paramsTypeMap["contextType"] = bindings.NewStringType() + pathParams["context_type"] = "contextType" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "firewall_status", + "PUT", + "/api/v1/firewall/status/{contextType}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/firewall/rules/RulesPackageTypes.go b/services/nsxt-mp/nsx/firewall/rules/RulesPackageTypes.go new file mode 100644 index 000000000..850fb5c26 --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/rules/RulesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.firewall.rules. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package rules diff --git a/services/nsxt-mp/nsx/firewall/rules/StateClient.go b/services/nsxt-mp/nsx/firewall/rules/StateClient.go new file mode 100644 index 000000000..c8e895508 --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/rules/StateClient.go @@ -0,0 +1,94 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: State +// Used by client-side stubs. + +package rules + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StateClient interface { + + // Return realized state information of a firewall rule. Returned response is same as rule's section realization state response. + // + // @param ruleIdParam (required) + // @param barrierIdParam (optional) + // @param requestIdParam Realization request ID (optional) + // @return com.vmware.nsx.model.RuleState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ruleIdParam string, barrierIdParam *int64, requestIdParam *string) (model.RuleState, error) +} + +type stateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStateClient(connector client.Connector) *stateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.firewall.rules.state") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := stateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *stateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *stateClient) Get(ruleIdParam string, barrierIdParam *int64, requestIdParam *string) (model.RuleState, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(stateGetInputType(), typeConverter) + sv.AddStructField("RuleId", ruleIdParam) + sv.AddStructField("BarrierId", barrierIdParam) + sv.AddStructField("RequestId", requestIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RuleState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.rules.state", "get", inputDataValue, executionContext) + var emptyOutput model.RuleState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RuleState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/firewall/rules/StateTypes.go b/services/nsxt-mp/nsx/firewall/rules/StateTypes.go new file mode 100644 index 000000000..2124cf474 --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/rules/StateTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: State. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package rules + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func stateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rule_id"] = bindings.NewStringType() + fields["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["rule_id"] = "RuleId" + fieldNameMap["barrier_id"] = "BarrierId" + fieldNameMap["request_id"] = "RequestId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RuleStateBindingType) +} + +func stateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["rule_id"] = bindings.NewStringType() + fields["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["rule_id"] = "RuleId" + fieldNameMap["barrier_id"] = "BarrierId" + fieldNameMap["request_id"] = "RequestId" + paramsTypeMap["rule_id"] = bindings.NewStringType() + paramsTypeMap["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["ruleId"] = bindings.NewStringType() + pathParams["rule_id"] = "ruleId" + queryParams["barrier_id"] = "barrier_id" + queryParams["request_id"] = "request_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/firewall/rules/{ruleId}/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/firewall/sections/RulesClient.go b/services/nsxt-mp/nsx/firewall/sections/RulesClient.go new file mode 100644 index 000000000..a846b7f24 --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/sections/RulesClient.go @@ -0,0 +1,397 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Rules +// Used by client-side stubs. + +package sections + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RulesClient interface { + + // Adds a new firewall rule in existing firewall section. Adding firewall rule to a section modifies parent section entity and simultaneous update (modify) operations on same section are not allowed to prevent overwriting stale content to firewall section. If a concurrent update is performed, HTTP response code 409 will be returned to the client operating on stale data. That client should retrieve the firewall section again and re-apply its update. + // + // @param sectionIdParam (required) + // @param firewallRuleParam (required) + // @param idParam Identifier of the anchor rule or section. This is a required field in case operation like 'insert_before' and 'insert_after'. (optional) + // @param operationParam Operation (optional, default to insert_top) + // @return com.vmware.nsx.model.FirewallRule + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(sectionIdParam string, firewallRuleParam model.FirewallRule, idParam *string, operationParam *string) (model.FirewallRule, error) + + // Create multiple firewall rules in existing firewall section bounded by limit of 1000 firewall rules per section. Adding multiple firewall rules in a section modifies parent section entity and simultaneous update (modify) operations on same section are not allowed to prevent overwriting stale contents to firewall section. If a concurrent update is performed, HTTP response code 409 will be returned to the client operating on stale data. That client should retrieve the firewall section again and re-apply its update. + // + // @param sectionIdParam (required) + // @param firewallRuleListParam (required) + // @param idParam Identifier of the anchor rule or section. This is a required field in case operation like 'insert_before' and 'insert_after'. (optional) + // @param operationParam Operation (optional, default to insert_top) + // @return com.vmware.nsx.model.FirewallRuleList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Createmultiple(sectionIdParam string, firewallRuleListParam model.FirewallRuleList, idParam *string, operationParam *string) (model.FirewallRuleList, error) + + // Delete existing firewall rule in a firewall section. Deleting firewall rule in a section modifies parent section and simultaneous update (modify) operations on same section are not allowed to prevent overwriting stale contents to firewall section. If a concurrent update is performed, HTTP response code 409 will be returned to the client operating on stale data. That client should retrieve the firewall section again and re-apply its update. + // + // @param sectionIdParam (required) + // @param ruleIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(sectionIdParam string, ruleIdParam string) error + + // Return existing firewall rule information in a firewall section. + // + // @param sectionIdParam (required) + // @param ruleIdParam (required) + // @return com.vmware.nsx.model.FirewallRule + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(sectionIdParam string, ruleIdParam string) (model.FirewallRule, error) + + // Return all firewall rule(s) information for a given firewall section. + // + // @param sectionIdParam (required) + // @param appliedTosParam AppliedTo's referenced by this section or section's Distributed Service Rules . (optional) + // @param contextProfilesParam Limits results to sections having rules with specific Context Profiles. (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param deepSearchParam Toggle to search with direct or indirect references. (optional, default to false) + // @param destinationsParam Destinations referenced by this section's Distributed Service Rules . (optional) + // @param extendedSourcesParam Limits results to sections having rules with specific Extended Sources. (optional) + // @param filterTypeParam Filter type (optional, default to FILTER) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param searchInvalidReferencesParam Return invalid references in results. (optional, default to false) + // @param servicesParam NSService referenced by this section's Distributed Service Rules . (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param sourcesParam Sources referenced by this section's Distributed Service Rules . (optional) + // @return com.vmware.nsx.model.FirewallRuleListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(sectionIdParam string, appliedTosParam *string, contextProfilesParam *string, cursorParam *string, deepSearchParam *bool, destinationsParam *string, extendedSourcesParam *string, filterTypeParam *string, includedFieldsParam *string, pageSizeParam *int64, searchInvalidReferencesParam *bool, servicesParam *string, sortAscendingParam *bool, sortByParam *string, sourcesParam *string) (model.FirewallRuleListResult, error) + + // Modifies existing firewall rule along with relative position among other firewall rules inside a firewall section. Revising firewall rule in a section modifies parent section entity and simultaneous update (modify) operations on same section are not allowed to prevent overwriting stale contents to firewall section. If a concurrent update is performed, HTTP response code 409 will be returned to the client operating on stale data. That client should retrieve the firewall section again and re-apply its update. + // + // @param sectionIdParam (required) + // @param ruleIdParam (required) + // @param firewallRuleParam (required) + // @param idParam Identifier of the anchor rule or section. This is a required field in case operation like 'insert_before' and 'insert_after'. (optional) + // @param operationParam Operation (optional, default to insert_top) + // @return com.vmware.nsx.model.FirewallRule + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Revise(sectionIdParam string, ruleIdParam string, firewallRuleParam model.FirewallRule, idParam *string, operationParam *string) (model.FirewallRule, error) + + // Modifies existing firewall rule in a firewall section. Updating firewall rule in a section modifies parent section entity and simultaneous update (modify) operations on same section are not allowed to prevent overwriting stale contents to firewall section. If a concurrent update is performed, HTTP response code 409 will be returned to the client operating on stale data. That client should retrieve the firewall section again and re-apply its update. + // + // @param sectionIdParam (required) + // @param ruleIdParam (required) + // @param firewallRuleParam (required) + // @return com.vmware.nsx.model.FirewallRule + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(sectionIdParam string, ruleIdParam string, firewallRuleParam model.FirewallRule) (model.FirewallRule, error) +} + +type rulesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRulesClient(connector client.Connector) *rulesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.firewall.sections.rules") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "createmultiple": core.NewMethodIdentifier(interfaceIdentifier, "createmultiple"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "revise": core.NewMethodIdentifier(interfaceIdentifier, "revise"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := rulesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *rulesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *rulesClient) Create(sectionIdParam string, firewallRuleParam model.FirewallRule, idParam *string, operationParam *string) (model.FirewallRule, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesCreateInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("FirewallRule", firewallRuleParam) + sv.AddStructField("Id", idParam) + sv.AddStructField("Operation", operationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallRule + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections.rules", "create", inputDataValue, executionContext) + var emptyOutput model.FirewallRule + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallRule), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rulesClient) Createmultiple(sectionIdParam string, firewallRuleListParam model.FirewallRuleList, idParam *string, operationParam *string) (model.FirewallRuleList, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesCreatemultipleInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("FirewallRuleList", firewallRuleListParam) + sv.AddStructField("Id", idParam) + sv.AddStructField("Operation", operationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallRuleList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesCreatemultipleRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections.rules", "createmultiple", inputDataValue, executionContext) + var emptyOutput model.FirewallRuleList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesCreatemultipleOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallRuleList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rulesClient) Delete(sectionIdParam string, ruleIdParam string) error { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesDeleteInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("RuleId", ruleIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections.rules", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (rIface *rulesClient) Get(sectionIdParam string, ruleIdParam string) (model.FirewallRule, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesGetInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("RuleId", ruleIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallRule + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections.rules", "get", inputDataValue, executionContext) + var emptyOutput model.FirewallRule + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallRule), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rulesClient) List(sectionIdParam string, appliedTosParam *string, contextProfilesParam *string, cursorParam *string, deepSearchParam *bool, destinationsParam *string, extendedSourcesParam *string, filterTypeParam *string, includedFieldsParam *string, pageSizeParam *int64, searchInvalidReferencesParam *bool, servicesParam *string, sortAscendingParam *bool, sortByParam *string, sourcesParam *string) (model.FirewallRuleListResult, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesListInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("AppliedTos", appliedTosParam) + sv.AddStructField("ContextProfiles", contextProfilesParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("DeepSearch", deepSearchParam) + sv.AddStructField("Destinations", destinationsParam) + sv.AddStructField("ExtendedSources", extendedSourcesParam) + sv.AddStructField("FilterType", filterTypeParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SearchInvalidReferences", searchInvalidReferencesParam) + sv.AddStructField("Services", servicesParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Sources", sourcesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallRuleListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections.rules", "list", inputDataValue, executionContext) + var emptyOutput model.FirewallRuleListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallRuleListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rulesClient) Revise(sectionIdParam string, ruleIdParam string, firewallRuleParam model.FirewallRule, idParam *string, operationParam *string) (model.FirewallRule, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesReviseInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("RuleId", ruleIdParam) + sv.AddStructField("FirewallRule", firewallRuleParam) + sv.AddStructField("Id", idParam) + sv.AddStructField("Operation", operationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallRule + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesReviseRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections.rules", "revise", inputDataValue, executionContext) + var emptyOutput model.FirewallRule + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesReviseOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallRule), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rulesClient) Update(sectionIdParam string, ruleIdParam string, firewallRuleParam model.FirewallRule) (model.FirewallRule, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesUpdateInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("RuleId", ruleIdParam) + sv.AddStructField("FirewallRule", firewallRuleParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallRule + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections.rules", "update", inputDataValue, executionContext) + var emptyOutput model.FirewallRule + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallRule), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/firewall/sections/RulesTypes.go b/services/nsxt-mp/nsx/firewall/sections/RulesTypes.go new file mode 100644 index 000000000..96325e52a --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/sections/RulesTypes.go @@ -0,0 +1,579 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Rules. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package sections + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``operation`` of method Rules#create. +const Rules_CREATE_OPERATION_TOP = "insert_top" + +// Possible value for ``operation`` of method Rules#create. +const Rules_CREATE_OPERATION_BOTTOM = "insert_bottom" + +// Possible value for ``operation`` of method Rules#create. +const Rules_CREATE_OPERATION_AFTER = "insert_after" + +// Possible value for ``operation`` of method Rules#create. +const Rules_CREATE_OPERATION_BEFORE = "insert_before" + +// Possible value for ``operation`` of method Rules#createmultiple. +const Rules_CREATEMULTIPLE_OPERATION_TOP = "insert_top" + +// Possible value for ``operation`` of method Rules#createmultiple. +const Rules_CREATEMULTIPLE_OPERATION_BOTTOM = "insert_bottom" + +// Possible value for ``operation`` of method Rules#createmultiple. +const Rules_CREATEMULTIPLE_OPERATION_AFTER = "insert_after" + +// Possible value for ``operation`` of method Rules#createmultiple. +const Rules_CREATEMULTIPLE_OPERATION_BEFORE = "insert_before" + +// Possible value for ``filterType`` of method Rules#list. +const Rules_LIST_FILTER_TYPE_FILTER = "FILTER" + +// Possible value for ``filterType`` of method Rules#list. +const Rules_LIST_FILTER_TYPE_SEARCH = "SEARCH" + +// Possible value for ``operation`` of method Rules#revise. +const Rules_REVISE_OPERATION_TOP = "insert_top" + +// Possible value for ``operation`` of method Rules#revise. +const Rules_REVISE_OPERATION_BOTTOM = "insert_bottom" + +// Possible value for ``operation`` of method Rules#revise. +const Rules_REVISE_OPERATION_AFTER = "insert_after" + +// Possible value for ``operation`` of method Rules#revise. +const Rules_REVISE_OPERATION_BEFORE = "insert_before" + +func rulesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["firewall_rule"] = bindings.NewReferenceType(model.FirewallRuleBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["firewall_rule"] = "FirewallRule" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallRuleBindingType) +} + +func rulesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["firewall_rule"] = bindings.NewReferenceType(model.FirewallRuleBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["firewall_rule"] = "FirewallRule" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + paramsTypeMap["firewall_rule"] = bindings.NewReferenceType(model.FirewallRuleBindingType) + paramsTypeMap["id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + queryParams["id"] = "id" + queryParams["operation"] = "operation" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "firewall_rule", + "POST", + "/api/v1/firewall/sections/{sectionId}/rules", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesCreatemultipleInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["firewall_rule_list"] = bindings.NewReferenceType(model.FirewallRuleListBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["firewall_rule_list"] = "FirewallRuleList" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesCreatemultipleOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallRuleListBindingType) +} + +func rulesCreatemultipleRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["firewall_rule_list"] = bindings.NewReferenceType(model.FirewallRuleListBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["firewall_rule_list"] = "FirewallRuleList" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + paramsTypeMap["id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["firewall_rule_list"] = bindings.NewReferenceType(model.FirewallRuleListBindingType) + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + queryParams["id"] = "id" + queryParams["operation"] = "operation" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=create_multiple", + "firewall_rule_list", + "POST", + "/api/v1/firewall/sections/{sectionId}/rules", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["rule_id"] = "RuleId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func rulesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["rule_id"] = "RuleId" + paramsTypeMap["rule_id"] = bindings.NewStringType() + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["sectionId"] = bindings.NewStringType() + paramsTypeMap["ruleId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + pathParams["rule_id"] = "ruleId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/firewall/sections/{sectionId}/rules/{ruleId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["rule_id"] = "RuleId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallRuleBindingType) +} + +func rulesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["rule_id"] = "RuleId" + paramsTypeMap["rule_id"] = bindings.NewStringType() + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["sectionId"] = bindings.NewStringType() + paramsTypeMap["ruleId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + pathParams["rule_id"] = "ruleId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/firewall/sections/{sectionId}/rules/{ruleId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["applied_tos"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["context_profiles"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["deep_search"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["destinations"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["extended_sources"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["filter_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["search_invalid_references"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["services"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sources"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["applied_tos"] = "AppliedTos" + fieldNameMap["context_profiles"] = "ContextProfiles" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["deep_search"] = "DeepSearch" + fieldNameMap["destinations"] = "Destinations" + fieldNameMap["extended_sources"] = "ExtendedSources" + fieldNameMap["filter_type"] = "FilterType" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["search_invalid_references"] = "SearchInvalidReferences" + fieldNameMap["services"] = "Services" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["sources"] = "Sources" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallRuleListResultBindingType) +} + +func rulesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["applied_tos"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["context_profiles"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["deep_search"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["destinations"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["extended_sources"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["filter_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["search_invalid_references"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["services"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sources"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["applied_tos"] = "AppliedTos" + fieldNameMap["context_profiles"] = "ContextProfiles" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["deep_search"] = "DeepSearch" + fieldNameMap["destinations"] = "Destinations" + fieldNameMap["extended_sources"] = "ExtendedSources" + fieldNameMap["filter_type"] = "FilterType" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["search_invalid_references"] = "SearchInvalidReferences" + fieldNameMap["services"] = "Services" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["sources"] = "Sources" + paramsTypeMap["sources"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["destinations"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["context_profiles"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["filter_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["extended_sources"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["applied_tos"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["search_invalid_references"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["services"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["deep_search"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + queryParams["cursor"] = "cursor" + queryParams["sources"] = "sources" + queryParams["deep_search"] = "deep_search" + queryParams["destinations"] = "destinations" + queryParams["context_profiles"] = "context_profiles" + queryParams["services"] = "services" + queryParams["sort_by"] = "sort_by" + queryParams["extended_sources"] = "extended_sources" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["filter_type"] = "filter_type" + queryParams["included_fields"] = "included_fields" + queryParams["applied_tos"] = "applied_tos" + queryParams["search_invalid_references"] = "search_invalid_references" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/firewall/sections/{sectionId}/rules", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesReviseInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fields["firewall_rule"] = bindings.NewReferenceType(model.FirewallRuleBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["rule_id"] = "RuleId" + fieldNameMap["firewall_rule"] = "FirewallRule" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesReviseOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallRuleBindingType) +} + +func rulesReviseRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fields["firewall_rule"] = bindings.NewReferenceType(model.FirewallRuleBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["rule_id"] = "RuleId" + fieldNameMap["firewall_rule"] = "FirewallRule" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + paramsTypeMap["rule_id"] = bindings.NewStringType() + paramsTypeMap["firewall_rule"] = bindings.NewReferenceType(model.FirewallRuleBindingType) + paramsTypeMap["id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sectionId"] = bindings.NewStringType() + paramsTypeMap["ruleId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + pathParams["rule_id"] = "ruleId" + queryParams["id"] = "id" + queryParams["operation"] = "operation" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=revise", + "firewall_rule", + "POST", + "/api/v1/firewall/sections/{sectionId}/rules/{ruleId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fields["firewall_rule"] = bindings.NewReferenceType(model.FirewallRuleBindingType) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["rule_id"] = "RuleId" + fieldNameMap["firewall_rule"] = "FirewallRule" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallRuleBindingType) +} + +func rulesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fields["firewall_rule"] = bindings.NewReferenceType(model.FirewallRuleBindingType) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["rule_id"] = "RuleId" + fieldNameMap["firewall_rule"] = "FirewallRule" + paramsTypeMap["rule_id"] = bindings.NewStringType() + paramsTypeMap["firewall_rule"] = bindings.NewReferenceType(model.FirewallRuleBindingType) + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["sectionId"] = bindings.NewStringType() + paramsTypeMap["ruleId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + pathParams["rule_id"] = "ruleId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "firewall_rule", + "PUT", + "/api/v1/firewall/sections/{sectionId}/rules/{ruleId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/firewall/sections/SectionsPackageTypes.go b/services/nsxt-mp/nsx/firewall/sections/SectionsPackageTypes.go new file mode 100644 index 000000000..47c733ad9 --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/sections/SectionsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.firewall.sections. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package sections diff --git a/services/nsxt-mp/nsx/firewall/sections/StateClient.go b/services/nsxt-mp/nsx/firewall/sections/StateClient.go new file mode 100644 index 000000000..65e04e541 --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/sections/StateClient.go @@ -0,0 +1,94 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: State +// Used by client-side stubs. + +package sections + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StateClient interface { + + // Return realized state information of a firewall section. + // + // @param sectionIdParam (required) + // @param barrierIdParam (optional) + // @param requestIdParam Realization request ID (optional) + // @return com.vmware.nsx.model.FirewallSectionState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(sectionIdParam string, barrierIdParam *int64, requestIdParam *string) (model.FirewallSectionState, error) +} + +type stateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStateClient(connector client.Connector) *stateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.firewall.sections.state") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := stateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *stateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *stateClient) Get(sectionIdParam string, barrierIdParam *int64, requestIdParam *string) (model.FirewallSectionState, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(stateGetInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("BarrierId", barrierIdParam) + sv.AddStructField("RequestId", requestIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallSectionState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections.state", "get", inputDataValue, executionContext) + var emptyOutput model.FirewallSectionState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallSectionState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/firewall/sections/StateTypes.go b/services/nsxt-mp/nsx/firewall/sections/StateTypes.go new file mode 100644 index 000000000..766829368 --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/sections/StateTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: State. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package sections + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func stateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["barrier_id"] = "BarrierId" + fieldNameMap["request_id"] = "RequestId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallSectionStateBindingType) +} + +func stateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["barrier_id"] = "BarrierId" + fieldNameMap["request_id"] = "RequestId" + paramsTypeMap["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + queryParams["barrier_id"] = "barrier_id" + queryParams["request_id"] = "request_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/firewall/sections/{sectionId}/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/firewall/sections/SummaryClient.go b/services/nsxt-mp/nsx/firewall/sections/SummaryClient.go new file mode 100644 index 000000000..53b8e4580 --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/sections/SummaryClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Summary +// Used by client-side stubs. + +package sections + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SummaryClient interface { + + // List the summary of number of sections and number of rules for each firewall category (L2DFW, L3DFW). + // + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.FirewallSectionsSummaryList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(sourceParam *string) (model.FirewallSectionsSummaryList, error) +} + +type summaryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSummaryClient(connector client.Connector) *summaryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.firewall.sections.summary") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := summaryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *summaryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *summaryClient) Get(sourceParam *string) (model.FirewallSectionsSummaryList, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(summaryGetInputType(), typeConverter) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallSectionsSummaryList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := summaryGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections.summary", "get", inputDataValue, executionContext) + var emptyOutput model.FirewallSectionsSummaryList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), summaryGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallSectionsSummaryList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/firewall/sections/SummaryTypes.go b/services/nsxt-mp/nsx/firewall/sections/SummaryTypes.go new file mode 100644 index 000000000..efbde5100 --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/sections/SummaryTypes.go @@ -0,0 +1,74 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Summary. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package sections + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Summary#get. +const Summary_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Summary#get. +const Summary_GET_SOURCE_CACHED = "cached" + +func summaryGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func summaryGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallSectionsSummaryListBindingType) +} + +func summaryGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/firewall/sections/summary", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/firewall/sections/rules/RulesPackageTypes.go b/services/nsxt-mp/nsx/firewall/sections/rules/RulesPackageTypes.go new file mode 100644 index 000000000..fe2dc99d4 --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/sections/rules/RulesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.firewall.sections.rules. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package rules diff --git a/services/nsxt-mp/nsx/firewall/sections/rules/StatsClient.go b/services/nsxt-mp/nsx/firewall/sections/rules/StatsClient.go new file mode 100644 index 000000000..a010779b0 --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/sections/rules/StatsClient.go @@ -0,0 +1,139 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Stats +// Used by client-side stubs. + +package rules + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatsClient interface { + + // Get aggregated statistics for all rules for a given firewall section. The API only supports access to cached (source=cached) statistical data collected offline in the system. Data includes total number of packets, bytes, sessions counters and popularity index for a firewall rule and overall session count, max session count and max popularity index for all firewall rules on transport nodes or edge nodes. Aggregated statistics like maximum popularity index, maximum session count and total session count are computed with lower frequency compared to individual generic rule statistics, hence they may have a computation delay up to 15 minutes to reflect in response to this API. + // + // @param sectionIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.FirewallStatsList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(sectionIdParam string, sourceParam *string) (model.FirewallStatsList, error) + + // Get aggregated statistics for a rule for given firewall section. The API only supports access to cached (source=cached) statistical data collected offline in the system. Data includes total number of packets, bytes, sessions counters and popularity index for a firewall rule and overall session count, max session count and max popularity index for all firewall rules on transport nodes or edge nodes. Aggregated statistics like maximum popularity index, maximum session count and total session count are computed with lower frequency compared to individual generic rule statistics, hence they may have a computation delay up to 15 minutes to reflect in response to this API. + // + // @param sectionIdParam (required) + // @param ruleIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.FirewallStats + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get0(sectionIdParam string, ruleIdParam string, sourceParam *string) (model.FirewallStats, error) +} + +type statsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatsClient(connector client.Connector) *statsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.firewall.sections.rules.stats") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "get_0": core.NewMethodIdentifier(interfaceIdentifier, "get_0"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statsClient) Get(sectionIdParam string, sourceParam *string) (model.FirewallStatsList, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statsGetInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallStatsList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections.rules.stats", "get", inputDataValue, executionContext) + var emptyOutput model.FirewallStatsList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallStatsList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statsClient) Get0(sectionIdParam string, ruleIdParam string, sourceParam *string) (model.FirewallStats, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statsGet0InputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("RuleId", ruleIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FirewallStats + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statsGet0RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.firewall.sections.rules.stats", "get_0", inputDataValue, executionContext) + var emptyOutput model.FirewallStats + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statsGet0OutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FirewallStats), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/firewall/sections/rules/StatsTypes.go b/services/nsxt-mp/nsx/firewall/sections/rules/StatsTypes.go new file mode 100644 index 000000000..7a7010bfa --- /dev/null +++ b/services/nsxt-mp/nsx/firewall/sections/rules/StatsTypes.go @@ -0,0 +1,150 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Stats. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package rules + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Stats#get. +const Stats_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Stats#get. +const Stats_GET_SOURCE_CACHED = "cached" + +// Possible value for ``source`` of method Stats#get0. +const Stats_GET_0_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Stats#get0. +const Stats_GET_0_SOURCE_CACHED = "cached" + +func statsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallStatsListBindingType) +} + +func statsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/firewall/sections/{sectionId}/rules/stats", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statsGet0InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["rule_id"] = "RuleId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statsGet0OutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FirewallStatsBindingType) +} + +func statsGet0RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["rule_id"] = "RuleId" + fieldNameMap["source"] = "Source" + paramsTypeMap["rule_id"] = bindings.NewStringType() + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["sectionId"] = bindings.NewStringType() + paramsTypeMap["ruleId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + pathParams["rule_id"] = "ruleId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/firewall/sections/{sectionId}/rules/{ruleId}/stats", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/idfw/IdfwComputeCollectionsClient.go b/services/nsxt-mp/nsx/idfw/IdfwComputeCollectionsClient.go new file mode 100644 index 000000000..e10499f62 --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/IdfwComputeCollectionsClient.go @@ -0,0 +1,222 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: IdfwComputeCollections +// Used by client-side stubs. + +package idfw + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type IdfwComputeCollectionsClient interface { + + // Delete individual compute collections for IDFW. + // + // @param ccExtIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(ccExtIdParam string) error + + // Get enable/disable status of individual compute collections for IDFW. + // + // @param ccExtIdParam (required) + // @return com.vmware.nsx.model.IdfwEnabledComputeCollection + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ccExtIdParam string) (model.IdfwEnabledComputeCollection, error) + + // List all Identity firewall compute collections. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.IdfwEnabledComputeCollectionListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IdfwEnabledComputeCollectionListResult, error) + + // Enable/disable individual compute collections for IDFW. + // + // @param ccExtIdParam (required) + // @param idfwEnabledComputeCollectionParam (required) + // @return com.vmware.nsx.model.IdfwEnabledComputeCollection + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(ccExtIdParam string, idfwEnabledComputeCollectionParam model.IdfwEnabledComputeCollection) (model.IdfwEnabledComputeCollection, error) +} + +type idfwComputeCollectionsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewIdfwComputeCollectionsClient(connector client.Connector) *idfwComputeCollectionsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.idfw.idfw_compute_collections") + methodIdentifiers := map[string]core.MethodIdentifier{ + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := idfwComputeCollectionsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *idfwComputeCollectionsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *idfwComputeCollectionsClient) Delete(ccExtIdParam string) error { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(idfwComputeCollectionsDeleteInputType(), typeConverter) + sv.AddStructField("CcExtId", ccExtIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := idfwComputeCollectionsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.idfw.idfw_compute_collections", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *idfwComputeCollectionsClient) Get(ccExtIdParam string) (model.IdfwEnabledComputeCollection, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(idfwComputeCollectionsGetInputType(), typeConverter) + sv.AddStructField("CcExtId", ccExtIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IdfwEnabledComputeCollection + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := idfwComputeCollectionsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.idfw.idfw_compute_collections", "get", inputDataValue, executionContext) + var emptyOutput model.IdfwEnabledComputeCollection + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), idfwComputeCollectionsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IdfwEnabledComputeCollection), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *idfwComputeCollectionsClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IdfwEnabledComputeCollectionListResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(idfwComputeCollectionsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IdfwEnabledComputeCollectionListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := idfwComputeCollectionsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.idfw.idfw_compute_collections", "list", inputDataValue, executionContext) + var emptyOutput model.IdfwEnabledComputeCollectionListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), idfwComputeCollectionsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IdfwEnabledComputeCollectionListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *idfwComputeCollectionsClient) Update(ccExtIdParam string, idfwEnabledComputeCollectionParam model.IdfwEnabledComputeCollection) (model.IdfwEnabledComputeCollection, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(idfwComputeCollectionsUpdateInputType(), typeConverter) + sv.AddStructField("CcExtId", ccExtIdParam) + sv.AddStructField("IdfwEnabledComputeCollection", idfwEnabledComputeCollectionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IdfwEnabledComputeCollection + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := idfwComputeCollectionsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.idfw.idfw_compute_collections", "update", inputDataValue, executionContext) + var emptyOutput model.IdfwEnabledComputeCollection + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), idfwComputeCollectionsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IdfwEnabledComputeCollection), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/idfw/IdfwComputeCollectionsTypes.go b/services/nsxt-mp/nsx/idfw/IdfwComputeCollectionsTypes.go new file mode 100644 index 000000000..412e3d48f --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/IdfwComputeCollectionsTypes.go @@ -0,0 +1,247 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: IdfwComputeCollections. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package idfw + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func idfwComputeCollectionsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cc_ext_id"] = bindings.NewStringType() + fieldNameMap["cc_ext_id"] = "CcExtId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func idfwComputeCollectionsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func idfwComputeCollectionsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cc_ext_id"] = bindings.NewStringType() + fieldNameMap["cc_ext_id"] = "CcExtId" + paramsTypeMap["cc_ext_id"] = bindings.NewStringType() + paramsTypeMap["ccExtId"] = bindings.NewStringType() + pathParams["cc_ext_id"] = "ccExtId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/idfw/idfw-compute-collections/{ccExtId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func idfwComputeCollectionsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cc_ext_id"] = bindings.NewStringType() + fieldNameMap["cc_ext_id"] = "CcExtId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func idfwComputeCollectionsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IdfwEnabledComputeCollectionBindingType) +} + +func idfwComputeCollectionsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cc_ext_id"] = bindings.NewStringType() + fieldNameMap["cc_ext_id"] = "CcExtId" + paramsTypeMap["cc_ext_id"] = bindings.NewStringType() + paramsTypeMap["ccExtId"] = bindings.NewStringType() + pathParams["cc_ext_id"] = "ccExtId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/idfw/idfw-compute-collections/{ccExtId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func idfwComputeCollectionsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func idfwComputeCollectionsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IdfwEnabledComputeCollectionListResultBindingType) +} + +func idfwComputeCollectionsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/idfw/idfw-compute-collections", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func idfwComputeCollectionsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cc_ext_id"] = bindings.NewStringType() + fields["idfw_enabled_compute_collection"] = bindings.NewReferenceType(model.IdfwEnabledComputeCollectionBindingType) + fieldNameMap["cc_ext_id"] = "CcExtId" + fieldNameMap["idfw_enabled_compute_collection"] = "IdfwEnabledComputeCollection" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func idfwComputeCollectionsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IdfwEnabledComputeCollectionBindingType) +} + +func idfwComputeCollectionsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cc_ext_id"] = bindings.NewStringType() + fields["idfw_enabled_compute_collection"] = bindings.NewReferenceType(model.IdfwEnabledComputeCollectionBindingType) + fieldNameMap["cc_ext_id"] = "CcExtId" + fieldNameMap["idfw_enabled_compute_collection"] = "IdfwEnabledComputeCollection" + paramsTypeMap["idfw_enabled_compute_collection"] = bindings.NewReferenceType(model.IdfwEnabledComputeCollectionBindingType) + paramsTypeMap["cc_ext_id"] = bindings.NewStringType() + paramsTypeMap["ccExtId"] = bindings.NewStringType() + pathParams["cc_ext_id"] = "ccExtId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "idfw_enabled_compute_collection", + "PUT", + "/api/v1/idfw/idfw-compute-collections/{ccExtId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/idfw/IdfwPackageTypes.go b/services/nsxt-mp/nsx/idfw/IdfwPackageTypes.go new file mode 100644 index 000000000..006d2977f --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/IdfwPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.idfw. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package idfw diff --git a/services/nsxt-mp/nsx/idfw/MasterSwitchSettingClient.go b/services/nsxt-mp/nsx/idfw/MasterSwitchSettingClient.go new file mode 100644 index 000000000..84f288b93 --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/MasterSwitchSettingClient.go @@ -0,0 +1,130 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MasterSwitchSetting +// Used by client-side stubs. + +package idfw + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MasterSwitchSettingClient interface { + + // Fetches IDFW master switch setting to check whether master switch is enabled or disabled + // @return com.vmware.nsx.model.IdfwMasterSwitchSetting + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.IdfwMasterSwitchSetting, error) + + // Update Identity Firewall master switch setting (true=enabled / false=disabled). Identity Firewall master switch setting enables or disables Identity Firewall feature across the system. It affects compute collections, hypervisor and virtual machines. This operation is expensive and also has big impact and implication on system perforamce. + // + // @param idfwMasterSwitchSettingParam (required) + // @return com.vmware.nsx.model.IdfwMasterSwitchSetting + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(idfwMasterSwitchSettingParam model.IdfwMasterSwitchSetting) (model.IdfwMasterSwitchSetting, error) +} + +type masterSwitchSettingClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMasterSwitchSettingClient(connector client.Connector) *masterSwitchSettingClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.idfw.master_switch_setting") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := masterSwitchSettingClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *masterSwitchSettingClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *masterSwitchSettingClient) Get() (model.IdfwMasterSwitchSetting, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(masterSwitchSettingGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IdfwMasterSwitchSetting + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := masterSwitchSettingGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.idfw.master_switch_setting", "get", inputDataValue, executionContext) + var emptyOutput model.IdfwMasterSwitchSetting + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), masterSwitchSettingGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IdfwMasterSwitchSetting), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *masterSwitchSettingClient) Update(idfwMasterSwitchSettingParam model.IdfwMasterSwitchSetting) (model.IdfwMasterSwitchSetting, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(masterSwitchSettingUpdateInputType(), typeConverter) + sv.AddStructField("IdfwMasterSwitchSetting", idfwMasterSwitchSettingParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IdfwMasterSwitchSetting + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := masterSwitchSettingUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.idfw.master_switch_setting", "update", inputDataValue, executionContext) + var emptyOutput model.IdfwMasterSwitchSetting + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), masterSwitchSettingUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IdfwMasterSwitchSetting), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/idfw/MasterSwitchSettingTypes.go b/services/nsxt-mp/nsx/idfw/MasterSwitchSettingTypes.go new file mode 100644 index 000000000..bb98067fd --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/MasterSwitchSettingTypes.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MasterSwitchSetting. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package idfw + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func masterSwitchSettingGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func masterSwitchSettingGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IdfwMasterSwitchSettingBindingType) +} + +func masterSwitchSettingGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/idfw/master-switch-setting", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func masterSwitchSettingUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["idfw_master_switch_setting"] = bindings.NewReferenceType(model.IdfwMasterSwitchSettingBindingType) + fieldNameMap["idfw_master_switch_setting"] = "IdfwMasterSwitchSetting" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func masterSwitchSettingUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IdfwMasterSwitchSettingBindingType) +} + +func masterSwitchSettingUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["idfw_master_switch_setting"] = bindings.NewReferenceType(model.IdfwMasterSwitchSettingBindingType) + fieldNameMap["idfw_master_switch_setting"] = "IdfwMasterSwitchSetting" + paramsTypeMap["idfw_master_switch_setting"] = bindings.NewReferenceType(model.IdfwMasterSwitchSettingBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "idfw_master_switch_setting", + "PUT", + "/api/v1/idfw/master-switch-setting", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/idfw/NsgroupVmDetailsClient.go b/services/nsxt-mp/nsx/idfw/NsgroupVmDetailsClient.go new file mode 100644 index 000000000..b50a99bfa --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/NsgroupVmDetailsClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: NsgroupVmDetails +// Used by client-side stubs. + +package idfw + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NsgroupVmDetailsClient interface { + + // Get all Identity Firewall NSGroup VM details for a given NSGroup. + // + // @param groupIdParam (required) + // @return com.vmware.nsx.model.IdfwNsgroupVmDetailListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(groupIdParam string) (model.IdfwNsgroupVmDetailListResult, error) +} + +type nsgroupVmDetailsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNsgroupVmDetailsClient(connector client.Connector) *nsgroupVmDetailsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.idfw.nsgroup_vm_details") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nsgroupVmDetailsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nsgroupVmDetailsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nsgroupVmDetailsClient) List(groupIdParam string) (model.IdfwNsgroupVmDetailListResult, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsgroupVmDetailsListInputType(), typeConverter) + sv.AddStructField("GroupId", groupIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IdfwNsgroupVmDetailListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsgroupVmDetailsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.idfw.nsgroup_vm_details", "list", inputDataValue, executionContext) + var emptyOutput model.IdfwNsgroupVmDetailListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsgroupVmDetailsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IdfwNsgroupVmDetailListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/idfw/NsgroupVmDetailsTypes.go b/services/nsxt-mp/nsx/idfw/NsgroupVmDetailsTypes.go new file mode 100644 index 000000000..6ff065687 --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/NsgroupVmDetailsTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: NsgroupVmDetails. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package idfw + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func nsgroupVmDetailsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["group_id"] = bindings.NewStringType() + fieldNameMap["group_id"] = "GroupId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsgroupVmDetailsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IdfwNsgroupVmDetailListResultBindingType) +} + +func nsgroupVmDetailsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["group_id"] = bindings.NewStringType() + fieldNameMap["group_id"] = "GroupId" + paramsTypeMap["group_id"] = bindings.NewStringType() + paramsTypeMap["groupId"] = bindings.NewStringType() + pathParams["group_id"] = "groupId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/idfw/nsgroup-vm-details/{groupId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/idfw/StandaloneHostSwitchSettingClient.go b/services/nsxt-mp/nsx/idfw/StandaloneHostSwitchSettingClient.go new file mode 100644 index 000000000..18b422ab2 --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/StandaloneHostSwitchSettingClient.go @@ -0,0 +1,130 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: StandaloneHostSwitchSetting +// Used by client-side stubs. + +package idfw + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StandaloneHostSwitchSettingClient interface { + + // Fetches IDFW standalone hosts switch setting to check whether standalone hosts is enabled or disabled + // @return com.vmware.nsx.model.IdfwStandaloneHostsSwitchSetting + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.IdfwStandaloneHostsSwitchSetting, error) + + // Update Identity Firewall standalone hosts switch setting (true=enabled / false=disabled). + // + // @param idfwStandaloneHostsSwitchSettingParam (required) + // @return com.vmware.nsx.model.IdfwStandaloneHostsSwitchSetting + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(idfwStandaloneHostsSwitchSettingParam model.IdfwStandaloneHostsSwitchSetting) (model.IdfwStandaloneHostsSwitchSetting, error) +} + +type standaloneHostSwitchSettingClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStandaloneHostSwitchSettingClient(connector client.Connector) *standaloneHostSwitchSettingClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.idfw.standalone_host_switch_setting") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := standaloneHostSwitchSettingClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *standaloneHostSwitchSettingClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *standaloneHostSwitchSettingClient) Get() (model.IdfwStandaloneHostsSwitchSetting, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(standaloneHostSwitchSettingGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IdfwStandaloneHostsSwitchSetting + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := standaloneHostSwitchSettingGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.idfw.standalone_host_switch_setting", "get", inputDataValue, executionContext) + var emptyOutput model.IdfwStandaloneHostsSwitchSetting + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), standaloneHostSwitchSettingGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IdfwStandaloneHostsSwitchSetting), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *standaloneHostSwitchSettingClient) Update(idfwStandaloneHostsSwitchSettingParam model.IdfwStandaloneHostsSwitchSetting) (model.IdfwStandaloneHostsSwitchSetting, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(standaloneHostSwitchSettingUpdateInputType(), typeConverter) + sv.AddStructField("IdfwStandaloneHostsSwitchSetting", idfwStandaloneHostsSwitchSettingParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IdfwStandaloneHostsSwitchSetting + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := standaloneHostSwitchSettingUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.idfw.standalone_host_switch_setting", "update", inputDataValue, executionContext) + var emptyOutput model.IdfwStandaloneHostsSwitchSetting + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), standaloneHostSwitchSettingUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IdfwStandaloneHostsSwitchSetting), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/idfw/StandaloneHostSwitchSettingTypes.go b/services/nsxt-mp/nsx/idfw/StandaloneHostSwitchSettingTypes.go new file mode 100644 index 000000000..9e60e28f5 --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/StandaloneHostSwitchSettingTypes.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: StandaloneHostSwitchSetting. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package idfw + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func standaloneHostSwitchSettingGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func standaloneHostSwitchSettingGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IdfwStandaloneHostsSwitchSettingBindingType) +} + +func standaloneHostSwitchSettingGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/idfw/standalone-host-switch-setting", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func standaloneHostSwitchSettingUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["idfw_standalone_hosts_switch_setting"] = bindings.NewReferenceType(model.IdfwStandaloneHostsSwitchSettingBindingType) + fieldNameMap["idfw_standalone_hosts_switch_setting"] = "IdfwStandaloneHostsSwitchSetting" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func standaloneHostSwitchSettingUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IdfwStandaloneHostsSwitchSettingBindingType) +} + +func standaloneHostSwitchSettingUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["idfw_standalone_hosts_switch_setting"] = bindings.NewReferenceType(model.IdfwStandaloneHostsSwitchSettingBindingType) + fieldNameMap["idfw_standalone_hosts_switch_setting"] = "IdfwStandaloneHostsSwitchSetting" + paramsTypeMap["idfw_standalone_hosts_switch_setting"] = bindings.NewReferenceType(model.IdfwStandaloneHostsSwitchSettingBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "idfw_standalone_hosts_switch_setting", + "PUT", + "/api/v1/idfw/standalone-host-switch-setting", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/idfw/SystemStatsClient.go b/services/nsxt-mp/nsx/idfw/SystemStatsClient.go new file mode 100644 index 000000000..34e7c2279 --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/SystemStatsClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: SystemStats +// Used by client-side stubs. + +package idfw + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SystemStatsClient interface { + + // Get IDFW system statistics data. + // @return com.vmware.nsx.model.IdfwSystemStats + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.IdfwSystemStats, error) +} + +type systemStatsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSystemStatsClient(connector client.Connector) *systemStatsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.idfw.system_stats") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := systemStatsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *systemStatsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *systemStatsClient) Get() (model.IdfwSystemStats, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(systemStatsGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IdfwSystemStats + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := systemStatsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.idfw.system_stats", "get", inputDataValue, executionContext) + var emptyOutput model.IdfwSystemStats + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), systemStatsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IdfwSystemStats), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/idfw/SystemStatsTypes.go b/services/nsxt-mp/nsx/idfw/SystemStatsTypes.go new file mode 100644 index 000000000..d4fa9d718 --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/SystemStatsTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: SystemStats. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package idfw + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func systemStatsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func systemStatsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IdfwSystemStatsBindingType) +} + +func systemStatsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/idfw/system-stats", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/idfw/UserSessionDataClient.go b/services/nsxt-mp/nsx/idfw/UserSessionDataClient.go new file mode 100644 index 000000000..9c36e431c --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/UserSessionDataClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: UserSessionData +// Used by client-side stubs. + +package idfw + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UserSessionDataClient interface { + + // Get user session data. + // @return com.vmware.nsx.model.IdfwUserSessionDataAndMappings + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.IdfwUserSessionDataAndMappings, error) +} + +type userSessionDataClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUserSessionDataClient(connector client.Connector) *userSessionDataClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.idfw.user_session_data") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := userSessionDataClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *userSessionDataClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *userSessionDataClient) Get() (model.IdfwUserSessionDataAndMappings, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(userSessionDataGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IdfwUserSessionDataAndMappings + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := userSessionDataGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.idfw.user_session_data", "get", inputDataValue, executionContext) + var emptyOutput model.IdfwUserSessionDataAndMappings + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), userSessionDataGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IdfwUserSessionDataAndMappings), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/idfw/UserSessionDataTypes.go b/services/nsxt-mp/nsx/idfw/UserSessionDataTypes.go new file mode 100644 index 000000000..b020877c8 --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/UserSessionDataTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: UserSessionData. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package idfw + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func userSessionDataGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func userSessionDataGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IdfwUserSessionDataAndMappingsBindingType) +} + +func userSessionDataGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/idfw/user-session-data", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/idfw/UserStatsClient.go b/services/nsxt-mp/nsx/idfw/UserStatsClient.go new file mode 100644 index 000000000..6b148503b --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/UserStatsClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: UserStats +// Used by client-side stubs. + +package idfw + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UserStatsClient interface { + + // Get IDFW user login events for a given user (all active plus up to 5 most recent archived entries). + // + // @param userIdParam (required) + // @return com.vmware.nsx.model.IdfwUserStats + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(userIdParam string) (model.IdfwUserStats, error) +} + +type userStatsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUserStatsClient(connector client.Connector) *userStatsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.idfw.user_stats") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := userStatsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *userStatsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *userStatsClient) Get(userIdParam string) (model.IdfwUserStats, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(userStatsGetInputType(), typeConverter) + sv.AddStructField("UserId", userIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IdfwUserStats + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := userStatsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.idfw.user_stats", "get", inputDataValue, executionContext) + var emptyOutput model.IdfwUserStats + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), userStatsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IdfwUserStats), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/idfw/UserStatsTypes.go b/services/nsxt-mp/nsx/idfw/UserStatsTypes.go new file mode 100644 index 000000000..677c180f9 --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/UserStatsTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: UserStats. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package idfw + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func userStatsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["user_id"] = bindings.NewStringType() + fieldNameMap["user_id"] = "UserId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func userStatsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IdfwUserStatsBindingType) +} + +func userStatsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["user_id"] = bindings.NewStringType() + fieldNameMap["user_id"] = "UserId" + paramsTypeMap["user_id"] = bindings.NewStringType() + paramsTypeMap["userId"] = bindings.NewStringType() + pathParams["user_id"] = "userId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/idfw/user-stats/{userId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/idfw/VmStatsClient.go b/services/nsxt-mp/nsx/idfw/VmStatsClient.go new file mode 100644 index 000000000..722236e60 --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/VmStatsClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: VmStats +// Used by client-side stubs. + +package idfw + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type VmStatsClient interface { + + // Get IDFW user login events for a given VM (all active plus up to 5 most recent archived entries). + // + // @param vmExtIdParam (required) + // @return com.vmware.nsx.model.IdfwVmStats + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(vmExtIdParam string) (model.IdfwVmStats, error) +} + +type vmStatsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewVmStatsClient(connector client.Connector) *vmStatsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.idfw.vm_stats") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + vIface := vmStatsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &vIface +} + +func (vIface *vmStatsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := vIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (vIface *vmStatsClient) Get(vmExtIdParam string) (model.IdfwVmStats, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(vmStatsGetInputType(), typeConverter) + sv.AddStructField("VmExtId", vmExtIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IdfwVmStats + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := vmStatsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.idfw.vm_stats", "get", inputDataValue, executionContext) + var emptyOutput model.IdfwVmStats + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), vmStatsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IdfwVmStats), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/idfw/VmStatsTypes.go b/services/nsxt-mp/nsx/idfw/VmStatsTypes.go new file mode 100644 index 000000000..92556fec9 --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/VmStatsTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: VmStats. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package idfw + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func vmStatsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["vm_ext_id"] = bindings.NewStringType() + fieldNameMap["vm_ext_id"] = "VmExtId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func vmStatsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IdfwVmStatsBindingType) +} + +func vmStatsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["vm_ext_id"] = bindings.NewStringType() + fieldNameMap["vm_ext_id"] = "VmExtId" + paramsTypeMap["vm_ext_id"] = bindings.NewStringType() + paramsTypeMap["vmExtId"] = bindings.NewStringType() + pathParams["vm_ext_id"] = "vmExtId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/idfw/vm-stats/{vmExtId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/idfw/compute_collections/ComputeCollectionsPackageTypes.go b/services/nsxt-mp/nsx/idfw/compute_collections/ComputeCollectionsPackageTypes.go new file mode 100644 index 000000000..e33a3f29d --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/compute_collections/ComputeCollectionsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.idfw.compute_collections. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package compute_collections diff --git a/services/nsxt-mp/nsx/idfw/compute_collections/StatusClient.go b/services/nsxt-mp/nsx/idfw/compute_collections/StatusClient.go new file mode 100644 index 000000000..6758e5473 --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/compute_collections/StatusClient.go @@ -0,0 +1,130 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package compute_collections + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Retrieve the compute collection status by ID. + // + // @param computeCollectionExtIdParam (required) + // @return com.vmware.nsx.model.IdfwComputeCollectionStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(computeCollectionExtIdParam string) (model.IdfwComputeCollectionStatus, error) + + // Retrieve all the Compute collection status. + // @return com.vmware.nsx.model.IdfwComputeCollectionListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.IdfwComputeCollectionListResult, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.idfw.compute_collections.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(computeCollectionExtIdParam string) (model.IdfwComputeCollectionStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("ComputeCollectionExtId", computeCollectionExtIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IdfwComputeCollectionStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.idfw.compute_collections.status", "get", inputDataValue, executionContext) + var emptyOutput model.IdfwComputeCollectionStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IdfwComputeCollectionStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statusClient) List() (model.IdfwComputeCollectionListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IdfwComputeCollectionListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.idfw.compute_collections.status", "list", inputDataValue, executionContext) + var emptyOutput model.IdfwComputeCollectionListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IdfwComputeCollectionListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/idfw/compute_collections/StatusTypes.go b/services/nsxt-mp/nsx/idfw/compute_collections/StatusTypes.go new file mode 100644 index 000000000..52f3789e9 --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/compute_collections/StatusTypes.go @@ -0,0 +1,112 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package compute_collections + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["compute_collection_ext_id"] = bindings.NewStringType() + fieldNameMap["compute_collection_ext_id"] = "ComputeCollectionExtId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IdfwComputeCollectionStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["compute_collection_ext_id"] = bindings.NewStringType() + fieldNameMap["compute_collection_ext_id"] = "ComputeCollectionExtId" + paramsTypeMap["compute_collection_ext_id"] = bindings.NewStringType() + paramsTypeMap["computeCollectionExtId"] = bindings.NewStringType() + pathParams["compute_collection_ext_id"] = "computeCollectionExtId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/idfw/compute-collections/{computeCollectionExtId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statusListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IdfwComputeCollectionListResultBindingType) +} + +func statusListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/idfw/compute-collections/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/idfw/compute_collections/transport_nodes/StatusClient.go b/services/nsxt-mp/nsx/idfw/compute_collections/transport_nodes/StatusClient.go new file mode 100644 index 000000000..a9e83b6a2 --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/compute_collections/transport_nodes/StatusClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package transport_nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Retrieve all the transport node and status by idfw enabled ComputeCollection ID in the request. + // + // @param ccExtIdParam (required) + // @return com.vmware.nsx.model.IdfwTransportNodeStatusListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(ccExtIdParam string) (model.IdfwTransportNodeStatusListResult, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.idfw.compute_collections.transport_nodes.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) List(ccExtIdParam string) (model.IdfwTransportNodeStatusListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusListInputType(), typeConverter) + sv.AddStructField("CcExtId", ccExtIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IdfwTransportNodeStatusListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.idfw.compute_collections.transport_nodes.status", "list", inputDataValue, executionContext) + var emptyOutput model.IdfwTransportNodeStatusListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IdfwTransportNodeStatusListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/idfw/compute_collections/transport_nodes/StatusTypes.go b/services/nsxt-mp/nsx/idfw/compute_collections/transport_nodes/StatusTypes.go new file mode 100644 index 000000000..ee287903b --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/compute_collections/transport_nodes/StatusTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package transport_nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cc_ext_id"] = bindings.NewStringType() + fieldNameMap["cc_ext_id"] = "CcExtId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IdfwTransportNodeStatusListResultBindingType) +} + +func statusListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cc_ext_id"] = bindings.NewStringType() + fieldNameMap["cc_ext_id"] = "CcExtId" + paramsTypeMap["cc_ext_id"] = bindings.NewStringType() + paramsTypeMap["ccExtId"] = bindings.NewStringType() + pathParams["cc_ext_id"] = "ccExtId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/idfw/compute-collections/{ccExtId}/transport-nodes/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/idfw/compute_collections/transport_nodes/TransportNodesPackageTypes.go b/services/nsxt-mp/nsx/idfw/compute_collections/transport_nodes/TransportNodesPackageTypes.go new file mode 100644 index 000000000..79c2ab1f0 --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/compute_collections/transport_nodes/TransportNodesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.idfw.compute_collections.transport_nodes. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package transport_nodes diff --git a/services/nsxt-mp/nsx/idfw/transport_nodes/vms/StatusClient.go b/services/nsxt-mp/nsx/idfw/transport_nodes/vms/StatusClient.go new file mode 100644 index 000000000..b95a14689 --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/transport_nodes/vms/StatusClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package vms + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Retrieve all the VM and status by transport node ID of idfw enabled compute collection in the request. + // + // @param transportNodeIdParam (required) + // @return com.vmware.nsx.model.IdfwVirtualMachineStatusListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(transportNodeIdParam string) (model.IdfwVirtualMachineStatusListResult, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.idfw.transport_nodes.vms.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) List(transportNodeIdParam string) (model.IdfwVirtualMachineStatusListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusListInputType(), typeConverter) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IdfwVirtualMachineStatusListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.idfw.transport_nodes.vms.status", "list", inputDataValue, executionContext) + var emptyOutput model.IdfwVirtualMachineStatusListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IdfwVirtualMachineStatusListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/idfw/transport_nodes/vms/StatusTypes.go b/services/nsxt-mp/nsx/idfw/transport_nodes/vms/StatusTypes.go new file mode 100644 index 000000000..19f006ecf --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/transport_nodes/vms/StatusTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package vms + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_id"] = bindings.NewStringType() + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IdfwVirtualMachineStatusListResultBindingType) +} + +func statusListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_id"] = bindings.NewStringType() + fieldNameMap["transport_node_id"] = "TransportNodeId" + paramsTypeMap["transport_node_id"] = bindings.NewStringType() + paramsTypeMap["transportNodeId"] = bindings.NewStringType() + pathParams["transport_node_id"] = "transportNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/idfw/transport-nodes/{transportNodeId}/vms/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/idfw/transport_nodes/vms/VmsPackageTypes.go b/services/nsxt-mp/nsx/idfw/transport_nodes/vms/VmsPackageTypes.go new file mode 100644 index 000000000..27802270d --- /dev/null +++ b/services/nsxt-mp/nsx/idfw/transport_nodes/vms/VmsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.idfw.transport_nodes.vms. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package vms diff --git a/services/nsxt-mp/nsx/intelligence/HostConfigClient.go b/services/nsxt-mp/nsx/intelligence/HostConfigClient.go new file mode 100644 index 000000000..7bc8e8612 --- /dev/null +++ b/services/nsxt-mp/nsx/intelligence/HostConfigClient.go @@ -0,0 +1,170 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: HostConfig +// Used by client-side stubs. + +package intelligence + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type HostConfigClient interface { + + // Deprecated - Please use the intelligence API /napp/api/v1/intelligence/data-collection/host-config instead, after installing NSX Intelligence. Get the current NSX-Intelligence host configuration. Recommend to keep the value same for flow_data_collection_interval and context_data_collection_interval. + // @return com.vmware.nsx.model.IntelligenceHostConfigurationInfo + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.IntelligenceHostConfigurationInfo, error) + + // Deprecated - Please use the intelligence API /napp/api/v1/intelligence/data-collection/host-config instead, after installing NSX Intelligence. Patch the current NSX-Intelligence host configuration. Return error if NSX-Intelligence is not registered with NSX. + // + // @param intelligenceHostConfigurationInfoParam (required) + // @return com.vmware.nsx.model.IntelligenceHostConfigurationInfo + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Patch(intelligenceHostConfigurationInfoParam model.IntelligenceHostConfigurationInfo) (model.IntelligenceHostConfigurationInfo, error) + + // Deprecated - Please use the intelligence API /napp/api/v1/intelligence/data-collection/host-config?action=reset instead, after installing NSX Intelligence. Reset NSX-Intelligence host configuration to the default setting. Clear NSX-Intelligence host configuration if NSX-Intelligence is not registered with NSX. Return the NSX-Intelligence host configuration after reset operation. + // @return com.vmware.nsx.model.IntelligenceHostConfigurationInfo + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Reset() (model.IntelligenceHostConfigurationInfo, error) +} + +type hostConfigClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewHostConfigClient(connector client.Connector) *hostConfigClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.intelligence.host_config") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "patch": core.NewMethodIdentifier(interfaceIdentifier, "patch"), + "reset": core.NewMethodIdentifier(interfaceIdentifier, "reset"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + hIface := hostConfigClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &hIface +} + +func (hIface *hostConfigClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := hIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (hIface *hostConfigClient) Get() (model.IntelligenceHostConfigurationInfo, error) { + typeConverter := hIface.connector.TypeConverter() + executionContext := hIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(hostConfigGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IntelligenceHostConfigurationInfo + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := hostConfigGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + hIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := hIface.connector.GetApiProvider().Invoke("com.vmware.nsx.intelligence.host_config", "get", inputDataValue, executionContext) + var emptyOutput model.IntelligenceHostConfigurationInfo + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), hostConfigGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IntelligenceHostConfigurationInfo), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), hIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (hIface *hostConfigClient) Patch(intelligenceHostConfigurationInfoParam model.IntelligenceHostConfigurationInfo) (model.IntelligenceHostConfigurationInfo, error) { + typeConverter := hIface.connector.TypeConverter() + executionContext := hIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(hostConfigPatchInputType(), typeConverter) + sv.AddStructField("IntelligenceHostConfigurationInfo", intelligenceHostConfigurationInfoParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IntelligenceHostConfigurationInfo + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := hostConfigPatchRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + hIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := hIface.connector.GetApiProvider().Invoke("com.vmware.nsx.intelligence.host_config", "patch", inputDataValue, executionContext) + var emptyOutput model.IntelligenceHostConfigurationInfo + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), hostConfigPatchOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IntelligenceHostConfigurationInfo), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), hIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (hIface *hostConfigClient) Reset() (model.IntelligenceHostConfigurationInfo, error) { + typeConverter := hIface.connector.TypeConverter() + executionContext := hIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(hostConfigResetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IntelligenceHostConfigurationInfo + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := hostConfigResetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + hIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := hIface.connector.GetApiProvider().Invoke("com.vmware.nsx.intelligence.host_config", "reset", inputDataValue, executionContext) + var emptyOutput model.IntelligenceHostConfigurationInfo + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), hostConfigResetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IntelligenceHostConfigurationInfo), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), hIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/intelligence/HostConfigTypes.go b/services/nsxt-mp/nsx/intelligence/HostConfigTypes.go new file mode 100644 index 000000000..c0178b679 --- /dev/null +++ b/services/nsxt-mp/nsx/intelligence/HostConfigTypes.go @@ -0,0 +1,153 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: HostConfig. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package intelligence + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func hostConfigGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func hostConfigGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IntelligenceHostConfigurationInfoBindingType) +} + +func hostConfigGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/intelligence/host-config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func hostConfigPatchInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["intelligence_host_configuration_info"] = bindings.NewReferenceType(model.IntelligenceHostConfigurationInfoBindingType) + fieldNameMap["intelligence_host_configuration_info"] = "IntelligenceHostConfigurationInfo" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func hostConfigPatchOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IntelligenceHostConfigurationInfoBindingType) +} + +func hostConfigPatchRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["intelligence_host_configuration_info"] = bindings.NewReferenceType(model.IntelligenceHostConfigurationInfoBindingType) + fieldNameMap["intelligence_host_configuration_info"] = "IntelligenceHostConfigurationInfo" + paramsTypeMap["intelligence_host_configuration_info"] = bindings.NewReferenceType(model.IntelligenceHostConfigurationInfoBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "intelligence_host_configuration_info", + "PATCH", + "/api/v1/intelligence/host-config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func hostConfigResetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func hostConfigResetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IntelligenceHostConfigurationInfoBindingType) +} + +func hostConfigResetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=reset", + "", + "POST", + "/api/v1/intelligence/host-config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/intelligence/IntelligencePackageTypes.go b/services/nsxt-mp/nsx/intelligence/IntelligencePackageTypes.go new file mode 100644 index 000000000..1f78f8024 --- /dev/null +++ b/services/nsxt-mp/nsx/intelligence/IntelligencePackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.intelligence. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package intelligence diff --git a/services/nsxt-mp/nsx/intelligence/nodes/DeploymentsClient.go b/services/nsxt-mp/nsx/intelligence/nodes/DeploymentsClient.go new file mode 100644 index 000000000..8ab032745 --- /dev/null +++ b/services/nsxt-mp/nsx/intelligence/nodes/DeploymentsClient.go @@ -0,0 +1,211 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Deployments +// Used by client-side stubs. + +package nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type DeploymentsClient interface { + + // Deploys a Intelligence cluster node VM as specified by the deployment config. + // + // @param addIntelligenceClusterNodeVMInfoParam (required) + // @return com.vmware.nsx.model.IntelligenceClusterNodeVMDeploymentRequestList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(addIntelligenceClusterNodeVMInfoParam model.AddIntelligenceClusterNodeVMInfo) (model.IntelligenceClusterNodeVMDeploymentRequestList, error) + + // Attempts to unregister and undeploy a specified auto-deployed cluster node VM. If it is a member of a cluster, then the VM will be automatically detached from the cluster before being unregistered and undeployed. Alternatively, if the original deployment attempt failed or the VM is not found, cleans up the deployment information associated with the deployment attempt. Note: If a VM has been successfully auto-deployed, then the associated deployment information will not be deleted unless and until the VM is successfully deleted. + // + // @param nodeIdParam (required) + // @param forceDeleteParam Delete by force (optional) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(nodeIdParam string, forceDeleteParam *bool) error + + // Returns deployment request information for a specific attempted deployment of a cluster node VM. + // + // @param nodeIdParam (required) + // @return com.vmware.nsx.model.IntelligenceClusterNodeVMDeploymentRequest + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nodeIdParam string) (model.IntelligenceClusterNodeVMDeploymentRequest, error) + + // Returns request information for every attempted deployment of a cluster node VM. + // @return com.vmware.nsx.model.IntelligenceClusterNodeVMDeploymentRequestList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.IntelligenceClusterNodeVMDeploymentRequestList, error) +} + +type deploymentsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewDeploymentsClient(connector client.Connector) *deploymentsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.intelligence.nodes.deployments") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + dIface := deploymentsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &dIface +} + +func (dIface *deploymentsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := dIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (dIface *deploymentsClient) Create(addIntelligenceClusterNodeVMInfoParam model.AddIntelligenceClusterNodeVMInfo) (model.IntelligenceClusterNodeVMDeploymentRequestList, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(deploymentsCreateInputType(), typeConverter) + sv.AddStructField("AddIntelligenceClusterNodeVMInfo", addIntelligenceClusterNodeVMInfoParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IntelligenceClusterNodeVMDeploymentRequestList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := deploymentsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.intelligence.nodes.deployments", "create", inputDataValue, executionContext) + var emptyOutput model.IntelligenceClusterNodeVMDeploymentRequestList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), deploymentsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IntelligenceClusterNodeVMDeploymentRequestList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *deploymentsClient) Delete(nodeIdParam string, forceDeleteParam *bool) error { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(deploymentsDeleteInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("ForceDelete", forceDeleteParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := deploymentsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.intelligence.nodes.deployments", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *deploymentsClient) Get(nodeIdParam string) (model.IntelligenceClusterNodeVMDeploymentRequest, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(deploymentsGetInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IntelligenceClusterNodeVMDeploymentRequest + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := deploymentsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.intelligence.nodes.deployments", "get", inputDataValue, executionContext) + var emptyOutput model.IntelligenceClusterNodeVMDeploymentRequest + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), deploymentsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IntelligenceClusterNodeVMDeploymentRequest), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *deploymentsClient) List() (model.IntelligenceClusterNodeVMDeploymentRequestList, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(deploymentsListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IntelligenceClusterNodeVMDeploymentRequestList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := deploymentsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.intelligence.nodes.deployments", "list", inputDataValue, executionContext) + var emptyOutput model.IntelligenceClusterNodeVMDeploymentRequestList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), deploymentsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IntelligenceClusterNodeVMDeploymentRequestList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/intelligence/nodes/DeploymentsTypes.go b/services/nsxt-mp/nsx/intelligence/nodes/DeploymentsTypes.go new file mode 100644 index 000000000..858bc2ad4 --- /dev/null +++ b/services/nsxt-mp/nsx/intelligence/nodes/DeploymentsTypes.go @@ -0,0 +1,216 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Deployments. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func deploymentsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["add_intelligence_cluster_node_VM_info"] = bindings.NewReferenceType(model.AddIntelligenceClusterNodeVMInfoBindingType) + fieldNameMap["add_intelligence_cluster_node_VM_info"] = "AddIntelligenceClusterNodeVMInfo" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func deploymentsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IntelligenceClusterNodeVMDeploymentRequestListBindingType) +} + +func deploymentsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["add_intelligence_cluster_node_VM_info"] = bindings.NewReferenceType(model.AddIntelligenceClusterNodeVMInfoBindingType) + fieldNameMap["add_intelligence_cluster_node_VM_info"] = "AddIntelligenceClusterNodeVMInfo" + paramsTypeMap["add_intelligence_cluster_node_VM_info"] = bindings.NewReferenceType(model.AddIntelligenceClusterNodeVMInfoBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "add_intelligence_cluster_node_VM_info", + "POST", + "/api/v1/intelligence/nodes/deployments", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func deploymentsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fields["force_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["force_delete"] = "ForceDelete" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func deploymentsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func deploymentsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fields["force_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["force_delete"] = "ForceDelete" + paramsTypeMap["force_delete"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + queryParams["force_delete"] = "force_delete" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=delete", + "", + "POST", + "/api/v1/intelligence/nodes/deployments/{nodeId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func deploymentsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func deploymentsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IntelligenceClusterNodeVMDeploymentRequestBindingType) +} + +func deploymentsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/intelligence/nodes/deployments/{nodeId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func deploymentsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func deploymentsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IntelligenceClusterNodeVMDeploymentRequestListBindingType) +} + +func deploymentsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/intelligence/nodes/deployments", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/intelligence/nodes/NodesPackageTypes.go b/services/nsxt-mp/nsx/intelligence/nodes/NodesPackageTypes.go new file mode 100644 index 000000000..00e40ccb4 --- /dev/null +++ b/services/nsxt-mp/nsx/intelligence/nodes/NodesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.intelligence.nodes. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nodes diff --git a/services/nsxt-mp/nsx/intelligence/nodes/deployments/DeploymentsPackageTypes.go b/services/nsxt-mp/nsx/intelligence/nodes/deployments/DeploymentsPackageTypes.go new file mode 100644 index 000000000..09fb4b711 --- /dev/null +++ b/services/nsxt-mp/nsx/intelligence/nodes/deployments/DeploymentsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.intelligence.nodes.deployments. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package deployments diff --git a/services/nsxt-mp/nsx/intelligence/nodes/deployments/StatusClient.go b/services/nsxt-mp/nsx/intelligence/nodes/deployments/StatusClient.go new file mode 100644 index 000000000..5ca9f4e12 --- /dev/null +++ b/services/nsxt-mp/nsx/intelligence/nodes/deployments/StatusClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package deployments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Returns the current deployment or undeployment status for a VM along with any other relevant current information, such as error messages. + // + // @param nodeIdParam (required) + // @return com.vmware.nsx.model.IntelligenceClusterNodeVMDeploymentStatusReport + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nodeIdParam string) (model.IntelligenceClusterNodeVMDeploymentStatusReport, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.intelligence.nodes.deployments.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(nodeIdParam string) (model.IntelligenceClusterNodeVMDeploymentStatusReport, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IntelligenceClusterNodeVMDeploymentStatusReport + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.intelligence.nodes.deployments.status", "get", inputDataValue, executionContext) + var emptyOutput model.IntelligenceClusterNodeVMDeploymentStatusReport + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IntelligenceClusterNodeVMDeploymentStatusReport), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/intelligence/nodes/deployments/StatusTypes.go b/services/nsxt-mp/nsx/intelligence/nodes/deployments/StatusTypes.go new file mode 100644 index 000000000..92ce4c0a2 --- /dev/null +++ b/services/nsxt-mp/nsx/intelligence/nodes/deployments/StatusTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package deployments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IntelligenceClusterNodeVMDeploymentStatusReportBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/intelligence/nodes/deployments/{nodeId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/intrusion_services/AffectedUsersClient.go b/services/nsxt-mp/nsx/intrusion_services/AffectedUsersClient.go new file mode 100644 index 000000000..b6146a9de --- /dev/null +++ b/services/nsxt-mp/nsx/intrusion_services/AffectedUsersClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: AffectedUsers +// Used by client-side stubs. + +package intrusion_services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AffectedUsersClient interface { + + // Get the list of the users affected pertaining to a specific signature. + // + // @param iDSEventDataRequestParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.IdsUserList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(iDSEventDataRequestParam model.IDSEventDataRequest, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IdsUserList, error) +} + +type affectedUsersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAffectedUsersClient(connector client.Connector) *affectedUsersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.intrusion_services.affected_users") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := affectedUsersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *affectedUsersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *affectedUsersClient) Create(iDSEventDataRequestParam model.IDSEventDataRequest, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IdsUserList, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(affectedUsersCreateInputType(), typeConverter) + sv.AddStructField("IDSEventDataRequest", iDSEventDataRequestParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IdsUserList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := affectedUsersCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.intrusion_services.affected_users", "create", inputDataValue, executionContext) + var emptyOutput model.IdsUserList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), affectedUsersCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IdsUserList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/intrusion_services/AffectedUsersTypes.go b/services/nsxt-mp/nsx/intrusion_services/AffectedUsersTypes.go new file mode 100644 index 000000000..1fbc52928 --- /dev/null +++ b/services/nsxt-mp/nsx/intrusion_services/AffectedUsersTypes.go @@ -0,0 +1,97 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: AffectedUsers. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package intrusion_services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func affectedUsersCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["i_DS_event_data_request"] = bindings.NewReferenceType(model.IDSEventDataRequestBindingType) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["i_DS_event_data_request"] = "IDSEventDataRequest" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func affectedUsersCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IdsUserListBindingType) +} + +func affectedUsersCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["i_DS_event_data_request"] = bindings.NewReferenceType(model.IDSEventDataRequestBindingType) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["i_DS_event_data_request"] = "IDSEventDataRequest" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["i_DS_event_data_request"] = bindings.NewReferenceType(model.IDSEventDataRequestBindingType) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "i_DS_event_data_request", + "POST", + "/api/v1/intrusion-services/affected-users", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/intrusion_services/AffectedVmsClient.go b/services/nsxt-mp/nsx/intrusion_services/AffectedVmsClient.go new file mode 100644 index 000000000..7b2321fa4 --- /dev/null +++ b/services/nsxt-mp/nsx/intrusion_services/AffectedVmsClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: AffectedVms +// Used by client-side stubs. + +package intrusion_services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AffectedVmsClient interface { + + // Get the list of the VMs affected pertaining to a specific signature. + // + // @param iDSEventDataRequestParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.IdsVmList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(iDSEventDataRequestParam model.IDSEventDataRequest, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IdsVmList, error) +} + +type affectedVmsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAffectedVmsClient(connector client.Connector) *affectedVmsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.intrusion_services.affected_vms") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := affectedVmsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *affectedVmsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *affectedVmsClient) Create(iDSEventDataRequestParam model.IDSEventDataRequest, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IdsVmList, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(affectedVmsCreateInputType(), typeConverter) + sv.AddStructField("IDSEventDataRequest", iDSEventDataRequestParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IdsVmList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := affectedVmsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.intrusion_services.affected_vms", "create", inputDataValue, executionContext) + var emptyOutput model.IdsVmList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), affectedVmsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IdsVmList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/intrusion_services/AffectedVmsTypes.go b/services/nsxt-mp/nsx/intrusion_services/AffectedVmsTypes.go new file mode 100644 index 000000000..fb6bbff0d --- /dev/null +++ b/services/nsxt-mp/nsx/intrusion_services/AffectedVmsTypes.go @@ -0,0 +1,97 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: AffectedVms. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package intrusion_services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func affectedVmsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["i_DS_event_data_request"] = bindings.NewReferenceType(model.IDSEventDataRequestBindingType) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["i_DS_event_data_request"] = "IDSEventDataRequest" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func affectedVmsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IdsVmListBindingType) +} + +func affectedVmsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["i_DS_event_data_request"] = bindings.NewReferenceType(model.IDSEventDataRequestBindingType) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["i_DS_event_data_request"] = "IDSEventDataRequest" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["i_DS_event_data_request"] = bindings.NewReferenceType(model.IDSEventDataRequestBindingType) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "i_DS_event_data_request", + "POST", + "/api/v1/intrusion-services/affected-vms", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/intrusion_services/IdsEventsClient.go b/services/nsxt-mp/nsx/intrusion_services/IdsEventsClient.go new file mode 100644 index 000000000..33717120a --- /dev/null +++ b/services/nsxt-mp/nsx/intrusion_services/IdsEventsClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: IdsEvents +// Used by client-side stubs. + +package intrusion_services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type IdsEventsClient interface { + + // Get the list of the IDS events that are detected with the total number of intrusions detected, their severity and the time they occurred, grouped by signature id. + // + // @param iDSEventDataRequestParam (required) + // @return com.vmware.nsx.model.IDSEventsBySignatureResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(iDSEventDataRequestParam model.IDSEventDataRequest) (model.IDSEventsBySignatureResult, error) +} + +type idsEventsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewIdsEventsClient(connector client.Connector) *idsEventsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.intrusion_services.ids_events") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := idsEventsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *idsEventsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *idsEventsClient) Create(iDSEventDataRequestParam model.IDSEventDataRequest) (model.IDSEventsBySignatureResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(idsEventsCreateInputType(), typeConverter) + sv.AddStructField("IDSEventDataRequest", iDSEventDataRequestParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IDSEventsBySignatureResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := idsEventsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.intrusion_services.ids_events", "create", inputDataValue, executionContext) + var emptyOutput model.IDSEventsBySignatureResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), idsEventsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IDSEventsBySignatureResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/intrusion_services/IdsEventsTypes.go b/services/nsxt-mp/nsx/intrusion_services/IdsEventsTypes.go new file mode 100644 index 000000000..a01927981 --- /dev/null +++ b/services/nsxt-mp/nsx/intrusion_services/IdsEventsTypes.go @@ -0,0 +1,67 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: IdsEvents. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package intrusion_services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func idsEventsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["i_DS_event_data_request"] = bindings.NewReferenceType(model.IDSEventDataRequestBindingType) + fieldNameMap["i_DS_event_data_request"] = "IDSEventDataRequest" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func idsEventsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IDSEventsBySignatureResultBindingType) +} + +func idsEventsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["i_DS_event_data_request"] = bindings.NewReferenceType(model.IDSEventDataRequestBindingType) + fieldNameMap["i_DS_event_data_request"] = "IDSEventDataRequest" + paramsTypeMap["i_DS_event_data_request"] = bindings.NewReferenceType(model.IDSEventDataRequestBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "i_DS_event_data_request", + "POST", + "/api/v1/intrusion-services/ids-events", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/intrusion_services/IdsSummaryClient.go b/services/nsxt-mp/nsx/intrusion_services/IdsSummaryClient.go new file mode 100644 index 000000000..952eff8e8 --- /dev/null +++ b/services/nsxt-mp/nsx/intrusion_services/IdsSummaryClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: IdsSummary +// Used by client-side stubs. + +package intrusion_services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type IdsSummaryClient interface { + + // Get the summary of all the intrusions that are detected grouped by signature with details including signature name, id, severity, attack type, protocol, first and recent occurence, and affected users and VMs. + // + // @param iDSEventDataRequestParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.IDSSummaryListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(iDSEventDataRequestParam model.IDSEventDataRequest, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IDSSummaryListResult, error) +} + +type idsSummaryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewIdsSummaryClient(connector client.Connector) *idsSummaryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.intrusion_services.ids_summary") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := idsSummaryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *idsSummaryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *idsSummaryClient) Create(iDSEventDataRequestParam model.IDSEventDataRequest, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IDSSummaryListResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(idsSummaryCreateInputType(), typeConverter) + sv.AddStructField("IDSEventDataRequest", iDSEventDataRequestParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IDSSummaryListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := idsSummaryCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.intrusion_services.ids_summary", "create", inputDataValue, executionContext) + var emptyOutput model.IDSSummaryListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), idsSummaryCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IDSSummaryListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/intrusion_services/IdsSummaryTypes.go b/services/nsxt-mp/nsx/intrusion_services/IdsSummaryTypes.go new file mode 100644 index 000000000..b19642207 --- /dev/null +++ b/services/nsxt-mp/nsx/intrusion_services/IdsSummaryTypes.go @@ -0,0 +1,97 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: IdsSummary. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package intrusion_services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func idsSummaryCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["i_DS_event_data_request"] = bindings.NewReferenceType(model.IDSEventDataRequestBindingType) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["i_DS_event_data_request"] = "IDSEventDataRequest" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func idsSummaryCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IDSSummaryListResultBindingType) +} + +func idsSummaryCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["i_DS_event_data_request"] = bindings.NewReferenceType(model.IDSEventDataRequestBindingType) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["i_DS_event_data_request"] = "IDSEventDataRequest" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["i_DS_event_data_request"] = bindings.NewReferenceType(model.IDSEventDataRequestBindingType) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "i_DS_event_data_request", + "POST", + "/api/v1/intrusion-services/ids-summary", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/intrusion_services/IntrusionServicesPackageTypes.go b/services/nsxt-mp/nsx/intrusion_services/IntrusionServicesPackageTypes.go new file mode 100644 index 000000000..9d43bc3f3 --- /dev/null +++ b/services/nsxt-mp/nsx/intrusion_services/IntrusionServicesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.intrusion_services. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package intrusion_services diff --git a/services/nsxt-mp/nsx/intrusion_services/ProfilesClient.go b/services/nsxt-mp/nsx/intrusion_services/ProfilesClient.go new file mode 100644 index 000000000..0b843e5f7 --- /dev/null +++ b/services/nsxt-mp/nsx/intrusion_services/ProfilesClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Profiles +// Used by client-side stubs. + +package intrusion_services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ProfilesClient interface { + + // Returns information about the specified IDSProfile. + // + // @param idsProfileIdParam IDSProfile Id (required) + // @return com.vmware.nsx.model.IDSProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(idsProfileIdParam string) (model.IDSProfile, error) +} + +type profilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewProfilesClient(connector client.Connector) *profilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.intrusion_services.profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + pIface := profilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &pIface +} + +func (pIface *profilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := pIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (pIface *profilesClient) Get(idsProfileIdParam string) (model.IDSProfile, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(profilesGetInputType(), typeConverter) + sv.AddStructField("IdsProfileId", idsProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IDSProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := profilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.intrusion_services.profiles", "get", inputDataValue, executionContext) + var emptyOutput model.IDSProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), profilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IDSProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/intrusion_services/ProfilesTypes.go b/services/nsxt-mp/nsx/intrusion_services/ProfilesTypes.go new file mode 100644 index 000000000..f76110535 --- /dev/null +++ b/services/nsxt-mp/nsx/intrusion_services/ProfilesTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Profiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package intrusion_services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func profilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ids_profile_id"] = bindings.NewStringType() + fieldNameMap["ids_profile_id"] = "IdsProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func profilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IDSProfileBindingType) +} + +func profilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ids_profile_id"] = bindings.NewStringType() + fieldNameMap["ids_profile_id"] = "IdsProfileId" + paramsTypeMap["ids_profile_id"] = bindings.NewStringType() + paramsTypeMap["idsProfileId"] = bindings.NewStringType() + pathParams["ids_profile_id"] = "idsProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/intrusion-services/profiles/{idsProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ip_sets/IpSetsPackageTypes.go b/services/nsxt-mp/nsx/ip_sets/IpSetsPackageTypes.go new file mode 100644 index 000000000..f1920438e --- /dev/null +++ b/services/nsxt-mp/nsx/ip_sets/IpSetsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.ip_sets. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ip_sets diff --git a/services/nsxt-mp/nsx/ip_sets/MembersClient.go b/services/nsxt-mp/nsx/ip_sets/MembersClient.go new file mode 100644 index 000000000..42e0b9280 --- /dev/null +++ b/services/nsxt-mp/nsx/ip_sets/MembersClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Members +// Used by client-side stubs. + +package ip_sets + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MembersClient interface { + + // List all IP addresses in a IPSet + // + // @param ipSetIdParam IP Set Id (required) + // @return com.vmware.nsx.model.IPAddressElementListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(ipSetIdParam string) (model.IPAddressElementListResult, error) +} + +type membersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMembersClient(connector client.Connector) *membersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ip_sets.members") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := membersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *membersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *membersClient) List(ipSetIdParam string) (model.IPAddressElementListResult, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(membersListInputType(), typeConverter) + sv.AddStructField("IpSetId", ipSetIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPAddressElementListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := membersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ip_sets.members", "list", inputDataValue, executionContext) + var emptyOutput model.IPAddressElementListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), membersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPAddressElementListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ip_sets/MembersTypes.go b/services/nsxt-mp/nsx/ip_sets/MembersTypes.go new file mode 100644 index 000000000..8edf37e96 --- /dev/null +++ b/services/nsxt-mp/nsx/ip_sets/MembersTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Members. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ip_sets + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func membersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_set_id"] = bindings.NewStringType() + fieldNameMap["ip_set_id"] = "IpSetId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func membersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPAddressElementListResultBindingType) +} + +func membersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ip_set_id"] = bindings.NewStringType() + fieldNameMap["ip_set_id"] = "IpSetId" + paramsTypeMap["ip_set_id"] = bindings.NewStringType() + paramsTypeMap["ipSetId"] = bindings.NewStringType() + pathParams["ip_set_id"] = "ipSetId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ip-sets/{ipSetId}/members", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ipfix/CollectorconfigsClient.go b/services/nsxt-mp/nsx/ipfix/CollectorconfigsClient.go new file mode 100644 index 000000000..0f03a8621 --- /dev/null +++ b/services/nsxt-mp/nsx/ipfix/CollectorconfigsClient.go @@ -0,0 +1,265 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Collectorconfigs +// Used by client-side stubs. + +package ipfix + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type CollectorconfigsClient interface { + + // Create a new IPFIX collector configuration + // + // @param ipfixCollectorConfigParam (required) + // @return com.vmware.nsx.model.IpfixCollectorConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(ipfixCollectorConfigParam model.IpfixCollectorConfig) (model.IpfixCollectorConfig, error) + + // Delete an existing IPFIX collector configuration + // + // @param collectorConfigIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(collectorConfigIdParam string) error + + // Get an existing IPFIX collector configuration + // + // @param collectorConfigIdParam (required) + // @return com.vmware.nsx.model.IpfixCollectorConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(collectorConfigIdParam string) (model.IpfixCollectorConfig, error) + + // List IPFIX collector configurations + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.IpfixCollectorConfigListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IpfixCollectorConfigListResult, error) + + // Update an existing IPFIX collector configuration + // + // @param collectorConfigIdParam (required) + // @param ipfixCollectorConfigParam (required) + // @return com.vmware.nsx.model.IpfixCollectorConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(collectorConfigIdParam string, ipfixCollectorConfigParam model.IpfixCollectorConfig) (model.IpfixCollectorConfig, error) +} + +type collectorconfigsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewCollectorconfigsClient(connector client.Connector) *collectorconfigsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ipfix.collectorconfigs") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := collectorconfigsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *collectorconfigsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *collectorconfigsClient) Create(ipfixCollectorConfigParam model.IpfixCollectorConfig) (model.IpfixCollectorConfig, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(collectorconfigsCreateInputType(), typeConverter) + sv.AddStructField("IpfixCollectorConfig", ipfixCollectorConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IpfixCollectorConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := collectorconfigsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipfix.collectorconfigs", "create", inputDataValue, executionContext) + var emptyOutput model.IpfixCollectorConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), collectorconfigsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IpfixCollectorConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *collectorconfigsClient) Delete(collectorConfigIdParam string) error { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(collectorconfigsDeleteInputType(), typeConverter) + sv.AddStructField("CollectorConfigId", collectorConfigIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := collectorconfigsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipfix.collectorconfigs", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *collectorconfigsClient) Get(collectorConfigIdParam string) (model.IpfixCollectorConfig, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(collectorconfigsGetInputType(), typeConverter) + sv.AddStructField("CollectorConfigId", collectorConfigIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IpfixCollectorConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := collectorconfigsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipfix.collectorconfigs", "get", inputDataValue, executionContext) + var emptyOutput model.IpfixCollectorConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), collectorconfigsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IpfixCollectorConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *collectorconfigsClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IpfixCollectorConfigListResult, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(collectorconfigsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IpfixCollectorConfigListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := collectorconfigsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipfix.collectorconfigs", "list", inputDataValue, executionContext) + var emptyOutput model.IpfixCollectorConfigListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), collectorconfigsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IpfixCollectorConfigListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *collectorconfigsClient) Update(collectorConfigIdParam string, ipfixCollectorConfigParam model.IpfixCollectorConfig) (model.IpfixCollectorConfig, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(collectorconfigsUpdateInputType(), typeConverter) + sv.AddStructField("CollectorConfigId", collectorConfigIdParam) + sv.AddStructField("IpfixCollectorConfig", ipfixCollectorConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IpfixCollectorConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := collectorconfigsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipfix.collectorconfigs", "update", inputDataValue, executionContext) + var emptyOutput model.IpfixCollectorConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), collectorconfigsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IpfixCollectorConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ipfix/CollectorconfigsTypes.go b/services/nsxt-mp/nsx/ipfix/CollectorconfigsTypes.go new file mode 100644 index 000000000..ac4af6ff3 --- /dev/null +++ b/services/nsxt-mp/nsx/ipfix/CollectorconfigsTypes.go @@ -0,0 +1,295 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Collectorconfigs. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ipfix + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func collectorconfigsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_collector_config"] = bindings.NewReferenceType(model.IpfixCollectorConfigBindingType) + fieldNameMap["ipfix_collector_config"] = "IpfixCollectorConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func collectorconfigsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IpfixCollectorConfigBindingType) +} + +func collectorconfigsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_collector_config"] = bindings.NewReferenceType(model.IpfixCollectorConfigBindingType) + fieldNameMap["ipfix_collector_config"] = "IpfixCollectorConfig" + paramsTypeMap["ipfix_collector_config"] = bindings.NewReferenceType(model.IpfixCollectorConfigBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ipfix_collector_config", + "POST", + "/api/v1/ipfix/collectorconfigs", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func collectorconfigsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["collector_config_id"] = bindings.NewStringType() + fieldNameMap["collector_config_id"] = "CollectorConfigId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func collectorconfigsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func collectorconfigsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["collector_config_id"] = bindings.NewStringType() + fieldNameMap["collector_config_id"] = "CollectorConfigId" + paramsTypeMap["collector_config_id"] = bindings.NewStringType() + paramsTypeMap["collectorConfigId"] = bindings.NewStringType() + pathParams["collector_config_id"] = "collectorConfigId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/ipfix/collectorconfigs/{collectorConfigId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func collectorconfigsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["collector_config_id"] = bindings.NewStringType() + fieldNameMap["collector_config_id"] = "CollectorConfigId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func collectorconfigsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IpfixCollectorConfigBindingType) +} + +func collectorconfigsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["collector_config_id"] = bindings.NewStringType() + fieldNameMap["collector_config_id"] = "CollectorConfigId" + paramsTypeMap["collector_config_id"] = bindings.NewStringType() + paramsTypeMap["collectorConfigId"] = bindings.NewStringType() + pathParams["collector_config_id"] = "collectorConfigId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ipfix/collectorconfigs/{collectorConfigId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func collectorconfigsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func collectorconfigsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IpfixCollectorConfigListResultBindingType) +} + +func collectorconfigsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ipfix/collectorconfigs", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func collectorconfigsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["collector_config_id"] = bindings.NewStringType() + fields["ipfix_collector_config"] = bindings.NewReferenceType(model.IpfixCollectorConfigBindingType) + fieldNameMap["collector_config_id"] = "CollectorConfigId" + fieldNameMap["ipfix_collector_config"] = "IpfixCollectorConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func collectorconfigsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IpfixCollectorConfigBindingType) +} + +func collectorconfigsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["collector_config_id"] = bindings.NewStringType() + fields["ipfix_collector_config"] = bindings.NewReferenceType(model.IpfixCollectorConfigBindingType) + fieldNameMap["collector_config_id"] = "CollectorConfigId" + fieldNameMap["ipfix_collector_config"] = "IpfixCollectorConfig" + paramsTypeMap["ipfix_collector_config"] = bindings.NewReferenceType(model.IpfixCollectorConfigBindingType) + paramsTypeMap["collector_config_id"] = bindings.NewStringType() + paramsTypeMap["collectorConfigId"] = bindings.NewStringType() + pathParams["collector_config_id"] = "collectorConfigId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ipfix_collector_config", + "PUT", + "/api/v1/ipfix/collectorconfigs/{collectorConfigId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ipfix/ConfigsClient.go b/services/nsxt-mp/nsx/ipfix/ConfigsClient.go new file mode 100644 index 000000000..87d478ab8 --- /dev/null +++ b/services/nsxt-mp/nsx/ipfix/ConfigsClient.go @@ -0,0 +1,275 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Configs +// Used by client-side stubs. + +package ipfix + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ConfigsClient interface { + + // Create a new IPFIX configuration + // + // @param ipfixConfigParam (required) + // The parameter must contain all the properties defined in model.IpfixConfig. + // @return com.vmware.nsx.model.IpfixConfig + // The return value will contain all the properties defined in model.IpfixConfig. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(ipfixConfigParam *data.StructValue) (*data.StructValue, error) + + // Delete an existing IPFIX configuration + // + // @param configIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(configIdParam string) error + + // Get an existing IPFIX configuration + // + // @param configIdParam (required) + // @return com.vmware.nsx.model.IpfixConfig + // The return value will contain all the properties defined in model.IpfixConfig. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(configIdParam string) (*data.StructValue, error) + + // List IPFIX configuration + // + // @param appliedToParam Applied To (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param ipfixConfigTypeParam Supported IPFIX Config Types. (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.IpfixConfigListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(appliedToParam *string, cursorParam *string, includedFieldsParam *string, ipfixConfigTypeParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IpfixConfigListResult, error) + + // Update an existing IPFIX configuration + // + // @param configIdParam (required) + // @param ipfixConfigParam (required) + // The parameter must contain all the properties defined in model.IpfixConfig. + // @return com.vmware.nsx.model.IpfixConfig + // The return value will contain all the properties defined in model.IpfixConfig. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(configIdParam string, ipfixConfigParam *data.StructValue) (*data.StructValue, error) +} + +type configsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewConfigsClient(connector client.Connector) *configsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ipfix.configs") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := configsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *configsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *configsClient) Create(ipfixConfigParam *data.StructValue) (*data.StructValue, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(configsCreateInputType(), typeConverter) + sv.AddStructField("IpfixConfig", ipfixConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := configsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipfix.configs", "create", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), configsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *configsClient) Delete(configIdParam string) error { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(configsDeleteInputType(), typeConverter) + sv.AddStructField("ConfigId", configIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := configsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipfix.configs", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *configsClient) Get(configIdParam string) (*data.StructValue, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(configsGetInputType(), typeConverter) + sv.AddStructField("ConfigId", configIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := configsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipfix.configs", "get", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), configsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *configsClient) List(appliedToParam *string, cursorParam *string, includedFieldsParam *string, ipfixConfigTypeParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IpfixConfigListResult, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(configsListInputType(), typeConverter) + sv.AddStructField("AppliedTo", appliedToParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("IpfixConfigType", ipfixConfigTypeParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IpfixConfigListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := configsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipfix.configs", "list", inputDataValue, executionContext) + var emptyOutput model.IpfixConfigListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), configsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IpfixConfigListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *configsClient) Update(configIdParam string, ipfixConfigParam *data.StructValue) (*data.StructValue, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(configsUpdateInputType(), typeConverter) + sv.AddStructField("ConfigId", configIdParam) + sv.AddStructField("IpfixConfig", ipfixConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := configsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipfix.configs", "update", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), configsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ipfix/ConfigsTypes.go b/services/nsxt-mp/nsx/ipfix/ConfigsTypes.go new file mode 100644 index 000000000..ab761f238 --- /dev/null +++ b/services/nsxt-mp/nsx/ipfix/ConfigsTypes.go @@ -0,0 +1,310 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Configs. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ipfix + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``ipfixConfigType`` of method Configs#list. +const Configs_LIST_IPFIX_CONFIG_TYPE_IPFIXDFWCONFIG = "IpfixDfwConfig" + +func configsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipfix_config"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IpfixConfigBindingType)}, bindings.REST) + fieldNameMap["ipfix_config"] = "IpfixConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func configsCreateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IpfixConfigBindingType)}, bindings.REST) +} + +func configsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipfix_config"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IpfixConfigBindingType)}, bindings.REST) + fieldNameMap["ipfix_config"] = "IpfixConfig" + paramsTypeMap["ipfix_config"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IpfixConfigBindingType)}, bindings.REST) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ipfix_config", + "POST", + "/api/v1/ipfix/configs", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func configsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["config_id"] = bindings.NewStringType() + fieldNameMap["config_id"] = "ConfigId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func configsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func configsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["config_id"] = bindings.NewStringType() + fieldNameMap["config_id"] = "ConfigId" + paramsTypeMap["config_id"] = bindings.NewStringType() + paramsTypeMap["configId"] = bindings.NewStringType() + pathParams["config_id"] = "configId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/ipfix/configs/{configId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func configsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["config_id"] = bindings.NewStringType() + fieldNameMap["config_id"] = "ConfigId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func configsGetOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IpfixConfigBindingType)}, bindings.REST) +} + +func configsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["config_id"] = bindings.NewStringType() + fieldNameMap["config_id"] = "ConfigId" + paramsTypeMap["config_id"] = bindings.NewStringType() + paramsTypeMap["configId"] = bindings.NewStringType() + pathParams["config_id"] = "configId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ipfix/configs/{configId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func configsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["applied_to"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["ipfix_config_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["applied_to"] = "AppliedTo" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["ipfix_config_type"] = "IpfixConfigType" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func configsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IpfixConfigListResultBindingType) +} + +func configsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["applied_to"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["ipfix_config_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["applied_to"] = "AppliedTo" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["ipfix_config_type"] = "IpfixConfigType" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["applied_to"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["ipfix_config_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["ipfix_config_type"] = "ipfix_config_type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["applied_to"] = "applied_to" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ipfix/configs", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func configsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["config_id"] = bindings.NewStringType() + fields["ipfix_config"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IpfixConfigBindingType)}, bindings.REST) + fieldNameMap["config_id"] = "ConfigId" + fieldNameMap["ipfix_config"] = "IpfixConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func configsUpdateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IpfixConfigBindingType)}, bindings.REST) +} + +func configsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["config_id"] = bindings.NewStringType() + fields["ipfix_config"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IpfixConfigBindingType)}, bindings.REST) + fieldNameMap["config_id"] = "ConfigId" + fieldNameMap["ipfix_config"] = "IpfixConfig" + paramsTypeMap["ipfix_config"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IpfixConfigBindingType)}, bindings.REST) + paramsTypeMap["config_id"] = bindings.NewStringType() + paramsTypeMap["configId"] = bindings.NewStringType() + pathParams["config_id"] = "configId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ipfix_config", + "PUT", + "/api/v1/ipfix/configs/{configId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ipfix/IpfixPackageTypes.go b/services/nsxt-mp/nsx/ipfix/IpfixPackageTypes.go new file mode 100644 index 000000000..823b52165 --- /dev/null +++ b/services/nsxt-mp/nsx/ipfix/IpfixPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.ipfix. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ipfix diff --git a/services/nsxt-mp/nsx/ipv6/DadProfilesClient.go b/services/nsxt-mp/nsx/ipv6/DadProfilesClient.go new file mode 100644 index 000000000..ea9244c30 --- /dev/null +++ b/services/nsxt-mp/nsx/ipv6/DadProfilesClient.go @@ -0,0 +1,265 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: DadProfiles +// Used by client-side stubs. + +package ipv6 + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type DadProfilesClient interface { + + // Adds a new DADProfile + // + // @param dADProfileParam (required) + // @return com.vmware.nsx.model.DADProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(dADProfileParam model.DADProfile) (model.DADProfile, error) + + // Delete DADProfile + // + // @param dadProfileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(dadProfileIdParam string) error + + // Returns information about specified IPv6 DADProfile. + // + // @param dadProfileIdParam (required) + // @return com.vmware.nsx.model.DADProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(dadProfileIdParam string) (model.DADProfile, error) + + // Returns all IPv6 DADProfiles. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.DADProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DADProfileListResult, error) + + // Update DADProfile. + // + // @param dadProfileIdParam (required) + // @param dADProfileParam (required) + // @return com.vmware.nsx.model.DADProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(dadProfileIdParam string, dADProfileParam model.DADProfile) (model.DADProfile, error) +} + +type dadProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewDadProfilesClient(connector client.Connector) *dadProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ipv6.dad_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + dIface := dadProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &dIface +} + +func (dIface *dadProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := dIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (dIface *dadProfilesClient) Create(dADProfileParam model.DADProfile) (model.DADProfile, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(dadProfilesCreateInputType(), typeConverter) + sv.AddStructField("DADProfile", dADProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DADProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dadProfilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipv6.dad_profiles", "create", inputDataValue, executionContext) + var emptyOutput model.DADProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dadProfilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DADProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *dadProfilesClient) Delete(dadProfileIdParam string) error { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(dadProfilesDeleteInputType(), typeConverter) + sv.AddStructField("DadProfileId", dadProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dadProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipv6.dad_profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *dadProfilesClient) Get(dadProfileIdParam string) (model.DADProfile, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(dadProfilesGetInputType(), typeConverter) + sv.AddStructField("DadProfileId", dadProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DADProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dadProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipv6.dad_profiles", "get", inputDataValue, executionContext) + var emptyOutput model.DADProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dadProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DADProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *dadProfilesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.DADProfileListResult, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(dadProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DADProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dadProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipv6.dad_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.DADProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dadProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DADProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *dadProfilesClient) Update(dadProfileIdParam string, dADProfileParam model.DADProfile) (model.DADProfile, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(dadProfilesUpdateInputType(), typeConverter) + sv.AddStructField("DadProfileId", dadProfileIdParam) + sv.AddStructField("DADProfile", dADProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.DADProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dadProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipv6.dad_profiles", "update", inputDataValue, executionContext) + var emptyOutput model.DADProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dadProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.DADProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ipv6/DadProfilesTypes.go b/services/nsxt-mp/nsx/ipv6/DadProfilesTypes.go new file mode 100644 index 000000000..a705c7a01 --- /dev/null +++ b/services/nsxt-mp/nsx/ipv6/DadProfilesTypes.go @@ -0,0 +1,295 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: DadProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ipv6 + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func dadProfilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["d_AD_profile"] = bindings.NewReferenceType(model.DADProfileBindingType) + fieldNameMap["d_AD_profile"] = "DADProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dadProfilesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DADProfileBindingType) +} + +func dadProfilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["d_AD_profile"] = bindings.NewReferenceType(model.DADProfileBindingType) + fieldNameMap["d_AD_profile"] = "DADProfile" + paramsTypeMap["d_AD_profile"] = bindings.NewReferenceType(model.DADProfileBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "d_AD_profile", + "POST", + "/api/v1/ipv6/dad-profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func dadProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dad_profile_id"] = bindings.NewStringType() + fieldNameMap["dad_profile_id"] = "DadProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dadProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func dadProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dad_profile_id"] = bindings.NewStringType() + fieldNameMap["dad_profile_id"] = "DadProfileId" + paramsTypeMap["dad_profile_id"] = bindings.NewStringType() + paramsTypeMap["dadProfileId"] = bindings.NewStringType() + pathParams["dad_profile_id"] = "dadProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/ipv6/dad-profiles/{dadProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func dadProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dad_profile_id"] = bindings.NewStringType() + fieldNameMap["dad_profile_id"] = "DadProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dadProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DADProfileBindingType) +} + +func dadProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dad_profile_id"] = bindings.NewStringType() + fieldNameMap["dad_profile_id"] = "DadProfileId" + paramsTypeMap["dad_profile_id"] = bindings.NewStringType() + paramsTypeMap["dadProfileId"] = bindings.NewStringType() + pathParams["dad_profile_id"] = "dadProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ipv6/dad-profiles/{dadProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func dadProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dadProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DADProfileListResultBindingType) +} + +func dadProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ipv6/dad-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func dadProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dad_profile_id"] = bindings.NewStringType() + fields["d_AD_profile"] = bindings.NewReferenceType(model.DADProfileBindingType) + fieldNameMap["dad_profile_id"] = "DadProfileId" + fieldNameMap["d_AD_profile"] = "DADProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dadProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.DADProfileBindingType) +} + +func dadProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["dad_profile_id"] = bindings.NewStringType() + fields["d_AD_profile"] = bindings.NewReferenceType(model.DADProfileBindingType) + fieldNameMap["dad_profile_id"] = "DadProfileId" + fieldNameMap["d_AD_profile"] = "DADProfile" + paramsTypeMap["d_AD_profile"] = bindings.NewReferenceType(model.DADProfileBindingType) + paramsTypeMap["dad_profile_id"] = bindings.NewStringType() + paramsTypeMap["dadProfileId"] = bindings.NewStringType() + pathParams["dad_profile_id"] = "dadProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "d_AD_profile", + "PUT", + "/api/v1/ipv6/dad-profiles/{dadProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ipv6/Ipv6PackageTypes.go b/services/nsxt-mp/nsx/ipv6/Ipv6PackageTypes.go new file mode 100644 index 000000000..964b57de8 --- /dev/null +++ b/services/nsxt-mp/nsx/ipv6/Ipv6PackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.ipv6. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ipv6 diff --git a/services/nsxt-mp/nsx/ipv6/NdRaProfilesClient.go b/services/nsxt-mp/nsx/ipv6/NdRaProfilesClient.go new file mode 100644 index 000000000..b0aa30ae5 --- /dev/null +++ b/services/nsxt-mp/nsx/ipv6/NdRaProfilesClient.go @@ -0,0 +1,265 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: NdRaProfiles +// Used by client-side stubs. + +package ipv6 + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NdRaProfilesClient interface { + + // Adds a new NDRAProfile + // + // @param nDRAProfileParam (required) + // @return com.vmware.nsx.model.NDRAProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(nDRAProfileParam model.NDRAProfile) (model.NDRAProfile, error) + + // Delete NDRAProfile + // + // @param ndRaProfileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(ndRaProfileIdParam string) error + + // Returns information about specified IPv6 NDRA Profile. + // + // @param ndRaProfileIdParam (required) + // @return com.vmware.nsx.model.NDRAProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ndRaProfileIdParam string) (model.NDRAProfile, error) + + // Returns all IPv6 NDRA Profiles. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.NDRAProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.NDRAProfileListResult, error) + + // Update NDRAProfile + // + // @param ndRaProfileIdParam (required) + // @param nDRAProfileParam (required) + // @return com.vmware.nsx.model.NDRAProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(ndRaProfileIdParam string, nDRAProfileParam model.NDRAProfile) (model.NDRAProfile, error) +} + +type ndRaProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNdRaProfilesClient(connector client.Connector) *ndRaProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ipv6.nd_ra_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := ndRaProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *ndRaProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *ndRaProfilesClient) Create(nDRAProfileParam model.NDRAProfile) (model.NDRAProfile, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ndRaProfilesCreateInputType(), typeConverter) + sv.AddStructField("NDRAProfile", nDRAProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NDRAProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ndRaProfilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipv6.nd_ra_profiles", "create", inputDataValue, executionContext) + var emptyOutput model.NDRAProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ndRaProfilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NDRAProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *ndRaProfilesClient) Delete(ndRaProfileIdParam string) error { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ndRaProfilesDeleteInputType(), typeConverter) + sv.AddStructField("NdRaProfileId", ndRaProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ndRaProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipv6.nd_ra_profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (nIface *ndRaProfilesClient) Get(ndRaProfileIdParam string) (model.NDRAProfile, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ndRaProfilesGetInputType(), typeConverter) + sv.AddStructField("NdRaProfileId", ndRaProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NDRAProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ndRaProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipv6.nd_ra_profiles", "get", inputDataValue, executionContext) + var emptyOutput model.NDRAProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ndRaProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NDRAProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *ndRaProfilesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.NDRAProfileListResult, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ndRaProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NDRAProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ndRaProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipv6.nd_ra_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.NDRAProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ndRaProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NDRAProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *ndRaProfilesClient) Update(ndRaProfileIdParam string, nDRAProfileParam model.NDRAProfile) (model.NDRAProfile, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ndRaProfilesUpdateInputType(), typeConverter) + sv.AddStructField("NdRaProfileId", ndRaProfileIdParam) + sv.AddStructField("NDRAProfile", nDRAProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NDRAProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ndRaProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ipv6.nd_ra_profiles", "update", inputDataValue, executionContext) + var emptyOutput model.NDRAProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ndRaProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NDRAProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ipv6/NdRaProfilesTypes.go b/services/nsxt-mp/nsx/ipv6/NdRaProfilesTypes.go new file mode 100644 index 000000000..964e0eb20 --- /dev/null +++ b/services/nsxt-mp/nsx/ipv6/NdRaProfilesTypes.go @@ -0,0 +1,295 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: NdRaProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ipv6 + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func ndRaProfilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["n_DRA_profile"] = bindings.NewReferenceType(model.NDRAProfileBindingType) + fieldNameMap["n_DRA_profile"] = "NDRAProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ndRaProfilesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NDRAProfileBindingType) +} + +func ndRaProfilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["n_DRA_profile"] = bindings.NewReferenceType(model.NDRAProfileBindingType) + fieldNameMap["n_DRA_profile"] = "NDRAProfile" + paramsTypeMap["n_DRA_profile"] = bindings.NewReferenceType(model.NDRAProfileBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "n_DRA_profile", + "POST", + "/api/v1/ipv6/nd-ra-profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ndRaProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["nd_ra_profile_id"] = bindings.NewStringType() + fieldNameMap["nd_ra_profile_id"] = "NdRaProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ndRaProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ndRaProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["nd_ra_profile_id"] = bindings.NewStringType() + fieldNameMap["nd_ra_profile_id"] = "NdRaProfileId" + paramsTypeMap["nd_ra_profile_id"] = bindings.NewStringType() + paramsTypeMap["ndRaProfileId"] = bindings.NewStringType() + pathParams["nd_ra_profile_id"] = "ndRaProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/ipv6/nd-ra-profiles/{ndRaProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ndRaProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["nd_ra_profile_id"] = bindings.NewStringType() + fieldNameMap["nd_ra_profile_id"] = "NdRaProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ndRaProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NDRAProfileBindingType) +} + +func ndRaProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["nd_ra_profile_id"] = bindings.NewStringType() + fieldNameMap["nd_ra_profile_id"] = "NdRaProfileId" + paramsTypeMap["nd_ra_profile_id"] = bindings.NewStringType() + paramsTypeMap["ndRaProfileId"] = bindings.NewStringType() + pathParams["nd_ra_profile_id"] = "ndRaProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ipv6/nd-ra-profiles/{ndRaProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ndRaProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ndRaProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NDRAProfileListResultBindingType) +} + +func ndRaProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ipv6/nd-ra-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ndRaProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["nd_ra_profile_id"] = bindings.NewStringType() + fields["n_DRA_profile"] = bindings.NewReferenceType(model.NDRAProfileBindingType) + fieldNameMap["nd_ra_profile_id"] = "NdRaProfileId" + fieldNameMap["n_DRA_profile"] = "NDRAProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ndRaProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NDRAProfileBindingType) +} + +func ndRaProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["nd_ra_profile_id"] = bindings.NewStringType() + fields["n_DRA_profile"] = bindings.NewReferenceType(model.NDRAProfileBindingType) + fieldNameMap["nd_ra_profile_id"] = "NdRaProfileId" + fieldNameMap["n_DRA_profile"] = "NDRAProfile" + paramsTypeMap["nd_ra_profile_id"] = bindings.NewStringType() + paramsTypeMap["n_DRA_profile"] = bindings.NewReferenceType(model.NDRAProfileBindingType) + paramsTypeMap["ndRaProfileId"] = bindings.NewStringType() + pathParams["nd_ra_profile_id"] = "ndRaProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "n_DRA_profile", + "PUT", + "/api/v1/ipv6/nd-ra-profiles/{ndRaProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/licenses/LicensesPackageTypes.go b/services/nsxt-mp/nsx/licenses/LicensesPackageTypes.go new file mode 100644 index 000000000..e7b71a4fd --- /dev/null +++ b/services/nsxt-mp/nsx/licenses/LicensesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.licenses. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package licenses diff --git a/services/nsxt-mp/nsx/licenses/LicensesUsageClient.go b/services/nsxt-mp/nsx/licenses/LicensesUsageClient.go new file mode 100644 index 000000000..c8a85fc45 --- /dev/null +++ b/services/nsxt-mp/nsx/licenses/LicensesUsageClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: LicensesUsage +// Used by client-side stubs. + +package licenses + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type LicensesUsageClient interface { + + // Returns usage report of all registered modules + // @return com.vmware.nsx.model.FeatureUsageList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.FeatureUsageList, error) +} + +type licensesUsageClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewLicensesUsageClient(connector client.Connector) *licensesUsageClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.licenses.licenses_usage") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + lIface := licensesUsageClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &lIface +} + +func (lIface *licensesUsageClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := lIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (lIface *licensesUsageClient) Get() (model.FeatureUsageList, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(licensesUsageGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FeatureUsageList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := licensesUsageGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.licenses.licenses_usage", "get", inputDataValue, executionContext) + var emptyOutput model.FeatureUsageList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), licensesUsageGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FeatureUsageList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/licenses/LicensesUsageTypes.go b/services/nsxt-mp/nsx/licenses/LicensesUsageTypes.go new file mode 100644 index 000000000..3e3df2295 --- /dev/null +++ b/services/nsxt-mp/nsx/licenses/LicensesUsageTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: LicensesUsage. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package licenses + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func licensesUsageGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func licensesUsageGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FeatureUsageListBindingType) +} + +func licensesUsageGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/licenses/licenses-usage", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/livetraces/LivetracesPackageTypes.go b/services/nsxt-mp/nsx/livetraces/LivetracesPackageTypes.go new file mode 100644 index 000000000..fedc9d7b3 --- /dev/null +++ b/services/nsxt-mp/nsx/livetraces/LivetracesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.livetraces. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package livetraces diff --git a/services/nsxt-mp/nsx/livetraces/ResultsClient.go b/services/nsxt-mp/nsx/livetraces/ResultsClient.go new file mode 100644 index 000000000..45f3633c7 --- /dev/null +++ b/services/nsxt-mp/nsx/livetraces/ResultsClient.go @@ -0,0 +1,102 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Results +// Used by client-side stubs. + +package livetraces + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ResultsClient interface { + + // Get the result of a livetrace session + // + // @param livetraceSessionIdParam (required) + // @param actionTypeParam The type of observations that will be listed. (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.LiveTraceResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(livetraceSessionIdParam string, actionTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LiveTraceResult, error) +} + +type resultsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewResultsClient(connector client.Connector) *resultsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.livetraces.results") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := resultsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *resultsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *resultsClient) Get(livetraceSessionIdParam string, actionTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LiveTraceResult, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(resultsGetInputType(), typeConverter) + sv.AddStructField("LivetraceSessionId", livetraceSessionIdParam) + sv.AddStructField("ActionType", actionTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LiveTraceResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := resultsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.livetraces.results", "get", inputDataValue, executionContext) + var emptyOutput model.LiveTraceResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), resultsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LiveTraceResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/livetraces/ResultsTypes.go b/services/nsxt-mp/nsx/livetraces/ResultsTypes.go new file mode 100644 index 000000000..eddd36521 --- /dev/null +++ b/services/nsxt-mp/nsx/livetraces/ResultsTypes.go @@ -0,0 +1,114 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Results. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package livetraces + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``actionType`` of method Results#get. +const Results_GET_ACTION_TYPE_TRACE = "TRACE" + +// Possible value for ``actionType`` of method Results#get. +const Results_GET_ACTION_TYPE_PKTCAP = "PKTCAP" + +// Possible value for ``actionType`` of method Results#get. +const Results_GET_ACTION_TYPE_COUNT = "COUNT" + +func resultsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["livetrace_session_id"] = bindings.NewStringType() + fields["action_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["livetrace_session_id"] = "LivetraceSessionId" + fieldNameMap["action_type"] = "ActionType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func resultsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LiveTraceResultBindingType) +} + +func resultsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["livetrace_session_id"] = bindings.NewStringType() + fields["action_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["livetrace_session_id"] = "LivetraceSessionId" + fieldNameMap["action_type"] = "ActionType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["livetrace_session_id"] = bindings.NewStringType() + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["action_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["livetraceSessionId"] = bindings.NewStringType() + pathParams["livetrace_session_id"] = "livetraceSessionId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["action_type"] = "action_type" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/livetraces/{livetraceSessionId}/results", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/lldp/fabric_nodes/FabricNodesPackageTypes.go b/services/nsxt-mp/nsx/lldp/fabric_nodes/FabricNodesPackageTypes.go new file mode 100644 index 000000000..362bbfb3e --- /dev/null +++ b/services/nsxt-mp/nsx/lldp/fabric_nodes/FabricNodesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.lldp.fabric_nodes. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package fabric_nodes diff --git a/services/nsxt-mp/nsx/lldp/fabric_nodes/InterfacesClient.go b/services/nsxt-mp/nsx/lldp/fabric_nodes/InterfacesClient.go new file mode 100644 index 000000000..e082d1b97 --- /dev/null +++ b/services/nsxt-mp/nsx/lldp/fabric_nodes/InterfacesClient.go @@ -0,0 +1,135 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Interfaces +// Used by client-side stubs. + +package fabric_nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type InterfacesClient interface { + + // Read LLDP Neighbor Properties for a specific interface of Fabric Node + // + // @param fabricNodeIdParam ID of fabric node (required) + // @param interfaceNameParam Interface name to read (required) + // @return com.vmware.nsx.model.InterfaceNeighborProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(fabricNodeIdParam string, interfaceNameParam string) (model.InterfaceNeighborProperties, error) + + // List LLDP Neighbor Properties for all interfaces of Fabric Node + // + // @param fabricNodeIdParam ID of fabric node (required) + // @return com.vmware.nsx.model.InterfaceNeighborPropertyListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(fabricNodeIdParam string) (model.InterfaceNeighborPropertyListResult, error) +} + +type interfacesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewInterfacesClient(connector client.Connector) *interfacesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.lldp.fabric_nodes.interfaces") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := interfacesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *interfacesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *interfacesClient) Get(fabricNodeIdParam string, interfaceNameParam string) (model.InterfaceNeighborProperties, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(interfacesGetInputType(), typeConverter) + sv.AddStructField("FabricNodeId", fabricNodeIdParam) + sv.AddStructField("InterfaceName", interfaceNameParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.InterfaceNeighborProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := interfacesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.lldp.fabric_nodes.interfaces", "get", inputDataValue, executionContext) + var emptyOutput model.InterfaceNeighborProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), interfacesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.InterfaceNeighborProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *interfacesClient) List(fabricNodeIdParam string) (model.InterfaceNeighborPropertyListResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(interfacesListInputType(), typeConverter) + sv.AddStructField("FabricNodeId", fabricNodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.InterfaceNeighborPropertyListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := interfacesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.lldp.fabric_nodes.interfaces", "list", inputDataValue, executionContext) + var emptyOutput model.InterfaceNeighborPropertyListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), interfacesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.InterfaceNeighborPropertyListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/lldp/fabric_nodes/InterfacesTypes.go b/services/nsxt-mp/nsx/lldp/fabric_nodes/InterfacesTypes.go new file mode 100644 index 000000000..ba01ed4f6 --- /dev/null +++ b/services/nsxt-mp/nsx/lldp/fabric_nodes/InterfacesTypes.go @@ -0,0 +1,126 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Interfaces. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package fabric_nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func interfacesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["fabric_node_id"] = bindings.NewStringType() + fields["interface_name"] = bindings.NewStringType() + fieldNameMap["fabric_node_id"] = "FabricNodeId" + fieldNameMap["interface_name"] = "InterfaceName" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func interfacesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.InterfaceNeighborPropertiesBindingType) +} + +func interfacesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["fabric_node_id"] = bindings.NewStringType() + fields["interface_name"] = bindings.NewStringType() + fieldNameMap["fabric_node_id"] = "FabricNodeId" + fieldNameMap["interface_name"] = "InterfaceName" + paramsTypeMap["fabric_node_id"] = bindings.NewStringType() + paramsTypeMap["interface_name"] = bindings.NewStringType() + paramsTypeMap["fabricNodeId"] = bindings.NewStringType() + paramsTypeMap["interfaceName"] = bindings.NewStringType() + pathParams["interface_name"] = "interfaceName" + pathParams["fabric_node_id"] = "fabricNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/lldp/fabric-nodes/{fabricNodeId}/interfaces/{interfaceName}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func interfacesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["fabric_node_id"] = bindings.NewStringType() + fieldNameMap["fabric_node_id"] = "FabricNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func interfacesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.InterfaceNeighborPropertyListResultBindingType) +} + +func interfacesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["fabric_node_id"] = bindings.NewStringType() + fieldNameMap["fabric_node_id"] = "FabricNodeId" + paramsTypeMap["fabric_node_id"] = bindings.NewStringType() + paramsTypeMap["fabricNodeId"] = bindings.NewStringType() + pathParams["fabric_node_id"] = "fabricNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/lldp/fabric-nodes/{fabricNodeId}/interfaces", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/lldp/transport_nodes/InterfacesClient.go b/services/nsxt-mp/nsx/lldp/transport_nodes/InterfacesClient.go new file mode 100644 index 000000000..3d0a6661a --- /dev/null +++ b/services/nsxt-mp/nsx/lldp/transport_nodes/InterfacesClient.go @@ -0,0 +1,135 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Interfaces +// Used by client-side stubs. + +package transport_nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type InterfacesClient interface { + + // Read LLDP Neighbor Properties for a specific interface of Transport Node + // + // @param nodeIdParam ID of transport node (required) + // @param interfaceNameParam Interface name to read (required) + // @return com.vmware.nsx.model.InterfaceNeighborProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nodeIdParam string, interfaceNameParam string) (model.InterfaceNeighborProperties, error) + + // List LLDP Neighbor Properties for all interfaces of Transport Node + // + // @param nodeIdParam ID of transport node (required) + // @return com.vmware.nsx.model.InterfaceNeighborPropertyListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(nodeIdParam string) (model.InterfaceNeighborPropertyListResult, error) +} + +type interfacesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewInterfacesClient(connector client.Connector) *interfacesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.lldp.transport_nodes.interfaces") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := interfacesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *interfacesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *interfacesClient) Get(nodeIdParam string, interfaceNameParam string) (model.InterfaceNeighborProperties, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(interfacesGetInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("InterfaceName", interfaceNameParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.InterfaceNeighborProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := interfacesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.lldp.transport_nodes.interfaces", "get", inputDataValue, executionContext) + var emptyOutput model.InterfaceNeighborProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), interfacesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.InterfaceNeighborProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *interfacesClient) List(nodeIdParam string) (model.InterfaceNeighborPropertyListResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(interfacesListInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.InterfaceNeighborPropertyListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := interfacesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.lldp.transport_nodes.interfaces", "list", inputDataValue, executionContext) + var emptyOutput model.InterfaceNeighborPropertyListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), interfacesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.InterfaceNeighborPropertyListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/lldp/transport_nodes/InterfacesTypes.go b/services/nsxt-mp/nsx/lldp/transport_nodes/InterfacesTypes.go new file mode 100644 index 000000000..7180cc19b --- /dev/null +++ b/services/nsxt-mp/nsx/lldp/transport_nodes/InterfacesTypes.go @@ -0,0 +1,126 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Interfaces. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package transport_nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func interfacesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fields["interface_name"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["interface_name"] = "InterfaceName" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func interfacesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.InterfaceNeighborPropertiesBindingType) +} + +func interfacesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fields["interface_name"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["interface_name"] = "InterfaceName" + paramsTypeMap["interface_name"] = bindings.NewStringType() + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + paramsTypeMap["interfaceName"] = bindings.NewStringType() + pathParams["interface_name"] = "interfaceName" + pathParams["node_id"] = "nodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/lldp/transport-nodes/{nodeId}/interfaces/{interfaceName}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func interfacesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func interfacesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.InterfaceNeighborPropertyListResultBindingType) +} + +func interfacesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/lldp/transport-nodes/{nodeId}/interfaces", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/lldp/transport_nodes/TransportNodesPackageTypes.go b/services/nsxt-mp/nsx/lldp/transport_nodes/TransportNodesPackageTypes.go new file mode 100644 index 000000000..89daa6189 --- /dev/null +++ b/services/nsxt-mp/nsx/lldp/transport_nodes/TransportNodesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.lldp.transport_nodes. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package transport_nodes diff --git a/services/nsxt-mp/nsx/loadbalancer/ApplicationProfilesClient.go b/services/nsxt-mp/nsx/loadbalancer/ApplicationProfilesClient.go new file mode 100644 index 000000000..cb196c83f --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/ApplicationProfilesClient.go @@ -0,0 +1,273 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ApplicationProfiles +// Used by client-side stubs. + +package loadbalancer + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ApplicationProfilesClient interface { + + // Create a load balancer application profile. + // + // @param lbAppProfileParam (required) + // The parameter must contain all the properties defined in model.LbAppProfile. + // @return com.vmware.nsx.model.LbAppProfile + // The return value will contain all the properties defined in model.LbAppProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(lbAppProfileParam *data.StructValue) (*data.StructValue, error) + + // Delete a load balancer application profile. + // + // @param applicationProfileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(applicationProfileIdParam string) error + + // Retrieve a load balancer application profile. + // + // @param applicationProfileIdParam (required) + // @return com.vmware.nsx.model.LbAppProfile + // The return value will contain all the properties defined in model.LbAppProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(applicationProfileIdParam string) (*data.StructValue, error) + + // Retrieve a paginated list of load balancer application profiles. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param type_Param application profile type (optional) + // @return com.vmware.nsx.model.LbAppProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, type_Param *string) (model.LbAppProfileListResult, error) + + // Update a load balancer application profile. + // + // @param applicationProfileIdParam (required) + // @param lbAppProfileParam (required) + // The parameter must contain all the properties defined in model.LbAppProfile. + // @return com.vmware.nsx.model.LbAppProfile + // The return value will contain all the properties defined in model.LbAppProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(applicationProfileIdParam string, lbAppProfileParam *data.StructValue) (*data.StructValue, error) +} + +type applicationProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewApplicationProfilesClient(connector client.Connector) *applicationProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.loadbalancer.application_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := applicationProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *applicationProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *applicationProfilesClient) Create(lbAppProfileParam *data.StructValue) (*data.StructValue, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(applicationProfilesCreateInputType(), typeConverter) + sv.AddStructField("LbAppProfile", lbAppProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := applicationProfilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.application_profiles", "create", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), applicationProfilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (aIface *applicationProfilesClient) Delete(applicationProfileIdParam string) error { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(applicationProfilesDeleteInputType(), typeConverter) + sv.AddStructField("ApplicationProfileId", applicationProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := applicationProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.application_profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (aIface *applicationProfilesClient) Get(applicationProfileIdParam string) (*data.StructValue, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(applicationProfilesGetInputType(), typeConverter) + sv.AddStructField("ApplicationProfileId", applicationProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := applicationProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.application_profiles", "get", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), applicationProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (aIface *applicationProfilesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, type_Param *string) (model.LbAppProfileListResult, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(applicationProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Type_", type_Param) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbAppProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := applicationProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.application_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.LbAppProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), applicationProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbAppProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (aIface *applicationProfilesClient) Update(applicationProfileIdParam string, lbAppProfileParam *data.StructValue) (*data.StructValue, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(applicationProfilesUpdateInputType(), typeConverter) + sv.AddStructField("ApplicationProfileId", applicationProfileIdParam) + sv.AddStructField("LbAppProfile", lbAppProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := applicationProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.application_profiles", "update", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), applicationProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/loadbalancer/ApplicationProfilesTypes.go b/services/nsxt-mp/nsx/loadbalancer/ApplicationProfilesTypes.go new file mode 100644 index 000000000..398f93740 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/ApplicationProfilesTypes.go @@ -0,0 +1,310 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ApplicationProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package loadbalancer + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``type`` of method ApplicationProfiles#list. +const ApplicationProfiles_LIST_TYPE_LBHTTPPROFILE = "LbHttpProfile" + +// Possible value for ``type`` of method ApplicationProfiles#list. +const ApplicationProfiles_LIST_TYPE_LBFASTTCPPROFILE = "LbFastTcpProfile" + +// Possible value for ``type`` of method ApplicationProfiles#list. +const ApplicationProfiles_LIST_TYPE_LBFASTUDPPROFILE = "LbFastUdpProfile" + +func applicationProfilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lb_app_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbAppProfileBindingType)}, bindings.REST) + fieldNameMap["lb_app_profile"] = "LbAppProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func applicationProfilesCreateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbAppProfileBindingType)}, bindings.REST) +} + +func applicationProfilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lb_app_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbAppProfileBindingType)}, bindings.REST) + fieldNameMap["lb_app_profile"] = "LbAppProfile" + paramsTypeMap["lb_app_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbAppProfileBindingType)}, bindings.REST) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "lb_app_profile", + "POST", + "/api/v1/loadbalancer/application-profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func applicationProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["application_profile_id"] = bindings.NewStringType() + fieldNameMap["application_profile_id"] = "ApplicationProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func applicationProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func applicationProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["application_profile_id"] = bindings.NewStringType() + fieldNameMap["application_profile_id"] = "ApplicationProfileId" + paramsTypeMap["application_profile_id"] = bindings.NewStringType() + paramsTypeMap["applicationProfileId"] = bindings.NewStringType() + pathParams["application_profile_id"] = "applicationProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/loadbalancer/application-profiles/{applicationProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func applicationProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["application_profile_id"] = bindings.NewStringType() + fieldNameMap["application_profile_id"] = "ApplicationProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func applicationProfilesGetOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbAppProfileBindingType)}, bindings.REST) +} + +func applicationProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["application_profile_id"] = bindings.NewStringType() + fieldNameMap["application_profile_id"] = "ApplicationProfileId" + paramsTypeMap["application_profile_id"] = bindings.NewStringType() + paramsTypeMap["applicationProfileId"] = bindings.NewStringType() + pathParams["application_profile_id"] = "applicationProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/application-profiles/{applicationProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func applicationProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func applicationProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbAppProfileListResultBindingType) +} + +func applicationProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["type"] = "type" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/application-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func applicationProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["application_profile_id"] = bindings.NewStringType() + fields["lb_app_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbAppProfileBindingType)}, bindings.REST) + fieldNameMap["application_profile_id"] = "ApplicationProfileId" + fieldNameMap["lb_app_profile"] = "LbAppProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func applicationProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbAppProfileBindingType)}, bindings.REST) +} + +func applicationProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["application_profile_id"] = bindings.NewStringType() + fields["lb_app_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbAppProfileBindingType)}, bindings.REST) + fieldNameMap["application_profile_id"] = "ApplicationProfileId" + fieldNameMap["lb_app_profile"] = "LbAppProfile" + paramsTypeMap["lb_app_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbAppProfileBindingType)}, bindings.REST) + paramsTypeMap["application_profile_id"] = bindings.NewStringType() + paramsTypeMap["applicationProfileId"] = bindings.NewStringType() + pathParams["application_profile_id"] = "applicationProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "lb_app_profile", + "PUT", + "/api/v1/loadbalancer/application-profiles/{applicationProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/loadbalancer/ClientSslProfilesClient.go b/services/nsxt-mp/nsx/loadbalancer/ClientSslProfilesClient.go new file mode 100644 index 000000000..8ef9b8ac3 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/ClientSslProfilesClient.go @@ -0,0 +1,265 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ClientSslProfiles +// Used by client-side stubs. + +package loadbalancer + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ClientSslProfilesClient interface { + + // Create a load balancer client-ssl profile. + // + // @param lbClientSslProfileParam (required) + // @return com.vmware.nsx.model.LbClientSslProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(lbClientSslProfileParam model.LbClientSslProfile) (model.LbClientSslProfile, error) + + // Delete a load balancer client-ssl profile. + // + // @param clientSslProfileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(clientSslProfileIdParam string) error + + // Retrieve a load balancer client-ssl profile. + // + // @param clientSslProfileIdParam (required) + // @return com.vmware.nsx.model.LbClientSslProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(clientSslProfileIdParam string) (model.LbClientSslProfile, error) + + // Retrieve a paginated list of load balancer client-ssl profiles. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.LbClientSslProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LbClientSslProfileListResult, error) + + // Update a load balancer client-ssl profile. + // + // @param clientSslProfileIdParam (required) + // @param lbClientSslProfileParam (required) + // @return com.vmware.nsx.model.LbClientSslProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(clientSslProfileIdParam string, lbClientSslProfileParam model.LbClientSslProfile) (model.LbClientSslProfile, error) +} + +type clientSslProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewClientSslProfilesClient(connector client.Connector) *clientSslProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.loadbalancer.client_ssl_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := clientSslProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *clientSslProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *clientSslProfilesClient) Create(lbClientSslProfileParam model.LbClientSslProfile) (model.LbClientSslProfile, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clientSslProfilesCreateInputType(), typeConverter) + sv.AddStructField("LbClientSslProfile", lbClientSslProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbClientSslProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clientSslProfilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.client_ssl_profiles", "create", inputDataValue, executionContext) + var emptyOutput model.LbClientSslProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), clientSslProfilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbClientSslProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *clientSslProfilesClient) Delete(clientSslProfileIdParam string) error { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clientSslProfilesDeleteInputType(), typeConverter) + sv.AddStructField("ClientSslProfileId", clientSslProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clientSslProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.client_ssl_profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *clientSslProfilesClient) Get(clientSslProfileIdParam string) (model.LbClientSslProfile, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clientSslProfilesGetInputType(), typeConverter) + sv.AddStructField("ClientSslProfileId", clientSslProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbClientSslProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clientSslProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.client_ssl_profiles", "get", inputDataValue, executionContext) + var emptyOutput model.LbClientSslProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), clientSslProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbClientSslProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *clientSslProfilesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LbClientSslProfileListResult, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clientSslProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbClientSslProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clientSslProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.client_ssl_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.LbClientSslProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), clientSslProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbClientSslProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *clientSslProfilesClient) Update(clientSslProfileIdParam string, lbClientSslProfileParam model.LbClientSslProfile) (model.LbClientSslProfile, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clientSslProfilesUpdateInputType(), typeConverter) + sv.AddStructField("ClientSslProfileId", clientSslProfileIdParam) + sv.AddStructField("LbClientSslProfile", lbClientSslProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbClientSslProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clientSslProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.client_ssl_profiles", "update", inputDataValue, executionContext) + var emptyOutput model.LbClientSslProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), clientSslProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbClientSslProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/loadbalancer/ClientSslProfilesTypes.go b/services/nsxt-mp/nsx/loadbalancer/ClientSslProfilesTypes.go new file mode 100644 index 000000000..0c77b3798 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/ClientSslProfilesTypes.go @@ -0,0 +1,295 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ClientSslProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package loadbalancer + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func clientSslProfilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lb_client_ssl_profile"] = bindings.NewReferenceType(model.LbClientSslProfileBindingType) + fieldNameMap["lb_client_ssl_profile"] = "LbClientSslProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clientSslProfilesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbClientSslProfileBindingType) +} + +func clientSslProfilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lb_client_ssl_profile"] = bindings.NewReferenceType(model.LbClientSslProfileBindingType) + fieldNameMap["lb_client_ssl_profile"] = "LbClientSslProfile" + paramsTypeMap["lb_client_ssl_profile"] = bindings.NewReferenceType(model.LbClientSslProfileBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "lb_client_ssl_profile", + "POST", + "/api/v1/loadbalancer/client-ssl-profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func clientSslProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["client_ssl_profile_id"] = bindings.NewStringType() + fieldNameMap["client_ssl_profile_id"] = "ClientSslProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clientSslProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func clientSslProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["client_ssl_profile_id"] = bindings.NewStringType() + fieldNameMap["client_ssl_profile_id"] = "ClientSslProfileId" + paramsTypeMap["client_ssl_profile_id"] = bindings.NewStringType() + paramsTypeMap["clientSslProfileId"] = bindings.NewStringType() + pathParams["client_ssl_profile_id"] = "clientSslProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/loadbalancer/client-ssl-profiles/{clientSslProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func clientSslProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["client_ssl_profile_id"] = bindings.NewStringType() + fieldNameMap["client_ssl_profile_id"] = "ClientSslProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clientSslProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbClientSslProfileBindingType) +} + +func clientSslProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["client_ssl_profile_id"] = bindings.NewStringType() + fieldNameMap["client_ssl_profile_id"] = "ClientSslProfileId" + paramsTypeMap["client_ssl_profile_id"] = bindings.NewStringType() + paramsTypeMap["clientSslProfileId"] = bindings.NewStringType() + pathParams["client_ssl_profile_id"] = "clientSslProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/client-ssl-profiles/{clientSslProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func clientSslProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clientSslProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbClientSslProfileListResultBindingType) +} + +func clientSslProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/client-ssl-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func clientSslProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["client_ssl_profile_id"] = bindings.NewStringType() + fields["lb_client_ssl_profile"] = bindings.NewReferenceType(model.LbClientSslProfileBindingType) + fieldNameMap["client_ssl_profile_id"] = "ClientSslProfileId" + fieldNameMap["lb_client_ssl_profile"] = "LbClientSslProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clientSslProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbClientSslProfileBindingType) +} + +func clientSslProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["client_ssl_profile_id"] = bindings.NewStringType() + fields["lb_client_ssl_profile"] = bindings.NewReferenceType(model.LbClientSslProfileBindingType) + fieldNameMap["client_ssl_profile_id"] = "ClientSslProfileId" + fieldNameMap["lb_client_ssl_profile"] = "LbClientSslProfile" + paramsTypeMap["client_ssl_profile_id"] = bindings.NewStringType() + paramsTypeMap["lb_client_ssl_profile"] = bindings.NewReferenceType(model.LbClientSslProfileBindingType) + paramsTypeMap["clientSslProfileId"] = bindings.NewStringType() + pathParams["client_ssl_profile_id"] = "clientSslProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "lb_client_ssl_profile", + "PUT", + "/api/v1/loadbalancer/client-ssl-profiles/{clientSslProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/loadbalancer/LoadbalancerPackageTypes.go b/services/nsxt-mp/nsx/loadbalancer/LoadbalancerPackageTypes.go new file mode 100644 index 000000000..8378488d3 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/LoadbalancerPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.loadbalancer. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package loadbalancer diff --git a/services/nsxt-mp/nsx/loadbalancer/MonitorsClient.go b/services/nsxt-mp/nsx/loadbalancer/MonitorsClient.go new file mode 100644 index 000000000..6b6ce42e1 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/MonitorsClient.go @@ -0,0 +1,273 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Monitors +// Used by client-side stubs. + +package loadbalancer + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MonitorsClient interface { + + // Create a load balancer monitor. + // + // @param lbMonitorParam (required) + // The parameter must contain all the properties defined in model.LbMonitor. + // @return com.vmware.nsx.model.LbMonitor + // The return value will contain all the properties defined in model.LbMonitor. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(lbMonitorParam *data.StructValue) (*data.StructValue, error) + + // Delete a load balancer monitor. + // + // @param monitorIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(monitorIdParam string) error + + // Retrieve a load balancer monitor. + // + // @param monitorIdParam (required) + // @return com.vmware.nsx.model.LbMonitor + // The return value will contain all the properties defined in model.LbMonitor. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(monitorIdParam string) (*data.StructValue, error) + + // Retrieve a paginated list of load balancer monitors. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param type_Param monitor query type (optional) + // @return com.vmware.nsx.model.LbMonitorListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, type_Param *string) (model.LbMonitorListResult, error) + + // Update a load balancer monitor. + // + // @param monitorIdParam (required) + // @param lbMonitorParam (required) + // The parameter must contain all the properties defined in model.LbMonitor. + // @return com.vmware.nsx.model.LbMonitor + // The return value will contain all the properties defined in model.LbMonitor. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(monitorIdParam string, lbMonitorParam *data.StructValue) (*data.StructValue, error) +} + +type monitorsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMonitorsClient(connector client.Connector) *monitorsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.loadbalancer.monitors") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := monitorsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *monitorsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *monitorsClient) Create(lbMonitorParam *data.StructValue) (*data.StructValue, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(monitorsCreateInputType(), typeConverter) + sv.AddStructField("LbMonitor", lbMonitorParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := monitorsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.monitors", "create", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), monitorsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *monitorsClient) Delete(monitorIdParam string) error { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(monitorsDeleteInputType(), typeConverter) + sv.AddStructField("MonitorId", monitorIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := monitorsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.monitors", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (mIface *monitorsClient) Get(monitorIdParam string) (*data.StructValue, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(monitorsGetInputType(), typeConverter) + sv.AddStructField("MonitorId", monitorIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := monitorsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.monitors", "get", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), monitorsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *monitorsClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, type_Param *string) (model.LbMonitorListResult, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(monitorsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Type_", type_Param) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbMonitorListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := monitorsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.monitors", "list", inputDataValue, executionContext) + var emptyOutput model.LbMonitorListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), monitorsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbMonitorListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *monitorsClient) Update(monitorIdParam string, lbMonitorParam *data.StructValue) (*data.StructValue, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(monitorsUpdateInputType(), typeConverter) + sv.AddStructField("MonitorId", monitorIdParam) + sv.AddStructField("LbMonitor", lbMonitorParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := monitorsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.monitors", "update", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), monitorsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/loadbalancer/MonitorsTypes.go b/services/nsxt-mp/nsx/loadbalancer/MonitorsTypes.go new file mode 100644 index 000000000..d22052d96 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/MonitorsTypes.go @@ -0,0 +1,322 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Monitors. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package loadbalancer + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``type`` of method Monitors#list. +const Monitors_LIST_TYPE_LBHTTPMONITOR = "LbHttpMonitor" + +// Possible value for ``type`` of method Monitors#list. +const Monitors_LIST_TYPE_LBHTTPSMONITOR = "LbHttpsMonitor" + +// Possible value for ``type`` of method Monitors#list. +const Monitors_LIST_TYPE_LBICMPMONITOR = "LbIcmpMonitor" + +// Possible value for ``type`` of method Monitors#list. +const Monitors_LIST_TYPE_LBTCPMONITOR = "LbTcpMonitor" + +// Possible value for ``type`` of method Monitors#list. +const Monitors_LIST_TYPE_LBUDPMONITOR = "LbUdpMonitor" + +// Possible value for ``type`` of method Monitors#list. +const Monitors_LIST_TYPE_LBPASSIVEMONITOR = "LbPassiveMonitor" + +// Possible value for ``type`` of method Monitors#list. +const Monitors_LIST_TYPE_LBACTIVEMONITOR = "LbActiveMonitor" + +func monitorsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lb_monitor"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbMonitorBindingType)}, bindings.REST) + fieldNameMap["lb_monitor"] = "LbMonitor" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func monitorsCreateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbMonitorBindingType)}, bindings.REST) +} + +func monitorsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lb_monitor"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbMonitorBindingType)}, bindings.REST) + fieldNameMap["lb_monitor"] = "LbMonitor" + paramsTypeMap["lb_monitor"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbMonitorBindingType)}, bindings.REST) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "lb_monitor", + "POST", + "/api/v1/loadbalancer/monitors", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func monitorsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["monitor_id"] = bindings.NewStringType() + fieldNameMap["monitor_id"] = "MonitorId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func monitorsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func monitorsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["monitor_id"] = bindings.NewStringType() + fieldNameMap["monitor_id"] = "MonitorId" + paramsTypeMap["monitor_id"] = bindings.NewStringType() + paramsTypeMap["monitorId"] = bindings.NewStringType() + pathParams["monitor_id"] = "monitorId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/loadbalancer/monitors/{monitorId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func monitorsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["monitor_id"] = bindings.NewStringType() + fieldNameMap["monitor_id"] = "MonitorId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func monitorsGetOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbMonitorBindingType)}, bindings.REST) +} + +func monitorsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["monitor_id"] = bindings.NewStringType() + fieldNameMap["monitor_id"] = "MonitorId" + paramsTypeMap["monitor_id"] = bindings.NewStringType() + paramsTypeMap["monitorId"] = bindings.NewStringType() + pathParams["monitor_id"] = "monitorId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/monitors/{monitorId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func monitorsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func monitorsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbMonitorListResultBindingType) +} + +func monitorsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["type"] = "type" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/monitors", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func monitorsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["monitor_id"] = bindings.NewStringType() + fields["lb_monitor"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbMonitorBindingType)}, bindings.REST) + fieldNameMap["monitor_id"] = "MonitorId" + fieldNameMap["lb_monitor"] = "LbMonitor" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func monitorsUpdateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbMonitorBindingType)}, bindings.REST) +} + +func monitorsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["monitor_id"] = bindings.NewStringType() + fields["lb_monitor"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbMonitorBindingType)}, bindings.REST) + fieldNameMap["monitor_id"] = "MonitorId" + fieldNameMap["lb_monitor"] = "LbMonitor" + paramsTypeMap["monitor_id"] = bindings.NewStringType() + paramsTypeMap["lb_monitor"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbMonitorBindingType)}, bindings.REST) + paramsTypeMap["monitorId"] = bindings.NewStringType() + pathParams["monitor_id"] = "monitorId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "lb_monitor", + "PUT", + "/api/v1/loadbalancer/monitors/{monitorId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/loadbalancer/NodeUsageSummaryClient.go b/services/nsxt-mp/nsx/loadbalancer/NodeUsageSummaryClient.go new file mode 100644 index 000000000..0b48360f7 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/NodeUsageSummaryClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: NodeUsageSummary +// Used by client-side stubs. + +package loadbalancer + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NodeUsageSummaryClient interface { + + // API is used to retrieve the load balancer node usage summary for all nodes. + // + // @param includeUsagesParam Whether to include node usages (optional) + // @return com.vmware.nsx.model.LbNodeUsageSummary + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(includeUsagesParam *bool) (model.LbNodeUsageSummary, error) +} + +type nodeUsageSummaryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNodeUsageSummaryClient(connector client.Connector) *nodeUsageSummaryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.loadbalancer.node_usage_summary") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nodeUsageSummaryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nodeUsageSummaryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nodeUsageSummaryClient) Get(includeUsagesParam *bool) (model.LbNodeUsageSummary, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodeUsageSummaryGetInputType(), typeConverter) + sv.AddStructField("IncludeUsages", includeUsagesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbNodeUsageSummary + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodeUsageSummaryGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.node_usage_summary", "get", inputDataValue, executionContext) + var emptyOutput model.LbNodeUsageSummary + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nodeUsageSummaryGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbNodeUsageSummary), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/loadbalancer/NodeUsageSummaryTypes.go b/services/nsxt-mp/nsx/loadbalancer/NodeUsageSummaryTypes.go new file mode 100644 index 000000000..eb6ca10bd --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/NodeUsageSummaryTypes.go @@ -0,0 +1,68 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: NodeUsageSummary. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package loadbalancer + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func nodeUsageSummaryGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["include_usages"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["include_usages"] = "IncludeUsages" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodeUsageSummaryGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbNodeUsageSummaryBindingType) +} + +func nodeUsageSummaryGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["include_usages"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["include_usages"] = "IncludeUsages" + paramsTypeMap["include_usages"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["include_usages"] = "include_usages" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/node-usage-summary", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/loadbalancer/PersistenceProfilesClient.go b/services/nsxt-mp/nsx/loadbalancer/PersistenceProfilesClient.go new file mode 100644 index 000000000..b6ba3206d --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/PersistenceProfilesClient.go @@ -0,0 +1,273 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: PersistenceProfiles +// Used by client-side stubs. + +package loadbalancer + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type PersistenceProfilesClient interface { + + // Create a load balancer persistence profile. + // + // @param lbPersistenceProfileParam (required) + // The parameter must contain all the properties defined in model.LbPersistenceProfile. + // @return com.vmware.nsx.model.LbPersistenceProfile + // The return value will contain all the properties defined in model.LbPersistenceProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(lbPersistenceProfileParam *data.StructValue) (*data.StructValue, error) + + // Delete a load balancer persistence profile. + // + // @param persistenceProfileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(persistenceProfileIdParam string) error + + // Retrieve a load balancer persistence profile. + // + // @param persistenceProfileIdParam (required) + // @return com.vmware.nsx.model.LbPersistenceProfile + // The return value will contain all the properties defined in model.LbPersistenceProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(persistenceProfileIdParam string) (*data.StructValue, error) + + // Retrieve a paginated list of load balancer persistence profiles. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param type_Param persistence profile type (optional) + // @return com.vmware.nsx.model.LbPersistenceProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, type_Param *string) (model.LbPersistenceProfileListResult, error) + + // Update a load balancer persistence profile. + // + // @param persistenceProfileIdParam (required) + // @param lbPersistenceProfileParam (required) + // The parameter must contain all the properties defined in model.LbPersistenceProfile. + // @return com.vmware.nsx.model.LbPersistenceProfile + // The return value will contain all the properties defined in model.LbPersistenceProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(persistenceProfileIdParam string, lbPersistenceProfileParam *data.StructValue) (*data.StructValue, error) +} + +type persistenceProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewPersistenceProfilesClient(connector client.Connector) *persistenceProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.loadbalancer.persistence_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + pIface := persistenceProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &pIface +} + +func (pIface *persistenceProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := pIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (pIface *persistenceProfilesClient) Create(lbPersistenceProfileParam *data.StructValue) (*data.StructValue, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(persistenceProfilesCreateInputType(), typeConverter) + sv.AddStructField("LbPersistenceProfile", lbPersistenceProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := persistenceProfilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.persistence_profiles", "create", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), persistenceProfilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *persistenceProfilesClient) Delete(persistenceProfileIdParam string) error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(persistenceProfilesDeleteInputType(), typeConverter) + sv.AddStructField("PersistenceProfileId", persistenceProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := persistenceProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.persistence_profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *persistenceProfilesClient) Get(persistenceProfileIdParam string) (*data.StructValue, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(persistenceProfilesGetInputType(), typeConverter) + sv.AddStructField("PersistenceProfileId", persistenceProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := persistenceProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.persistence_profiles", "get", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), persistenceProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *persistenceProfilesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, type_Param *string) (model.LbPersistenceProfileListResult, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(persistenceProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Type_", type_Param) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbPersistenceProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := persistenceProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.persistence_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.LbPersistenceProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), persistenceProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbPersistenceProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *persistenceProfilesClient) Update(persistenceProfileIdParam string, lbPersistenceProfileParam *data.StructValue) (*data.StructValue, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(persistenceProfilesUpdateInputType(), typeConverter) + sv.AddStructField("PersistenceProfileId", persistenceProfileIdParam) + sv.AddStructField("LbPersistenceProfile", lbPersistenceProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := persistenceProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.persistence_profiles", "update", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), persistenceProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/loadbalancer/PersistenceProfilesTypes.go b/services/nsxt-mp/nsx/loadbalancer/PersistenceProfilesTypes.go new file mode 100644 index 000000000..f40cc004f --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/PersistenceProfilesTypes.go @@ -0,0 +1,310 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: PersistenceProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package loadbalancer + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``type`` of method PersistenceProfiles#list. +const PersistenceProfiles_LIST_TYPE_LBCOOKIEPERSISTENCEPROFILE = "LbCookiePersistenceProfile" + +// Possible value for ``type`` of method PersistenceProfiles#list. +const PersistenceProfiles_LIST_TYPE_LBSOURCEIPPERSISTENCEPROFILE = "LbSourceIpPersistenceProfile" + +// Possible value for ``type`` of method PersistenceProfiles#list. +const PersistenceProfiles_LIST_TYPE_LBGENERICPERSISTENCEPROFILE = "LbGenericPersistenceProfile" + +func persistenceProfilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lb_persistence_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbPersistenceProfileBindingType)}, bindings.REST) + fieldNameMap["lb_persistence_profile"] = "LbPersistenceProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func persistenceProfilesCreateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbPersistenceProfileBindingType)}, bindings.REST) +} + +func persistenceProfilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lb_persistence_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbPersistenceProfileBindingType)}, bindings.REST) + fieldNameMap["lb_persistence_profile"] = "LbPersistenceProfile" + paramsTypeMap["lb_persistence_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbPersistenceProfileBindingType)}, bindings.REST) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "lb_persistence_profile", + "POST", + "/api/v1/loadbalancer/persistence-profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func persistenceProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["persistence_profile_id"] = bindings.NewStringType() + fieldNameMap["persistence_profile_id"] = "PersistenceProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func persistenceProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func persistenceProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["persistence_profile_id"] = bindings.NewStringType() + fieldNameMap["persistence_profile_id"] = "PersistenceProfileId" + paramsTypeMap["persistence_profile_id"] = bindings.NewStringType() + paramsTypeMap["persistenceProfileId"] = bindings.NewStringType() + pathParams["persistence_profile_id"] = "persistenceProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/loadbalancer/persistence-profiles/{persistenceProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func persistenceProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["persistence_profile_id"] = bindings.NewStringType() + fieldNameMap["persistence_profile_id"] = "PersistenceProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func persistenceProfilesGetOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbPersistenceProfileBindingType)}, bindings.REST) +} + +func persistenceProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["persistence_profile_id"] = bindings.NewStringType() + fieldNameMap["persistence_profile_id"] = "PersistenceProfileId" + paramsTypeMap["persistence_profile_id"] = bindings.NewStringType() + paramsTypeMap["persistenceProfileId"] = bindings.NewStringType() + pathParams["persistence_profile_id"] = "persistenceProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/persistence-profiles/{persistenceProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func persistenceProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func persistenceProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbPersistenceProfileListResultBindingType) +} + +func persistenceProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["type"] = "type" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/persistence-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func persistenceProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["persistence_profile_id"] = bindings.NewStringType() + fields["lb_persistence_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbPersistenceProfileBindingType)}, bindings.REST) + fieldNameMap["persistence_profile_id"] = "PersistenceProfileId" + fieldNameMap["lb_persistence_profile"] = "LbPersistenceProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func persistenceProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbPersistenceProfileBindingType)}, bindings.REST) +} + +func persistenceProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["persistence_profile_id"] = bindings.NewStringType() + fields["lb_persistence_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbPersistenceProfileBindingType)}, bindings.REST) + fieldNameMap["persistence_profile_id"] = "PersistenceProfileId" + fieldNameMap["lb_persistence_profile"] = "LbPersistenceProfile" + paramsTypeMap["persistence_profile_id"] = bindings.NewStringType() + paramsTypeMap["lb_persistence_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbPersistenceProfileBindingType)}, bindings.REST) + paramsTypeMap["persistenceProfileId"] = bindings.NewStringType() + pathParams["persistence_profile_id"] = "persistenceProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "lb_persistence_profile", + "PUT", + "/api/v1/loadbalancer/persistence-profiles/{persistenceProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/loadbalancer/PoolsClient.go b/services/nsxt-mp/nsx/loadbalancer/PoolsClient.go new file mode 100644 index 000000000..e4d47c543 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/PoolsClient.go @@ -0,0 +1,312 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Pools +// Used by client-side stubs. + +package loadbalancer + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type PoolsClient interface { + + // Create a load balancer pool. + // + // @param lbPoolParam (required) + // @return com.vmware.nsx.model.LbPool + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(lbPoolParam model.LbPool) (model.LbPool, error) + + // For ADD_MEMBERS, pool members will be created and added to load balancer pool. This action is only valid for static pool members. For REMOVE_MEMBERS, pool members will be removed from load balancer pool via IP and port in pool member settings. This action is only valid for static pool members. For UPDATE_MEMBERS, pool members admin state will be updated. This action is valid for both static pool members and dynamic pool members. For dynamic pool members, this update will be stored in customized_members field in load balancer pool member group. + // + // @param poolIdParam (required) + // @param poolMemberSettingListParam (required) + // @param actionParam Specifies addition, removal and modification action (required) + // @return com.vmware.nsx.model.LbPool + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create0(poolIdParam string, poolMemberSettingListParam model.PoolMemberSettingList, actionParam string) (model.LbPool, error) + + // Delete a load balancer pool. + // + // @param poolIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(poolIdParam string) error + + // Retrieve a load balancer pool. + // + // @param poolIdParam (required) + // @return com.vmware.nsx.model.LbPool + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(poolIdParam string) (model.LbPool, error) + + // Retrieve a paginated list of load balancer pools. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.LbPoolListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LbPoolListResult, error) + + // Update a load balancer pool. + // + // @param poolIdParam (required) + // @param lbPoolParam (required) + // @return com.vmware.nsx.model.LbPool + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(poolIdParam string, lbPoolParam model.LbPool) (model.LbPool, error) +} + +type poolsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewPoolsClient(connector client.Connector) *poolsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.loadbalancer.pools") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "create_0": core.NewMethodIdentifier(interfaceIdentifier, "create_0"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + pIface := poolsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &pIface +} + +func (pIface *poolsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := pIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (pIface *poolsClient) Create(lbPoolParam model.LbPool) (model.LbPool, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(poolsCreateInputType(), typeConverter) + sv.AddStructField("LbPool", lbPoolParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbPool + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := poolsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.pools", "create", inputDataValue, executionContext) + var emptyOutput model.LbPool + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), poolsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbPool), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *poolsClient) Create0(poolIdParam string, poolMemberSettingListParam model.PoolMemberSettingList, actionParam string) (model.LbPool, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(poolsCreate0InputType(), typeConverter) + sv.AddStructField("PoolId", poolIdParam) + sv.AddStructField("PoolMemberSettingList", poolMemberSettingListParam) + sv.AddStructField("Action", actionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbPool + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := poolsCreate0RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.pools", "create_0", inputDataValue, executionContext) + var emptyOutput model.LbPool + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), poolsCreate0OutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbPool), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *poolsClient) Delete(poolIdParam string) error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(poolsDeleteInputType(), typeConverter) + sv.AddStructField("PoolId", poolIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := poolsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.pools", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *poolsClient) Get(poolIdParam string) (model.LbPool, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(poolsGetInputType(), typeConverter) + sv.AddStructField("PoolId", poolIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbPool + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := poolsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.pools", "get", inputDataValue, executionContext) + var emptyOutput model.LbPool + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), poolsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbPool), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *poolsClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LbPoolListResult, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(poolsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbPoolListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := poolsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.pools", "list", inputDataValue, executionContext) + var emptyOutput model.LbPoolListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), poolsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbPoolListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *poolsClient) Update(poolIdParam string, lbPoolParam model.LbPool) (model.LbPool, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(poolsUpdateInputType(), typeConverter) + sv.AddStructField("PoolId", poolIdParam) + sv.AddStructField("LbPool", lbPoolParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbPool + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := poolsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.pools", "update", inputDataValue, executionContext) + var emptyOutput model.LbPool + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), poolsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbPool), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/loadbalancer/PoolsTypes.go b/services/nsxt-mp/nsx/loadbalancer/PoolsTypes.go new file mode 100644 index 000000000..caa1690a9 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/PoolsTypes.go @@ -0,0 +1,365 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Pools. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package loadbalancer + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``action`` of method Pools#create0. +const Pools_CREATE_0_ACTION_ADD_MEMBERS = "ADD_MEMBERS" + +// Possible value for ``action`` of method Pools#create0. +const Pools_CREATE_0_ACTION_REMOVE_MEMBERS = "REMOVE_MEMBERS" + +// Possible value for ``action`` of method Pools#create0. +const Pools_CREATE_0_ACTION_UPDATE_MEMBERS = "UPDATE_MEMBERS" + +func poolsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lb_pool"] = bindings.NewReferenceType(model.LbPoolBindingType) + fieldNameMap["lb_pool"] = "LbPool" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func poolsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbPoolBindingType) +} + +func poolsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lb_pool"] = bindings.NewReferenceType(model.LbPoolBindingType) + fieldNameMap["lb_pool"] = "LbPool" + paramsTypeMap["lb_pool"] = bindings.NewReferenceType(model.LbPoolBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "lb_pool", + "POST", + "/api/v1/loadbalancer/pools", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func poolsCreate0InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["pool_id"] = bindings.NewStringType() + fields["pool_member_setting_list"] = bindings.NewReferenceType(model.PoolMemberSettingListBindingType) + fields["action"] = bindings.NewStringType() + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["pool_member_setting_list"] = "PoolMemberSettingList" + fieldNameMap["action"] = "Action" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func poolsCreate0OutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbPoolBindingType) +} + +func poolsCreate0RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["pool_id"] = bindings.NewStringType() + fields["pool_member_setting_list"] = bindings.NewReferenceType(model.PoolMemberSettingListBindingType) + fields["action"] = bindings.NewStringType() + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["pool_member_setting_list"] = "PoolMemberSettingList" + fieldNameMap["action"] = "Action" + paramsTypeMap["pool_member_setting_list"] = bindings.NewReferenceType(model.PoolMemberSettingListBindingType) + paramsTypeMap["action"] = bindings.NewStringType() + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + queryParams["action"] = "action" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "pool_member_setting_list", + "POST", + "/api/v1/loadbalancer/pools/{poolId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func poolsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["pool_id"] = bindings.NewStringType() + fieldNameMap["pool_id"] = "PoolId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func poolsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func poolsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["pool_id"] = bindings.NewStringType() + fieldNameMap["pool_id"] = "PoolId" + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/loadbalancer/pools/{poolId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func poolsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["pool_id"] = bindings.NewStringType() + fieldNameMap["pool_id"] = "PoolId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func poolsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbPoolBindingType) +} + +func poolsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["pool_id"] = bindings.NewStringType() + fieldNameMap["pool_id"] = "PoolId" + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/pools/{poolId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func poolsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func poolsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbPoolListResultBindingType) +} + +func poolsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/pools", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func poolsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["pool_id"] = bindings.NewStringType() + fields["lb_pool"] = bindings.NewReferenceType(model.LbPoolBindingType) + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["lb_pool"] = "LbPool" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func poolsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbPoolBindingType) +} + +func poolsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["pool_id"] = bindings.NewStringType() + fields["lb_pool"] = bindings.NewReferenceType(model.LbPoolBindingType) + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["lb_pool"] = "LbPool" + paramsTypeMap["lb_pool"] = bindings.NewReferenceType(model.LbPoolBindingType) + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "lb_pool", + "PUT", + "/api/v1/loadbalancer/pools/{poolId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/loadbalancer/RulesClient.go b/services/nsxt-mp/nsx/loadbalancer/RulesClient.go new file mode 100644 index 000000000..0768a6438 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/RulesClient.go @@ -0,0 +1,265 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Rules +// Used by client-side stubs. + +package loadbalancer + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RulesClient interface { + + // Create a load balancer rule. + // + // @param lbRuleParam (required) + // @return com.vmware.nsx.model.LbRule + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(lbRuleParam model.LbRule) (model.LbRule, error) + + // Delete a load balancer rule. + // + // @param ruleIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(ruleIdParam string) error + + // Retrieve a load balancer rule. + // + // @param ruleIdParam (required) + // @return com.vmware.nsx.model.LbRule + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ruleIdParam string) (model.LbRule, error) + + // Retrieve a paginated list of load balancer rules. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.LbRuleListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LbRuleListResult, error) + + // Update a load balancer rule. + // + // @param ruleIdParam (required) + // @param lbRuleParam (required) + // @return com.vmware.nsx.model.LbRule + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(ruleIdParam string, lbRuleParam model.LbRule) (model.LbRule, error) +} + +type rulesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRulesClient(connector client.Connector) *rulesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.loadbalancer.rules") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := rulesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *rulesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *rulesClient) Create(lbRuleParam model.LbRule) (model.LbRule, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesCreateInputType(), typeConverter) + sv.AddStructField("LbRule", lbRuleParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbRule + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.rules", "create", inputDataValue, executionContext) + var emptyOutput model.LbRule + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbRule), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rulesClient) Delete(ruleIdParam string) error { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesDeleteInputType(), typeConverter) + sv.AddStructField("RuleId", ruleIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.rules", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (rIface *rulesClient) Get(ruleIdParam string) (model.LbRule, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesGetInputType(), typeConverter) + sv.AddStructField("RuleId", ruleIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbRule + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.rules", "get", inputDataValue, executionContext) + var emptyOutput model.LbRule + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbRule), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rulesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LbRuleListResult, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbRuleListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.rules", "list", inputDataValue, executionContext) + var emptyOutput model.LbRuleListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbRuleListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rulesClient) Update(ruleIdParam string, lbRuleParam model.LbRule) (model.LbRule, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesUpdateInputType(), typeConverter) + sv.AddStructField("RuleId", ruleIdParam) + sv.AddStructField("LbRule", lbRuleParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbRule + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.rules", "update", inputDataValue, executionContext) + var emptyOutput model.LbRule + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbRule), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/loadbalancer/RulesTypes.go b/services/nsxt-mp/nsx/loadbalancer/RulesTypes.go new file mode 100644 index 000000000..190f14327 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/RulesTypes.go @@ -0,0 +1,295 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Rules. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package loadbalancer + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func rulesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lb_rule"] = bindings.NewReferenceType(model.LbRuleBindingType) + fieldNameMap["lb_rule"] = "LbRule" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbRuleBindingType) +} + +func rulesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lb_rule"] = bindings.NewReferenceType(model.LbRuleBindingType) + fieldNameMap["lb_rule"] = "LbRule" + paramsTypeMap["lb_rule"] = bindings.NewReferenceType(model.LbRuleBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "lb_rule", + "POST", + "/api/v1/loadbalancer/rules", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rule_id"] = bindings.NewStringType() + fieldNameMap["rule_id"] = "RuleId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func rulesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["rule_id"] = bindings.NewStringType() + fieldNameMap["rule_id"] = "RuleId" + paramsTypeMap["rule_id"] = bindings.NewStringType() + paramsTypeMap["ruleId"] = bindings.NewStringType() + pathParams["rule_id"] = "ruleId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/loadbalancer/rules/{ruleId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rule_id"] = bindings.NewStringType() + fieldNameMap["rule_id"] = "RuleId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbRuleBindingType) +} + +func rulesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["rule_id"] = bindings.NewStringType() + fieldNameMap["rule_id"] = "RuleId" + paramsTypeMap["rule_id"] = bindings.NewStringType() + paramsTypeMap["ruleId"] = bindings.NewStringType() + pathParams["rule_id"] = "ruleId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/rules/{ruleId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbRuleListResultBindingType) +} + +func rulesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/rules", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rule_id"] = bindings.NewStringType() + fields["lb_rule"] = bindings.NewReferenceType(model.LbRuleBindingType) + fieldNameMap["rule_id"] = "RuleId" + fieldNameMap["lb_rule"] = "LbRule" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbRuleBindingType) +} + +func rulesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["rule_id"] = bindings.NewStringType() + fields["lb_rule"] = bindings.NewReferenceType(model.LbRuleBindingType) + fieldNameMap["rule_id"] = "RuleId" + fieldNameMap["lb_rule"] = "LbRule" + paramsTypeMap["rule_id"] = bindings.NewStringType() + paramsTypeMap["lb_rule"] = bindings.NewReferenceType(model.LbRuleBindingType) + paramsTypeMap["ruleId"] = bindings.NewStringType() + pathParams["rule_id"] = "ruleId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "lb_rule", + "PUT", + "/api/v1/loadbalancer/rules/{ruleId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/loadbalancer/ServerSslProfilesClient.go b/services/nsxt-mp/nsx/loadbalancer/ServerSslProfilesClient.go new file mode 100644 index 000000000..b85934a1b --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/ServerSslProfilesClient.go @@ -0,0 +1,265 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ServerSslProfiles +// Used by client-side stubs. + +package loadbalancer + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ServerSslProfilesClient interface { + + // Create a load balancer server-ssl profile. + // + // @param lbServerSslProfileParam (required) + // @return com.vmware.nsx.model.LbServerSslProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(lbServerSslProfileParam model.LbServerSslProfile) (model.LbServerSslProfile, error) + + // Delete a load balancer server-ssl profile. + // + // @param serverSslProfileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(serverSslProfileIdParam string) error + + // Retrieve a load balancer server-ssl profile. + // + // @param serverSslProfileIdParam (required) + // @return com.vmware.nsx.model.LbServerSslProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serverSslProfileIdParam string) (model.LbServerSslProfile, error) + + // Retrieve a paginated list of load balancer server-ssl profiles. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.LbServerSslProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LbServerSslProfileListResult, error) + + // Update a load balancer server-ssl profile. + // + // @param serverSslProfileIdParam (required) + // @param lbServerSslProfileParam (required) + // @return com.vmware.nsx.model.LbServerSslProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(serverSslProfileIdParam string, lbServerSslProfileParam model.LbServerSslProfile) (model.LbServerSslProfile, error) +} + +type serverSslProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewServerSslProfilesClient(connector client.Connector) *serverSslProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.loadbalancer.server_ssl_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := serverSslProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *serverSslProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *serverSslProfilesClient) Create(lbServerSslProfileParam model.LbServerSslProfile) (model.LbServerSslProfile, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serverSslProfilesCreateInputType(), typeConverter) + sv.AddStructField("LbServerSslProfile", lbServerSslProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbServerSslProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serverSslProfilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.server_ssl_profiles", "create", inputDataValue, executionContext) + var emptyOutput model.LbServerSslProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serverSslProfilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbServerSslProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serverSslProfilesClient) Delete(serverSslProfileIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serverSslProfilesDeleteInputType(), typeConverter) + sv.AddStructField("ServerSslProfileId", serverSslProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serverSslProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.server_ssl_profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *serverSslProfilesClient) Get(serverSslProfileIdParam string) (model.LbServerSslProfile, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serverSslProfilesGetInputType(), typeConverter) + sv.AddStructField("ServerSslProfileId", serverSslProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbServerSslProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serverSslProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.server_ssl_profiles", "get", inputDataValue, executionContext) + var emptyOutput model.LbServerSslProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serverSslProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbServerSslProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serverSslProfilesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LbServerSslProfileListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serverSslProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbServerSslProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serverSslProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.server_ssl_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.LbServerSslProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serverSslProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbServerSslProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serverSslProfilesClient) Update(serverSslProfileIdParam string, lbServerSslProfileParam model.LbServerSslProfile) (model.LbServerSslProfile, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serverSslProfilesUpdateInputType(), typeConverter) + sv.AddStructField("ServerSslProfileId", serverSslProfileIdParam) + sv.AddStructField("LbServerSslProfile", lbServerSslProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbServerSslProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serverSslProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.server_ssl_profiles", "update", inputDataValue, executionContext) + var emptyOutput model.LbServerSslProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serverSslProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbServerSslProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/loadbalancer/ServerSslProfilesTypes.go b/services/nsxt-mp/nsx/loadbalancer/ServerSslProfilesTypes.go new file mode 100644 index 000000000..a4945c9ef --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/ServerSslProfilesTypes.go @@ -0,0 +1,295 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ServerSslProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package loadbalancer + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func serverSslProfilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lb_server_ssl_profile"] = bindings.NewReferenceType(model.LbServerSslProfileBindingType) + fieldNameMap["lb_server_ssl_profile"] = "LbServerSslProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serverSslProfilesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbServerSslProfileBindingType) +} + +func serverSslProfilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lb_server_ssl_profile"] = bindings.NewReferenceType(model.LbServerSslProfileBindingType) + fieldNameMap["lb_server_ssl_profile"] = "LbServerSslProfile" + paramsTypeMap["lb_server_ssl_profile"] = bindings.NewReferenceType(model.LbServerSslProfileBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "lb_server_ssl_profile", + "POST", + "/api/v1/loadbalancer/server-ssl-profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serverSslProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_ssl_profile_id"] = bindings.NewStringType() + fieldNameMap["server_ssl_profile_id"] = "ServerSslProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serverSslProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func serverSslProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_ssl_profile_id"] = bindings.NewStringType() + fieldNameMap["server_ssl_profile_id"] = "ServerSslProfileId" + paramsTypeMap["server_ssl_profile_id"] = bindings.NewStringType() + paramsTypeMap["serverSslProfileId"] = bindings.NewStringType() + pathParams["server_ssl_profile_id"] = "serverSslProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/loadbalancer/server-ssl-profiles/{serverSslProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serverSslProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_ssl_profile_id"] = bindings.NewStringType() + fieldNameMap["server_ssl_profile_id"] = "ServerSslProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serverSslProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbServerSslProfileBindingType) +} + +func serverSslProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_ssl_profile_id"] = bindings.NewStringType() + fieldNameMap["server_ssl_profile_id"] = "ServerSslProfileId" + paramsTypeMap["server_ssl_profile_id"] = bindings.NewStringType() + paramsTypeMap["serverSslProfileId"] = bindings.NewStringType() + pathParams["server_ssl_profile_id"] = "serverSslProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/server-ssl-profiles/{serverSslProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serverSslProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serverSslProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbServerSslProfileListResultBindingType) +} + +func serverSslProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/server-ssl-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serverSslProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["server_ssl_profile_id"] = bindings.NewStringType() + fields["lb_server_ssl_profile"] = bindings.NewReferenceType(model.LbServerSslProfileBindingType) + fieldNameMap["server_ssl_profile_id"] = "ServerSslProfileId" + fieldNameMap["lb_server_ssl_profile"] = "LbServerSslProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serverSslProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbServerSslProfileBindingType) +} + +func serverSslProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["server_ssl_profile_id"] = bindings.NewStringType() + fields["lb_server_ssl_profile"] = bindings.NewReferenceType(model.LbServerSslProfileBindingType) + fieldNameMap["server_ssl_profile_id"] = "ServerSslProfileId" + fieldNameMap["lb_server_ssl_profile"] = "LbServerSslProfile" + paramsTypeMap["server_ssl_profile_id"] = bindings.NewStringType() + paramsTypeMap["lb_server_ssl_profile"] = bindings.NewReferenceType(model.LbServerSslProfileBindingType) + paramsTypeMap["serverSslProfileId"] = bindings.NewStringType() + pathParams["server_ssl_profile_id"] = "serverSslProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "lb_server_ssl_profile", + "PUT", + "/api/v1/loadbalancer/server-ssl-profiles/{serverSslProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/loadbalancer/ServicesClient.go b/services/nsxt-mp/nsx/loadbalancer/ServicesClient.go new file mode 100644 index 000000000..01c222713 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/ServicesClient.go @@ -0,0 +1,267 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Services +// Used by client-side stubs. + +package loadbalancer + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ServicesClient interface { + + // Create a load balancer service. + // + // @param lbServiceParam (required) + // @return com.vmware.nsx.model.LbService + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(lbServiceParam model.LbService) (model.LbService, error) + + // Delete a load balancer service. + // + // @param serviceIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(serviceIdParam string) error + + // Retrieve a load balancer service. + // + // @param serviceIdParam (required) + // @return com.vmware.nsx.model.LbService + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string) (model.LbService, error) + + // Retrieve a paginated list of load balancer services. When logical_router_id is specified in request parameters, the associated load balancer services which are related to the given logical router returned. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param logicalRouterIdParam Logical router identifier (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.LbServiceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, logicalRouterIdParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LbServiceListResult, error) + + // Update a load balancer service. + // + // @param serviceIdParam (required) + // @param lbServiceParam (required) + // @return com.vmware.nsx.model.LbService + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(serviceIdParam string, lbServiceParam model.LbService) (model.LbService, error) +} + +type servicesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewServicesClient(connector client.Connector) *servicesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.loadbalancer.services") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := servicesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *servicesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *servicesClient) Create(lbServiceParam model.LbService) (model.LbService, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(servicesCreateInputType(), typeConverter) + sv.AddStructField("LbService", lbServiceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbService + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.services", "create", inputDataValue, executionContext) + var emptyOutput model.LbService + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), servicesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbService), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *servicesClient) Delete(serviceIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(servicesDeleteInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.services", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *servicesClient) Get(serviceIdParam string) (model.LbService, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(servicesGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbService + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.services", "get", inputDataValue, executionContext) + var emptyOutput model.LbService + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), servicesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbService), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *servicesClient) List(cursorParam *string, includedFieldsParam *string, logicalRouterIdParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LbServiceListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(servicesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbServiceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.services", "list", inputDataValue, executionContext) + var emptyOutput model.LbServiceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), servicesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbServiceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *servicesClient) Update(serviceIdParam string, lbServiceParam model.LbService) (model.LbService, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(servicesUpdateInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("LbService", lbServiceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbService + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.services", "update", inputDataValue, executionContext) + var emptyOutput model.LbService + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), servicesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbService), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/loadbalancer/ServicesTypes.go b/services/nsxt-mp/nsx/loadbalancer/ServicesTypes.go new file mode 100644 index 000000000..188bbace8 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/ServicesTypes.go @@ -0,0 +1,301 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Services. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package loadbalancer + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func servicesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lb_service"] = bindings.NewReferenceType(model.LbServiceBindingType) + fieldNameMap["lb_service"] = "LbService" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbServiceBindingType) +} + +func servicesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lb_service"] = bindings.NewReferenceType(model.LbServiceBindingType) + fieldNameMap["lb_service"] = "LbService" + paramsTypeMap["lb_service"] = bindings.NewReferenceType(model.LbServiceBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "lb_service", + "POST", + "/api/v1/loadbalancer/services/nsxt-mp", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func servicesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func servicesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/loadbalancer/services/nsxt-mp/{serviceId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func servicesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbServiceBindingType) +} + +func servicesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/services/nsxt-mp/{serviceId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func servicesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbServiceListResultBindingType) +} + +func servicesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["logical_router_id"] = "logical_router_id" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/services/nsxt-mp", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func servicesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["lb_service"] = bindings.NewReferenceType(model.LbServiceBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["lb_service"] = "LbService" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbServiceBindingType) +} + +func servicesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["lb_service"] = bindings.NewReferenceType(model.LbServiceBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["lb_service"] = "LbService" + paramsTypeMap["lb_service"] = bindings.NewReferenceType(model.LbServiceBindingType) + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "lb_service", + "PUT", + "/api/v1/loadbalancer/services/nsxt-mp/{serviceId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/loadbalancer/UsagePerNodeClient.go b/services/nsxt-mp/nsx/loadbalancer/UsagePerNodeClient.go new file mode 100644 index 000000000..e41880521 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/UsagePerNodeClient.go @@ -0,0 +1,91 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: UsagePerNode +// Used by client-side stubs. + +package loadbalancer + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UsagePerNodeClient interface { + + // API is used to retrieve the usage of load balancer entities which include current number and remaining number of credits, virtual Servers, pools, pool Members and different size of LB services from the given node. Currently only Edge node is supported. + // + // @param nodeIdParam (required) + // @return com.vmware.nsx.model.LbNodeUsage + // The return value will contain all the properties defined in model.LbNodeUsage. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nodeIdParam string) (*data.StructValue, error) +} + +type usagePerNodeClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUsagePerNodeClient(connector client.Connector) *usagePerNodeClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.loadbalancer.usage_per_node") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := usagePerNodeClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *usagePerNodeClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *usagePerNodeClient) Get(nodeIdParam string) (*data.StructValue, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(usagePerNodeGetInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := usagePerNodeGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.usage_per_node", "get", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), usagePerNodeGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/loadbalancer/UsagePerNodeTypes.go b/services/nsxt-mp/nsx/loadbalancer/UsagePerNodeTypes.go new file mode 100644 index 000000000..dd6fa9413 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/UsagePerNodeTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: UsagePerNode. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package loadbalancer + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func usagePerNodeGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func usagePerNodeGetOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.LbNodeUsageBindingType)}, bindings.REST) +} + +func usagePerNodeGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/usage-per-node/{nodeId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/loadbalancer/VirtualServersClient.go b/services/nsxt-mp/nsx/loadbalancer/VirtualServersClient.go new file mode 100644 index 000000000..2b04a450d --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/VirtualServersClient.go @@ -0,0 +1,355 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: VirtualServers +// Used by client-side stubs. + +package loadbalancer + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type VirtualServersClient interface { + + // Create a load balancer virtual server. + // + // @param lbVirtualServerParam (required) + // @return com.vmware.nsx.model.LbVirtualServer + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(lbVirtualServerParam model.LbVirtualServer) (model.LbVirtualServer, error) + + // It is used to create virtual servers, the associated rules and bind the rules to the virtual server. To add new rules, make sure the rules which have no identifier specified, the new rules are automatically generated and associated to the virtual server. If the virtual server need to consume some existed rules without change, those rules should not be specified in this array, otherwise, the rules are updated. + // + // @param lbVirtualServerWithRuleParam (required) + // @return com.vmware.nsx.model.LbVirtualServerWithRule + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Createwithrules(lbVirtualServerWithRuleParam model.LbVirtualServerWithRule) (model.LbVirtualServerWithRule, error) + + // Delete a load balancer virtual server. + // + // @param virtualServerIdParam (required) + // @param deleteAssociatedRulesParam Delete associated rules (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(virtualServerIdParam string, deleteAssociatedRulesParam *bool) error + + // Retrieve a load balancer virtual server. + // + // @param virtualServerIdParam (required) + // @return com.vmware.nsx.model.LbVirtualServer + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(virtualServerIdParam string) (model.LbVirtualServer, error) + + // Retrieve a paginated list of load balancer virtual servers. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.LbVirtualServerListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LbVirtualServerListResult, error) + + // Update a load balancer virtual server. + // + // @param virtualServerIdParam (required) + // @param lbVirtualServerParam (required) + // @return com.vmware.nsx.model.LbVirtualServer + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(virtualServerIdParam string, lbVirtualServerParam model.LbVirtualServer) (model.LbVirtualServer, error) + + // It is used to update virtual servers, the associated rules and update the binding of virtual server and rules. To add new rules, make sure the rules which have no identifier specified, the new rules are automatically generated and associated to the virtual server. To delete old rules, the rules should not be configured in new action, the UUID of deleted rules should be also removed from rule_ids. To update rules, the rules should be specified with new change and configured with identifier. If there are some rules which are not modified, those rule should not be specified in the rules list, the UUID list of rules should be specified in rule_ids of LbVirtualServer. + // + // @param virtualServerIdParam (required) + // @param lbVirtualServerWithRuleParam (required) + // @return com.vmware.nsx.model.LbVirtualServerWithRule + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Updatewithrules(virtualServerIdParam string, lbVirtualServerWithRuleParam model.LbVirtualServerWithRule) (model.LbVirtualServerWithRule, error) +} + +type virtualServersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewVirtualServersClient(connector client.Connector) *virtualServersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.loadbalancer.virtual_servers") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "createwithrules": core.NewMethodIdentifier(interfaceIdentifier, "createwithrules"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + "updatewithrules": core.NewMethodIdentifier(interfaceIdentifier, "updatewithrules"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + vIface := virtualServersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &vIface +} + +func (vIface *virtualServersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := vIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (vIface *virtualServersClient) Create(lbVirtualServerParam model.LbVirtualServer) (model.LbVirtualServer, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(virtualServersCreateInputType(), typeConverter) + sv.AddStructField("LbVirtualServer", lbVirtualServerParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbVirtualServer + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := virtualServersCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.virtual_servers", "create", inputDataValue, executionContext) + var emptyOutput model.LbVirtualServer + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), virtualServersCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbVirtualServer), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (vIface *virtualServersClient) Createwithrules(lbVirtualServerWithRuleParam model.LbVirtualServerWithRule) (model.LbVirtualServerWithRule, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(virtualServersCreatewithrulesInputType(), typeConverter) + sv.AddStructField("LbVirtualServerWithRule", lbVirtualServerWithRuleParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbVirtualServerWithRule + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := virtualServersCreatewithrulesRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.virtual_servers", "createwithrules", inputDataValue, executionContext) + var emptyOutput model.LbVirtualServerWithRule + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), virtualServersCreatewithrulesOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbVirtualServerWithRule), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (vIface *virtualServersClient) Delete(virtualServerIdParam string, deleteAssociatedRulesParam *bool) error { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(virtualServersDeleteInputType(), typeConverter) + sv.AddStructField("VirtualServerId", virtualServerIdParam) + sv.AddStructField("DeleteAssociatedRules", deleteAssociatedRulesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := virtualServersDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.virtual_servers", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (vIface *virtualServersClient) Get(virtualServerIdParam string) (model.LbVirtualServer, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(virtualServersGetInputType(), typeConverter) + sv.AddStructField("VirtualServerId", virtualServerIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbVirtualServer + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := virtualServersGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.virtual_servers", "get", inputDataValue, executionContext) + var emptyOutput model.LbVirtualServer + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), virtualServersGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbVirtualServer), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (vIface *virtualServersClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LbVirtualServerListResult, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(virtualServersListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbVirtualServerListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := virtualServersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.virtual_servers", "list", inputDataValue, executionContext) + var emptyOutput model.LbVirtualServerListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), virtualServersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbVirtualServerListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (vIface *virtualServersClient) Update(virtualServerIdParam string, lbVirtualServerParam model.LbVirtualServer) (model.LbVirtualServer, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(virtualServersUpdateInputType(), typeConverter) + sv.AddStructField("VirtualServerId", virtualServerIdParam) + sv.AddStructField("LbVirtualServer", lbVirtualServerParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbVirtualServer + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := virtualServersUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.virtual_servers", "update", inputDataValue, executionContext) + var emptyOutput model.LbVirtualServer + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), virtualServersUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbVirtualServer), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (vIface *virtualServersClient) Updatewithrules(virtualServerIdParam string, lbVirtualServerWithRuleParam model.LbVirtualServerWithRule) (model.LbVirtualServerWithRule, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(virtualServersUpdatewithrulesInputType(), typeConverter) + sv.AddStructField("VirtualServerId", virtualServerIdParam) + sv.AddStructField("LbVirtualServerWithRule", lbVirtualServerWithRuleParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbVirtualServerWithRule + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := virtualServersUpdatewithrulesRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.virtual_servers", "updatewithrules", inputDataValue, executionContext) + var emptyOutput model.LbVirtualServerWithRule + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), virtualServersUpdatewithrulesOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbVirtualServerWithRule), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/loadbalancer/VirtualServersTypes.go b/services/nsxt-mp/nsx/loadbalancer/VirtualServersTypes.go new file mode 100644 index 000000000..5065c6a8e --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/VirtualServersTypes.go @@ -0,0 +1,404 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: VirtualServers. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package loadbalancer + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func virtualServersCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lb_virtual_server"] = bindings.NewReferenceType(model.LbVirtualServerBindingType) + fieldNameMap["lb_virtual_server"] = "LbVirtualServer" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func virtualServersCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbVirtualServerBindingType) +} + +func virtualServersCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lb_virtual_server"] = bindings.NewReferenceType(model.LbVirtualServerBindingType) + fieldNameMap["lb_virtual_server"] = "LbVirtualServer" + paramsTypeMap["lb_virtual_server"] = bindings.NewReferenceType(model.LbVirtualServerBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "lb_virtual_server", + "POST", + "/api/v1/loadbalancer/virtual-servers", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func virtualServersCreatewithrulesInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lb_virtual_server_with_rule"] = bindings.NewReferenceType(model.LbVirtualServerWithRuleBindingType) + fieldNameMap["lb_virtual_server_with_rule"] = "LbVirtualServerWithRule" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func virtualServersCreatewithrulesOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbVirtualServerWithRuleBindingType) +} + +func virtualServersCreatewithrulesRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lb_virtual_server_with_rule"] = bindings.NewReferenceType(model.LbVirtualServerWithRuleBindingType) + fieldNameMap["lb_virtual_server_with_rule"] = "LbVirtualServerWithRule" + paramsTypeMap["lb_virtual_server_with_rule"] = bindings.NewReferenceType(model.LbVirtualServerWithRuleBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=create_with_rules", + "lb_virtual_server_with_rule", + "POST", + "/api/v1/loadbalancer/virtual-servers", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func virtualServersDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["virtual_server_id"] = bindings.NewStringType() + fields["delete_associated_rules"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["virtual_server_id"] = "VirtualServerId" + fieldNameMap["delete_associated_rules"] = "DeleteAssociatedRules" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func virtualServersDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func virtualServersDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["virtual_server_id"] = bindings.NewStringType() + fields["delete_associated_rules"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["virtual_server_id"] = "VirtualServerId" + fieldNameMap["delete_associated_rules"] = "DeleteAssociatedRules" + paramsTypeMap["delete_associated_rules"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["virtual_server_id"] = bindings.NewStringType() + paramsTypeMap["virtualServerId"] = bindings.NewStringType() + pathParams["virtual_server_id"] = "virtualServerId" + queryParams["delete_associated_rules"] = "delete_associated_rules" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/loadbalancer/virtual-servers/{virtualServerId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func virtualServersGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["virtual_server_id"] = bindings.NewStringType() + fieldNameMap["virtual_server_id"] = "VirtualServerId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func virtualServersGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbVirtualServerBindingType) +} + +func virtualServersGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["virtual_server_id"] = bindings.NewStringType() + fieldNameMap["virtual_server_id"] = "VirtualServerId" + paramsTypeMap["virtual_server_id"] = bindings.NewStringType() + paramsTypeMap["virtualServerId"] = bindings.NewStringType() + pathParams["virtual_server_id"] = "virtualServerId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/virtual-servers/{virtualServerId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func virtualServersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func virtualServersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbVirtualServerListResultBindingType) +} + +func virtualServersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/virtual-servers", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func virtualServersUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["virtual_server_id"] = bindings.NewStringType() + fields["lb_virtual_server"] = bindings.NewReferenceType(model.LbVirtualServerBindingType) + fieldNameMap["virtual_server_id"] = "VirtualServerId" + fieldNameMap["lb_virtual_server"] = "LbVirtualServer" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func virtualServersUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbVirtualServerBindingType) +} + +func virtualServersUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["virtual_server_id"] = bindings.NewStringType() + fields["lb_virtual_server"] = bindings.NewReferenceType(model.LbVirtualServerBindingType) + fieldNameMap["virtual_server_id"] = "VirtualServerId" + fieldNameMap["lb_virtual_server"] = "LbVirtualServer" + paramsTypeMap["lb_virtual_server"] = bindings.NewReferenceType(model.LbVirtualServerBindingType) + paramsTypeMap["virtual_server_id"] = bindings.NewStringType() + paramsTypeMap["virtualServerId"] = bindings.NewStringType() + pathParams["virtual_server_id"] = "virtualServerId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "lb_virtual_server", + "PUT", + "/api/v1/loadbalancer/virtual-servers/{virtualServerId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func virtualServersUpdatewithrulesInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["virtual_server_id"] = bindings.NewStringType() + fields["lb_virtual_server_with_rule"] = bindings.NewReferenceType(model.LbVirtualServerWithRuleBindingType) + fieldNameMap["virtual_server_id"] = "VirtualServerId" + fieldNameMap["lb_virtual_server_with_rule"] = "LbVirtualServerWithRule" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func virtualServersUpdatewithrulesOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbVirtualServerWithRuleBindingType) +} + +func virtualServersUpdatewithrulesRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["virtual_server_id"] = bindings.NewStringType() + fields["lb_virtual_server_with_rule"] = bindings.NewReferenceType(model.LbVirtualServerWithRuleBindingType) + fieldNameMap["virtual_server_id"] = "VirtualServerId" + fieldNameMap["lb_virtual_server_with_rule"] = "LbVirtualServerWithRule" + paramsTypeMap["lb_virtual_server_with_rule"] = bindings.NewReferenceType(model.LbVirtualServerWithRuleBindingType) + paramsTypeMap["virtual_server_id"] = bindings.NewStringType() + paramsTypeMap["virtualServerId"] = bindings.NewStringType() + pathParams["virtual_server_id"] = "virtualServerId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=update_with_rules", + "lb_virtual_server_with_rule", + "PUT", + "/api/v1/loadbalancer/virtual-servers/{virtualServerId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/loadbalancer/services/DebugInfoClient.go b/services/nsxt-mp/nsx/loadbalancer/services/DebugInfoClient.go new file mode 100644 index 000000000..3fba1a108 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/services/DebugInfoClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: DebugInfo +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type DebugInfoClient interface { + + // API to download below information which will be used for debugging and troubleshooting. 1) Load balancer service 2) Load balancer associated virtual servers 3) Load balancer associated pools 4) Load balancer associated profiles such as persistence, SSL, application. 5) Load balancer associated monitors 6) Load balancer associated rules + // + // @param serviceIdParam (required) + // @return com.vmware.nsx.model.LbServiceDebugInfo + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string) (model.LbServiceDebugInfo, error) +} + +type debugInfoClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewDebugInfoClient(connector client.Connector) *debugInfoClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.loadbalancer.services.debug_info") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + dIface := debugInfoClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &dIface +} + +func (dIface *debugInfoClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := dIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (dIface *debugInfoClient) Get(serviceIdParam string) (model.LbServiceDebugInfo, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(debugInfoGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbServiceDebugInfo + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := debugInfoGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.services.debug_info", "get", inputDataValue, executionContext) + var emptyOutput model.LbServiceDebugInfo + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), debugInfoGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbServiceDebugInfo), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/loadbalancer/services/DebugInfoTypes.go b/services/nsxt-mp/nsx/loadbalancer/services/DebugInfoTypes.go new file mode 100644 index 000000000..d6357bf6c --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/services/DebugInfoTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: DebugInfo. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func debugInfoGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func debugInfoGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbServiceDebugInfoBindingType) +} + +func debugInfoGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/services/nsxt-mp/{serviceId}/debug-info", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/loadbalancer/services/ServicesPackageTypes.go b/services/nsxt-mp/nsx/loadbalancer/services/ServicesPackageTypes.go new file mode 100644 index 000000000..32dbd116a --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/services/ServicesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.loadbalancer.services. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services diff --git a/services/nsxt-mp/nsx/loadbalancer/services/StatisticsClient.go b/services/nsxt-mp/nsx/loadbalancer/services/StatisticsClient.go new file mode 100644 index 000000000..823f510d9 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/services/StatisticsClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Statistics +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatisticsClient interface { + + // Returns the statistics of the given load balancer service. + // + // @param serviceIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.LbServiceStatistics + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string, sourceParam *string) (model.LbServiceStatistics, error) +} + +type statisticsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatisticsClient(connector client.Connector) *statisticsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.loadbalancer.services.statistics") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statisticsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statisticsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statisticsClient) Get(serviceIdParam string, sourceParam *string) (model.LbServiceStatistics, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statisticsGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbServiceStatistics + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statisticsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.services.statistics", "get", inputDataValue, executionContext) + var emptyOutput model.LbServiceStatistics + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statisticsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbServiceStatistics), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/loadbalancer/services/StatisticsTypes.go b/services/nsxt-mp/nsx/loadbalancer/services/StatisticsTypes.go new file mode 100644 index 000000000..f0abc370a --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/services/StatisticsTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Statistics. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Statistics#get. +const Statistics_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Statistics#get. +const Statistics_GET_SOURCE_CACHED = "cached" + +func statisticsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statisticsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbServiceStatisticsBindingType) +} + +func statisticsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/services/nsxt-mp/{serviceId}/statistics", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/loadbalancer/services/StatusClient.go b/services/nsxt-mp/nsx/loadbalancer/services/StatusClient.go new file mode 100644 index 000000000..139735b95 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/services/StatusClient.go @@ -0,0 +1,96 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Returns the status of the given load balancer service. + // + // @param serviceIdParam (required) + // @param includeInstanceDetailsParam Flag to indicate whether include detail information (optional, default to false) + // @param sourceParam Data source type. (optional) + // @param transportNodeIdsParam The UUIDs of transport nodes (optional) + // @return com.vmware.nsx.model.LbServiceStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string, includeInstanceDetailsParam *bool, sourceParam *string, transportNodeIdsParam *string) (model.LbServiceStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.loadbalancer.services.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(serviceIdParam string, includeInstanceDetailsParam *bool, sourceParam *string, transportNodeIdsParam *string) (model.LbServiceStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("IncludeInstanceDetails", includeInstanceDetailsParam) + sv.AddStructField("Source", sourceParam) + sv.AddStructField("TransportNodeIds", transportNodeIdsParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbServiceStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.services.status", "get", inputDataValue, executionContext) + var emptyOutput model.LbServiceStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbServiceStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/loadbalancer/services/StatusTypes.go b/services/nsxt-mp/nsx/loadbalancer/services/StatusTypes.go new file mode 100644 index 000000000..2209edaa1 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/services/StatusTypes.go @@ -0,0 +1,93 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_CACHED = "cached" + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["include_instance_details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_node_ids"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["include_instance_details"] = "IncludeInstanceDetails" + fieldNameMap["source"] = "Source" + fieldNameMap["transport_node_ids"] = "TransportNodeIds" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbServiceStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["include_instance_details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_node_ids"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["include_instance_details"] = "IncludeInstanceDetails" + fieldNameMap["source"] = "Source" + fieldNameMap["transport_node_ids"] = "TransportNodeIds" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["transport_node_ids"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["include_instance_details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + queryParams["include_instance_details"] = "include_instance_details" + queryParams["transport_node_ids"] = "transport_node_ids" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/services/nsxt-mp/{serviceId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/loadbalancer/services/UsageClient.go b/services/nsxt-mp/nsx/loadbalancer/services/UsageClient.go new file mode 100644 index 000000000..4c1f8e640 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/services/UsageClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Usage +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UsageClient interface { + + // API to fetch the capacity and current usage of the given load balancer service. + // + // @param serviceIdParam (required) + // @return com.vmware.nsx.model.LbServiceUsage + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string) (model.LbServiceUsage, error) +} + +type usageClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUsageClient(connector client.Connector) *usageClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.loadbalancer.services.usage") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := usageClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *usageClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *usageClient) Get(serviceIdParam string) (model.LbServiceUsage, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(usageGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbServiceUsage + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := usageGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.services.usage", "get", inputDataValue, executionContext) + var emptyOutput model.LbServiceUsage + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), usageGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbServiceUsage), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/loadbalancer/services/UsageTypes.go b/services/nsxt-mp/nsx/loadbalancer/services/UsageTypes.go new file mode 100644 index 000000000..775e1b146 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/services/UsageTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Usage. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func usageGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func usageGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbServiceUsageBindingType) +} + +func usageGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/services/nsxt-mp/{serviceId}/usage", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/loadbalancer/services/pools/PoolsPackageTypes.go b/services/nsxt-mp/nsx/loadbalancer/services/pools/PoolsPackageTypes.go new file mode 100644 index 000000000..5db3a5a78 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/services/pools/PoolsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.loadbalancer.services.pools. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package pools diff --git a/services/nsxt-mp/nsx/loadbalancer/services/pools/StatisticsClient.go b/services/nsxt-mp/nsx/loadbalancer/services/pools/StatisticsClient.go new file mode 100644 index 000000000..ae455ff52 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/services/pools/StatisticsClient.go @@ -0,0 +1,139 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Statistics +// Used by client-side stubs. + +package pools + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatisticsClient interface { + + // Returns the statistics of the given load balancer pool by given load balancer serives id and load balancer pool id. Currently, only realtime mode is supported. + // + // @param serviceIdParam (required) + // @param poolIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.LbPoolStatistics + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string, poolIdParam string, sourceParam *string) (model.LbPoolStatistics, error) + + // Returns the statistics list of load balancer pools in given load balancer service. Currently, only realtime mode is supported. + // + // @param serviceIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.LbPoolStatisticsListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(serviceIdParam string, sourceParam *string) (model.LbPoolStatisticsListResult, error) +} + +type statisticsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatisticsClient(connector client.Connector) *statisticsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.loadbalancer.services.pools.statistics") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statisticsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statisticsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statisticsClient) Get(serviceIdParam string, poolIdParam string, sourceParam *string) (model.LbPoolStatistics, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statisticsGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("PoolId", poolIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbPoolStatistics + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statisticsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.services.pools.statistics", "get", inputDataValue, executionContext) + var emptyOutput model.LbPoolStatistics + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statisticsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbPoolStatistics), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statisticsClient) List(serviceIdParam string, sourceParam *string) (model.LbPoolStatisticsListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statisticsListInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbPoolStatisticsListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statisticsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.services.pools.statistics", "list", inputDataValue, executionContext) + var emptyOutput model.LbPoolStatisticsListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statisticsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbPoolStatisticsListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/loadbalancer/services/pools/StatisticsTypes.go b/services/nsxt-mp/nsx/loadbalancer/services/pools/StatisticsTypes.go new file mode 100644 index 000000000..aeb9e9a99 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/services/pools/StatisticsTypes.go @@ -0,0 +1,150 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Statistics. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package pools + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Statistics#get. +const Statistics_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Statistics#get. +const Statistics_GET_SOURCE_CACHED = "cached" + +// Possible value for ``source`` of method Statistics#list. +const Statistics_LIST_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Statistics#list. +const Statistics_LIST_SOURCE_CACHED = "cached" + +func statisticsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["pool_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statisticsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbPoolStatisticsBindingType) +} + +func statisticsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["pool_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + pathParams["service_id"] = "serviceId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/services/nsxt-mp/{serviceId}/pools/{poolId}/statistics", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statisticsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statisticsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbPoolStatisticsListResultBindingType) +} + +func statisticsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/services/nsxt-mp/{serviceId}/pools/statistics", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/loadbalancer/services/pools/StatusClient.go b/services/nsxt-mp/nsx/loadbalancer/services/pools/StatusClient.go new file mode 100644 index 000000000..ac9c7db7c --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/services/pools/StatusClient.go @@ -0,0 +1,139 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package pools + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Returns the status of the given load balancer pool by given load balancer serives id and load balancer pool id. + // + // @param serviceIdParam (required) + // @param poolIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.LbPoolStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string, poolIdParam string, sourceParam *string) (model.LbPoolStatus, error) + + // Returns the status list of load balancer pools in given load balancer service. + // + // @param serviceIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.LbPoolStatusListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(serviceIdParam string, sourceParam *string) (model.LbPoolStatusListResult, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.loadbalancer.services.pools.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(serviceIdParam string, poolIdParam string, sourceParam *string) (model.LbPoolStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("PoolId", poolIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbPoolStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.services.pools.status", "get", inputDataValue, executionContext) + var emptyOutput model.LbPoolStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbPoolStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statusClient) List(serviceIdParam string, sourceParam *string) (model.LbPoolStatusListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusListInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbPoolStatusListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.services.pools.status", "list", inputDataValue, executionContext) + var emptyOutput model.LbPoolStatusListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbPoolStatusListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/loadbalancer/services/pools/StatusTypes.go b/services/nsxt-mp/nsx/loadbalancer/services/pools/StatusTypes.go new file mode 100644 index 000000000..842a6e0b0 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/services/pools/StatusTypes.go @@ -0,0 +1,150 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package pools + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_CACHED = "cached" + +// Possible value for ``source`` of method Status#list. +const Status_LIST_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Status#list. +const Status_LIST_SOURCE_CACHED = "cached" + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["pool_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbPoolStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["pool_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + pathParams["service_id"] = "serviceId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/services/nsxt-mp/{serviceId}/pools/{poolId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statusListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbPoolStatusListResultBindingType) +} + +func statusListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/services/nsxt-mp/{serviceId}/pools/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/loadbalancer/services/virtual_servers/StatisticsClient.go b/services/nsxt-mp/nsx/loadbalancer/services/virtual_servers/StatisticsClient.go new file mode 100644 index 000000000..1dd042892 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/services/virtual_servers/StatisticsClient.go @@ -0,0 +1,139 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Statistics +// Used by client-side stubs. + +package virtual_servers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatisticsClient interface { + + // Returns the statistics of the load balancer virtual server by given load balancer serives id and load balancer virtual server id. + // + // @param serviceIdParam (required) + // @param virtualServerIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.LbVirtualServerStatistics + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string, virtualServerIdParam string, sourceParam *string) (model.LbVirtualServerStatistics, error) + + // Returns the statistics list of virtual servers in given load balancer service. Currently, only realtime mode is supported. + // + // @param serviceIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.LbVirtualServerStatisticsListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(serviceIdParam string, sourceParam *string) (model.LbVirtualServerStatisticsListResult, error) +} + +type statisticsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatisticsClient(connector client.Connector) *statisticsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.loadbalancer.services.virtual_servers.statistics") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statisticsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statisticsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statisticsClient) Get(serviceIdParam string, virtualServerIdParam string, sourceParam *string) (model.LbVirtualServerStatistics, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statisticsGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("VirtualServerId", virtualServerIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbVirtualServerStatistics + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statisticsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.services.virtual_servers.statistics", "get", inputDataValue, executionContext) + var emptyOutput model.LbVirtualServerStatistics + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statisticsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbVirtualServerStatistics), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statisticsClient) List(serviceIdParam string, sourceParam *string) (model.LbVirtualServerStatisticsListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statisticsListInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbVirtualServerStatisticsListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statisticsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.services.virtual_servers.statistics", "list", inputDataValue, executionContext) + var emptyOutput model.LbVirtualServerStatisticsListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statisticsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbVirtualServerStatisticsListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/loadbalancer/services/virtual_servers/StatisticsTypes.go b/services/nsxt-mp/nsx/loadbalancer/services/virtual_servers/StatisticsTypes.go new file mode 100644 index 000000000..31e0257dc --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/services/virtual_servers/StatisticsTypes.go @@ -0,0 +1,150 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Statistics. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package virtual_servers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Statistics#get. +const Statistics_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Statistics#get. +const Statistics_GET_SOURCE_CACHED = "cached" + +// Possible value for ``source`` of method Statistics#list. +const Statistics_LIST_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Statistics#list. +const Statistics_LIST_SOURCE_CACHED = "cached" + +func statisticsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["virtual_server_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["virtual_server_id"] = "VirtualServerId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statisticsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbVirtualServerStatisticsBindingType) +} + +func statisticsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["virtual_server_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["virtual_server_id"] = "VirtualServerId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["virtual_server_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["virtualServerId"] = bindings.NewStringType() + pathParams["virtual_server_id"] = "virtualServerId" + pathParams["service_id"] = "serviceId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/services/nsxt-mp/{serviceId}/virtual-servers/{virtualServerId}/statistics", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statisticsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statisticsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbVirtualServerStatisticsListResultBindingType) +} + +func statisticsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/services/nsxt-mp/{serviceId}/virtual-servers/statistics", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/loadbalancer/services/virtual_servers/StatusClient.go b/services/nsxt-mp/nsx/loadbalancer/services/virtual_servers/StatusClient.go new file mode 100644 index 000000000..a61e20b07 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/services/virtual_servers/StatusClient.go @@ -0,0 +1,139 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package virtual_servers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Returns the status of the virtual server by given load balancer serives id and load balancer virtual server id. + // + // @param serviceIdParam (required) + // @param virtualServerIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.LbVirtualServerStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string, virtualServerIdParam string, sourceParam *string) (model.LbVirtualServerStatus, error) + + // Returns the status list of virtual servers in given load balancer service. + // + // @param serviceIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.LbVirtualServerStatusListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(serviceIdParam string, sourceParam *string) (model.LbVirtualServerStatusListResult, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.loadbalancer.services.virtual_servers.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(serviceIdParam string, virtualServerIdParam string, sourceParam *string) (model.LbVirtualServerStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("VirtualServerId", virtualServerIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbVirtualServerStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.services.virtual_servers.status", "get", inputDataValue, executionContext) + var emptyOutput model.LbVirtualServerStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbVirtualServerStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statusClient) List(serviceIdParam string, sourceParam *string) (model.LbVirtualServerStatusListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusListInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbVirtualServerStatusListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.services.virtual_servers.status", "list", inputDataValue, executionContext) + var emptyOutput model.LbVirtualServerStatusListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbVirtualServerStatusListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/loadbalancer/services/virtual_servers/StatusTypes.go b/services/nsxt-mp/nsx/loadbalancer/services/virtual_servers/StatusTypes.go new file mode 100644 index 000000000..331d5f6d2 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/services/virtual_servers/StatusTypes.go @@ -0,0 +1,150 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package virtual_servers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_CACHED = "cached" + +// Possible value for ``source`` of method Status#list. +const Status_LIST_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Status#list. +const Status_LIST_SOURCE_CACHED = "cached" + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["virtual_server_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["virtual_server_id"] = "VirtualServerId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbVirtualServerStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["virtual_server_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["virtual_server_id"] = "VirtualServerId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["virtual_server_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["virtualServerId"] = bindings.NewStringType() + pathParams["virtual_server_id"] = "virtualServerId" + pathParams["service_id"] = "serviceId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/services/nsxt-mp/{serviceId}/virtual-servers/{virtualServerId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statusListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbVirtualServerStatusListResultBindingType) +} + +func statusListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/services/nsxt-mp/{serviceId}/virtual-servers/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/loadbalancer/services/virtual_servers/VirtualServersPackageTypes.go b/services/nsxt-mp/nsx/loadbalancer/services/virtual_servers/VirtualServersPackageTypes.go new file mode 100644 index 000000000..0f55d099f --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/services/virtual_servers/VirtualServersPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.loadbalancer.services.virtual_servers. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package virtual_servers diff --git a/services/nsxt-mp/nsx/loadbalancer/ssl/CiphersAndProtocolsClient.go b/services/nsxt-mp/nsx/loadbalancer/ssl/CiphersAndProtocolsClient.go new file mode 100644 index 000000000..37ffc5eaf --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/ssl/CiphersAndProtocolsClient.go @@ -0,0 +1,98 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: CiphersAndProtocols +// Used by client-side stubs. + +package ssl + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type CiphersAndProtocolsClient interface { + + // Retrieve a list of supported SSL ciphers and protocols. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.LbSslCipherAndProtocolListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LbSslCipherAndProtocolListResult, error) +} + +type ciphersAndProtocolsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewCiphersAndProtocolsClient(connector client.Connector) *ciphersAndProtocolsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.loadbalancer.ssl.ciphers_and_protocols") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := ciphersAndProtocolsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *ciphersAndProtocolsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *ciphersAndProtocolsClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LbSslCipherAndProtocolListResult, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ciphersAndProtocolsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LbSslCipherAndProtocolListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ciphersAndProtocolsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.loadbalancer.ssl.ciphers_and_protocols", "list", inputDataValue, executionContext) + var emptyOutput model.LbSslCipherAndProtocolListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ciphersAndProtocolsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LbSslCipherAndProtocolListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/loadbalancer/ssl/CiphersAndProtocolsTypes.go b/services/nsxt-mp/nsx/loadbalancer/ssl/CiphersAndProtocolsTypes.go new file mode 100644 index 000000000..50ce03fa8 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/ssl/CiphersAndProtocolsTypes.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: CiphersAndProtocols. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ssl + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func ciphersAndProtocolsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ciphersAndProtocolsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LbSslCipherAndProtocolListResultBindingType) +} + +func ciphersAndProtocolsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/loadbalancer/ssl/ciphers-and-protocols", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/loadbalancer/ssl/SslPackageTypes.go b/services/nsxt-mp/nsx/loadbalancer/ssl/SslPackageTypes.go new file mode 100644 index 000000000..747b44825 --- /dev/null +++ b/services/nsxt-mp/nsx/loadbalancer/ssl/SslPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.loadbalancer.ssl. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ssl diff --git a/services/nsxt-mp/nsx/logical_ports/ForwardingPathClient.go b/services/nsxt-mp/nsx/logical_ports/ForwardingPathClient.go new file mode 100644 index 000000000..c156b1143 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_ports/ForwardingPathClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ForwardingPath +// Used by client-side stubs. + +package logical_ports + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ForwardingPathClient interface { + + // Get networking entities between two logical ports with VIF attachment + // + // @param lportIdParam ID of source port (required) + // @param peerPortIdParam ID of peer port (required) + // @return com.vmware.nsx.model.PortConnectionEntities + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(lportIdParam string, peerPortIdParam string) (model.PortConnectionEntities, error) +} + +type forwardingPathClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewForwardingPathClient(connector client.Connector) *forwardingPathClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_ports.forwarding_path") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + fIface := forwardingPathClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &fIface +} + +func (fIface *forwardingPathClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := fIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (fIface *forwardingPathClient) Get(lportIdParam string, peerPortIdParam string) (model.PortConnectionEntities, error) { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(forwardingPathGetInputType(), typeConverter) + sv.AddStructField("LportId", lportIdParam) + sv.AddStructField("PeerPortId", peerPortIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PortConnectionEntities + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := forwardingPathGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_ports.forwarding_path", "get", inputDataValue, executionContext) + var emptyOutput model.PortConnectionEntities + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), forwardingPathGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PortConnectionEntities), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_ports/ForwardingPathTypes.go b/services/nsxt-mp/nsx/logical_ports/ForwardingPathTypes.go new file mode 100644 index 000000000..cbf99b9a5 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_ports/ForwardingPathTypes.go @@ -0,0 +1,75 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ForwardingPath. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_ports + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func forwardingPathGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lport_id"] = bindings.NewStringType() + fields["peer_port_id"] = bindings.NewStringType() + fieldNameMap["lport_id"] = "LportId" + fieldNameMap["peer_port_id"] = "PeerPortId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func forwardingPathGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PortConnectionEntitiesBindingType) +} + +func forwardingPathGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lport_id"] = bindings.NewStringType() + fields["peer_port_id"] = bindings.NewStringType() + fieldNameMap["lport_id"] = "LportId" + fieldNameMap["peer_port_id"] = "PeerPortId" + paramsTypeMap["lport_id"] = bindings.NewStringType() + paramsTypeMap["peer_port_id"] = bindings.NewStringType() + paramsTypeMap["lportId"] = bindings.NewStringType() + pathParams["lport_id"] = "lportId" + queryParams["peer_port_id"] = "peer_port_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-ports/{lportId}/forwarding-path", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_ports/LogicalPortsPackageTypes.go b/services/nsxt-mp/nsx/logical_ports/LogicalPortsPackageTypes.go new file mode 100644 index 000000000..2acc833ff --- /dev/null +++ b/services/nsxt-mp/nsx/logical_ports/LogicalPortsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.logical_ports. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_ports diff --git a/services/nsxt-mp/nsx/logical_ports/MacTableClient.go b/services/nsxt-mp/nsx/logical_ports/MacTableClient.go new file mode 100644 index 000000000..78371e459 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_ports/MacTableClient.go @@ -0,0 +1,104 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MacTable +// Used by client-side stubs. + +package logical_ports + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MacTableClient interface { + + // Returns MAC table of a specified logical port. If the target transport node id is not provided, the NSX manager will ask the controller for the transport node where the logical port is located. The query parameter \"source=cached\" is not supported. MAC table retrieval is not supported on logical ports that are attached to a logical router. + // + // @param lportIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param sourceParam Data source type. (optional) + // @param transportNodeIdParam TransportNode Id (optional) + // @return com.vmware.nsx.model.LogicalPortMacAddressListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(lportIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, sourceParam *string, transportNodeIdParam *string) (model.LogicalPortMacAddressListResult, error) +} + +type macTableClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMacTableClient(connector client.Connector) *macTableClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_ports.mac_table") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := macTableClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *macTableClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *macTableClient) List(lportIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, sourceParam *string, transportNodeIdParam *string) (model.LogicalPortMacAddressListResult, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(macTableListInputType(), typeConverter) + sv.AddStructField("LportId", lportIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Source", sourceParam) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalPortMacAddressListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := macTableListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_ports.mac_table", "list", inputDataValue, executionContext) + var emptyOutput model.LogicalPortMacAddressListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), macTableListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalPortMacAddressListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_ports/MacTableTypes.go b/services/nsxt-mp/nsx/logical_ports/MacTableTypes.go new file mode 100644 index 000000000..20a018a58 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_ports/MacTableTypes.go @@ -0,0 +1,117 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MacTable. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_ports + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method MacTable#list. +const MacTable_LIST_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method MacTable#list. +const MacTable_LIST_SOURCE_CACHED = "cached" + +func macTableListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lport_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_id"] = "LportId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func macTableListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalPortMacAddressListResultBindingType) +} + +func macTableListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lport_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_id"] = "LportId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["transport_node_id"] = "TransportNodeId" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["lport_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["lportId"] = bindings.NewStringType() + pathParams["lport_id"] = "lportId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["source"] = "source" + queryParams["transport_node_id"] = "transport_node_id" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-ports/{lportId}/mac-table", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_ports/StateClient.go b/services/nsxt-mp/nsx/logical_ports/StateClient.go new file mode 100644 index 000000000..f56a8ba37 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_ports/StateClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: State +// Used by client-side stubs. + +package logical_ports + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StateClient interface { + + // Returns transport node id for a specified logical port. Also returns information about all address bindings of the specified logical port. This includes address bindings discovered via various snooping methods like ARP snooping, DHCP snooping etc. and addressing bindings that are realized based on user configuration. This api is now deprecated. Please use new api - GET policy/api/v1/infra/realized-state/realized-entities?intent_path={{intent-path}} GET policy/api/v1/infra/realized-state/status?intent_path={{intent-path}} + // + // @param lportIdParam (required) + // @return com.vmware.nsx.model.LogicalPortState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(lportIdParam string) (model.LogicalPortState, error) +} + +type stateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStateClient(connector client.Connector) *stateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_ports.state") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := stateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *stateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *stateClient) Get(lportIdParam string) (model.LogicalPortState, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(stateGetInputType(), typeConverter) + sv.AddStructField("LportId", lportIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalPortState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_ports.state", "get", inputDataValue, executionContext) + var emptyOutput model.LogicalPortState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalPortState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_ports/StateTypes.go b/services/nsxt-mp/nsx/logical_ports/StateTypes.go new file mode 100644 index 000000000..b98451e49 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_ports/StateTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: State. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_ports + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func stateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lport_id"] = bindings.NewStringType() + fieldNameMap["lport_id"] = "LportId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalPortStateBindingType) +} + +func stateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lport_id"] = bindings.NewStringType() + fieldNameMap["lport_id"] = "LportId" + paramsTypeMap["lport_id"] = bindings.NewStringType() + paramsTypeMap["lportId"] = bindings.NewStringType() + pathParams["lport_id"] = "lportId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-ports/{lportId}/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_ports/StatisticsClient.go b/services/nsxt-mp/nsx/logical_ports/StatisticsClient.go new file mode 100644 index 000000000..dbd3cbdf5 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_ports/StatisticsClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Statistics +// Used by client-side stubs. + +package logical_ports + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatisticsClient interface { + + // Returns statistics of a specified logical port. If the logical port is attached to a logical router port, query parameter \"source=realtime\" is not supported. + // + // @param lportIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.LogicalPortStatistics + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(lportIdParam string, sourceParam *string) (model.LogicalPortStatistics, error) +} + +type statisticsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatisticsClient(connector client.Connector) *statisticsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_ports.statistics") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statisticsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statisticsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statisticsClient) Get(lportIdParam string, sourceParam *string) (model.LogicalPortStatistics, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statisticsGetInputType(), typeConverter) + sv.AddStructField("LportId", lportIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalPortStatistics + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statisticsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_ports.statistics", "get", inputDataValue, executionContext) + var emptyOutput model.LogicalPortStatistics + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statisticsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalPortStatistics), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_ports/StatisticsTypes.go b/services/nsxt-mp/nsx/logical_ports/StatisticsTypes.go new file mode 100644 index 000000000..845866e70 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_ports/StatisticsTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Statistics. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_ports + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Statistics#get. +const Statistics_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Statistics#get. +const Statistics_GET_SOURCE_CACHED = "cached" + +func statisticsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lport_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_id"] = "LportId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statisticsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalPortStatisticsBindingType) +} + +func statisticsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lport_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_id"] = "LportId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["lport_id"] = bindings.NewStringType() + paramsTypeMap["lportId"] = bindings.NewStringType() + pathParams["lport_id"] = "lportId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-ports/{lportId}/statistics", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_ports/StatusClient.go b/services/nsxt-mp/nsx/logical_ports/StatusClient.go new file mode 100644 index 000000000..972bf5e6f --- /dev/null +++ b/services/nsxt-mp/nsx/logical_ports/StatusClient.go @@ -0,0 +1,165 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package logical_ports + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Returns operational status of a specified logical port. + // + // @param lportIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.LogicalPortOperationalStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(lportIdParam string, sourceParam *string) (model.LogicalPortOperationalStatus, error) + + // Returns operational status of all logical ports. The query parameter \"source=realtime\" is not supported. Pagination is not supported for this API. The query parameters \"cursor\", \"sort_ascending\", \"sort_by\", \"page_size\" and \"included_fields\" will be ignored. + // + // @param attachmentIdParam Logical Port attachment Id (optional) + // @param attachmentTypeParam Type of attachment for logical port; for query only. (optional) + // @param bridgeClusterIdParam Bridge Cluster identifier (optional) + // @param containerPortsOnlyParam Only container VIF logical ports will be returned if true (optional, default to false) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param diagnosticParam Flag to enable showing of transit logical port. (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param logicalSwitchIdParam Logical Switch identifier (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param parentVifIdParam ID of the VIF of type PARENT (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param sourceParam Data source type. (optional) + // @param switchingProfileIdParam Network Profile identifier (optional) + // @param transportNodeIdParam Transport node identifier (optional) + // @param transportZoneIdParam Transport zone identifier (optional) + // @return com.vmware.nsx.model.LogicalPortStatusSummary + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Getall(attachmentIdParam *string, attachmentTypeParam *string, bridgeClusterIdParam *string, containerPortsOnlyParam *bool, cursorParam *string, diagnosticParam *bool, includedFieldsParam *string, logicalSwitchIdParam *string, pageSizeParam *int64, parentVifIdParam *string, sortAscendingParam *bool, sortByParam *string, sourceParam *string, switchingProfileIdParam *string, transportNodeIdParam *string, transportZoneIdParam *string) (model.LogicalPortStatusSummary, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_ports.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "getall": core.NewMethodIdentifier(interfaceIdentifier, "getall"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(lportIdParam string, sourceParam *string) (model.LogicalPortOperationalStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("LportId", lportIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalPortOperationalStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_ports.status", "get", inputDataValue, executionContext) + var emptyOutput model.LogicalPortOperationalStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalPortOperationalStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statusClient) Getall(attachmentIdParam *string, attachmentTypeParam *string, bridgeClusterIdParam *string, containerPortsOnlyParam *bool, cursorParam *string, diagnosticParam *bool, includedFieldsParam *string, logicalSwitchIdParam *string, pageSizeParam *int64, parentVifIdParam *string, sortAscendingParam *bool, sortByParam *string, sourceParam *string, switchingProfileIdParam *string, transportNodeIdParam *string, transportZoneIdParam *string) (model.LogicalPortStatusSummary, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetallInputType(), typeConverter) + sv.AddStructField("AttachmentId", attachmentIdParam) + sv.AddStructField("AttachmentType", attachmentTypeParam) + sv.AddStructField("BridgeClusterId", bridgeClusterIdParam) + sv.AddStructField("ContainerPortsOnly", containerPortsOnlyParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("Diagnostic", diagnosticParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("LogicalSwitchId", logicalSwitchIdParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("ParentVifId", parentVifIdParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Source", sourceParam) + sv.AddStructField("SwitchingProfileId", switchingProfileIdParam) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + sv.AddStructField("TransportZoneId", transportZoneIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalPortStatusSummary + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetallRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_ports.status", "getall", inputDataValue, executionContext) + var emptyOutput model.LogicalPortStatusSummary + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetallOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalPortStatusSummary), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_ports/StatusTypes.go b/services/nsxt-mp/nsx/logical_ports/StatusTypes.go new file mode 100644 index 000000000..e6af2098f --- /dev/null +++ b/services/nsxt-mp/nsx/logical_ports/StatusTypes.go @@ -0,0 +1,247 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_ports + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_CACHED = "cached" + +// Possible value for ``attachmentType`` of method Status#getall. +const Status_GETALL_ATTACHMENT_TYPE_VIF = "VIF" + +// Possible value for ``attachmentType`` of method Status#getall. +const Status_GETALL_ATTACHMENT_TYPE_LOGICALROUTER = "LOGICALROUTER" + +// Possible value for ``attachmentType`` of method Status#getall. +const Status_GETALL_ATTACHMENT_TYPE_BRIDGEENDPOINT = "BRIDGEENDPOINT" + +// Possible value for ``attachmentType`` of method Status#getall. +const Status_GETALL_ATTACHMENT_TYPE_DHCP_SERVICE = "DHCP_SERVICE" + +// Possible value for ``attachmentType`` of method Status#getall. +const Status_GETALL_ATTACHMENT_TYPE_METADATA_PROXY = "METADATA_PROXY" + +// Possible value for ``attachmentType`` of method Status#getall. +const Status_GETALL_ATTACHMENT_TYPE_L2VPN_SESSION = "L2VPN_SESSION" + +// Possible value for ``attachmentType`` of method Status#getall. +const Status_GETALL_ATTACHMENT_TYPE_NONE = "NONE" + +// Possible value for ``source`` of method Status#getall. +const Status_GETALL_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Status#getall. +const Status_GETALL_SOURCE_CACHED = "cached" + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lport_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_id"] = "LportId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalPortOperationalStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lport_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_id"] = "LportId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["lport_id"] = bindings.NewStringType() + paramsTypeMap["lportId"] = bindings.NewStringType() + pathParams["lport_id"] = "lportId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-ports/{lportId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statusGetallInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["attachment_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["attachment_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["bridge_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["container_ports_only"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["diagnostic"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["parent_vif_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["switching_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["attachment_id"] = "AttachmentId" + fieldNameMap["attachment_type"] = "AttachmentType" + fieldNameMap["bridge_cluster_id"] = "BridgeClusterId" + fieldNameMap["container_ports_only"] = "ContainerPortsOnly" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["diagnostic"] = "Diagnostic" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["parent_vif_id"] = "ParentVifId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["switching_profile_id"] = "SwitchingProfileId" + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["transport_zone_id"] = "TransportZoneId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetallOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalPortStatusSummaryBindingType) +} + +func statusGetallRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["attachment_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["attachment_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["bridge_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["container_ports_only"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["diagnostic"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["parent_vif_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["switching_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["attachment_id"] = "AttachmentId" + fieldNameMap["attachment_type"] = "AttachmentType" + fieldNameMap["bridge_cluster_id"] = "BridgeClusterId" + fieldNameMap["container_ports_only"] = "ContainerPortsOnly" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["diagnostic"] = "Diagnostic" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["parent_vif_id"] = "ParentVifId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["switching_profile_id"] = "SwitchingProfileId" + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["transport_zone_id"] = "TransportZoneId" + paramsTypeMap["bridge_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["switching_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["parent_vif_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["container_ports_only"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["diagnostic"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["attachment_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["attachment_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["switching_profile_id"] = "switching_profile_id" + queryParams["sort_by"] = "sort_by" + queryParams["source"] = "source" + queryParams["transport_node_id"] = "transport_node_id" + queryParams["bridge_cluster_id"] = "bridge_cluster_id" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["attachment_type"] = "attachment_type" + queryParams["included_fields"] = "included_fields" + queryParams["attachment_id"] = "attachment_id" + queryParams["transport_zone_id"] = "transport_zone_id" + queryParams["container_ports_only"] = "container_ports_only" + queryParams["diagnostic"] = "diagnostic" + queryParams["parent_vif_id"] = "parent_vif_id" + queryParams["logical_switch_id"] = "logical_switch_id" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-ports/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_router_ports/ArpTableClient.go b/services/nsxt-mp/nsx/logical_router_ports/ArpTableClient.go new file mode 100644 index 000000000..925833c35 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_router_ports/ArpTableClient.go @@ -0,0 +1,104 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ArpTable +// Used by client-side stubs. + +package logical_router_ports + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ArpTableClient interface { + + // Returns ARP table (IPv4) or Neighbor Discovery table (IPv6) for the Logical Router Port of the given id, on a node if a query parameter \"transport_node_id=\" is given. The transport_node_id parameter is mandatory if the router port is not uplink type. Query parameter \"source=realtime\" is the only supported source. + // + // @param logicalRouterPortIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param sourceParam Data source type. (optional) + // @param transportNodeIdParam TransportNode Id (optional) + // @return com.vmware.nsx.model.LogicalRouterPortArpTable + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(logicalRouterPortIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, sourceParam *string, transportNodeIdParam *string) (model.LogicalRouterPortArpTable, error) +} + +type arpTableClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewArpTableClient(connector client.Connector) *arpTableClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_router_ports.arp_table") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := arpTableClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *arpTableClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *arpTableClient) List(logicalRouterPortIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, sourceParam *string, transportNodeIdParam *string) (model.LogicalRouterPortArpTable, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(arpTableListInputType(), typeConverter) + sv.AddStructField("LogicalRouterPortId", logicalRouterPortIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Source", sourceParam) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalRouterPortArpTable + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := arpTableListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_router_ports.arp_table", "list", inputDataValue, executionContext) + var emptyOutput model.LogicalRouterPortArpTable + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), arpTableListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalRouterPortArpTable), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_router_ports/ArpTableTypes.go b/services/nsxt-mp/nsx/logical_router_ports/ArpTableTypes.go new file mode 100644 index 000000000..38ff603a3 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_router_ports/ArpTableTypes.go @@ -0,0 +1,117 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ArpTable. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_router_ports + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method ArpTable#list. +const ArpTable_LIST_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method ArpTable#list. +const ArpTable_LIST_SOURCE_CACHED = "cached" + +func arpTableListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_port_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func arpTableListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalRouterPortArpTableBindingType) +} + +func arpTableListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_port_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["transport_node_id"] = "TransportNodeId" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["logical_router_port_id"] = bindings.NewStringType() + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["logicalRouterPortId"] = bindings.NewStringType() + pathParams["logical_router_port_id"] = "logicalRouterPortId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["source"] = "source" + queryParams["transport_node_id"] = "transport_node_id" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-router-ports/{logicalRouterPortId}/arp-table", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_router_ports/LogicalRouterPortsPackageTypes.go b/services/nsxt-mp/nsx/logical_router_ports/LogicalRouterPortsPackageTypes.go new file mode 100644 index 000000000..ca31747d9 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_router_ports/LogicalRouterPortsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.logical_router_ports. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_router_ports diff --git a/services/nsxt-mp/nsx/logical_router_ports/StateClient.go b/services/nsxt-mp/nsx/logical_router_ports/StateClient.go new file mode 100644 index 000000000..d9c2e5dc8 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_router_ports/StateClient.go @@ -0,0 +1,94 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: State +// Used by client-side stubs. + +package logical_router_ports + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StateClient interface { + + // Return realized state information of a logical router port. Any configuration update that affects the logical router port can use this API to get its realized state by passing a request_id returned by the configuration change operation. e.g. Update configuration of logical router ports, dhcp relays, etc. + // + // @param logicalRouterPortIdParam (required) + // @param barrierIdParam (optional) + // @param requestIdParam Realization request ID (optional) + // @return com.vmware.nsx.model.LogicalRouterPortState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterPortIdParam string, barrierIdParam *int64, requestIdParam *string) (model.LogicalRouterPortState, error) +} + +type stateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStateClient(connector client.Connector) *stateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_router_ports.state") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := stateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *stateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *stateClient) Get(logicalRouterPortIdParam string, barrierIdParam *int64, requestIdParam *string) (model.LogicalRouterPortState, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(stateGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterPortId", logicalRouterPortIdParam) + sv.AddStructField("BarrierId", barrierIdParam) + sv.AddStructField("RequestId", requestIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalRouterPortState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_router_ports.state", "get", inputDataValue, executionContext) + var emptyOutput model.LogicalRouterPortState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalRouterPortState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_router_ports/StateTypes.go b/services/nsxt-mp/nsx/logical_router_ports/StateTypes.go new file mode 100644 index 000000000..1d5f3bb00 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_router_ports/StateTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: State. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_router_ports + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func stateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_port_id"] = bindings.NewStringType() + fields["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + fieldNameMap["barrier_id"] = "BarrierId" + fieldNameMap["request_id"] = "RequestId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalRouterPortStateBindingType) +} + +func stateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_port_id"] = bindings.NewStringType() + fields["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + fieldNameMap["barrier_id"] = "BarrierId" + fieldNameMap["request_id"] = "RequestId" + paramsTypeMap["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["logical_router_port_id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterPortId"] = bindings.NewStringType() + pathParams["logical_router_port_id"] = "logicalRouterPortId" + queryParams["barrier_id"] = "barrier_id" + queryParams["request_id"] = "request_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-router-ports/{logicalRouterPortId}/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_router_ports/StatisticsClient.go b/services/nsxt-mp/nsx/logical_router_ports/StatisticsClient.go new file mode 100644 index 000000000..475a8d36f --- /dev/null +++ b/services/nsxt-mp/nsx/logical_router_ports/StatisticsClient.go @@ -0,0 +1,94 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Statistics +// Used by client-side stubs. + +package logical_router_ports + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatisticsClient interface { + + // Returns the statistics for the Logical Router Port. If query parameter \"transport_node_id=\" is given, only the statistics from the given node for the logical router port will be returned. Otherwise the statistics from each node for the same logical router port will be returned. The transport_node_id is mandatory if the router port is not uplink type. The query parameter \"source=cached\" will be ignored and it will always return realtime statistics of the logical router port. + // + // @param logicalRouterPortIdParam (required) + // @param sourceParam Data source type. (optional) + // @param transportNodeIdParam TransportNode Id (optional) + // @return com.vmware.nsx.model.LogicalRouterPortStatistics + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterPortIdParam string, sourceParam *string, transportNodeIdParam *string) (model.LogicalRouterPortStatistics, error) +} + +type statisticsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatisticsClient(connector client.Connector) *statisticsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_router_ports.statistics") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statisticsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statisticsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statisticsClient) Get(logicalRouterPortIdParam string, sourceParam *string, transportNodeIdParam *string) (model.LogicalRouterPortStatistics, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statisticsGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterPortId", logicalRouterPortIdParam) + sv.AddStructField("Source", sourceParam) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalRouterPortStatistics + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statisticsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_router_ports.statistics", "get", inputDataValue, executionContext) + var emptyOutput model.LogicalRouterPortStatistics + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statisticsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalRouterPortStatistics), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_router_ports/StatisticsTypes.go b/services/nsxt-mp/nsx/logical_router_ports/StatisticsTypes.go new file mode 100644 index 000000000..0db0a9663 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_router_ports/StatisticsTypes.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Statistics. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_router_ports + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Statistics#get. +const Statistics_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Statistics#get. +const Statistics_GET_SOURCE_CACHED = "cached" + +func statisticsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_port_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + fieldNameMap["source"] = "Source" + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statisticsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalRouterPortStatisticsBindingType) +} + +func statisticsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_port_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + fieldNameMap["source"] = "Source" + fieldNameMap["transport_node_id"] = "TransportNodeId" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["logical_router_port_id"] = bindings.NewStringType() + paramsTypeMap["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["logicalRouterPortId"] = bindings.NewStringType() + pathParams["logical_router_port_id"] = "logicalRouterPortId" + queryParams["source"] = "source" + queryParams["transport_node_id"] = "transport_node_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-router-ports/{logicalRouterPortId}/statistics", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_router_ports/statistics/StatisticsPackageTypes.go b/services/nsxt-mp/nsx/logical_router_ports/statistics/StatisticsPackageTypes.go new file mode 100644 index 000000000..f13c43d12 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_router_ports/statistics/StatisticsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.logical_router_ports.statistics. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package statistics diff --git a/services/nsxt-mp/nsx/logical_router_ports/statistics/SummaryClient.go b/services/nsxt-mp/nsx/logical_router_ports/statistics/SummaryClient.go new file mode 100644 index 000000000..1a16c8a4e --- /dev/null +++ b/services/nsxt-mp/nsx/logical_router_ports/statistics/SummaryClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Summary +// Used by client-side stubs. + +package statistics + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SummaryClient interface { + + // Returns the summation of statistics from all nodes for the Specified Logical Router Port. The query parameter \"source=realtime\" is not supported. + // + // @param logicalRouterPortIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.LogicalRouterPortStatisticsSummary + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterPortIdParam string, sourceParam *string) (model.LogicalRouterPortStatisticsSummary, error) +} + +type summaryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSummaryClient(connector client.Connector) *summaryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_router_ports.statistics.summary") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := summaryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *summaryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *summaryClient) Get(logicalRouterPortIdParam string, sourceParam *string) (model.LogicalRouterPortStatisticsSummary, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(summaryGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterPortId", logicalRouterPortIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalRouterPortStatisticsSummary + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := summaryGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_router_ports.statistics.summary", "get", inputDataValue, executionContext) + var emptyOutput model.LogicalRouterPortStatisticsSummary + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), summaryGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalRouterPortStatisticsSummary), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_router_ports/statistics/SummaryTypes.go b/services/nsxt-mp/nsx/logical_router_ports/statistics/SummaryTypes.go new file mode 100644 index 000000000..17e59792e --- /dev/null +++ b/services/nsxt-mp/nsx/logical_router_ports/statistics/SummaryTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Summary. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package statistics + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Summary#get. +const Summary_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Summary#get. +const Summary_GET_SOURCE_CACHED = "cached" + +func summaryGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_port_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func summaryGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalRouterPortStatisticsSummaryBindingType) +} + +func summaryGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_port_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["logical_router_port_id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterPortId"] = bindings.NewStringType() + pathParams["logical_router_port_id"] = "logicalRouterPortId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-router-ports/{logicalRouterPortId}/statistics/summary", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/LogicalRoutersPackageTypes.go b/services/nsxt-mp/nsx/logical_routers/LogicalRoutersPackageTypes.go new file mode 100644 index 000000000..b62fea708 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/LogicalRoutersPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.logical_routers. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_routers diff --git a/services/nsxt-mp/nsx/logical_routers/RoutingClient.go b/services/nsxt-mp/nsx/logical_routers/RoutingClient.go new file mode 100644 index 000000000..2fa686e55 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/RoutingClient.go @@ -0,0 +1,135 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Routing +// Used by client-side stubs. + +package logical_routers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RoutingClient interface { + + // Returns the routing configuration for a specified logical router. + // + // @param logicalRouterIdParam (required) + // @return com.vmware.nsx.model.RoutingConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterIdParam string) (model.RoutingConfig, error) + + // Modifies the routing configuration for a specified logical router. + // + // @param logicalRouterIdParam (required) + // @param routingConfigParam (required) + // @return com.vmware.nsx.model.RoutingConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(logicalRouterIdParam string, routingConfigParam model.RoutingConfig) (model.RoutingConfig, error) +} + +type routingClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRoutingClient(connector client.Connector) *routingClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.routing") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := routingClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *routingClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *routingClient) Get(logicalRouterIdParam string) (model.RoutingConfig, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(routingGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RoutingConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := routingGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing", "get", inputDataValue, executionContext) + var emptyOutput model.RoutingConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), routingGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RoutingConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *routingClient) Update(logicalRouterIdParam string, routingConfigParam model.RoutingConfig) (model.RoutingConfig, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(routingUpdateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("RoutingConfig", routingConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RoutingConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := routingUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing", "update", inputDataValue, executionContext) + var emptyOutput model.RoutingConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), routingUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RoutingConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/RoutingTypes.go b/services/nsxt-mp/nsx/logical_routers/RoutingTypes.go new file mode 100644 index 000000000..a64b0ce1a --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/RoutingTypes.go @@ -0,0 +1,124 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Routing. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_routers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func routingGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func routingGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RoutingConfigBindingType) +} + +func routingGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func routingUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["routing_config"] = bindings.NewReferenceType(model.RoutingConfigBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["routing_config"] = "RoutingConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func routingUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RoutingConfigBindingType) +} + +func routingUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["routing_config"] = bindings.NewReferenceType(model.RoutingConfigBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["routing_config"] = "RoutingConfig" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["routing_config"] = bindings.NewReferenceType(model.RoutingConfigBindingType) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "routing_config", + "PUT", + "/api/v1/logical-routers/{logicalRouterId}/routing", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/StateClient.go b/services/nsxt-mp/nsx/logical_routers/StateClient.go new file mode 100644 index 000000000..5d47b624b --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/StateClient.go @@ -0,0 +1,94 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: State +// Used by client-side stubs. + +package logical_routers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StateClient interface { + + // Return realized state information of a logical router. Any configuration update that affects the logical router can use this API to get its realized state by passing a request_id returned by the configuration change operation. e.g. Update configuration of logical router, static routes, etc. + // + // @param logicalRouterIdParam (required) + // @param barrierIdParam (optional) + // @param requestIdParam Realization request ID (optional) + // @return com.vmware.nsx.model.LogicalRouterState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterIdParam string, barrierIdParam *int64, requestIdParam *string) (model.LogicalRouterState, error) +} + +type stateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStateClient(connector client.Connector) *stateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.state") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := stateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *stateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *stateClient) Get(logicalRouterIdParam string, barrierIdParam *int64, requestIdParam *string) (model.LogicalRouterState, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(stateGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("BarrierId", barrierIdParam) + sv.AddStructField("RequestId", requestIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalRouterState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.state", "get", inputDataValue, executionContext) + var emptyOutput model.LogicalRouterState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalRouterState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/StateTypes.go b/services/nsxt-mp/nsx/logical_routers/StateTypes.go new file mode 100644 index 000000000..287591bca --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/StateTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: State. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_routers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func stateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["barrier_id"] = "BarrierId" + fieldNameMap["request_id"] = "RequestId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalRouterStateBindingType) +} + +func stateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["barrier_id"] = "BarrierId" + fieldNameMap["request_id"] = "RequestId" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + queryParams["barrier_id"] = "barrier_id" + queryParams["request_id"] = "request_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/StatusClient.go b/services/nsxt-mp/nsx/logical_routers/StatusClient.go new file mode 100644 index 000000000..d608bbe7a --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/StatusClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package logical_routers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Returns status for the Logical Router of the given id. + // + // @param logicalRouterIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.LogicalRouterStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterIdParam string, sourceParam *string) (model.LogicalRouterStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(logicalRouterIdParam string, sourceParam *string) (model.LogicalRouterStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalRouterStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.status", "get", inputDataValue, executionContext) + var emptyOutput model.LogicalRouterStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalRouterStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/StatusTypes.go b/services/nsxt-mp/nsx/logical_routers/StatusTypes.go new file mode 100644 index 000000000..2ab9ccdd5 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/StatusTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_routers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_CACHED = "cached" + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalRouterStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["source"] = "Source" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/nat/NatPackageTypes.go b/services/nsxt-mp/nsx/logical_routers/nat/NatPackageTypes.go new file mode 100644 index 000000000..88bdfb72f --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/nat/NatPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.logical_routers.nat. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nat diff --git a/services/nsxt-mp/nsx/logical_routers/nat/RulesClient.go b/services/nsxt-mp/nsx/logical_routers/nat/RulesClient.go new file mode 100644 index 000000000..6c4ff673b --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/nat/RulesClient.go @@ -0,0 +1,322 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Rules +// Used by client-side stubs. + +package nat + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RulesClient interface { + + // Add a NAT rule in a specific logical router. + // + // @param logicalRouterIdParam (required) + // @param natRuleParam (required) + // @return com.vmware.nsx.model.NatRule + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(logicalRouterIdParam string, natRuleParam model.NatRule) (model.NatRule, error) + + // Create multiple NAT rules in a specific logical router. The API succeeds only when all rules are accepted and created successfully. Any one validation voilation will fail the API, no rule will be created. The ruleIds of each rules can be found from the responsed message. + // + // @param logicalRouterIdParam (required) + // @param natRuleListParam (required) + // @return com.vmware.nsx.model.NatRuleList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Createmultiple(logicalRouterIdParam string, natRuleListParam model.NatRuleList) (model.NatRuleList, error) + + // Delete a specific NAT rule from a logical router + // + // @param logicalRouterIdParam (required) + // @param ruleIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(logicalRouterIdParam string, ruleIdParam string) error + + // Get a specific NAT rule from a given logical router + // + // @param logicalRouterIdParam (required) + // @param ruleIdParam (required) + // @return com.vmware.nsx.model.NatRule + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterIdParam string, ruleIdParam string) (model.NatRule, error) + + // Returns paginated list of all user defined NAT rules of the specific logical router. If a rule_type is provided, only the given type of rules will be returned. If no rule_type is specified, the rule_type will be defaulted to NATv4, i.e. only the NATv4 rules will be listed. + // + // @param logicalRouterIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param ruleTypeParam Action type for getting NAT rules (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.NatRuleListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(logicalRouterIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, ruleTypeParam *string, sortAscendingParam *bool, sortByParam *string) (model.NatRuleListResult, error) + + // Update a specific NAT rule from a given logical router. + // + // @param logicalRouterIdParam (required) + // @param ruleIdParam (required) + // @param natRuleParam (required) + // @return com.vmware.nsx.model.NatRule + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(logicalRouterIdParam string, ruleIdParam string, natRuleParam model.NatRule) (model.NatRule, error) +} + +type rulesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRulesClient(connector client.Connector) *rulesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.nat.rules") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "createmultiple": core.NewMethodIdentifier(interfaceIdentifier, "createmultiple"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := rulesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *rulesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *rulesClient) Create(logicalRouterIdParam string, natRuleParam model.NatRule) (model.NatRule, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesCreateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("NatRule", natRuleParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NatRule + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.nat.rules", "create", inputDataValue, executionContext) + var emptyOutput model.NatRule + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NatRule), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rulesClient) Createmultiple(logicalRouterIdParam string, natRuleListParam model.NatRuleList) (model.NatRuleList, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesCreatemultipleInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("NatRuleList", natRuleListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NatRuleList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesCreatemultipleRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.nat.rules", "createmultiple", inputDataValue, executionContext) + var emptyOutput model.NatRuleList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesCreatemultipleOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NatRuleList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rulesClient) Delete(logicalRouterIdParam string, ruleIdParam string) error { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesDeleteInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("RuleId", ruleIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.nat.rules", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (rIface *rulesClient) Get(logicalRouterIdParam string, ruleIdParam string) (model.NatRule, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("RuleId", ruleIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NatRule + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.nat.rules", "get", inputDataValue, executionContext) + var emptyOutput model.NatRule + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NatRule), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rulesClient) List(logicalRouterIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, ruleTypeParam *string, sortAscendingParam *bool, sortByParam *string) (model.NatRuleListResult, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesListInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("RuleType", ruleTypeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NatRuleListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.nat.rules", "list", inputDataValue, executionContext) + var emptyOutput model.NatRuleListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NatRuleListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rulesClient) Update(logicalRouterIdParam string, ruleIdParam string, natRuleParam model.NatRule) (model.NatRule, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesUpdateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("RuleId", ruleIdParam) + sv.AddStructField("NatRule", natRuleParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NatRule + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.nat.rules", "update", inputDataValue, executionContext) + var emptyOutput model.NatRule + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NatRule), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/nat/RulesTypes.go b/services/nsxt-mp/nsx/logical_routers/nat/RulesTypes.go new file mode 100644 index 000000000..713eb5c37 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/nat/RulesTypes.go @@ -0,0 +1,400 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Rules. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nat + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``ruleType`` of method Rules#list. +const Rules_LIST_RULE_TYPE_ALL = "ALL" + +// Possible value for ``ruleType`` of method Rules#list. +const Rules_LIST_RULE_TYPE_NATV4 = "NATv4" + +// Possible value for ``ruleType`` of method Rules#list. +const Rules_LIST_RULE_TYPE_NAT64 = "NAT64" + +func rulesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["nat_rule"] = bindings.NewReferenceType(model.NatRuleBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["nat_rule"] = "NatRule" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NatRuleBindingType) +} + +func rulesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["nat_rule"] = bindings.NewReferenceType(model.NatRuleBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["nat_rule"] = "NatRule" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["nat_rule"] = bindings.NewReferenceType(model.NatRuleBindingType) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "nat_rule", + "POST", + "/api/v1/logical-routers/{logicalRouterId}/nat/rules", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesCreatemultipleInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["nat_rule_list"] = bindings.NewReferenceType(model.NatRuleListBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["nat_rule_list"] = "NatRuleList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesCreatemultipleOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NatRuleListBindingType) +} + +func rulesCreatemultipleRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["nat_rule_list"] = bindings.NewReferenceType(model.NatRuleListBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["nat_rule_list"] = "NatRuleList" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["nat_rule_list"] = bindings.NewReferenceType(model.NatRuleListBindingType) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=create_multiple", + "nat_rule_list", + "POST", + "/api/v1/logical-routers/{logicalRouterId}/nat/rules", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["rule_id"] = "RuleId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func rulesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["rule_id"] = "RuleId" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["rule_id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["ruleId"] = bindings.NewStringType() + pathParams["rule_id"] = "ruleId" + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/logical-routers/{logicalRouterId}/nat/rules/{ruleId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["rule_id"] = "RuleId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NatRuleBindingType) +} + +func rulesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["rule_id"] = "RuleId" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["rule_id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["ruleId"] = bindings.NewStringType() + pathParams["rule_id"] = "ruleId" + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/nat/rules/{ruleId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["rule_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["rule_type"] = "RuleType" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NatRuleListResultBindingType) +} + +func rulesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["rule_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["rule_type"] = "RuleType" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["rule_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + queryParams["cursor"] = "cursor" + queryParams["rule_type"] = "rule_type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/nat/rules", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fields["nat_rule"] = bindings.NewReferenceType(model.NatRuleBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["rule_id"] = "RuleId" + fieldNameMap["nat_rule"] = "NatRule" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NatRuleBindingType) +} + +func rulesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fields["nat_rule"] = bindings.NewReferenceType(model.NatRuleBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["rule_id"] = "RuleId" + fieldNameMap["nat_rule"] = "NatRule" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["rule_id"] = bindings.NewStringType() + paramsTypeMap["nat_rule"] = bindings.NewReferenceType(model.NatRuleBindingType) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["ruleId"] = bindings.NewStringType() + pathParams["rule_id"] = "ruleId" + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "nat_rule", + "PUT", + "/api/v1/logical-routers/{logicalRouterId}/nat/rules/{ruleId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/nat/rules/RulesPackageTypes.go b/services/nsxt-mp/nsx/logical_routers/nat/rules/RulesPackageTypes.go new file mode 100644 index 000000000..7ced1c596 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/nat/rules/RulesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.logical_routers.nat.rules. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package rules diff --git a/services/nsxt-mp/nsx/logical_routers/nat/rules/StatisticsClient.go b/services/nsxt-mp/nsx/logical_routers/nat/rules/StatisticsClient.go new file mode 100644 index 000000000..d235e1b3f --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/nat/rules/StatisticsClient.go @@ -0,0 +1,139 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Statistics +// Used by client-side stubs. + +package rules + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatisticsClient interface { + + // Returns the summation of statistics for all rules from all nodes for the Specified Logical Router. Also gives the per transport node statistics for provided logical router. The query parameter \"source=realtime\" is not supported. + // + // @param logicalRouterIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.NatStatisticsPerLogicalRouter + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Getperlogicalrouter(logicalRouterIdParam string, sourceParam *string) (model.NatStatisticsPerLogicalRouter, error) + + // Returns the summation of statistics from all nodes for the Specified Logical Router NAT Rule. Query parameter \"source=realtime\" is the only supported source. + // + // @param logicalRouterIdParam (required) + // @param ruleIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.NatStatisticsPerRule + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Getperrule(logicalRouterIdParam string, ruleIdParam string, sourceParam *string) (model.NatStatisticsPerRule, error) +} + +type statisticsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatisticsClient(connector client.Connector) *statisticsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.nat.rules.statistics") + methodIdentifiers := map[string]core.MethodIdentifier{ + "getperlogicalrouter": core.NewMethodIdentifier(interfaceIdentifier, "getperlogicalrouter"), + "getperrule": core.NewMethodIdentifier(interfaceIdentifier, "getperrule"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statisticsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statisticsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statisticsClient) Getperlogicalrouter(logicalRouterIdParam string, sourceParam *string) (model.NatStatisticsPerLogicalRouter, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statisticsGetperlogicalrouterInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NatStatisticsPerLogicalRouter + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statisticsGetperlogicalrouterRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.nat.rules.statistics", "getperlogicalrouter", inputDataValue, executionContext) + var emptyOutput model.NatStatisticsPerLogicalRouter + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statisticsGetperlogicalrouterOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NatStatisticsPerLogicalRouter), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statisticsClient) Getperrule(logicalRouterIdParam string, ruleIdParam string, sourceParam *string) (model.NatStatisticsPerRule, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statisticsGetperruleInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("RuleId", ruleIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NatStatisticsPerRule + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statisticsGetperruleRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.nat.rules.statistics", "getperrule", inputDataValue, executionContext) + var emptyOutput model.NatStatisticsPerRule + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statisticsGetperruleOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NatStatisticsPerRule), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/nat/rules/StatisticsTypes.go b/services/nsxt-mp/nsx/logical_routers/nat/rules/StatisticsTypes.go new file mode 100644 index 000000000..15e8bb3ba --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/nat/rules/StatisticsTypes.go @@ -0,0 +1,150 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Statistics. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package rules + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Statistics#getperlogicalrouter. +const Statistics_GETPERLOGICALROUTER_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Statistics#getperlogicalrouter. +const Statistics_GETPERLOGICALROUTER_SOURCE_CACHED = "cached" + +// Possible value for ``source`` of method Statistics#getperrule. +const Statistics_GETPERRULE_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Statistics#getperrule. +const Statistics_GETPERRULE_SOURCE_CACHED = "cached" + +func statisticsGetperlogicalrouterInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statisticsGetperlogicalrouterOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NatStatisticsPerLogicalRouterBindingType) +} + +func statisticsGetperlogicalrouterRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["source"] = "Source" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/nat/rules/statistics", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statisticsGetperruleInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["rule_id"] = "RuleId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statisticsGetperruleOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NatStatisticsPerRuleBindingType) +} + +func statisticsGetperruleRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["rule_id"] = "RuleId" + fieldNameMap["source"] = "Source" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["rule_id"] = bindings.NewStringType() + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["ruleId"] = bindings.NewStringType() + pathParams["rule_id"] = "ruleId" + pathParams["logical_router_id"] = "logicalRouterId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/nat/rules/{ruleId}/statistics", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/AdvertisementClient.go b/services/nsxt-mp/nsx/logical_routers/routing/AdvertisementClient.go new file mode 100644 index 000000000..31aba1da4 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/AdvertisementClient.go @@ -0,0 +1,135 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Advertisement +// Used by client-side stubs. + +package routing + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AdvertisementClient interface { + + // Returns information about the routes to be advertised by the specified TIER1 logical router. + // + // @param logicalRouterIdParam (required) + // @return com.vmware.nsx.model.AdvertisementConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterIdParam string) (model.AdvertisementConfig, error) + + // Modifies the route advertisement configuration on the specified logical router. + // + // @param logicalRouterIdParam (required) + // @param advertisementConfigParam (required) + // @return com.vmware.nsx.model.AdvertisementConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(logicalRouterIdParam string, advertisementConfigParam model.AdvertisementConfig) (model.AdvertisementConfig, error) +} + +type advertisementClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAdvertisementClient(connector client.Connector) *advertisementClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.routing.advertisement") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := advertisementClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *advertisementClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *advertisementClient) Get(logicalRouterIdParam string) (model.AdvertisementConfig, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(advertisementGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.AdvertisementConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := advertisementGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.advertisement", "get", inputDataValue, executionContext) + var emptyOutput model.AdvertisementConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), advertisementGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.AdvertisementConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (aIface *advertisementClient) Update(logicalRouterIdParam string, advertisementConfigParam model.AdvertisementConfig) (model.AdvertisementConfig, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(advertisementUpdateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("AdvertisementConfig", advertisementConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.AdvertisementConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := advertisementUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.advertisement", "update", inputDataValue, executionContext) + var emptyOutput model.AdvertisementConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), advertisementUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.AdvertisementConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/AdvertisementTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/AdvertisementTypes.go new file mode 100644 index 000000000..7d1abcf3d --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/AdvertisementTypes.go @@ -0,0 +1,124 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Advertisement. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package routing + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func advertisementGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func advertisementGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.AdvertisementConfigBindingType) +} + +func advertisementGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/advertisement", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func advertisementUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["advertisement_config"] = bindings.NewReferenceType(model.AdvertisementConfigBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["advertisement_config"] = "AdvertisementConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func advertisementUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.AdvertisementConfigBindingType) +} + +func advertisementUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["advertisement_config"] = bindings.NewReferenceType(model.AdvertisementConfigBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["advertisement_config"] = "AdvertisementConfig" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["advertisement_config"] = bindings.NewReferenceType(model.AdvertisementConfigBindingType) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "advertisement_config", + "PUT", + "/api/v1/logical-routers/{logicalRouterId}/routing/advertisement", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/BfdConfigClient.go b/services/nsxt-mp/nsx/logical_routers/routing/BfdConfigClient.go new file mode 100644 index 000000000..db1abe87b --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/BfdConfigClient.go @@ -0,0 +1,135 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: BfdConfig +// Used by client-side stubs. + +package routing + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type BfdConfigClient interface { + + // Returns the BFD configuration for all routing BFD peers. This will be inherited | by all BFD peers for LogicalRouter unless overriden while configuring the Peer. + // + // @param logicalRouterIdParam (required) + // @return com.vmware.nsx.model.BfdConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterIdParam string) (model.BfdConfig, error) + + // Modifies the BFD configuration for routing BFD peers. Note - the configuration | changes apply only to those routing BFD peers for which the BFD configuration has | not been overridden at Peer level. + // + // @param logicalRouterIdParam (required) + // @param bfdConfigParam (required) + // @return com.vmware.nsx.model.BfdConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(logicalRouterIdParam string, bfdConfigParam model.BfdConfig) (model.BfdConfig, error) +} + +type bfdConfigClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewBfdConfigClient(connector client.Connector) *bfdConfigClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.routing.bfd_config") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + bIface := bfdConfigClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &bIface +} + +func (bIface *bfdConfigClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := bIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (bIface *bfdConfigClient) Get(logicalRouterIdParam string) (model.BfdConfig, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bfdConfigGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BfdConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bfdConfigGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.bfd_config", "get", inputDataValue, executionContext) + var emptyOutput model.BfdConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bfdConfigGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BfdConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (bIface *bfdConfigClient) Update(logicalRouterIdParam string, bfdConfigParam model.BfdConfig) (model.BfdConfig, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bfdConfigUpdateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("BfdConfig", bfdConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BfdConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bfdConfigUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.bfd_config", "update", inputDataValue, executionContext) + var emptyOutput model.BfdConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bfdConfigUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BfdConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/BfdConfigTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/BfdConfigTypes.go new file mode 100644 index 000000000..bc4642954 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/BfdConfigTypes.go @@ -0,0 +1,124 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: BfdConfig. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package routing + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func bfdConfigGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bfdConfigGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BfdConfigBindingType) +} + +func bfdConfigGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/bfd-config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func bfdConfigUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["bfd_config"] = bindings.NewReferenceType(model.BfdConfigBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["bfd_config"] = "BfdConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bfdConfigUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BfdConfigBindingType) +} + +func bfdConfigUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["bfd_config"] = bindings.NewReferenceType(model.BfdConfigBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["bfd_config"] = "BfdConfig" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["bfd_config"] = bindings.NewReferenceType(model.BfdConfigBindingType) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "bfd_config", + "PUT", + "/api/v1/logical-routers/{logicalRouterId}/routing/bfd-config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/BgpClient.go b/services/nsxt-mp/nsx/logical_routers/routing/BgpClient.go new file mode 100644 index 000000000..f0b078861 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/BgpClient.go @@ -0,0 +1,135 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Bgp +// Used by client-side stubs. + +package routing + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type BgpClient interface { + + // Returns information about the BGP configuration on a specified logical router. Information includes whether or not the BGP configuration is enabled, the AS number, and whether or not graceful restart is enabled. + // + // @param logicalRouterIdParam (required) + // @return com.vmware.nsx.model.BgpConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterIdParam string) (model.BgpConfig, error) + + // Modifies the BGP configuration on a specified TIER0 logical router. Modifiable parameters include enabled, graceful_restart, as_number. + // + // @param logicalRouterIdParam (required) + // @param bgpConfigParam (required) + // @return com.vmware.nsx.model.BgpConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(logicalRouterIdParam string, bgpConfigParam model.BgpConfig) (model.BgpConfig, error) +} + +type bgpClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewBgpClient(connector client.Connector) *bgpClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.routing.bgp") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + bIface := bgpClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &bIface +} + +func (bIface *bgpClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := bIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (bIface *bgpClient) Get(logicalRouterIdParam string) (model.BgpConfig, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bgpGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BgpConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bgpGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.bgp", "get", inputDataValue, executionContext) + var emptyOutput model.BgpConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bgpGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BgpConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (bIface *bgpClient) Update(logicalRouterIdParam string, bgpConfigParam model.BgpConfig) (model.BgpConfig, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bgpUpdateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("BgpConfig", bgpConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BgpConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bgpUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.bgp", "update", inputDataValue, executionContext) + var emptyOutput model.BgpConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bgpUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BgpConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/BgpTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/BgpTypes.go new file mode 100644 index 000000000..ccdc62747 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/BgpTypes.go @@ -0,0 +1,124 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Bgp. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package routing + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func bgpGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bgpGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BgpConfigBindingType) +} + +func bgpGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/bgp", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func bgpUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["bgp_config"] = bindings.NewReferenceType(model.BgpConfigBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["bgp_config"] = "BgpConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bgpUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BgpConfigBindingType) +} + +func bgpUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["bgp_config"] = bindings.NewReferenceType(model.BgpConfigBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["bgp_config"] = "BgpConfig" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["bgp_config"] = bindings.NewReferenceType(model.BgpConfigBindingType) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "bgp_config", + "PUT", + "/api/v1/logical-routers/{logicalRouterId}/routing/bgp", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/ForwardingTableClient.go b/services/nsxt-mp/nsx/logical_routers/routing/ForwardingTableClient.go new file mode 100644 index 000000000..ce460ad1e --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/ForwardingTableClient.go @@ -0,0 +1,106 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ForwardingTable +// Used by client-side stubs. + +package routing + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ForwardingTableClient interface { + + // Returns the FIB for the logical router on a node of the given transport-node-id. Query parameter \"transport_node_id=\" is required. To filter the result by network address, paramter \"network_prefix=\" needs to be specified. Query parameter \"source=realtime\" is the only supported source. + // + // @param logicalRouterIdParam (required) + // @param transportNodeIdParam TransportNode Id (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param networkPrefixParam IPv4 or IPv6 CIDR Block (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.LogicalRouterRouteTable + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(logicalRouterIdParam string, transportNodeIdParam string, cursorParam *string, includedFieldsParam *string, networkPrefixParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, sourceParam *string) (model.LogicalRouterRouteTable, error) +} + +type forwardingTableClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewForwardingTableClient(connector client.Connector) *forwardingTableClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.routing.forwarding_table") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + fIface := forwardingTableClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &fIface +} + +func (fIface *forwardingTableClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := fIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (fIface *forwardingTableClient) List(logicalRouterIdParam string, transportNodeIdParam string, cursorParam *string, includedFieldsParam *string, networkPrefixParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, sourceParam *string) (model.LogicalRouterRouteTable, error) { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(forwardingTableListInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("NetworkPrefix", networkPrefixParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalRouterRouteTable + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := forwardingTableListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.forwarding_table", "list", inputDataValue, executionContext) + var emptyOutput model.LogicalRouterRouteTable + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), forwardingTableListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalRouterRouteTable), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/ForwardingTableTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/ForwardingTableTypes.go new file mode 100644 index 000000000..260cb89dd --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/ForwardingTableTypes.go @@ -0,0 +1,123 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ForwardingTable. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package routing + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method ForwardingTable#list. +const ForwardingTable_LIST_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method ForwardingTable#list. +const ForwardingTable_LIST_SOURCE_CACHED = "cached" + +func forwardingTableListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["transport_node_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["network_prefix"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["network_prefix"] = "NetworkPrefix" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func forwardingTableListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalRouterRouteTableBindingType) +} + +func forwardingTableListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["transport_node_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["network_prefix"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["network_prefix"] = "NetworkPrefix" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["network_prefix"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["transport_node_id"] = bindings.NewStringType() + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + queryParams["cursor"] = "cursor" + queryParams["network_prefix"] = "network_prefix" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["transport_node_id"] = "transport_node_id" + queryParams["sort_by"] = "sort_by" + queryParams["source"] = "source" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/forwarding-table", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/IpPrefixListsClient.go b/services/nsxt-mp/nsx/logical_routers/routing/IpPrefixListsClient.go new file mode 100644 index 000000000..d4249e591 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/IpPrefixListsClient.go @@ -0,0 +1,275 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: IpPrefixLists +// Used by client-side stubs. + +package routing + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type IpPrefixListsClient interface { + + // Adds a new IPPrefixList on a Logical Router + // + // @param logicalRouterIdParam (required) + // @param ipPrefixListParam (required) + // @return com.vmware.nsx.model.IPPrefixList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(logicalRouterIdParam string, ipPrefixListParam model.IPPrefixList) (model.IPPrefixList, error) + + // Deletes a specific IPPrefixList on the specified logical router. + // + // @param logicalRouterIdParam (required) + // @param idParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(logicalRouterIdParam string, idParam string) error + + // Read a specific IPPrefixList on the specified logical router. + // + // @param logicalRouterIdParam (required) + // @param idParam (required) + // @return com.vmware.nsx.model.IPPrefixList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterIdParam string, idParam string) (model.IPPrefixList, error) + + // Paginated List of IPPrefixLists + // + // @param logicalRouterIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.IPPrefixListListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(logicalRouterIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPPrefixListListResult, error) + + // Update a specific IPPrefixList on the specified logical router. + // + // @param logicalRouterIdParam (required) + // @param idParam (required) + // @param ipPrefixListParam (required) + // @return com.vmware.nsx.model.IPPrefixList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(logicalRouterIdParam string, idParam string, ipPrefixListParam model.IPPrefixList) (model.IPPrefixList, error) +} + +type ipPrefixListsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewIpPrefixListsClient(connector client.Connector) *ipPrefixListsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.routing.ip_prefix_lists") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := ipPrefixListsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *ipPrefixListsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *ipPrefixListsClient) Create(logicalRouterIdParam string, ipPrefixListParam model.IPPrefixList) (model.IPPrefixList, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipPrefixListsCreateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("IpPrefixList", ipPrefixListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPPrefixList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipPrefixListsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.ip_prefix_lists", "create", inputDataValue, executionContext) + var emptyOutput model.IPPrefixList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipPrefixListsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPPrefixList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipPrefixListsClient) Delete(logicalRouterIdParam string, idParam string) error { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipPrefixListsDeleteInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Id", idParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipPrefixListsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.ip_prefix_lists", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *ipPrefixListsClient) Get(logicalRouterIdParam string, idParam string) (model.IPPrefixList, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipPrefixListsGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Id", idParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPPrefixList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipPrefixListsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.ip_prefix_lists", "get", inputDataValue, executionContext) + var emptyOutput model.IPPrefixList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipPrefixListsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPPrefixList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipPrefixListsClient) List(logicalRouterIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPPrefixListListResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipPrefixListsListInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPPrefixListListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipPrefixListsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.ip_prefix_lists", "list", inputDataValue, executionContext) + var emptyOutput model.IPPrefixListListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipPrefixListsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPPrefixListListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipPrefixListsClient) Update(logicalRouterIdParam string, idParam string, ipPrefixListParam model.IPPrefixList) (model.IPPrefixList, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipPrefixListsUpdateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Id", idParam) + sv.AddStructField("IpPrefixList", ipPrefixListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPPrefixList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipPrefixListsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.ip_prefix_lists", "update", inputDataValue, executionContext) + var emptyOutput model.IPPrefixList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipPrefixListsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPPrefixList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/IpPrefixListsTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/IpPrefixListsTypes.go new file mode 100644 index 000000000..f04ada47c --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/IpPrefixListsTypes.go @@ -0,0 +1,330 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: IpPrefixLists. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package routing + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func ipPrefixListsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["ip_prefix_list"] = bindings.NewReferenceType(model.IPPrefixListBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["ip_prefix_list"] = "IpPrefixList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipPrefixListsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPPrefixListBindingType) +} + +func ipPrefixListsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["ip_prefix_list"] = bindings.NewReferenceType(model.IPPrefixListBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["ip_prefix_list"] = "IpPrefixList" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["ip_prefix_list"] = bindings.NewReferenceType(model.IPPrefixListBindingType) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_prefix_list", + "POST", + "/api/v1/logical-routers/{logicalRouterId}/routing/ip-prefix-lists", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipPrefixListsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipPrefixListsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipPrefixListsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + pathParams["id"] = "id" + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/logical-routers/{logicalRouterId}/routing/ip-prefix-lists/{id}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipPrefixListsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipPrefixListsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPPrefixListBindingType) +} + +func ipPrefixListsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + pathParams["id"] = "id" + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/ip-prefix-lists/{id}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipPrefixListsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipPrefixListsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPPrefixListListResultBindingType) +} + +func ipPrefixListsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/ip-prefix-lists", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipPrefixListsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fields["ip_prefix_list"] = bindings.NewReferenceType(model.IPPrefixListBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + fieldNameMap["ip_prefix_list"] = "IpPrefixList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipPrefixListsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPPrefixListBindingType) +} + +func ipPrefixListsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fields["ip_prefix_list"] = bindings.NewReferenceType(model.IPPrefixListBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + fieldNameMap["ip_prefix_list"] = "IpPrefixList" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["ip_prefix_list"] = bindings.NewReferenceType(model.IPPrefixListBindingType) + paramsTypeMap["id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + pathParams["id"] = "id" + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_prefix_list", + "PUT", + "/api/v1/logical-routers/{logicalRouterId}/routing/ip-prefix-lists/{id}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/RedistributionClient.go b/services/nsxt-mp/nsx/logical_routers/routing/RedistributionClient.go new file mode 100644 index 000000000..f8090c627 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/RedistributionClient.go @@ -0,0 +1,135 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Redistribution +// Used by client-side stubs. + +package routing + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RedistributionClient interface { + + // Returns information about configured route redistribution for the specified logical router. + // + // @param logicalRouterIdParam (required) + // @return com.vmware.nsx.model.RedistributionConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterIdParam string) (model.RedistributionConfig, error) + + // Modifies existing route redistribution rules for the specified TIER0 logical router. + // + // @param logicalRouterIdParam (required) + // @param redistributionConfigParam (required) + // @return com.vmware.nsx.model.RedistributionConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(logicalRouterIdParam string, redistributionConfigParam model.RedistributionConfig) (model.RedistributionConfig, error) +} + +type redistributionClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRedistributionClient(connector client.Connector) *redistributionClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.routing.redistribution") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := redistributionClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *redistributionClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *redistributionClient) Get(logicalRouterIdParam string) (model.RedistributionConfig, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(redistributionGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RedistributionConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := redistributionGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.redistribution", "get", inputDataValue, executionContext) + var emptyOutput model.RedistributionConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), redistributionGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RedistributionConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *redistributionClient) Update(logicalRouterIdParam string, redistributionConfigParam model.RedistributionConfig) (model.RedistributionConfig, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(redistributionUpdateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("RedistributionConfig", redistributionConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RedistributionConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := redistributionUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.redistribution", "update", inputDataValue, executionContext) + var emptyOutput model.RedistributionConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), redistributionUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RedistributionConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/RedistributionTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/RedistributionTypes.go new file mode 100644 index 000000000..1dd3d2488 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/RedistributionTypes.go @@ -0,0 +1,124 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Redistribution. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package routing + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func redistributionGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func redistributionGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RedistributionConfigBindingType) +} + +func redistributionGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/redistribution", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func redistributionUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["redistribution_config"] = bindings.NewReferenceType(model.RedistributionConfigBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["redistribution_config"] = "RedistributionConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func redistributionUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RedistributionConfigBindingType) +} + +func redistributionUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["redistribution_config"] = bindings.NewReferenceType(model.RedistributionConfigBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["redistribution_config"] = "RedistributionConfig" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["redistribution_config"] = bindings.NewReferenceType(model.RedistributionConfigBindingType) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "redistribution_config", + "PUT", + "/api/v1/logical-routers/{logicalRouterId}/routing/redistribution", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/RouteMapsClient.go b/services/nsxt-mp/nsx/logical_routers/routing/RouteMapsClient.go new file mode 100644 index 000000000..050d12262 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/RouteMapsClient.go @@ -0,0 +1,275 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: RouteMaps +// Used by client-side stubs. + +package routing + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RouteMapsClient interface { + + // Adds a new RouteMap on a Logical Router + // + // @param logicalRouterIdParam (required) + // @param routeMapParam (required) + // @return com.vmware.nsx.model.RouteMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(logicalRouterIdParam string, routeMapParam model.RouteMap) (model.RouteMap, error) + + // Deletes a specific RouteMap on the specified logical router. + // + // @param logicalRouterIdParam (required) + // @param idParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(logicalRouterIdParam string, idParam string) error + + // Read a specific RouteMap on the specified logical router. + // + // @param logicalRouterIdParam (required) + // @param idParam (required) + // @return com.vmware.nsx.model.RouteMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterIdParam string, idParam string) (model.RouteMap, error) + + // Paginated List of RouteMaps + // + // @param logicalRouterIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.RouteMapListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(logicalRouterIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.RouteMapListResult, error) + + // Update a specific RouteMap on the specified logical router. + // + // @param logicalRouterIdParam (required) + // @param idParam (required) + // @param routeMapParam (required) + // @return com.vmware.nsx.model.RouteMap + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(logicalRouterIdParam string, idParam string, routeMapParam model.RouteMap) (model.RouteMap, error) +} + +type routeMapsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRouteMapsClient(connector client.Connector) *routeMapsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.routing.route_maps") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := routeMapsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *routeMapsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *routeMapsClient) Create(logicalRouterIdParam string, routeMapParam model.RouteMap) (model.RouteMap, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(routeMapsCreateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("RouteMap", routeMapParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RouteMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := routeMapsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.route_maps", "create", inputDataValue, executionContext) + var emptyOutput model.RouteMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), routeMapsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RouteMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *routeMapsClient) Delete(logicalRouterIdParam string, idParam string) error { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(routeMapsDeleteInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Id", idParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := routeMapsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.route_maps", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (rIface *routeMapsClient) Get(logicalRouterIdParam string, idParam string) (model.RouteMap, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(routeMapsGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Id", idParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RouteMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := routeMapsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.route_maps", "get", inputDataValue, executionContext) + var emptyOutput model.RouteMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), routeMapsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RouteMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *routeMapsClient) List(logicalRouterIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.RouteMapListResult, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(routeMapsListInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RouteMapListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := routeMapsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.route_maps", "list", inputDataValue, executionContext) + var emptyOutput model.RouteMapListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), routeMapsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RouteMapListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *routeMapsClient) Update(logicalRouterIdParam string, idParam string, routeMapParam model.RouteMap) (model.RouteMap, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(routeMapsUpdateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Id", idParam) + sv.AddStructField("RouteMap", routeMapParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RouteMap + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := routeMapsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.route_maps", "update", inputDataValue, executionContext) + var emptyOutput model.RouteMap + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), routeMapsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RouteMap), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/RouteMapsTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/RouteMapsTypes.go new file mode 100644 index 000000000..e0e6d1d36 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/RouteMapsTypes.go @@ -0,0 +1,330 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: RouteMaps. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package routing + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func routeMapsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["route_map"] = bindings.NewReferenceType(model.RouteMapBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["route_map"] = "RouteMap" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func routeMapsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RouteMapBindingType) +} + +func routeMapsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["route_map"] = bindings.NewReferenceType(model.RouteMapBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["route_map"] = "RouteMap" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["route_map"] = bindings.NewReferenceType(model.RouteMapBindingType) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "route_map", + "POST", + "/api/v1/logical-routers/{logicalRouterId}/routing/route-maps", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func routeMapsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func routeMapsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func routeMapsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + pathParams["id"] = "id" + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/logical-routers/{logicalRouterId}/routing/route-maps/{id}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func routeMapsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func routeMapsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RouteMapBindingType) +} + +func routeMapsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + pathParams["id"] = "id" + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/route-maps/{id}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func routeMapsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func routeMapsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RouteMapListResultBindingType) +} + +func routeMapsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/route-maps", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func routeMapsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fields["route_map"] = bindings.NewReferenceType(model.RouteMapBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + fieldNameMap["route_map"] = "RouteMap" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func routeMapsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RouteMapBindingType) +} + +func routeMapsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fields["route_map"] = bindings.NewReferenceType(model.RouteMapBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + fieldNameMap["route_map"] = "RouteMap" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["route_map"] = bindings.NewReferenceType(model.RouteMapBindingType) + paramsTypeMap["id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + pathParams["id"] = "id" + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "route_map", + "PUT", + "/api/v1/logical-routers/{logicalRouterId}/routing/route-maps/{id}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/RouteTableClient.go b/services/nsxt-mp/nsx/logical_routers/routing/RouteTableClient.go new file mode 100644 index 000000000..e644801cf --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/RouteTableClient.go @@ -0,0 +1,104 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: RouteTable +// Used by client-side stubs. + +package routing + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RouteTableClient interface { + + // Deprecated - Please use /logical-routers//routing/routing-table for RIB and /logical-routers//routing/forwarding-table for FIB. Returns the route table for the logical router on a node of the given transport-node-id. Query parameter \"transport_node_id=\" is required. Query parameter \"source=realtime\" is the only supported source. + // + // @param logicalRouterIdParam (required) + // @param transportNodeIdParam TransportNode Id (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.LogicalRouterRouteTable + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(logicalRouterIdParam string, transportNodeIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, sourceParam *string) (model.LogicalRouterRouteTable, error) +} + +type routeTableClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRouteTableClient(connector client.Connector) *routeTableClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.routing.route_table") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := routeTableClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *routeTableClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *routeTableClient) List(logicalRouterIdParam string, transportNodeIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, sourceParam *string) (model.LogicalRouterRouteTable, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(routeTableListInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalRouterRouteTable + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := routeTableListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.route_table", "list", inputDataValue, executionContext) + var emptyOutput model.LogicalRouterRouteTable + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), routeTableListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalRouterRouteTable), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/RouteTableTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/RouteTableTypes.go new file mode 100644 index 000000000..9b94d8e38 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/RouteTableTypes.go @@ -0,0 +1,117 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: RouteTable. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package routing + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method RouteTable#list. +const RouteTable_LIST_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method RouteTable#list. +const RouteTable_LIST_SOURCE_CACHED = "cached" + +func routeTableListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["transport_node_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func routeTableListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalRouterRouteTableBindingType) +} + +func routeTableListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["transport_node_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["transport_node_id"] = bindings.NewStringType() + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["transport_node_id"] = "transport_node_id" + queryParams["sort_by"] = "sort_by" + queryParams["source"] = "source" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/route-table", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/RoutingPackageTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/RoutingPackageTypes.go new file mode 100644 index 000000000..7aa4fbeb1 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/RoutingPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.logical_routers.routing. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package routing diff --git a/services/nsxt-mp/nsx/logical_routers/routing/RoutingTableClient.go b/services/nsxt-mp/nsx/logical_routers/routing/RoutingTableClient.go new file mode 100644 index 000000000..f17679a7f --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/RoutingTableClient.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: RoutingTable +// Used by client-side stubs. + +package routing + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RoutingTableClient interface { + + // Returns the route table(RIB) for the logical router on a node of the given transport-node-id. Query parameter \"transport_node_id=\" is required. To filter the result by network address, parameter \"network_prefix=\" needs to be specified. To filter the result by route source, parameter \"route_source=\" needs to be specified where source_type can be BGP, STATIC, CONNECTED, NSX_STATIC, TIER1_NAT or TIER0_NAT. It is also possible to filter the RIB table using both network address and route source filter together. Query parameter \"source=realtime\" is the only supported source. + // + // @param logicalRouterIdParam (required) + // @param transportNodeIdParam TransportNode Id (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param networkPrefixParam IPAddress or CIDR Block (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param routeSourceParam Route source filter parameter (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param sourceParam Data source type. (optional) + // @param vrfTableParam VRF filter parameter (optional) + // @return com.vmware.nsx.model.LogicalRouterRouteTable + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(logicalRouterIdParam string, transportNodeIdParam string, cursorParam *string, includedFieldsParam *string, networkPrefixParam *string, pageSizeParam *int64, routeSourceParam *string, sortAscendingParam *bool, sortByParam *string, sourceParam *string, vrfTableParam *string) (model.LogicalRouterRouteTable, error) +} + +type routingTableClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRoutingTableClient(connector client.Connector) *routingTableClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.routing.routing_table") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := routingTableClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *routingTableClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *routingTableClient) List(logicalRouterIdParam string, transportNodeIdParam string, cursorParam *string, includedFieldsParam *string, networkPrefixParam *string, pageSizeParam *int64, routeSourceParam *string, sortAscendingParam *bool, sortByParam *string, sourceParam *string, vrfTableParam *string) (model.LogicalRouterRouteTable, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(routingTableListInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("NetworkPrefix", networkPrefixParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("RouteSource", routeSourceParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Source", sourceParam) + sv.AddStructField("VrfTable", vrfTableParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalRouterRouteTable + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := routingTableListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.routing_table", "list", inputDataValue, executionContext) + var emptyOutput model.LogicalRouterRouteTable + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), routingTableListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalRouterRouteTable), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/RoutingTableTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/RoutingTableTypes.go new file mode 100644 index 000000000..3c2852268 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/RoutingTableTypes.go @@ -0,0 +1,153 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: RoutingTable. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package routing + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``routeSource`` of method RoutingTable#list. +const RoutingTable_LIST_ROUTE_SOURCE_BGP = "BGP" + +// Possible value for ``routeSource`` of method RoutingTable#list. +const RoutingTable_LIST_ROUTE_SOURCE_STATIC = "STATIC" + +// Possible value for ``routeSource`` of method RoutingTable#list. +const RoutingTable_LIST_ROUTE_SOURCE_CONNECTED = "CONNECTED" + +// Possible value for ``routeSource`` of method RoutingTable#list. +const RoutingTable_LIST_ROUTE_SOURCE_OSPF = "OSPF" + +// Possible value for ``source`` of method RoutingTable#list. +const RoutingTable_LIST_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method RoutingTable#list. +const RoutingTable_LIST_SOURCE_CACHED = "cached" + +// Possible value for ``vrfTable`` of method RoutingTable#list. +const RoutingTable_LIST_VRF_TABLE_DEFAULT = "DEFAULT" + +// Possible value for ``vrfTable`` of method RoutingTable#list. +const RoutingTable_LIST_VRF_TABLE_INTER_SR = "INTER_SR" + +func routingTableListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["transport_node_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["network_prefix"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["route_source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["vrf_table"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["network_prefix"] = "NetworkPrefix" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["route_source"] = "RouteSource" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["vrf_table"] = "VrfTable" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func routingTableListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalRouterRouteTableBindingType) +} + +func routingTableListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["transport_node_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["network_prefix"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["route_source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["vrf_table"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["network_prefix"] = "NetworkPrefix" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["route_source"] = "RouteSource" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["vrf_table"] = "VrfTable" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["vrf_table"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["network_prefix"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["route_source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["transport_node_id"] = bindings.NewStringType() + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + queryParams["cursor"] = "cursor" + queryParams["vrf_table"] = "vrf_table" + queryParams["network_prefix"] = "network_prefix" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["transport_node_id"] = "transport_node_id" + queryParams["sort_by"] = "sort_by" + queryParams["source"] = "source" + queryParams["route_source"] = "route_source" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/routing-table", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/StaticRoutesClient.go b/services/nsxt-mp/nsx/logical_routers/routing/StaticRoutesClient.go new file mode 100644 index 000000000..a8016ccb7 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/StaticRoutesClient.go @@ -0,0 +1,275 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: StaticRoutes +// Used by client-side stubs. + +package routing + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StaticRoutesClient interface { + + // Adds a new static route on a Logical Router + // + // @param logicalRouterIdParam (required) + // @param staticRouteParam (required) + // @return com.vmware.nsx.model.StaticRoute + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(logicalRouterIdParam string, staticRouteParam model.StaticRoute) (model.StaticRoute, error) + + // Deletes a specific static route on the specified logical router. + // + // @param logicalRouterIdParam (required) + // @param idParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(logicalRouterIdParam string, idParam string) error + + // Read a specific static routes on the specified logical router. + // + // @param logicalRouterIdParam (required) + // @param idParam (required) + // @return com.vmware.nsx.model.StaticRoute + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterIdParam string, idParam string) (model.StaticRoute, error) + + // Returns information about configured static routes, including the network address and next hops for each static route. + // + // @param logicalRouterIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.StaticRouteListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(logicalRouterIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.StaticRouteListResult, error) + + // Update a specific static route on the specified logical router. + // + // @param logicalRouterIdParam (required) + // @param idParam (required) + // @param staticRouteParam (required) + // @return com.vmware.nsx.model.StaticRoute + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(logicalRouterIdParam string, idParam string, staticRouteParam model.StaticRoute) (model.StaticRoute, error) +} + +type staticRoutesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStaticRoutesClient(connector client.Connector) *staticRoutesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.routing.static_routes") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := staticRoutesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *staticRoutesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *staticRoutesClient) Create(logicalRouterIdParam string, staticRouteParam model.StaticRoute) (model.StaticRoute, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(staticRoutesCreateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("StaticRoute", staticRouteParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.StaticRoute + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := staticRoutesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.static_routes", "create", inputDataValue, executionContext) + var emptyOutput model.StaticRoute + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), staticRoutesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.StaticRoute), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *staticRoutesClient) Delete(logicalRouterIdParam string, idParam string) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(staticRoutesDeleteInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Id", idParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := staticRoutesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.static_routes", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *staticRoutesClient) Get(logicalRouterIdParam string, idParam string) (model.StaticRoute, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(staticRoutesGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Id", idParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.StaticRoute + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := staticRoutesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.static_routes", "get", inputDataValue, executionContext) + var emptyOutput model.StaticRoute + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), staticRoutesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.StaticRoute), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *staticRoutesClient) List(logicalRouterIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.StaticRouteListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(staticRoutesListInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.StaticRouteListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := staticRoutesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.static_routes", "list", inputDataValue, executionContext) + var emptyOutput model.StaticRouteListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), staticRoutesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.StaticRouteListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *staticRoutesClient) Update(logicalRouterIdParam string, idParam string, staticRouteParam model.StaticRoute) (model.StaticRoute, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(staticRoutesUpdateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Id", idParam) + sv.AddStructField("StaticRoute", staticRouteParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.StaticRoute + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := staticRoutesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.static_routes", "update", inputDataValue, executionContext) + var emptyOutput model.StaticRoute + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), staticRoutesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.StaticRoute), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/StaticRoutesTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/StaticRoutesTypes.go new file mode 100644 index 000000000..c8ea78806 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/StaticRoutesTypes.go @@ -0,0 +1,330 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: StaticRoutes. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package routing + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func staticRoutesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["static_route"] = bindings.NewReferenceType(model.StaticRouteBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["static_route"] = "StaticRoute" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func staticRoutesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.StaticRouteBindingType) +} + +func staticRoutesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["static_route"] = bindings.NewReferenceType(model.StaticRouteBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["static_route"] = "StaticRoute" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["static_route"] = bindings.NewReferenceType(model.StaticRouteBindingType) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "static_route", + "POST", + "/api/v1/logical-routers/{logicalRouterId}/routing/static-routes", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func staticRoutesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func staticRoutesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func staticRoutesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + pathParams["id"] = "id" + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/logical-routers/{logicalRouterId}/routing/static-routes/{id}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func staticRoutesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func staticRoutesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.StaticRouteBindingType) +} + +func staticRoutesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + pathParams["id"] = "id" + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/static-routes/{id}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func staticRoutesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func staticRoutesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.StaticRouteListResultBindingType) +} + +func staticRoutesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/static-routes", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func staticRoutesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fields["static_route"] = bindings.NewReferenceType(model.StaticRouteBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + fieldNameMap["static_route"] = "StaticRoute" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func staticRoutesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.StaticRouteBindingType) +} + +func staticRoutesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fields["static_route"] = bindings.NewReferenceType(model.StaticRouteBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + fieldNameMap["static_route"] = "StaticRoute" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["static_route"] = bindings.NewReferenceType(model.StaticRouteBindingType) + paramsTypeMap["id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + pathParams["id"] = "id" + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "static_route", + "PUT", + "/api/v1/logical-routers/{logicalRouterId}/routing/static-routes/{id}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/advertisement/AdvertisementPackageTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/advertisement/AdvertisementPackageTypes.go new file mode 100644 index 000000000..e65a46a5e --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/advertisement/AdvertisementPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.logical_routers.routing.advertisement. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package advertisement diff --git a/services/nsxt-mp/nsx/logical_routers/routing/advertisement/RulesClient.go b/services/nsxt-mp/nsx/logical_routers/routing/advertisement/RulesClient.go new file mode 100644 index 000000000..7b2f0e31b --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/advertisement/RulesClient.go @@ -0,0 +1,135 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Rules +// Used by client-side stubs. + +package advertisement + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RulesClient interface { + + // Returns the advertisement rule list for the specified TIER1 logical router. + // + // @param logicalRouterIdParam (required) + // @return com.vmware.nsx.model.AdvertiseRuleList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterIdParam string) (model.AdvertiseRuleList, error) + + // Modifies the advertisement rules on the specified logical router. The PUT request must include all the rules with the networks parameter. Modifiable parameters are networks, display_name, and description. Set the rules list to empty to delete/clear all rules. + // + // @param logicalRouterIdParam (required) + // @param advertiseRuleListParam (required) + // @return com.vmware.nsx.model.AdvertiseRuleList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(logicalRouterIdParam string, advertiseRuleListParam model.AdvertiseRuleList) (model.AdvertiseRuleList, error) +} + +type rulesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRulesClient(connector client.Connector) *rulesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.routing.advertisement.rules") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := rulesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *rulesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *rulesClient) Get(logicalRouterIdParam string) (model.AdvertiseRuleList, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.AdvertiseRuleList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.advertisement.rules", "get", inputDataValue, executionContext) + var emptyOutput model.AdvertiseRuleList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.AdvertiseRuleList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rulesClient) Update(logicalRouterIdParam string, advertiseRuleListParam model.AdvertiseRuleList) (model.AdvertiseRuleList, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesUpdateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("AdvertiseRuleList", advertiseRuleListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.AdvertiseRuleList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.advertisement.rules", "update", inputDataValue, executionContext) + var emptyOutput model.AdvertiseRuleList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.AdvertiseRuleList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/advertisement/RulesTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/advertisement/RulesTypes.go new file mode 100644 index 000000000..804a98d1f --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/advertisement/RulesTypes.go @@ -0,0 +1,124 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Rules. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package advertisement + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func rulesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.AdvertiseRuleListBindingType) +} + +func rulesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/advertisement/rules", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["advertise_rule_list"] = bindings.NewReferenceType(model.AdvertiseRuleListBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["advertise_rule_list"] = "AdvertiseRuleList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.AdvertiseRuleListBindingType) +} + +func rulesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["advertise_rule_list"] = bindings.NewReferenceType(model.AdvertiseRuleListBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["advertise_rule_list"] = "AdvertiseRuleList" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["advertise_rule_list"] = bindings.NewReferenceType(model.AdvertiseRuleListBindingType) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "advertise_rule_list", + "PUT", + "/api/v1/logical-routers/{logicalRouterId}/routing/advertisement/rules", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/bgp/BgpPackageTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/bgp/BgpPackageTypes.go new file mode 100644 index 000000000..328baf4ff --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/bgp/BgpPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.logical_routers.routing.bgp. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package bgp diff --git a/services/nsxt-mp/nsx/logical_routers/routing/bgp/CommunityListsClient.go b/services/nsxt-mp/nsx/logical_routers/routing/bgp/CommunityListsClient.go new file mode 100644 index 000000000..9e0b32e98 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/bgp/CommunityListsClient.go @@ -0,0 +1,275 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: CommunityLists +// Used by client-side stubs. + +package bgp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type CommunityListsClient interface { + + // Add a new BGP Community List on a Logical Router + // + // @param logicalRouterIdParam (required) + // @param bGPCommunityListParam (required) + // @return com.vmware.nsx.model.BGPCommunityList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(logicalRouterIdParam string, bGPCommunityListParam model.BGPCommunityList) (model.BGPCommunityList, error) + + // Delete a specific BGP community list from a Logical Router + // + // @param logicalRouterIdParam (required) + // @param communityListIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(logicalRouterIdParam string, communityListIdParam string) error + + // Read a specific BGP community list from a Logical Router + // + // @param logicalRouterIdParam (required) + // @param communityListIdParam (required) + // @return com.vmware.nsx.model.BGPCommunityList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterIdParam string, communityListIdParam string) (model.BGPCommunityList, error) + + // Paginated list of BGP Community Lists on a Logical Router + // + // @param logicalRouterIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.BGPCommunityListListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(logicalRouterIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.BGPCommunityListListResult, error) + + // Update a specific BGP community list from a Logical Router + // + // @param logicalRouterIdParam (required) + // @param communityListIdParam (required) + // @param bGPCommunityListParam (required) + // @return com.vmware.nsx.model.BGPCommunityList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(logicalRouterIdParam string, communityListIdParam string, bGPCommunityListParam model.BGPCommunityList) (model.BGPCommunityList, error) +} + +type communityListsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewCommunityListsClient(connector client.Connector) *communityListsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.routing.bgp.community_lists") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := communityListsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *communityListsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *communityListsClient) Create(logicalRouterIdParam string, bGPCommunityListParam model.BGPCommunityList) (model.BGPCommunityList, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(communityListsCreateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("BGPCommunityList", bGPCommunityListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BGPCommunityList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := communityListsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.bgp.community_lists", "create", inputDataValue, executionContext) + var emptyOutput model.BGPCommunityList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), communityListsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BGPCommunityList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *communityListsClient) Delete(logicalRouterIdParam string, communityListIdParam string) error { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(communityListsDeleteInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("CommunityListId", communityListIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := communityListsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.bgp.community_lists", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *communityListsClient) Get(logicalRouterIdParam string, communityListIdParam string) (model.BGPCommunityList, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(communityListsGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("CommunityListId", communityListIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BGPCommunityList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := communityListsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.bgp.community_lists", "get", inputDataValue, executionContext) + var emptyOutput model.BGPCommunityList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), communityListsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BGPCommunityList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *communityListsClient) List(logicalRouterIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.BGPCommunityListListResult, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(communityListsListInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BGPCommunityListListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := communityListsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.bgp.community_lists", "list", inputDataValue, executionContext) + var emptyOutput model.BGPCommunityListListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), communityListsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BGPCommunityListListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *communityListsClient) Update(logicalRouterIdParam string, communityListIdParam string, bGPCommunityListParam model.BGPCommunityList) (model.BGPCommunityList, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(communityListsUpdateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("CommunityListId", communityListIdParam) + sv.AddStructField("BGPCommunityList", bGPCommunityListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BGPCommunityList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := communityListsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.bgp.community_lists", "update", inputDataValue, executionContext) + var emptyOutput model.BGPCommunityList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), communityListsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BGPCommunityList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/bgp/CommunityListsTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/bgp/CommunityListsTypes.go new file mode 100644 index 000000000..e8c10e158 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/bgp/CommunityListsTypes.go @@ -0,0 +1,330 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: CommunityLists. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package bgp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func communityListsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["b_GP_community_list"] = bindings.NewReferenceType(model.BGPCommunityListBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["b_GP_community_list"] = "BGPCommunityList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func communityListsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BGPCommunityListBindingType) +} + +func communityListsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["b_GP_community_list"] = bindings.NewReferenceType(model.BGPCommunityListBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["b_GP_community_list"] = "BGPCommunityList" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["b_GP_community_list"] = bindings.NewReferenceType(model.BGPCommunityListBindingType) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "b_GP_community_list", + "POST", + "/api/v1/logical-routers/{logicalRouterId}/routing/bgp/community-lists", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func communityListsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["community_list_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["community_list_id"] = "CommunityListId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func communityListsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func communityListsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["community_list_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["community_list_id"] = "CommunityListId" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["community_list_id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["communityListId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + pathParams["community_list_id"] = "communityListId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/logical-routers/{logicalRouterId}/routing/bgp/community-lists/{communityListId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func communityListsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["community_list_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["community_list_id"] = "CommunityListId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func communityListsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BGPCommunityListBindingType) +} + +func communityListsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["community_list_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["community_list_id"] = "CommunityListId" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["community_list_id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["communityListId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + pathParams["community_list_id"] = "communityListId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/bgp/community-lists/{communityListId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func communityListsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func communityListsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BGPCommunityListListResultBindingType) +} + +func communityListsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/bgp/community-lists", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func communityListsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["community_list_id"] = bindings.NewStringType() + fields["b_GP_community_list"] = bindings.NewReferenceType(model.BGPCommunityListBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["community_list_id"] = "CommunityListId" + fieldNameMap["b_GP_community_list"] = "BGPCommunityList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func communityListsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BGPCommunityListBindingType) +} + +func communityListsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["community_list_id"] = bindings.NewStringType() + fields["b_GP_community_list"] = bindings.NewReferenceType(model.BGPCommunityListBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["community_list_id"] = "CommunityListId" + fieldNameMap["b_GP_community_list"] = "BGPCommunityList" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["community_list_id"] = bindings.NewStringType() + paramsTypeMap["b_GP_community_list"] = bindings.NewReferenceType(model.BGPCommunityListBindingType) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["communityListId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + pathParams["community_list_id"] = "communityListId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "b_GP_community_list", + "PUT", + "/api/v1/logical-routers/{logicalRouterId}/routing/bgp/community-lists/{communityListId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/bgp/CommuntyListsClient.go b/services/nsxt-mp/nsx/logical_routers/routing/bgp/CommuntyListsClient.go new file mode 100644 index 000000000..206764c29 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/bgp/CommuntyListsClient.go @@ -0,0 +1,94 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: CommuntyLists +// Used by client-side stubs. + +package bgp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type CommuntyListsClient interface { + + // Update a specific BGP community list from a Logical Router + // + // @param logicalRouterIdParam (required) + // @param communityListIdParam (required) + // @param bGPCommunityListParam (required) + // @return com.vmware.nsx.model.BGPCommunityList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(logicalRouterIdParam string, communityListIdParam string, bGPCommunityListParam model.BGPCommunityList) (model.BGPCommunityList, error) +} + +type communtyListsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewCommuntyListsClient(connector client.Connector) *communtyListsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.routing.bgp.communty_lists") + methodIdentifiers := map[string]core.MethodIdentifier{ + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := communtyListsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *communtyListsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *communtyListsClient) Update(logicalRouterIdParam string, communityListIdParam string, bGPCommunityListParam model.BGPCommunityList) (model.BGPCommunityList, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(communtyListsUpdateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("CommunityListId", communityListIdParam) + sv.AddStructField("BGPCommunityList", bGPCommunityListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BGPCommunityList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := communtyListsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.bgp.communty_lists", "update", inputDataValue, executionContext) + var emptyOutput model.BGPCommunityList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), communtyListsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BGPCommunityList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/bgp/CommuntyListsTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/bgp/CommuntyListsTypes.go new file mode 100644 index 000000000..4e03803c9 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/bgp/CommuntyListsTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: CommuntyLists. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package bgp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func communtyListsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["community_list_id"] = bindings.NewStringType() + fields["b_GP_community_list"] = bindings.NewReferenceType(model.BGPCommunityListBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["community_list_id"] = "CommunityListId" + fieldNameMap["b_GP_community_list"] = "BGPCommunityList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func communtyListsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BGPCommunityListBindingType) +} + +func communtyListsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["community_list_id"] = bindings.NewStringType() + fields["b_GP_community_list"] = bindings.NewReferenceType(model.BGPCommunityListBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["community_list_id"] = "CommunityListId" + fieldNameMap["b_GP_community_list"] = "BGPCommunityList" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["community_list_id"] = bindings.NewStringType() + paramsTypeMap["b_GP_community_list"] = bindings.NewReferenceType(model.BGPCommunityListBindingType) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["communityListId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + pathParams["community_list_id"] = "communityListId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "b_GP_community_list", + "PUT", + "/api/v1/logical-routers/{logicalRouterId}/routing/bgp/communty-lists/{communityListId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/bgp/NeighborsClient.go b/services/nsxt-mp/nsx/logical_routers/routing/bgp/NeighborsClient.go new file mode 100644 index 000000000..5361be6fd --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/bgp/NeighborsClient.go @@ -0,0 +1,367 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Neighbors +// Used by client-side stubs. + +package bgp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NeighborsClient interface { + + // Add a new BGP Neighbor on a Logical Router + // + // @param logicalRouterIdParam (required) + // @param bgpNeighborParam (required) + // @return com.vmware.nsx.model.BgpNeighbor + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(logicalRouterIdParam string, bgpNeighborParam model.BgpNeighbor) (model.BgpNeighbor, error) + + // Delete a specific BGP Neighbor on a Logical Router + // + // @param logicalRouterIdParam (required) + // @param idParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(logicalRouterIdParam string, idParam string) error + + // Read a specific BGP Neighbor on a Logical Router + // + // @param logicalRouterIdParam (required) + // @param idParam (required) + // @return com.vmware.nsx.model.BgpNeighbor + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterIdParam string, idParam string) (model.BgpNeighbor, error) + + // Paginated list of BGP Neighbors on a Logical Router + // + // @param logicalRouterIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.BgpNeighborListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(logicalRouterIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.BgpNeighborListResult, error) + + // Read a specific BGP Neighbor details with password on a Logical Router + // + // @param logicalRouterIdParam (required) + // @param idParam (required) + // @return com.vmware.nsx.model.BgpNeighbor + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Showsensitivedata(logicalRouterIdParam string, idParam string) (model.BgpNeighbor, error) + + // Unset/Delete the password property on the specific BGP Neighbor. No other property of the BgpNeighbor can be updated using this API + // + // @param logicalRouterIdParam (required) + // @param idParam (required) + // @param actionParam (optional) + // @return com.vmware.nsx.model.BgpNeighbor + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Unsetpassword(logicalRouterIdParam string, idParam string, actionParam *string) (model.BgpNeighbor, error) + + // Update a specific BGP Neighbor on a Logical Router + // + // @param logicalRouterIdParam (required) + // @param idParam (required) + // @param bgpNeighborParam (required) + // @return com.vmware.nsx.model.BgpNeighbor + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(logicalRouterIdParam string, idParam string, bgpNeighborParam model.BgpNeighbor) (model.BgpNeighbor, error) +} + +type neighborsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNeighborsClient(connector client.Connector) *neighborsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.routing.bgp.neighbors") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "showsensitivedata": core.NewMethodIdentifier(interfaceIdentifier, "showsensitivedata"), + "unsetpassword": core.NewMethodIdentifier(interfaceIdentifier, "unsetpassword"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := neighborsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *neighborsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *neighborsClient) Create(logicalRouterIdParam string, bgpNeighborParam model.BgpNeighbor) (model.BgpNeighbor, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(neighborsCreateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("BgpNeighbor", bgpNeighborParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BgpNeighbor + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := neighborsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.bgp.neighbors", "create", inputDataValue, executionContext) + var emptyOutput model.BgpNeighbor + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), neighborsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BgpNeighbor), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *neighborsClient) Delete(logicalRouterIdParam string, idParam string) error { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(neighborsDeleteInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Id", idParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := neighborsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.bgp.neighbors", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (nIface *neighborsClient) Get(logicalRouterIdParam string, idParam string) (model.BgpNeighbor, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(neighborsGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Id", idParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BgpNeighbor + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := neighborsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.bgp.neighbors", "get", inputDataValue, executionContext) + var emptyOutput model.BgpNeighbor + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), neighborsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BgpNeighbor), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *neighborsClient) List(logicalRouterIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.BgpNeighborListResult, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(neighborsListInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BgpNeighborListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := neighborsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.bgp.neighbors", "list", inputDataValue, executionContext) + var emptyOutput model.BgpNeighborListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), neighborsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BgpNeighborListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *neighborsClient) Showsensitivedata(logicalRouterIdParam string, idParam string) (model.BgpNeighbor, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(neighborsShowsensitivedataInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Id", idParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BgpNeighbor + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := neighborsShowsensitivedataRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.bgp.neighbors", "showsensitivedata", inputDataValue, executionContext) + var emptyOutput model.BgpNeighbor + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), neighborsShowsensitivedataOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BgpNeighbor), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *neighborsClient) Unsetpassword(logicalRouterIdParam string, idParam string, actionParam *string) (model.BgpNeighbor, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(neighborsUnsetpasswordInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Id", idParam) + sv.AddStructField("Action", actionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BgpNeighbor + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := neighborsUnsetpasswordRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.bgp.neighbors", "unsetpassword", inputDataValue, executionContext) + var emptyOutput model.BgpNeighbor + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), neighborsUnsetpasswordOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BgpNeighbor), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *neighborsClient) Update(logicalRouterIdParam string, idParam string, bgpNeighborParam model.BgpNeighbor) (model.BgpNeighbor, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(neighborsUpdateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Id", idParam) + sv.AddStructField("BgpNeighbor", bgpNeighborParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BgpNeighbor + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := neighborsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.bgp.neighbors", "update", inputDataValue, executionContext) + var emptyOutput model.BgpNeighbor + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), neighborsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BgpNeighbor), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/bgp/NeighborsTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/bgp/NeighborsTypes.go new file mode 100644 index 000000000..6ff6d1eeb --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/bgp/NeighborsTypes.go @@ -0,0 +1,453 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Neighbors. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package bgp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``action`` of method Neighbors#unsetpassword. +const Neighbors_UNSETPASSWORD_ACTION_PASSWORD = "clear_password" + +func neighborsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["bgp_neighbor"] = bindings.NewReferenceType(model.BgpNeighborBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["bgp_neighbor"] = "BgpNeighbor" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func neighborsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BgpNeighborBindingType) +} + +func neighborsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["bgp_neighbor"] = bindings.NewReferenceType(model.BgpNeighborBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["bgp_neighbor"] = "BgpNeighbor" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["bgp_neighbor"] = bindings.NewReferenceType(model.BgpNeighborBindingType) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "bgp_neighbor", + "POST", + "/api/v1/logical-routers/{logicalRouterId}/routing/bgp/neighbors", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func neighborsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func neighborsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func neighborsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + pathParams["id"] = "id" + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/logical-routers/{logicalRouterId}/routing/bgp/neighbors/{id}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func neighborsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func neighborsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BgpNeighborBindingType) +} + +func neighborsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + pathParams["id"] = "id" + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/bgp/neighbors/{id}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func neighborsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func neighborsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BgpNeighborListResultBindingType) +} + +func neighborsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/bgp/neighbors", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func neighborsShowsensitivedataInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func neighborsShowsensitivedataOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BgpNeighborBindingType) +} + +func neighborsShowsensitivedataRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + pathParams["id"] = "id" + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=show-sensitive-data", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/bgp/neighbors/{id}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func neighborsUnsetpasswordInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + fieldNameMap["action"] = "Action" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func neighborsUnsetpasswordOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BgpNeighborBindingType) +} + +func neighborsUnsetpasswordRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + fieldNameMap["action"] = "Action" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["action"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + pathParams["id"] = "id" + pathParams["logical_router_id"] = "logicalRouterId" + queryParams["action"] = "action" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "POST", + "/api/v1/logical-routers/{logicalRouterId}/routing/bgp/neighbors/{id}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func neighborsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fields["bgp_neighbor"] = bindings.NewReferenceType(model.BgpNeighborBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + fieldNameMap["bgp_neighbor"] = "BgpNeighbor" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func neighborsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BgpNeighborBindingType) +} + +func neighborsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["id"] = bindings.NewStringType() + fields["bgp_neighbor"] = bindings.NewReferenceType(model.BgpNeighborBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["id"] = "Id" + fieldNameMap["bgp_neighbor"] = "BgpNeighbor" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["bgp_neighbor"] = bindings.NewReferenceType(model.BgpNeighborBindingType) + paramsTypeMap["id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + pathParams["id"] = "id" + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "bgp_neighbor", + "PUT", + "/api/v1/logical-routers/{logicalRouterId}/routing/bgp/neighbors/{id}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/AdvertisedRoutesClient.go b/services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/AdvertisedRoutesClient.go new file mode 100644 index 000000000..66e8381ed --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/AdvertisedRoutesClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: AdvertisedRoutes +// Used by client-side stubs. + +package neighbors + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AdvertisedRoutesClient interface { + + // Returns routes advertised by BGP neighbor from all edge transport nodes on which this neighbor is currently enabled. It always returns realtime response. + // + // @param logicalRouterIdParam (required) + // @param neighborIdParam (required) + // @return com.vmware.nsx.model.BgpNeighborRouteDetails + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterIdParam string, neighborIdParam string) (model.BgpNeighborRouteDetails, error) +} + +type advertisedRoutesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAdvertisedRoutesClient(connector client.Connector) *advertisedRoutesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.routing.bgp.neighbors.advertised_routes") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := advertisedRoutesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *advertisedRoutesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *advertisedRoutesClient) Get(logicalRouterIdParam string, neighborIdParam string) (model.BgpNeighborRouteDetails, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(advertisedRoutesGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("NeighborId", neighborIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BgpNeighborRouteDetails + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := advertisedRoutesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.bgp.neighbors.advertised_routes", "get", inputDataValue, executionContext) + var emptyOutput model.BgpNeighborRouteDetails + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), advertisedRoutesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BgpNeighborRouteDetails), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/AdvertisedRoutesTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/AdvertisedRoutesTypes.go new file mode 100644 index 000000000..47a7e2e57 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/AdvertisedRoutesTypes.go @@ -0,0 +1,76 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: AdvertisedRoutes. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package neighbors + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func advertisedRoutesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["neighbor_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["neighbor_id"] = "NeighborId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func advertisedRoutesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BgpNeighborRouteDetailsBindingType) +} + +func advertisedRoutesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["neighbor_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["neighbor_id"] = "NeighborId" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["neighbor_id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["neighborId"] = bindings.NewStringType() + pathParams["neighbor_id"] = "neighborId" + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/bgp/neighbors/{neighborId}/advertised-routes", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/NeighborsPackageTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/NeighborsPackageTypes.go new file mode 100644 index 000000000..0ec276d67 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/NeighborsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.logical_routers.routing.bgp.neighbors. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package neighbors diff --git a/services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/RoutesClient.go b/services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/RoutesClient.go new file mode 100644 index 000000000..5e744174e --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/RoutesClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Routes +// Used by client-side stubs. + +package neighbors + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RoutesClient interface { + + // Returns routes learned by BGP neighbor from all edge transport nodes on which this neighbor is currently enabled. It always returns realtime response. + // + // @param logicalRouterIdParam (required) + // @param neighborIdParam (required) + // @return com.vmware.nsx.model.BgpNeighborRouteDetails + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterIdParam string, neighborIdParam string) (model.BgpNeighborRouteDetails, error) +} + +type routesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRoutesClient(connector client.Connector) *routesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.routing.bgp.neighbors.routes") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := routesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *routesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *routesClient) Get(logicalRouterIdParam string, neighborIdParam string) (model.BgpNeighborRouteDetails, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(routesGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("NeighborId", neighborIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BgpNeighborRouteDetails + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := routesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.bgp.neighbors.routes", "get", inputDataValue, executionContext) + var emptyOutput model.BgpNeighborRouteDetails + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), routesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BgpNeighborRouteDetails), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/RoutesTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/RoutesTypes.go new file mode 100644 index 000000000..9275787f0 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/RoutesTypes.go @@ -0,0 +1,76 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Routes. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package neighbors + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func routesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["neighbor_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["neighbor_id"] = "NeighborId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func routesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BgpNeighborRouteDetailsBindingType) +} + +func routesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["neighbor_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["neighbor_id"] = "NeighborId" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["neighbor_id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["neighborId"] = bindings.NewStringType() + pathParams["neighbor_id"] = "neighborId" + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/bgp/neighbors/{neighborId}/routes", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/StatusClient.go b/services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/StatusClient.go new file mode 100644 index 000000000..498efab3a --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/StatusClient.go @@ -0,0 +1,104 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package neighbors + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Returns the status of all the BGP neighbors for the Logical Router of the given id. To get BGP neighbors status for the logical router from particular node, parameter \"transport_node_id=\" needs to be specified. Query parameter \"source=realtime\" is the only supported source. + // + // @param logicalRouterIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param sourceParam Data source type. (optional) + // @param transportNodeIdParam Transport node id (optional) + // @return com.vmware.nsx.model.BgpNeighborsStatusListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(logicalRouterIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, sourceParam *string, transportNodeIdParam *string) (model.BgpNeighborsStatusListResult, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.routing.bgp.neighbors.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) List(logicalRouterIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, sourceParam *string, transportNodeIdParam *string) (model.BgpNeighborsStatusListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusListInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Source", sourceParam) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BgpNeighborsStatusListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.bgp.neighbors.status", "list", inputDataValue, executionContext) + var emptyOutput model.BgpNeighborsStatusListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BgpNeighborsStatusListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/StatusTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/StatusTypes.go new file mode 100644 index 000000000..0b69fea40 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/bgp/neighbors/StatusTypes.go @@ -0,0 +1,117 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package neighbors + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Status#list. +const Status_LIST_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Status#list. +const Status_LIST_SOURCE_CACHED = "cached" + +func statusListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BgpNeighborsStatusListResultBindingType) +} + +func statusListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["transport_node_id"] = "TransportNodeId" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["source"] = "source" + queryParams["transport_node_id"] = "transport_node_id" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/bgp/neighbors/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/redistribution/RedistributionPackageTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/redistribution/RedistributionPackageTypes.go new file mode 100644 index 000000000..6ea76f1ad --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/redistribution/RedistributionPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.logical_routers.routing.redistribution. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package redistribution diff --git a/services/nsxt-mp/nsx/logical_routers/routing/redistribution/RulesClient.go b/services/nsxt-mp/nsx/logical_routers/routing/redistribution/RulesClient.go new file mode 100644 index 000000000..45fdf66d5 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/redistribution/RulesClient.go @@ -0,0 +1,135 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Rules +// Used by client-side stubs. + +package redistribution + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RulesClient interface { + + // Returns all the route redistribution rules for the specified logical router. + // + // @param logicalRouterIdParam (required) + // @return com.vmware.nsx.model.RedistributionRuleList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterIdParam string) (model.RedistributionRuleList, error) + + // Modifies all route redistribution rules for the specified TIER0 logical router. Set the rules list to empty to delete/clear all rules. + // + // @param logicalRouterIdParam (required) + // @param redistributionRuleListParam (required) + // @return com.vmware.nsx.model.RedistributionRuleList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(logicalRouterIdParam string, redistributionRuleListParam model.RedistributionRuleList) (model.RedistributionRuleList, error) +} + +type rulesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRulesClient(connector client.Connector) *rulesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.routing.redistribution.rules") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := rulesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *rulesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *rulesClient) Get(logicalRouterIdParam string) (model.RedistributionRuleList, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RedistributionRuleList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.redistribution.rules", "get", inputDataValue, executionContext) + var emptyOutput model.RedistributionRuleList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RedistributionRuleList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rulesClient) Update(logicalRouterIdParam string, redistributionRuleListParam model.RedistributionRuleList) (model.RedistributionRuleList, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesUpdateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("RedistributionRuleList", redistributionRuleListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RedistributionRuleList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.redistribution.rules", "update", inputDataValue, executionContext) + var emptyOutput model.RedistributionRuleList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RedistributionRuleList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/redistribution/RulesTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/redistribution/RulesTypes.go new file mode 100644 index 000000000..209791688 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/redistribution/RulesTypes.go @@ -0,0 +1,124 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Rules. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package redistribution + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func rulesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RedistributionRuleListBindingType) +} + +func rulesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/redistribution/rules", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["redistribution_rule_list"] = bindings.NewReferenceType(model.RedistributionRuleListBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["redistribution_rule_list"] = "RedistributionRuleList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RedistributionRuleListBindingType) +} + +func rulesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["redistribution_rule_list"] = bindings.NewReferenceType(model.RedistributionRuleListBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["redistribution_rule_list"] = "RedistributionRuleList" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["redistribution_rule_list"] = bindings.NewReferenceType(model.RedistributionRuleListBindingType) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "redistribution_rule_list", + "PUT", + "/api/v1/logical-routers/{logicalRouterId}/routing/redistribution/rules", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/static_routes/BfdPeersClient.go b/services/nsxt-mp/nsx/logical_routers/routing/static_routes/BfdPeersClient.go new file mode 100644 index 000000000..185b0922b --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/static_routes/BfdPeersClient.go @@ -0,0 +1,277 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: BfdPeers +// Used by client-side stubs. + +package static_routes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type BfdPeersClient interface { + + // Creates a BFD peer for static route. The required parameters includes peer IP address. + // + // @param logicalRouterIdParam (required) + // @param staticHopBfdPeerParam (required) + // @return com.vmware.nsx.model.StaticHopBfdPeer + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(logicalRouterIdParam string, staticHopBfdPeerParam model.StaticHopBfdPeer) (model.StaticHopBfdPeer, error) + + // Deletes the specified BFD peer present on specified logical router. + // + // @param logicalRouterIdParam (required) + // @param bfdPeerIdParam (required) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(logicalRouterIdParam string, bfdPeerIdParam string, forceParam *bool) error + + // Read the BFD peer having specified ID. + // + // @param logicalRouterIdParam (required) + // @param bfdPeerIdParam (required) + // @return com.vmware.nsx.model.StaticHopBfdPeer + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterIdParam string, bfdPeerIdParam string) (model.StaticHopBfdPeer, error) + + // Returns information about all BFD peers created on specified logical router for static routes. + // + // @param logicalRouterIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.StaticHopBfdPeerListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(logicalRouterIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.StaticHopBfdPeerListResult, error) + + // Modifies the static route BFD peer. Modifiable parameters includes peer IP, enable flag and configuration of the BFD peer. + // + // @param logicalRouterIdParam (required) + // @param bfdPeerIdParam (required) + // @param staticHopBfdPeerParam (required) + // @return com.vmware.nsx.model.StaticHopBfdPeer + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(logicalRouterIdParam string, bfdPeerIdParam string, staticHopBfdPeerParam model.StaticHopBfdPeer) (model.StaticHopBfdPeer, error) +} + +type bfdPeersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewBfdPeersClient(connector client.Connector) *bfdPeersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.routing.static_routes.bfd_peers") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + bIface := bfdPeersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &bIface +} + +func (bIface *bfdPeersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := bIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (bIface *bfdPeersClient) Create(logicalRouterIdParam string, staticHopBfdPeerParam model.StaticHopBfdPeer) (model.StaticHopBfdPeer, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bfdPeersCreateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("StaticHopBfdPeer", staticHopBfdPeerParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.StaticHopBfdPeer + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bfdPeersCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.static_routes.bfd_peers", "create", inputDataValue, executionContext) + var emptyOutput model.StaticHopBfdPeer + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bfdPeersCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.StaticHopBfdPeer), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (bIface *bfdPeersClient) Delete(logicalRouterIdParam string, bfdPeerIdParam string, forceParam *bool) error { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bfdPeersDeleteInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("BfdPeerId", bfdPeerIdParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bfdPeersDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.static_routes.bfd_peers", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (bIface *bfdPeersClient) Get(logicalRouterIdParam string, bfdPeerIdParam string) (model.StaticHopBfdPeer, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bfdPeersGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("BfdPeerId", bfdPeerIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.StaticHopBfdPeer + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bfdPeersGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.static_routes.bfd_peers", "get", inputDataValue, executionContext) + var emptyOutput model.StaticHopBfdPeer + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bfdPeersGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.StaticHopBfdPeer), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (bIface *bfdPeersClient) List(logicalRouterIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.StaticHopBfdPeerListResult, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bfdPeersListInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.StaticHopBfdPeerListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bfdPeersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.static_routes.bfd_peers", "list", inputDataValue, executionContext) + var emptyOutput model.StaticHopBfdPeerListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bfdPeersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.StaticHopBfdPeerListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (bIface *bfdPeersClient) Update(logicalRouterIdParam string, bfdPeerIdParam string, staticHopBfdPeerParam model.StaticHopBfdPeer) (model.StaticHopBfdPeer, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bfdPeersUpdateInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("BfdPeerId", bfdPeerIdParam) + sv.AddStructField("StaticHopBfdPeer", staticHopBfdPeerParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.StaticHopBfdPeer + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bfdPeersUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.routing.static_routes.bfd_peers", "update", inputDataValue, executionContext) + var emptyOutput model.StaticHopBfdPeer + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bfdPeersUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.StaticHopBfdPeer), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/static_routes/BfdPeersTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/static_routes/BfdPeersTypes.go new file mode 100644 index 000000000..0f0205712 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/static_routes/BfdPeersTypes.go @@ -0,0 +1,336 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: BfdPeers. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package static_routes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func bfdPeersCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["static_hop_bfd_peer"] = bindings.NewReferenceType(model.StaticHopBfdPeerBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["static_hop_bfd_peer"] = "StaticHopBfdPeer" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bfdPeersCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.StaticHopBfdPeerBindingType) +} + +func bfdPeersCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["static_hop_bfd_peer"] = bindings.NewReferenceType(model.StaticHopBfdPeerBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["static_hop_bfd_peer"] = "StaticHopBfdPeer" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["static_hop_bfd_peer"] = bindings.NewReferenceType(model.StaticHopBfdPeerBindingType) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "static_hop_bfd_peer", + "POST", + "/api/v1/logical-routers/{logicalRouterId}/routing/static-routes/bfd-peers", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func bfdPeersDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["bfd_peer_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["bfd_peer_id"] = "BfdPeerId" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bfdPeersDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func bfdPeersDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["bfd_peer_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["bfd_peer_id"] = "BfdPeerId" + fieldNameMap["force"] = "Force" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["bfd_peer_id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["bfdPeerId"] = bindings.NewStringType() + pathParams["bfd_peer_id"] = "bfdPeerId" + pathParams["logical_router_id"] = "logicalRouterId" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/logical-routers/{logicalRouterId}/routing/static-routes/bfd-peers/{bfdPeerId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func bfdPeersGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["bfd_peer_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["bfd_peer_id"] = "BfdPeerId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bfdPeersGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.StaticHopBfdPeerBindingType) +} + +func bfdPeersGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["bfd_peer_id"] = bindings.NewStringType() + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["bfd_peer_id"] = "BfdPeerId" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["bfd_peer_id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["bfdPeerId"] = bindings.NewStringType() + pathParams["bfd_peer_id"] = "bfdPeerId" + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/static-routes/bfd-peers/{bfdPeerId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func bfdPeersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bfdPeersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.StaticHopBfdPeerListResultBindingType) +} + +func bfdPeersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/routing/static-routes/bfd-peers", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func bfdPeersUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["bfd_peer_id"] = bindings.NewStringType() + fields["static_hop_bfd_peer"] = bindings.NewReferenceType(model.StaticHopBfdPeerBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["bfd_peer_id"] = "BfdPeerId" + fieldNameMap["static_hop_bfd_peer"] = "StaticHopBfdPeer" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bfdPeersUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.StaticHopBfdPeerBindingType) +} + +func bfdPeersUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["bfd_peer_id"] = bindings.NewStringType() + fields["static_hop_bfd_peer"] = bindings.NewReferenceType(model.StaticHopBfdPeerBindingType) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["bfd_peer_id"] = "BfdPeerId" + fieldNameMap["static_hop_bfd_peer"] = "StaticHopBfdPeer" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["static_hop_bfd_peer"] = bindings.NewReferenceType(model.StaticHopBfdPeerBindingType) + paramsTypeMap["bfd_peer_id"] = bindings.NewStringType() + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + paramsTypeMap["bfdPeerId"] = bindings.NewStringType() + pathParams["bfd_peer_id"] = "bfdPeerId" + pathParams["logical_router_id"] = "logicalRouterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "static_hop_bfd_peer", + "PUT", + "/api/v1/logical-routers/{logicalRouterId}/routing/static-routes/bfd-peers/{bfdPeerId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_routers/routing/static_routes/StaticRoutesPackageTypes.go b/services/nsxt-mp/nsx/logical_routers/routing/static_routes/StaticRoutesPackageTypes.go new file mode 100644 index 000000000..af81b3bec --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/routing/static_routes/StaticRoutesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.logical_routers.routing.static_routes. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package static_routes diff --git a/services/nsxt-mp/nsx/logical_routers/service_cluster/ServiceClusterPackageTypes.go b/services/nsxt-mp/nsx/logical_routers/service_cluster/ServiceClusterPackageTypes.go new file mode 100644 index 000000000..170e88050 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/service_cluster/ServiceClusterPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.logical_routers.service_cluster. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package service_cluster diff --git a/services/nsxt-mp/nsx/logical_routers/service_cluster/StateClient.go b/services/nsxt-mp/nsx/logical_routers/service_cluster/StateClient.go new file mode 100644 index 000000000..9a7d7b752 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/service_cluster/StateClient.go @@ -0,0 +1,94 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: State +// Used by client-side stubs. + +package service_cluster + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StateClient interface { + + // Return realized state information of a logical service router cluster. Any configuration update that affects the logical service router cluster can use this API to get its realized state by passing a request_id returned by the configuration change operation. e.g. Update configuration of nat, bgp, bfd, etc. What is a Service Router? When a service cannot be distributed is enabled on a Logical Router, a Service Router (SR) is instantiated. Some examples of services that are not distributed are NAT, DHCP server, Metadata Proxy, Edge Firewall, Load Balancer and so on. + // + // @param logicalRouterIdParam (required) + // @param barrierIdParam (optional) + // @param requestIdParam Realization request ID (optional) + // @return com.vmware.nsx.model.LogicalServiceRouterClusterState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalRouterIdParam string, barrierIdParam *int64, requestIdParam *string) (model.LogicalServiceRouterClusterState, error) +} + +type stateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStateClient(connector client.Connector) *stateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_routers.service_cluster.state") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := stateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *stateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *stateClient) Get(logicalRouterIdParam string, barrierIdParam *int64, requestIdParam *string) (model.LogicalServiceRouterClusterState, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(stateGetInputType(), typeConverter) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("BarrierId", barrierIdParam) + sv.AddStructField("RequestId", requestIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalServiceRouterClusterState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_routers.service_cluster.state", "get", inputDataValue, executionContext) + var emptyOutput model.LogicalServiceRouterClusterState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalServiceRouterClusterState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_routers/service_cluster/StateTypes.go b/services/nsxt-mp/nsx/logical_routers/service_cluster/StateTypes.go new file mode 100644 index 000000000..91b887c35 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_routers/service_cluster/StateTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: State. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package service_cluster + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func stateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewStringType() + fields["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["barrier_id"] = "BarrierId" + fieldNameMap["request_id"] = "RequestId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalServiceRouterClusterStateBindingType) +} + +func stateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_router_id"] = bindings.NewStringType() + fields["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["barrier_id"] = "BarrierId" + fieldNameMap["request_id"] = "RequestId" + paramsTypeMap["logical_router_id"] = bindings.NewStringType() + paramsTypeMap["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["logicalRouterId"] = bindings.NewStringType() + pathParams["logical_router_id"] = "logicalRouterId" + queryParams["barrier_id"] = "barrier_id" + queryParams["request_id"] = "request_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-routers/{logicalRouterId}/service-cluster/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_switches/LogicalSwitchesPackageTypes.go b/services/nsxt-mp/nsx/logical_switches/LogicalSwitchesPackageTypes.go new file mode 100644 index 000000000..10ca981e2 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_switches/LogicalSwitchesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.logical_switches. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_switches diff --git a/services/nsxt-mp/nsx/logical_switches/MacTableClient.go b/services/nsxt-mp/nsx/logical_switches/MacTableClient.go new file mode 100644 index 000000000..d76882901 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_switches/MacTableClient.go @@ -0,0 +1,104 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MacTable +// Used by client-side stubs. + +package logical_switches + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MacTableClient interface { + + // Returns MAC table of a specified logical switch from the given transport node if a transport node id is given in the query parameter from the Central Controller Plane. The query parameter \"source=cached\" is not supported. + // + // @param lswitchIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param sourceParam Data source type. (optional) + // @param transportNodeIdParam TransportNode Id (optional) + // @return com.vmware.nsx.model.MacAddressListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(lswitchIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, sourceParam *string, transportNodeIdParam *string) (model.MacAddressListResult, error) +} + +type macTableClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMacTableClient(connector client.Connector) *macTableClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_switches.mac_table") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := macTableClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *macTableClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *macTableClient) List(lswitchIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, sourceParam *string, transportNodeIdParam *string) (model.MacAddressListResult, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(macTableListInputType(), typeConverter) + sv.AddStructField("LswitchId", lswitchIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Source", sourceParam) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MacAddressListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := macTableListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_switches.mac_table", "list", inputDataValue, executionContext) + var emptyOutput model.MacAddressListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), macTableListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MacAddressListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_switches/MacTableTypes.go b/services/nsxt-mp/nsx/logical_switches/MacTableTypes.go new file mode 100644 index 000000000..33199ed22 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_switches/MacTableTypes.go @@ -0,0 +1,117 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MacTable. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_switches + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method MacTable#list. +const MacTable_LIST_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method MacTable#list. +const MacTable_LIST_SOURCE_CACHED = "cached" + +func macTableListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lswitch_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lswitch_id"] = "LswitchId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func macTableListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MacAddressListResultBindingType) +} + +func macTableListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lswitch_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lswitch_id"] = "LswitchId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["transport_node_id"] = "TransportNodeId" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["lswitch_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["lswitchId"] = bindings.NewStringType() + pathParams["lswitch_id"] = "lswitchId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["source"] = "source" + queryParams["transport_node_id"] = "transport_node_id" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-switches/{lswitchId}/mac-table", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_switches/StateClient.go b/services/nsxt-mp/nsx/logical_switches/StateClient.go new file mode 100644 index 000000000..a007dbd08 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_switches/StateClient.go @@ -0,0 +1,133 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: State +// Used by client-side stubs. + +package logical_switches + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StateClient interface { + + // Returns current state of the logical switch configuration and details of only out-of-sync transport nodes. This api is now deprecated. Please use new api - policy/api/v1/infra/realized-state/realized-entities?intent_path={{intent-path}} + // + // @param lswitchIdParam (required) + // @return com.vmware.nsx.model.LogicalSwitchState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(lswitchIdParam string) (model.LogicalSwitchState, error) + + // Returns a list of logical switches states that have realized state as provided as query parameter. This api is now deprecated. Please use new api - policy/api/v1/infra/realized-state/realized-entities?intent_path={{intent-path}} + // + // @param statusParam Realized state of logical switches (optional) + // @return com.vmware.nsx.model.LogicalSwitchStateListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(statusParam *string) (model.LogicalSwitchStateListResult, error) +} + +type stateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStateClient(connector client.Connector) *stateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_switches.state") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := stateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *stateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *stateClient) Get(lswitchIdParam string) (model.LogicalSwitchState, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(stateGetInputType(), typeConverter) + sv.AddStructField("LswitchId", lswitchIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalSwitchState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_switches.state", "get", inputDataValue, executionContext) + var emptyOutput model.LogicalSwitchState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalSwitchState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *stateClient) List(statusParam *string) (model.LogicalSwitchStateListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(stateListInputType(), typeConverter) + sv.AddStructField("Status", statusParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalSwitchStateListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_switches.state", "list", inputDataValue, executionContext) + var emptyOutput model.LogicalSwitchStateListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalSwitchStateListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_switches/StateTypes.go b/services/nsxt-mp/nsx/logical_switches/StateTypes.go new file mode 100644 index 000000000..db2a8aa14 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_switches/StateTypes.go @@ -0,0 +1,130 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: State. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_switches + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``status`` of method State#list. +const State_LIST_STATUS_PENDING = "PENDING" + +// Possible value for ``status`` of method State#list. +const State_LIST_STATUS_IN_PROGRESS = "IN_PROGRESS" + +// Possible value for ``status`` of method State#list. +const State_LIST_STATUS_PARTIAL_SUCCESS = "PARTIAL_SUCCESS" + +// Possible value for ``status`` of method State#list. +const State_LIST_STATUS_SUCCESS = "SUCCESS" + +func stateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lswitch_id"] = bindings.NewStringType() + fieldNameMap["lswitch_id"] = "LswitchId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalSwitchStateBindingType) +} + +func stateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lswitch_id"] = bindings.NewStringType() + fieldNameMap["lswitch_id"] = "LswitchId" + paramsTypeMap["lswitch_id"] = bindings.NewStringType() + paramsTypeMap["lswitchId"] = bindings.NewStringType() + pathParams["lswitch_id"] = "lswitchId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-switches/{lswitchId}/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func stateListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalSwitchStateListResultBindingType) +} + +func stateListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + paramsTypeMap["status"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["status"] = "status" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-switches/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_switches/StatisticsClient.go b/services/nsxt-mp/nsx/logical_switches/StatisticsClient.go new file mode 100644 index 000000000..eb9f2a489 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_switches/StatisticsClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Statistics +// Used by client-side stubs. + +package logical_switches + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatisticsClient interface { + + // Returns statistics of a specified logical switch. The query parameter \"source=realtime\" is not supported. + // + // @param lswitchIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.LogicalSwitchStatistics + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(lswitchIdParam string, sourceParam *string) (model.LogicalSwitchStatistics, error) +} + +type statisticsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatisticsClient(connector client.Connector) *statisticsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_switches.statistics") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statisticsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statisticsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statisticsClient) Get(lswitchIdParam string, sourceParam *string) (model.LogicalSwitchStatistics, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statisticsGetInputType(), typeConverter) + sv.AddStructField("LswitchId", lswitchIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalSwitchStatistics + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statisticsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_switches.statistics", "get", inputDataValue, executionContext) + var emptyOutput model.LogicalSwitchStatistics + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statisticsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalSwitchStatistics), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_switches/StatisticsTypes.go b/services/nsxt-mp/nsx/logical_switches/StatisticsTypes.go new file mode 100644 index 000000000..87b9023a4 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_switches/StatisticsTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Statistics. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_switches + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Statistics#get. +const Statistics_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Statistics#get. +const Statistics_GET_SOURCE_CACHED = "cached" + +func statisticsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lswitch_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lswitch_id"] = "LswitchId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statisticsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalSwitchStatisticsBindingType) +} + +func statisticsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lswitch_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lswitch_id"] = "LswitchId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["lswitch_id"] = bindings.NewStringType() + paramsTypeMap["lswitchId"] = bindings.NewStringType() + pathParams["lswitch_id"] = "lswitchId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-switches/{lswitchId}/statistics", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_switches/StatusClient.go b/services/nsxt-mp/nsx/logical_switches/StatusClient.go new file mode 100644 index 000000000..b738afff7 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_switches/StatusClient.go @@ -0,0 +1,116 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package logical_switches + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Returns Operational status of all logical switches. The query parameter \"source=realtime\" is not supported. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param diagnosticParam Flag to enable showing of transit logical switch. (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param sourceParam Data source type. (optional) + // @param switchTypeParam Logical Switch type (optional) + // @param switchingProfileIdParam Switching Profile identifier (optional) + // @param transportTypeParam Mode of transport supported in the transport zone for this logical switch (optional) + // @param transportZoneIdParam Transport zone identifier (optional) + // @param uplinkTeamingPolicyNameParam The logical switch's uplink teaming policy name (optional) + // @param vlanParam Virtual Local Area Network Identifier (optional) + // @param vniParam VNI of the OVERLAY LogicalSwitch(es) to return. (optional) + // @return com.vmware.nsx.model.LogicalSwitchStatusSummary + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(cursorParam *string, diagnosticParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, sourceParam *string, switchTypeParam *string, switchingProfileIdParam *string, transportTypeParam *string, transportZoneIdParam *string, uplinkTeamingPolicyNameParam *string, vlanParam *int64, vniParam *int64) (model.LogicalSwitchStatusSummary, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_switches.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(cursorParam *string, diagnosticParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, sourceParam *string, switchTypeParam *string, switchingProfileIdParam *string, transportTypeParam *string, transportZoneIdParam *string, uplinkTeamingPolicyNameParam *string, vlanParam *int64, vniParam *int64) (model.LogicalSwitchStatusSummary, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("Diagnostic", diagnosticParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Source", sourceParam) + sv.AddStructField("SwitchType", switchTypeParam) + sv.AddStructField("SwitchingProfileId", switchingProfileIdParam) + sv.AddStructField("TransportType", transportTypeParam) + sv.AddStructField("TransportZoneId", transportZoneIdParam) + sv.AddStructField("UplinkTeamingPolicyName", uplinkTeamingPolicyNameParam) + sv.AddStructField("Vlan", vlanParam) + sv.AddStructField("Vni", vniParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalSwitchStatusSummary + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_switches.status", "get", inputDataValue, executionContext) + var emptyOutput model.LogicalSwitchStatusSummary + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalSwitchStatusSummary), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_switches/StatusTypes.go b/services/nsxt-mp/nsx/logical_switches/StatusTypes.go new file mode 100644 index 000000000..89fe4051b --- /dev/null +++ b/services/nsxt-mp/nsx/logical_switches/StatusTypes.go @@ -0,0 +1,179 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_switches + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_CACHED = "cached" + +// Possible value for ``switchType`` of method Status#get. +const Status_GET_SWITCH_TYPE_DEFAULT = "DEFAULT" + +// Possible value for ``switchType`` of method Status#get. +const Status_GET_SWITCH_TYPE_SERVICE_PLANE = "SERVICE_PLANE" + +// Possible value for ``switchType`` of method Status#get. +const Status_GET_SWITCH_TYPE_DHCP_RELAY = "DHCP_RELAY" + +// Possible value for ``switchType`` of method Status#get. +const Status_GET_SWITCH_TYPE_GLOBAL = "GLOBAL" + +// Possible value for ``switchType`` of method Status#get. +const Status_GET_SWITCH_TYPE_INTER_ROUTER = "INTER_ROUTER" + +// Possible value for ``switchType`` of method Status#get. +const Status_GET_SWITCH_TYPE_EVPN = "EVPN" + +// Possible value for ``switchType`` of method Status#get. +const Status_GET_SWITCH_TYPE_DVPG = "DVPG" + +// Possible value for ``transportType`` of method Status#get. +const Status_GET_TRANSPORT_TYPE_OVERLAY = "OVERLAY" + +// Possible value for ``transportType`` of method Status#get. +const Status_GET_TRANSPORT_TYPE_VLAN = "VLAN" + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["diagnostic"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["switch_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["switching_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["uplink_teaming_policy_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["vlan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["vni"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["diagnostic"] = "Diagnostic" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["switch_type"] = "SwitchType" + fieldNameMap["switching_profile_id"] = "SwitchingProfileId" + fieldNameMap["transport_type"] = "TransportType" + fieldNameMap["transport_zone_id"] = "TransportZoneId" + fieldNameMap["uplink_teaming_policy_name"] = "UplinkTeamingPolicyName" + fieldNameMap["vlan"] = "Vlan" + fieldNameMap["vni"] = "Vni" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalSwitchStatusSummaryBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["diagnostic"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["switch_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["switching_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["uplink_teaming_policy_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["vlan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["vni"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["diagnostic"] = "Diagnostic" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["switch_type"] = "SwitchType" + fieldNameMap["switching_profile_id"] = "SwitchingProfileId" + fieldNameMap["transport_type"] = "TransportType" + fieldNameMap["transport_zone_id"] = "TransportZoneId" + fieldNameMap["uplink_teaming_policy_name"] = "UplinkTeamingPolicyName" + fieldNameMap["vlan"] = "Vlan" + fieldNameMap["vni"] = "Vni" + paramsTypeMap["switch_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["switching_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["diagnostic"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["vni"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["uplink_teaming_policy_name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["vlan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + queryParams["cursor"] = "cursor" + queryParams["switching_profile_id"] = "switching_profile_id" + queryParams["sort_by"] = "sort_by" + queryParams["source"] = "source" + queryParams["switch_type"] = "switch_type" + queryParams["uplink_teaming_policy_name"] = "uplink_teaming_policy_name" + queryParams["vni"] = "vni" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["vlan"] = "vlan" + queryParams["included_fields"] = "included_fields" + queryParams["transport_type"] = "transport_type" + queryParams["transport_zone_id"] = "transport_zone_id" + queryParams["diagnostic"] = "diagnostic" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-switches/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_switches/SummaryClient.go b/services/nsxt-mp/nsx/logical_switches/SummaryClient.go new file mode 100644 index 000000000..206bf046e --- /dev/null +++ b/services/nsxt-mp/nsx/logical_switches/SummaryClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Summary +// Used by client-side stubs. + +package logical_switches + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SummaryClient interface { + + // Returns the number of ports assigned to logical switch. This api is now deprecated Please use new API - GET policy/api/v1/infra/realized-state/status?intent_path={{intent-path}} + // + // @param lswitchIdParam (required) + // @return com.vmware.nsx.model.LogicalSwitchStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(lswitchIdParam string) (model.LogicalSwitchStatus, error) +} + +type summaryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSummaryClient(connector client.Connector) *summaryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_switches.summary") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := summaryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *summaryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *summaryClient) Get(lswitchIdParam string) (model.LogicalSwitchStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(summaryGetInputType(), typeConverter) + sv.AddStructField("LswitchId", lswitchIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalSwitchStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := summaryGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_switches.summary", "get", inputDataValue, executionContext) + var emptyOutput model.LogicalSwitchStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), summaryGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalSwitchStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_switches/SummaryTypes.go b/services/nsxt-mp/nsx/logical_switches/SummaryTypes.go new file mode 100644 index 000000000..dee4d7ab4 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_switches/SummaryTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Summary. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_switches + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func summaryGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lswitch_id"] = bindings.NewStringType() + fieldNameMap["lswitch_id"] = "LswitchId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func summaryGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalSwitchStatusBindingType) +} + +func summaryGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lswitch_id"] = bindings.NewStringType() + fieldNameMap["lswitch_id"] = "LswitchId" + paramsTypeMap["lswitch_id"] = bindings.NewStringType() + paramsTypeMap["lswitchId"] = bindings.NewStringType() + pathParams["lswitch_id"] = "lswitchId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-switches/{lswitchId}/summary", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_switches/VtepTableClient.go b/services/nsxt-mp/nsx/logical_switches/VtepTableClient.go new file mode 100644 index 000000000..d52bbb8ec --- /dev/null +++ b/services/nsxt-mp/nsx/logical_switches/VtepTableClient.go @@ -0,0 +1,104 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: VtepTable +// Used by client-side stubs. + +package logical_switches + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type VtepTableClient interface { + + // Returns the virtual tunnel endpoint table of a specified logical switch from the given transport node if a transport node id is given in the query parameter, from the Central Controller Plane. The query parameter \"source=cached\" is not supported. + // + // @param lswitchIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param sourceParam Data source type. (optional) + // @param transportNodeIdParam TransportNode Id (optional) + // @return com.vmware.nsx.model.VtepListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(lswitchIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, sourceParam *string, transportNodeIdParam *string) (model.VtepListResult, error) +} + +type vtepTableClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewVtepTableClient(connector client.Connector) *vtepTableClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_switches.vtep_table") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + vIface := vtepTableClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &vIface +} + +func (vIface *vtepTableClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := vIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (vIface *vtepTableClient) List(lswitchIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, sourceParam *string, transportNodeIdParam *string) (model.VtepListResult, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(vtepTableListInputType(), typeConverter) + sv.AddStructField("LswitchId", lswitchIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Source", sourceParam) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.VtepListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := vtepTableListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_switches.vtep_table", "list", inputDataValue, executionContext) + var emptyOutput model.VtepListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), vtepTableListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.VtepListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_switches/VtepTableTypes.go b/services/nsxt-mp/nsx/logical_switches/VtepTableTypes.go new file mode 100644 index 000000000..bf9801ed8 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_switches/VtepTableTypes.go @@ -0,0 +1,117 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: VtepTable. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_switches + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method VtepTable#list. +const VtepTable_LIST_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method VtepTable#list. +const VtepTable_LIST_SOURCE_CACHED = "cached" + +func vtepTableListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lswitch_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lswitch_id"] = "LswitchId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func vtepTableListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.VtepListResultBindingType) +} + +func vtepTableListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["lswitch_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lswitch_id"] = "LswitchId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["transport_node_id"] = "TransportNodeId" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["lswitch_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["lswitchId"] = bindings.NewStringType() + pathParams["lswitch_id"] = "lswitchId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["source"] = "source" + queryParams["transport_node_id"] = "transport_node_id" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-switches/{lswitchId}/vtep-table", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/InterSiteForwarderPackageTypes.go b/services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/InterSiteForwarderPackageTypes.go new file mode 100644 index 000000000..2c073a0ac --- /dev/null +++ b/services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/InterSiteForwarderPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.logical_switches.inter_site_forwarder. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package inter_site_forwarder diff --git a/services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/SiteSpanInfoClient.go b/services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/SiteSpanInfoClient.go new file mode 100644 index 000000000..9600e0f9f --- /dev/null +++ b/services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/SiteSpanInfoClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: SiteSpanInfo +// Used by client-side stubs. + +package inter_site_forwarder + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SiteSpanInfoClient interface { + + // Returns remote mac addresses of the l2 forwarder on logical switch. It always returns realtime response. + // + // @param logicalSwitchIdParam (required) + // @return com.vmware.nsx.model.L2ForwarderRemoteMacs + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalSwitchIdParam string) (model.L2ForwarderRemoteMacs, error) +} + +type siteSpanInfoClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSiteSpanInfoClient(connector client.Connector) *siteSpanInfoClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_switches.inter_site_forwarder.site_span_info") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := siteSpanInfoClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *siteSpanInfoClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *siteSpanInfoClient) Get(logicalSwitchIdParam string) (model.L2ForwarderRemoteMacs, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(siteSpanInfoGetInputType(), typeConverter) + sv.AddStructField("LogicalSwitchId", logicalSwitchIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.L2ForwarderRemoteMacs + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := siteSpanInfoGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_switches.inter_site_forwarder.site_span_info", "get", inputDataValue, executionContext) + var emptyOutput model.L2ForwarderRemoteMacs + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), siteSpanInfoGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.L2ForwarderRemoteMacs), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/SiteSpanInfoTypes.go b/services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/SiteSpanInfoTypes.go new file mode 100644 index 000000000..fe56ae9ab --- /dev/null +++ b/services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/SiteSpanInfoTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: SiteSpanInfo. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package inter_site_forwarder + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func siteSpanInfoGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_switch_id"] = bindings.NewStringType() + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func siteSpanInfoGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.L2ForwarderRemoteMacsBindingType) +} + +func siteSpanInfoGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_switch_id"] = bindings.NewStringType() + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + paramsTypeMap["logical_switch_id"] = bindings.NewStringType() + paramsTypeMap["logicalSwitchId"] = bindings.NewStringType() + pathParams["logical_switch_id"] = "logicalSwitchId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-switches/{logicalSwitchId}/inter-site-forwarder/site-span-info", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/StatisticsClient.go b/services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/StatisticsClient.go new file mode 100644 index 000000000..c6207b3ad --- /dev/null +++ b/services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/StatisticsClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Statistics +// Used by client-side stubs. + +package inter_site_forwarder + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatisticsClient interface { + + // Returns statistics of the l2 forwarder on logical switch. It always returns realtime response. + // + // @param logicalSwitchIdParam (required) + // @return com.vmware.nsx.model.L2ForwarderStatistics + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalSwitchIdParam string) (model.L2ForwarderStatistics, error) +} + +type statisticsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatisticsClient(connector client.Connector) *statisticsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_switches.inter_site_forwarder.statistics") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statisticsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statisticsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statisticsClient) Get(logicalSwitchIdParam string) (model.L2ForwarderStatistics, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statisticsGetInputType(), typeConverter) + sv.AddStructField("LogicalSwitchId", logicalSwitchIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.L2ForwarderStatistics + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statisticsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_switches.inter_site_forwarder.statistics", "get", inputDataValue, executionContext) + var emptyOutput model.L2ForwarderStatistics + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statisticsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.L2ForwarderStatistics), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/StatisticsTypes.go b/services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/StatisticsTypes.go new file mode 100644 index 000000000..02c97e90c --- /dev/null +++ b/services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/StatisticsTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Statistics. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package inter_site_forwarder + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statisticsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_switch_id"] = bindings.NewStringType() + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statisticsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.L2ForwarderStatisticsBindingType) +} + +func statisticsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_switch_id"] = bindings.NewStringType() + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + paramsTypeMap["logical_switch_id"] = bindings.NewStringType() + paramsTypeMap["logicalSwitchId"] = bindings.NewStringType() + pathParams["logical_switch_id"] = "logicalSwitchId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-switches/{logicalSwitchId}/inter-site-forwarder/statistics", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/StatusClient.go b/services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/StatusClient.go new file mode 100644 index 000000000..828dec9a4 --- /dev/null +++ b/services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/StatusClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package inter_site_forwarder + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Returns status per transport node of the l2 forwarder on logical switch. + // + // @param logicalSwitchIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.L2ForwarderStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logicalSwitchIdParam string, sourceParam *string) (model.L2ForwarderStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.logical_switches.inter_site_forwarder.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(logicalSwitchIdParam string, sourceParam *string) (model.L2ForwarderStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("LogicalSwitchId", logicalSwitchIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.L2ForwarderStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.logical_switches.inter_site_forwarder.status", "get", inputDataValue, executionContext) + var emptyOutput model.L2ForwarderStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.L2ForwarderStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/StatusTypes.go b/services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/StatusTypes.go new file mode 100644 index 000000000..950166dae --- /dev/null +++ b/services/nsxt-mp/nsx/logical_switches/inter_site_forwarder/StatusTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package inter_site_forwarder + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_CACHED = "cached" + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_switch_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.L2ForwarderStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["logical_switch_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["logical_switch_id"] = bindings.NewStringType() + paramsTypeMap["logicalSwitchId"] = bindings.NewStringType() + pathParams["logical_switch_id"] = "logicalSwitchId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/logical-switches/{logicalSwitchId}/inter-site-forwarder/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/mac_sets/MacSetsPackageTypes.go b/services/nsxt-mp/nsx/mac_sets/MacSetsPackageTypes.go new file mode 100644 index 000000000..3d1ee144a --- /dev/null +++ b/services/nsxt-mp/nsx/mac_sets/MacSetsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.mac_sets. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package mac_sets diff --git a/services/nsxt-mp/nsx/mac_sets/MembersClient.go b/services/nsxt-mp/nsx/mac_sets/MembersClient.go new file mode 100644 index 000000000..8e0284952 --- /dev/null +++ b/services/nsxt-mp/nsx/mac_sets/MembersClient.go @@ -0,0 +1,173 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Members +// Used by client-side stubs. + +package mac_sets + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MembersClient interface { + + // Add an individual MAC address to a MACSet + // + // @param macSetIdParam MAC Set Id (required) + // @param mACAddressElementParam (required) + // @return com.vmware.nsx.model.MACAddressElement + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(macSetIdParam string, mACAddressElementParam model.MACAddressElement) (model.MACAddressElement, error) + + // Remove an individual MAC address from a MACSet + // + // @param macSetIdParam MACSet Id (required) + // @param macAddressParam MAC address to be removed (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(macSetIdParam string, macAddressParam string) error + + // List all MAC addresses in a MACSet + // + // @param macSetIdParam MAC Set Id (required) + // @return com.vmware.nsx.model.MACAddressElementListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(macSetIdParam string) (model.MACAddressElementListResult, error) +} + +type membersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMembersClient(connector client.Connector) *membersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.mac_sets.members") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := membersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *membersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *membersClient) Create(macSetIdParam string, mACAddressElementParam model.MACAddressElement) (model.MACAddressElement, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(membersCreateInputType(), typeConverter) + sv.AddStructField("MacSetId", macSetIdParam) + sv.AddStructField("MACAddressElement", mACAddressElementParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MACAddressElement + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := membersCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.mac_sets.members", "create", inputDataValue, executionContext) + var emptyOutput model.MACAddressElement + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), membersCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MACAddressElement), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *membersClient) Delete(macSetIdParam string, macAddressParam string) error { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(membersDeleteInputType(), typeConverter) + sv.AddStructField("MacSetId", macSetIdParam) + sv.AddStructField("MacAddress", macAddressParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := membersDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.mac_sets.members", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (mIface *membersClient) List(macSetIdParam string) (model.MACAddressElementListResult, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(membersListInputType(), typeConverter) + sv.AddStructField("MacSetId", macSetIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MACAddressElementListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := membersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.mac_sets.members", "list", inputDataValue, executionContext) + var emptyOutput model.MACAddressElementListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), membersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MACAddressElementListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/mac_sets/MembersTypes.go b/services/nsxt-mp/nsx/mac_sets/MembersTypes.go new file mode 100644 index 000000000..7fbdce9a0 --- /dev/null +++ b/services/nsxt-mp/nsx/mac_sets/MembersTypes.go @@ -0,0 +1,181 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Members. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package mac_sets + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func membersCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mac_set_id"] = bindings.NewStringType() + fields["m_AC_address_element"] = bindings.NewReferenceType(model.MACAddressElementBindingType) + fieldNameMap["mac_set_id"] = "MacSetId" + fieldNameMap["m_AC_address_element"] = "MACAddressElement" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func membersCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MACAddressElementBindingType) +} + +func membersCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["mac_set_id"] = bindings.NewStringType() + fields["m_AC_address_element"] = bindings.NewReferenceType(model.MACAddressElementBindingType) + fieldNameMap["mac_set_id"] = "MacSetId" + fieldNameMap["m_AC_address_element"] = "MACAddressElement" + paramsTypeMap["mac_set_id"] = bindings.NewStringType() + paramsTypeMap["m_AC_address_element"] = bindings.NewReferenceType(model.MACAddressElementBindingType) + paramsTypeMap["macSetId"] = bindings.NewStringType() + pathParams["mac_set_id"] = "macSetId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "m_AC_address_element", + "POST", + "/api/v1/mac-sets/{macSetId}/members", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func membersDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mac_set_id"] = bindings.NewStringType() + fields["mac_address"] = bindings.NewStringType() + fieldNameMap["mac_set_id"] = "MacSetId" + fieldNameMap["mac_address"] = "MacAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func membersDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func membersDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["mac_set_id"] = bindings.NewStringType() + fields["mac_address"] = bindings.NewStringType() + fieldNameMap["mac_set_id"] = "MacSetId" + fieldNameMap["mac_address"] = "MacAddress" + paramsTypeMap["mac_set_id"] = bindings.NewStringType() + paramsTypeMap["mac_address"] = bindings.NewStringType() + paramsTypeMap["macSetId"] = bindings.NewStringType() + paramsTypeMap["macAddress"] = bindings.NewStringType() + pathParams["mac_address"] = "macAddress" + pathParams["mac_set_id"] = "macSetId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/mac-sets/{macSetId}/members/{macAddress}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func membersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mac_set_id"] = bindings.NewStringType() + fieldNameMap["mac_set_id"] = "MacSetId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func membersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MACAddressElementListResultBindingType) +} + +func membersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["mac_set_id"] = bindings.NewStringType() + fieldNameMap["mac_set_id"] = "MacSetId" + paramsTypeMap["mac_set_id"] = bindings.NewStringType() + paramsTypeMap["macSetId"] = bindings.NewStringType() + pathParams["mac_set_id"] = "macSetId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/mac-sets/{macSetId}/members", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/md_proxies/MdProxiesPackageTypes.go b/services/nsxt-mp/nsx/md_proxies/MdProxiesPackageTypes.go new file mode 100644 index 000000000..939b580bf --- /dev/null +++ b/services/nsxt-mp/nsx/md_proxies/MdProxiesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.md_proxies. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package md_proxies diff --git a/services/nsxt-mp/nsx/md_proxies/StatisticsClient.go b/services/nsxt-mp/nsx/md_proxies/StatisticsClient.go new file mode 100644 index 000000000..04f79e48f --- /dev/null +++ b/services/nsxt-mp/nsx/md_proxies/StatisticsClient.go @@ -0,0 +1,94 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Statistics +// Used by client-side stubs. + +package md_proxies + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatisticsClient interface { + + // Returns the statistics of the given metatada proxy. If no logical switch is provided, all staticstics of all the logical switches the proxy was attached will be returned. + // + // @param proxyIdParam (required) + // @param logicalSwitchIdParam The uuid of logical switch (optional) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.MetadataProxyStatistics + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(proxyIdParam string, logicalSwitchIdParam *string, sourceParam *string) (model.MetadataProxyStatistics, error) +} + +type statisticsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatisticsClient(connector client.Connector) *statisticsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.md_proxies.statistics") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statisticsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statisticsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statisticsClient) Get(proxyIdParam string, logicalSwitchIdParam *string, sourceParam *string) (model.MetadataProxyStatistics, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statisticsGetInputType(), typeConverter) + sv.AddStructField("ProxyId", proxyIdParam) + sv.AddStructField("LogicalSwitchId", logicalSwitchIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MetadataProxyStatistics + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statisticsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.md_proxies.statistics", "get", inputDataValue, executionContext) + var emptyOutput model.MetadataProxyStatistics + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statisticsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MetadataProxyStatistics), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/md_proxies/StatisticsTypes.go b/services/nsxt-mp/nsx/md_proxies/StatisticsTypes.go new file mode 100644 index 000000000..47298254c --- /dev/null +++ b/services/nsxt-mp/nsx/md_proxies/StatisticsTypes.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Statistics. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package md_proxies + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Statistics#get. +const Statistics_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Statistics#get. +const Statistics_GET_SOURCE_CACHED = "cached" + +func statisticsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["proxy_id"] = bindings.NewStringType() + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["proxy_id"] = "ProxyId" + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statisticsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MetadataProxyStatisticsBindingType) +} + +func statisticsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["proxy_id"] = bindings.NewStringType() + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["proxy_id"] = "ProxyId" + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["proxy_id"] = bindings.NewStringType() + paramsTypeMap["proxyId"] = bindings.NewStringType() + pathParams["proxy_id"] = "proxyId" + queryParams["source"] = "source" + queryParams["logical_switch_id"] = "logical_switch_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/md-proxies/{proxyId}/statistics", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/md_proxies/StatusClient.go b/services/nsxt-mp/nsx/md_proxies/StatusClient.go new file mode 100644 index 000000000..043586152 --- /dev/null +++ b/services/nsxt-mp/nsx/md_proxies/StatusClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package md_proxies + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Returns the status of the given metadata proxy and attached logical switch. + // + // @param proxyIdParam (required) + // @param logicalSwitchIdParam (required) + // @return com.vmware.nsx.model.MetadataProxyStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(proxyIdParam string, logicalSwitchIdParam string) (model.MetadataProxyStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.md_proxies.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(proxyIdParam string, logicalSwitchIdParam string) (model.MetadataProxyStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("ProxyId", proxyIdParam) + sv.AddStructField("LogicalSwitchId", logicalSwitchIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MetadataProxyStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.md_proxies.status", "get", inputDataValue, executionContext) + var emptyOutput model.MetadataProxyStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MetadataProxyStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/md_proxies/StatusTypes.go b/services/nsxt-mp/nsx/md_proxies/StatusTypes.go new file mode 100644 index 000000000..741a4febc --- /dev/null +++ b/services/nsxt-mp/nsx/md_proxies/StatusTypes.go @@ -0,0 +1,76 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package md_proxies + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["proxy_id"] = bindings.NewStringType() + fields["logical_switch_id"] = bindings.NewStringType() + fieldNameMap["proxy_id"] = "ProxyId" + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MetadataProxyStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["proxy_id"] = bindings.NewStringType() + fields["logical_switch_id"] = bindings.NewStringType() + fieldNameMap["proxy_id"] = "ProxyId" + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + paramsTypeMap["proxy_id"] = bindings.NewStringType() + paramsTypeMap["logical_switch_id"] = bindings.NewStringType() + paramsTypeMap["proxyId"] = bindings.NewStringType() + paramsTypeMap["logicalSwitchId"] = bindings.NewStringType() + pathParams["logical_switch_id"] = "logicalSwitchId" + pathParams["proxy_id"] = "proxyId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/md-proxies/{proxyId}/{logicalSwitchId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/DataClient.go b/services/nsxt-mp/nsx/migration/DataClient.go new file mode 100644 index 000000000..e54c1bb5a --- /dev/null +++ b/services/nsxt-mp/nsx/migration/DataClient.go @@ -0,0 +1,130 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Data +// Used by client-side stubs. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type DataClient interface { + + // Delete the specified migration data file. + // + // @param fileTypeParam Type of the Migration data file that needs to be deleted. (required) + // @param federationSiteIdParam Id of the site in NSX-T Federation (optional) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(fileTypeParam string, federationSiteIdParam *string) error + + // Get information about the requested Migration Data file. + // + // @param fileTypeParam Type of the Migration data file for which info is needed. (required) + // @param federationSiteIdParam Id of the site in NSX-T Federation (optional) + // @return com.vmware.nsx.model.MigrationDataInfo + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(fileTypeParam string, federationSiteIdParam *string) (model.MigrationDataInfo, error) +} + +type dataClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewDataClient(connector client.Connector) *dataClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.data") + methodIdentifiers := map[string]core.MethodIdentifier{ + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + dIface := dataClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &dIface +} + +func (dIface *dataClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := dIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (dIface *dataClient) Delete(fileTypeParam string, federationSiteIdParam *string) error { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(dataDeleteInputType(), typeConverter) + sv.AddStructField("FileType", fileTypeParam) + sv.AddStructField("FederationSiteId", federationSiteIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dataDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.data", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *dataClient) Get(fileTypeParam string, federationSiteIdParam *string) (model.MigrationDataInfo, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(dataGetInputType(), typeConverter) + sv.AddStructField("FileType", fileTypeParam) + sv.AddStructField("FederationSiteId", federationSiteIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationDataInfo + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dataGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.data", "get", inputDataValue, executionContext) + var emptyOutput model.MigrationDataInfo + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dataGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationDataInfo), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/DataTypes.go b/services/nsxt-mp/nsx/migration/DataTypes.go new file mode 100644 index 000000000..52077948c --- /dev/null +++ b/services/nsxt-mp/nsx/migration/DataTypes.go @@ -0,0 +1,156 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Data. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``fileType`` of method Data#delete. +const Data_DELETE_FILE_TYPE_VRA_INPUT = "VRA_INPUT" + +// Possible value for ``fileType`` of method Data#delete. +const Data_DELETE_FILE_TYPE_EDGE_CUTOVER_MAPPING = "EDGE_CUTOVER_MAPPING" + +// Possible value for ``fileType`` of method Data#delete. +const Data_DELETE_FILE_TYPE_BYOT_L3_MAPPING = "BYOT_L3_MAPPING" + +// Possible value for ``fileType`` of method Data#delete. +const Data_DELETE_FILE_TYPE_AVI_LB_MAPPING = "AVI_LB_MAPPING" + +// Possible value for ``fileType`` of method Data#get. +const Data_GET_FILE_TYPE_VRA_INPUT = "VRA_INPUT" + +// Possible value for ``fileType`` of method Data#get. +const Data_GET_FILE_TYPE_VRA_OUTPUT = "VRA_OUTPUT" + +// Possible value for ``fileType`` of method Data#get. +const Data_GET_FILE_TYPE_EDGE_CUTOVER_MAPPING = "EDGE_CUTOVER_MAPPING" + +// Possible value for ``fileType`` of method Data#get. +const Data_GET_FILE_TYPE_BYOT_L3_MAPPING = "BYOT_L3_MAPPING" + +// Possible value for ``fileType`` of method Data#get. +const Data_GET_FILE_TYPE_AVI_LB_MAPPING = "AVI_LB_MAPPING" + +func dataDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_type"] = bindings.NewStringType() + fields["federation_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_type"] = "FileType" + fieldNameMap["federation_site_id"] = "FederationSiteId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dataDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func dataDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["file_type"] = bindings.NewStringType() + fields["federation_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_type"] = "FileType" + fieldNameMap["federation_site_id"] = "FederationSiteId" + paramsTypeMap["file_type"] = bindings.NewStringType() + paramsTypeMap["federation_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["file_type"] = "file_type" + queryParams["federation_site_id"] = "federation_site_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/migration/data", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func dataGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_type"] = bindings.NewStringType() + fields["federation_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_type"] = "FileType" + fieldNameMap["federation_site_id"] = "FederationSiteId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dataGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationDataInfoBindingType) +} + +func dataGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["file_type"] = bindings.NewStringType() + fields["federation_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_type"] = "FileType" + fieldNameMap["federation_site_id"] = "FederationSiteId" + paramsTypeMap["file_type"] = bindings.NewStringType() + paramsTypeMap["federation_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["file_type"] = "file_type" + queryParams["federation_site_id"] = "federation_site_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/data", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/DiscoveredSwitchesClient.go b/services/nsxt-mp/nsx/migration/DiscoveredSwitchesClient.go new file mode 100644 index 000000000..6252aa2dc --- /dev/null +++ b/services/nsxt-mp/nsx/migration/DiscoveredSwitchesClient.go @@ -0,0 +1,99 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: DiscoveredSwitches +// Used by client-side stubs. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type DiscoveredSwitchesClient interface { + + // Get the list of discovered switches (DVS, VSS) for the selected VC. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.MigrationSwitchListResult + // @throws Unauthenticated Unauthorized + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.MigrationSwitchListResult, error) +} + +type discoveredSwitchesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewDiscoveredSwitchesClient(connector client.Connector) *discoveredSwitchesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.discovered_switches") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + dIface := discoveredSwitchesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &dIface +} + +func (dIface *discoveredSwitchesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := dIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (dIface *discoveredSwitchesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.MigrationSwitchListResult, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(discoveredSwitchesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationSwitchListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := discoveredSwitchesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.discovered_switches", "list", inputDataValue, executionContext) + var emptyOutput model.MigrationSwitchListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), discoveredSwitchesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationSwitchListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/DiscoveredSwitchesTypes.go b/services/nsxt-mp/nsx/migration/DiscoveredSwitchesTypes.go new file mode 100644 index 000000000..f3ec220ef --- /dev/null +++ b/services/nsxt-mp/nsx/migration/DiscoveredSwitchesTypes.go @@ -0,0 +1,94 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: DiscoveredSwitches. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func discoveredSwitchesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func discoveredSwitchesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationSwitchListResultBindingType) +} + +func discoveredSwitchesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"] = make(map[string]string) + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"]["challenge"] = "WWW-Authenticate" + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/discovered-switches", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.unauthenticated": 401, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/FeedbackRequestsClient.go b/services/nsxt-mp/nsx/migration/FeedbackRequestsClient.go new file mode 100644 index 000000000..ab2a63b18 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/FeedbackRequestsClient.go @@ -0,0 +1,111 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: FeedbackRequests +// Used by client-side stubs. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type FeedbackRequestsClient interface { + + // Get feedback details of NSX-V to be migrated. + // + // @param categoryParam Category on which feedback request should be filtered (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param federationSiteIdParam Id of the site in NSX-T Federation (optional) + // @param hashParam Hash based on which feedback request should be filtered (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param networkLayerParam Network layer for which feedback is generated (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param stateParam Filter based on current state of the feedback request (optional, default to ALL) + // @param subCategoryParam Sub category based on which feedback request should be filtered (optional) + // @return com.vmware.nsx.model.MigrationFeedbackRequestListResult + // @throws Unauthenticated Unauthorized + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(categoryParam *string, cursorParam *string, federationSiteIdParam *string, hashParam *string, includedFieldsParam *string, networkLayerParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, stateParam *string, subCategoryParam *string) (model.MigrationFeedbackRequestListResult, error) +} + +type feedbackRequestsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewFeedbackRequestsClient(connector client.Connector) *feedbackRequestsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.feedback_requests") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + fIface := feedbackRequestsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &fIface +} + +func (fIface *feedbackRequestsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := fIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (fIface *feedbackRequestsClient) List(categoryParam *string, cursorParam *string, federationSiteIdParam *string, hashParam *string, includedFieldsParam *string, networkLayerParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, stateParam *string, subCategoryParam *string) (model.MigrationFeedbackRequestListResult, error) { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(feedbackRequestsListInputType(), typeConverter) + sv.AddStructField("Category", categoryParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("FederationSiteId", federationSiteIdParam) + sv.AddStructField("Hash", hashParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("NetworkLayer", networkLayerParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("State", stateParam) + sv.AddStructField("SubCategory", subCategoryParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationFeedbackRequestListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := feedbackRequestsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.feedback_requests", "list", inputDataValue, executionContext) + var emptyOutput model.MigrationFeedbackRequestListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), feedbackRequestsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationFeedbackRequestListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/FeedbackRequestsTypes.go b/services/nsxt-mp/nsx/migration/FeedbackRequestsTypes.go new file mode 100644 index 000000000..b8a07e89c --- /dev/null +++ b/services/nsxt-mp/nsx/migration/FeedbackRequestsTypes.go @@ -0,0 +1,145 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: FeedbackRequests. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``networkLayer`` of method FeedbackRequests#list. +const FeedbackRequests_LIST_NETWORK_LAYER_L2 = "L2" + +// Possible value for ``networkLayer`` of method FeedbackRequests#list. +const FeedbackRequests_LIST_NETWORK_LAYER_L3_L7 = "L3_L7" + +// Possible value for ``state`` of method FeedbackRequests#list. +const FeedbackRequests_LIST_STATE_ALL = "ALL" + +// Possible value for ``state`` of method FeedbackRequests#list. +const FeedbackRequests_LIST_STATE_RESOLVED = "RESOLVED" + +// Possible value for ``state`` of method FeedbackRequests#list. +const FeedbackRequests_LIST_STATE_UNRESOLVED = "UNRESOLVED" + +func feedbackRequestsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["category"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["federation_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["hash"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["network_layer"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sub_category"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["category"] = "Category" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["federation_site_id"] = "FederationSiteId" + fieldNameMap["hash"] = "Hash" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["network_layer"] = "NetworkLayer" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["state"] = "State" + fieldNameMap["sub_category"] = "SubCategory" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func feedbackRequestsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationFeedbackRequestListResultBindingType) +} + +func feedbackRequestsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["category"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["federation_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["hash"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["network_layer"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sub_category"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["category"] = "Category" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["federation_site_id"] = "FederationSiteId" + fieldNameMap["hash"] = "Hash" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["network_layer"] = "NetworkLayer" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["state"] = "State" + fieldNameMap["sub_category"] = "SubCategory" + paramsTypeMap["category"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["hash"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["network_layer"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["sub_category"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["federation_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["state"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["network_layer"] = "network_layer" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sub_category"] = "sub_category" + queryParams["federation_site_id"] = "federation_site_id" + queryParams["sort_by"] = "sort_by" + queryParams["state"] = "state" + queryParams["category"] = "category" + queryParams["hash"] = "hash" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"] = make(map[string]string) + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"]["challenge"] = "WWW-Authenticate" + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/feedback-requests", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.unauthenticated": 401, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/FeedbackResponseClient.go b/services/nsxt-mp/nsx/migration/FeedbackResponseClient.go new file mode 100644 index 000000000..7734db1d8 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/FeedbackResponseClient.go @@ -0,0 +1,123 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: FeedbackResponse +// Used by client-side stubs. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type FeedbackResponseClient interface { + + // Pick default resolution for all feedback items. + // + // @param networkLayerParam Network layer for which feedback is generated (optional) + // @throws Unauthenticated Unauthorized + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Acceptrecommended(networkLayerParam *string) error + + // Provide response for feedback queries needed for migration. + // + // @param migrationFeedbackResponseListParam (required) + // @param networkLayerParam Network layer for which feedback is generated (optional) + // @throws Unauthenticated Unauthorized + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(migrationFeedbackResponseListParam model.MigrationFeedbackResponseList, networkLayerParam *string) error +} + +type feedbackResponseClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewFeedbackResponseClient(connector client.Connector) *feedbackResponseClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.feedback_response") + methodIdentifiers := map[string]core.MethodIdentifier{ + "acceptrecommended": core.NewMethodIdentifier(interfaceIdentifier, "acceptrecommended"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + fIface := feedbackResponseClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &fIface +} + +func (fIface *feedbackResponseClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := fIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (fIface *feedbackResponseClient) Acceptrecommended(networkLayerParam *string) error { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(feedbackResponseAcceptrecommendedInputType(), typeConverter) + sv.AddStructField("NetworkLayer", networkLayerParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := feedbackResponseAcceptrecommendedRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.feedback_response", "acceptrecommended", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (fIface *feedbackResponseClient) Update(migrationFeedbackResponseListParam model.MigrationFeedbackResponseList, networkLayerParam *string) error { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(feedbackResponseUpdateInputType(), typeConverter) + sv.AddStructField("MigrationFeedbackResponseList", migrationFeedbackResponseListParam) + sv.AddStructField("NetworkLayer", networkLayerParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := feedbackResponseUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.feedback_response", "update", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/FeedbackResponseTypes.go b/services/nsxt-mp/nsx/migration/FeedbackResponseTypes.go new file mode 100644 index 000000000..3d2ca0ff1 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/FeedbackResponseTypes.go @@ -0,0 +1,138 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: FeedbackResponse. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``networkLayer`` of method FeedbackResponse#acceptrecommended. +const FeedbackResponse_ACCEPTRECOMMENDED_NETWORK_LAYER_L2 = "L2" + +// Possible value for ``networkLayer`` of method FeedbackResponse#acceptrecommended. +const FeedbackResponse_ACCEPTRECOMMENDED_NETWORK_LAYER_L3_L7 = "L3_L7" + +// Possible value for ``networkLayer`` of method FeedbackResponse#update. +const FeedbackResponse_UPDATE_NETWORK_LAYER_L2 = "L2" + +// Possible value for ``networkLayer`` of method FeedbackResponse#update. +const FeedbackResponse_UPDATE_NETWORK_LAYER_L3_L7 = "L3_L7" + +func feedbackResponseAcceptrecommendedInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["network_layer"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network_layer"] = "NetworkLayer" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func feedbackResponseAcceptrecommendedOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func feedbackResponseAcceptrecommendedRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["network_layer"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network_layer"] = "NetworkLayer" + paramsTypeMap["network_layer"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["network_layer"] = "network_layer" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"] = make(map[string]string) + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"]["challenge"] = "WWW-Authenticate" + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=accept-recommended", + "", + "POST", + "/api/v1/migration/feedback-response", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.unauthenticated": 401, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func feedbackResponseUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["migration_feedback_response_list"] = bindings.NewReferenceType(model.MigrationFeedbackResponseListBindingType) + fields["network_layer"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["migration_feedback_response_list"] = "MigrationFeedbackResponseList" + fieldNameMap["network_layer"] = "NetworkLayer" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func feedbackResponseUpdateOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func feedbackResponseUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["migration_feedback_response_list"] = bindings.NewReferenceType(model.MigrationFeedbackResponseListBindingType) + fields["network_layer"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["migration_feedback_response_list"] = "MigrationFeedbackResponseList" + fieldNameMap["network_layer"] = "NetworkLayer" + paramsTypeMap["network_layer"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["migration_feedback_response_list"] = bindings.NewReferenceType(model.MigrationFeedbackResponseListBindingType) + queryParams["network_layer"] = "network_layer" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"] = make(map[string]string) + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"]["challenge"] = "WWW-Authenticate" + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "migration_feedback_response_list", + "PUT", + "/api/v1/migration/feedback-response", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.unauthenticated": 401, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/FeedbackSummaryClient.go b/services/nsxt-mp/nsx/migration/FeedbackSummaryClient.go new file mode 100644 index 000000000..cbf1aded5 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/FeedbackSummaryClient.go @@ -0,0 +1,101 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: FeedbackSummary +// Used by client-side stubs. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type FeedbackSummaryClient interface { + + // Get feedback summary of NSX-V to be migrated. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param networkLayerParam Network layer for which feedback is generated (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.MigrationFeedbackSummaryListResult + // @throws Unauthenticated Unauthorized + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, networkLayerParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.MigrationFeedbackSummaryListResult, error) +} + +type feedbackSummaryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewFeedbackSummaryClient(connector client.Connector) *feedbackSummaryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.feedback_summary") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + fIface := feedbackSummaryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &fIface +} + +func (fIface *feedbackSummaryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := fIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (fIface *feedbackSummaryClient) List(cursorParam *string, includedFieldsParam *string, networkLayerParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.MigrationFeedbackSummaryListResult, error) { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(feedbackSummaryListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("NetworkLayer", networkLayerParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationFeedbackSummaryListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := feedbackSummaryListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.feedback_summary", "list", inputDataValue, executionContext) + var emptyOutput model.MigrationFeedbackSummaryListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), feedbackSummaryListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationFeedbackSummaryListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/FeedbackSummaryTypes.go b/services/nsxt-mp/nsx/migration/FeedbackSummaryTypes.go new file mode 100644 index 000000000..394521bcf --- /dev/null +++ b/services/nsxt-mp/nsx/migration/FeedbackSummaryTypes.go @@ -0,0 +1,106 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: FeedbackSummary. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``networkLayer`` of method FeedbackSummary#list. +const FeedbackSummary_LIST_NETWORK_LAYER_L2 = "L2" + +// Possible value for ``networkLayer`` of method FeedbackSummary#list. +const FeedbackSummary_LIST_NETWORK_LAYER_L3_L7 = "L3_L7" + +func feedbackSummaryListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["network_layer"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["network_layer"] = "NetworkLayer" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func feedbackSummaryListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationFeedbackSummaryListResultBindingType) +} + +func feedbackSummaryListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["network_layer"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["network_layer"] = "NetworkLayer" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["network_layer"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["network_layer"] = "network_layer" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"] = make(map[string]string) + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"]["challenge"] = "WWW-Authenticate" + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/feedback-summary", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.unauthenticated": 401, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/GroupedFeedbackRequestsClient.go b/services/nsxt-mp/nsx/migration/GroupedFeedbackRequestsClient.go new file mode 100644 index 000000000..423fab795 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/GroupedFeedbackRequestsClient.go @@ -0,0 +1,111 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: GroupedFeedbackRequests +// Used by client-side stubs. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type GroupedFeedbackRequestsClient interface { + + // Get feedback details of NSX-V to be migrated, grouped by feedback type. + // + // @param categoryParam Category on which feedback request should be filtered (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param federationSiteIdParam Id of the site in NSX-T Federation (optional) + // @param hashParam Hash based on which feedback request should be filtered (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param networkLayerParam Network layer for which feedback is generated (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param stateParam Filter based on current state of the feedback request (optional, default to ALL) + // @param subCategoryParam Sub category based on which feedback request should be filtered (optional) + // @return com.vmware.nsx.model.GroupedMigrationFeedbackRequestListResult + // @throws Unauthenticated Unauthorized + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(categoryParam *string, cursorParam *string, federationSiteIdParam *string, hashParam *string, includedFieldsParam *string, networkLayerParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, stateParam *string, subCategoryParam *string) (model.GroupedMigrationFeedbackRequestListResult, error) +} + +type groupedFeedbackRequestsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewGroupedFeedbackRequestsClient(connector client.Connector) *groupedFeedbackRequestsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.grouped_feedback_requests") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + gIface := groupedFeedbackRequestsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &gIface +} + +func (gIface *groupedFeedbackRequestsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := gIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (gIface *groupedFeedbackRequestsClient) List(categoryParam *string, cursorParam *string, federationSiteIdParam *string, hashParam *string, includedFieldsParam *string, networkLayerParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, stateParam *string, subCategoryParam *string) (model.GroupedMigrationFeedbackRequestListResult, error) { + typeConverter := gIface.connector.TypeConverter() + executionContext := gIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(groupedFeedbackRequestsListInputType(), typeConverter) + sv.AddStructField("Category", categoryParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("FederationSiteId", federationSiteIdParam) + sv.AddStructField("Hash", hashParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("NetworkLayer", networkLayerParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("State", stateParam) + sv.AddStructField("SubCategory", subCategoryParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.GroupedMigrationFeedbackRequestListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := groupedFeedbackRequestsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := gIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.grouped_feedback_requests", "list", inputDataValue, executionContext) + var emptyOutput model.GroupedMigrationFeedbackRequestListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), groupedFeedbackRequestsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.GroupedMigrationFeedbackRequestListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/GroupedFeedbackRequestsTypes.go b/services/nsxt-mp/nsx/migration/GroupedFeedbackRequestsTypes.go new file mode 100644 index 000000000..b972aca84 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/GroupedFeedbackRequestsTypes.go @@ -0,0 +1,145 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: GroupedFeedbackRequests. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``networkLayer`` of method GroupedFeedbackRequests#list. +const GroupedFeedbackRequests_LIST_NETWORK_LAYER_L2 = "L2" + +// Possible value for ``networkLayer`` of method GroupedFeedbackRequests#list. +const GroupedFeedbackRequests_LIST_NETWORK_LAYER_L3_L7 = "L3_L7" + +// Possible value for ``state`` of method GroupedFeedbackRequests#list. +const GroupedFeedbackRequests_LIST_STATE_ALL = "ALL" + +// Possible value for ``state`` of method GroupedFeedbackRequests#list. +const GroupedFeedbackRequests_LIST_STATE_RESOLVED = "RESOLVED" + +// Possible value for ``state`` of method GroupedFeedbackRequests#list. +const GroupedFeedbackRequests_LIST_STATE_UNRESOLVED = "UNRESOLVED" + +func groupedFeedbackRequestsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["category"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["federation_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["hash"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["network_layer"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sub_category"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["category"] = "Category" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["federation_site_id"] = "FederationSiteId" + fieldNameMap["hash"] = "Hash" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["network_layer"] = "NetworkLayer" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["state"] = "State" + fieldNameMap["sub_category"] = "SubCategory" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func groupedFeedbackRequestsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.GroupedMigrationFeedbackRequestListResultBindingType) +} + +func groupedFeedbackRequestsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["category"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["federation_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["hash"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["network_layer"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sub_category"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["category"] = "Category" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["federation_site_id"] = "FederationSiteId" + fieldNameMap["hash"] = "Hash" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["network_layer"] = "NetworkLayer" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["state"] = "State" + fieldNameMap["sub_category"] = "SubCategory" + paramsTypeMap["category"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["hash"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["network_layer"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["sub_category"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["federation_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["state"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["network_layer"] = "network_layer" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sub_category"] = "sub_category" + queryParams["federation_site_id"] = "federation_site_id" + queryParams["sort_by"] = "sort_by" + queryParams["state"] = "state" + queryParams["category"] = "category" + queryParams["hash"] = "hash" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"] = make(map[string]string) + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"]["challenge"] = "WWW-Authenticate" + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/grouped-feedback-requests", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.unauthenticated": 401, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/MigratedResourcesClient.go b/services/nsxt-mp/nsx/migration/MigratedResourcesClient.go new file mode 100644 index 000000000..d4f6a21eb --- /dev/null +++ b/services/nsxt-mp/nsx/migration/MigratedResourcesClient.go @@ -0,0 +1,102 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MigratedResources +// Used by client-side stubs. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MigratedResourcesClient interface { + + // List migrated resources.This API is applicable for mp2Policy migration mode only. + // + // @param resourceTypeParam Resource type (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param resourceIdParam Resource id (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.MigratedObjectListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(resourceTypeParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, resourceIdParam *string, sortAscendingParam *bool, sortByParam *string) (model.MigratedObjectListResult, error) +} + +type migratedResourcesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMigratedResourcesClient(connector client.Connector) *migratedResourcesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.migrated_resources") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := migratedResourcesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *migratedResourcesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *migratedResourcesClient) List(resourceTypeParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, resourceIdParam *string, sortAscendingParam *bool, sortByParam *string) (model.MigratedObjectListResult, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(migratedResourcesListInputType(), typeConverter) + sv.AddStructField("ResourceType", resourceTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("ResourceId", resourceIdParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigratedObjectListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := migratedResourcesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.migrated_resources", "list", inputDataValue, executionContext) + var emptyOutput model.MigratedObjectListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), migratedResourcesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigratedObjectListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/MigratedResourcesTypes.go b/services/nsxt-mp/nsx/migration/MigratedResourcesTypes.go new file mode 100644 index 000000000..848f306c3 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/MigratedResourcesTypes.go @@ -0,0 +1,179 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MigratedResources. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_IPBLOCK = "IPBLOCK" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_IPPOOL = "IPPOOL" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_IPBLOCK_SUBNET = "IPBLOCK_SUBNET" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_IPPOOL_ALLOCATION = "IPPOOL_ALLOCATION" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_TIER0 = "TIER0" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_TIER1 = "TIER1" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_TIER0_LOGICAL_ROUTER_PORT = "TIER0_LOGICAL_ROUTER_PORT" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_TIER1_LOGICAL_ROUTER_PORT = "TIER1_LOGICAL_ROUTER_PORT" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_TIER0_LOGICAL_ROUTER_CONFIG = "TIER0_LOGICAL_ROUTER_CONFIG" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_SPOOFGUARD_PROFILES = "SPOOFGUARD_PROFILES" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_LOGICAL_SWITCH = "LOGICAL_SWITCH" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_LOGICAL_PORT = "LOGICAL_PORT" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_NAT = "NAT" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_IP_SET = "IP_SET" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_NS_GROUP = "NS_GROUP" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_CERTIFICATE = "CERTIFICATE" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_CRL = "CRL" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_LB_MONITOR = "LB_MONITOR" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_LB_POOL = "LB_POOL" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_LB_PERSISTENCE_PROFILE = "LB_PERSISTENCE_PROFILE" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_LB_APPLICATION_PROFILE = "LB_APPLICATION_PROFILE" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_LB_SERVICE = "LB_SERVICE" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_LB_CLIENT_SSL_PROFILE = "LB_CLIENT_SSL_PROFILE" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_LB_VIRTUAL_SERVER = "LB_VIRTUAL_SERVER" + +// Possible value for ``resourceType`` of method MigratedResources#list. +const MigratedResources_LIST_RESOURCE_TYPE_DFW_SECTION = "DFW_SECTION" + +func migratedResourcesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_type"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["resource_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["resource_id"] = "ResourceId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func migratedResourcesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigratedObjectListResultBindingType) +} + +func migratedResourcesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["resource_type"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["resource_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["resource_id"] = "ResourceId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["resource_type"] = bindings.NewStringType() + paramsTypeMap["resource_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["resource_type"] = "resource_type" + queryParams["resource_id"] = "resource_id" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/migrated-resources", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/MigratedSwitchesClient.go b/services/nsxt-mp/nsx/migration/MigratedSwitchesClient.go new file mode 100644 index 000000000..161ed4a8c --- /dev/null +++ b/services/nsxt-mp/nsx/migration/MigratedSwitchesClient.go @@ -0,0 +1,99 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MigratedSwitches +// Used by client-side stubs. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MigratedSwitchesClient interface { + + // Get the list of migrated switches (DVS, VSS) for the selected VC. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.MigrationSwitchListResult + // @throws Unauthenticated Unauthorized + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.MigrationSwitchListResult, error) +} + +type migratedSwitchesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMigratedSwitchesClient(connector client.Connector) *migratedSwitchesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.migrated_switches") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := migratedSwitchesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *migratedSwitchesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *migratedSwitchesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.MigrationSwitchListResult, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(migratedSwitchesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationSwitchListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := migratedSwitchesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.migrated_switches", "list", inputDataValue, executionContext) + var emptyOutput model.MigrationSwitchListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), migratedSwitchesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationSwitchListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/MigratedSwitchesTypes.go b/services/nsxt-mp/nsx/migration/MigratedSwitchesTypes.go new file mode 100644 index 000000000..811f595ca --- /dev/null +++ b/services/nsxt-mp/nsx/migration/MigratedSwitchesTypes.go @@ -0,0 +1,94 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MigratedSwitches. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func migratedSwitchesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func migratedSwitchesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationSwitchListResultBindingType) +} + +func migratedSwitchesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"] = make(map[string]string) + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"]["challenge"] = "WWW-Authenticate" + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/migrated-switches", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.unauthenticated": 401, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/MigrationPackageTypes.go b/services/nsxt-mp/nsx/migration/MigrationPackageTypes.go new file mode 100644 index 000000000..a78c10bff --- /dev/null +++ b/services/nsxt-mp/nsx/migration/MigrationPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.migration. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration diff --git a/services/nsxt-mp/nsx/migration/MigrationUnitGroupsClient.go b/services/nsxt-mp/nsx/migration/MigrationUnitGroupsClient.go new file mode 100644 index 000000000..8a5798185 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/MigrationUnitGroupsClient.go @@ -0,0 +1,356 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MigrationUnitGroups +// Used by client-side stubs. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MigrationUnitGroupsClient interface { + + // Add migration units to specified migration unit group. The migration units will be added at the end of the migration unit list. + // + // @param groupIdParam (required) + // @param migrationUnitListParam (required) + // @return com.vmware.nsx.model.MigrationUnitList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Addmigrationunits(groupIdParam string, migrationUnitListParam model.MigrationUnitList) (model.MigrationUnitList, error) + + // Create a group of migration units. + // + // @param migrationUnitGroupParam (required) + // @return com.vmware.nsx.model.MigrationUnitGroup + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(migrationUnitGroupParam model.MigrationUnitGroup) (model.MigrationUnitGroup, error) + + // Delete the specified group. NOTE - A group can be deleted only if it is empty. If user tries to delete a group containing one or more migration units, the operation will fail and an error will be returned. + // + // @param groupIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(groupIdParam string) error + + // Returns information about a specific migration unit group in the migration plan. If request parameter summary is set to true, then only count of migration units will be returned, migration units list will be empty. + // + // @param groupIdParam (required) + // @param summaryParam Flag indicating whether to return the summary (optional, default to false) + // @return com.vmware.nsx.model.MigrationUnitGroup + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(groupIdParam string, summaryParam *bool) (model.MigrationUnitGroup, error) + + // Return information of all migration unit groups in the migration plan. If request parameter summary is set to true, then only count of migration units will be returned, migration units list will be empty. If request parameter component type is specified, then all migration unit groups for that component will be returned. + // + // @param componentTypeParam Component type based on which migration unit groups to be filtered (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param summaryParam Flag indicating whether to return summary (optional, default to false) + // @param syncParam Synchronize before returning migration unit groups (optional, default to false) + // @return com.vmware.nsx.model.MigrationUnitGroupListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(componentTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, summaryParam *bool, syncParam *bool) (model.MigrationUnitGroupListResult, error) + + // Reorder an migration unit group by placing it before/after the specified migration unit group. + // + // @param groupIdParam (required) + // @param reorderMigrationRequestParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Reorder(groupIdParam string, reorderMigrationRequestParam model.ReorderMigrationRequest) error + + // Update the specified migration unit group. Removal of migration units from the group using this is not allowed. An error will be returned in that case. + // + // @param groupIdParam (required) + // @param migrationUnitGroupParam (required) + // @return com.vmware.nsx.model.MigrationUnitGroup + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(groupIdParam string, migrationUnitGroupParam model.MigrationUnitGroup) (model.MigrationUnitGroup, error) +} + +type migrationUnitGroupsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMigrationUnitGroupsClient(connector client.Connector) *migrationUnitGroupsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.migration_unit_groups") + methodIdentifiers := map[string]core.MethodIdentifier{ + "addmigrationunits": core.NewMethodIdentifier(interfaceIdentifier, "addmigrationunits"), + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "reorder": core.NewMethodIdentifier(interfaceIdentifier, "reorder"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := migrationUnitGroupsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *migrationUnitGroupsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *migrationUnitGroupsClient) Addmigrationunits(groupIdParam string, migrationUnitListParam model.MigrationUnitList) (model.MigrationUnitList, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(migrationUnitGroupsAddmigrationunitsInputType(), typeConverter) + sv.AddStructField("GroupId", groupIdParam) + sv.AddStructField("MigrationUnitList", migrationUnitListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationUnitList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := migrationUnitGroupsAddmigrationunitsRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.migration_unit_groups", "addmigrationunits", inputDataValue, executionContext) + var emptyOutput model.MigrationUnitList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), migrationUnitGroupsAddmigrationunitsOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationUnitList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *migrationUnitGroupsClient) Create(migrationUnitGroupParam model.MigrationUnitGroup) (model.MigrationUnitGroup, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(migrationUnitGroupsCreateInputType(), typeConverter) + sv.AddStructField("MigrationUnitGroup", migrationUnitGroupParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationUnitGroup + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := migrationUnitGroupsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.migration_unit_groups", "create", inputDataValue, executionContext) + var emptyOutput model.MigrationUnitGroup + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), migrationUnitGroupsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationUnitGroup), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *migrationUnitGroupsClient) Delete(groupIdParam string) error { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(migrationUnitGroupsDeleteInputType(), typeConverter) + sv.AddStructField("GroupId", groupIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := migrationUnitGroupsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.migration_unit_groups", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (mIface *migrationUnitGroupsClient) Get(groupIdParam string, summaryParam *bool) (model.MigrationUnitGroup, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(migrationUnitGroupsGetInputType(), typeConverter) + sv.AddStructField("GroupId", groupIdParam) + sv.AddStructField("Summary", summaryParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationUnitGroup + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := migrationUnitGroupsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.migration_unit_groups", "get", inputDataValue, executionContext) + var emptyOutput model.MigrationUnitGroup + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), migrationUnitGroupsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationUnitGroup), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *migrationUnitGroupsClient) List(componentTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, summaryParam *bool, syncParam *bool) (model.MigrationUnitGroupListResult, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(migrationUnitGroupsListInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Summary", summaryParam) + sv.AddStructField("Sync", syncParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationUnitGroupListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := migrationUnitGroupsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.migration_unit_groups", "list", inputDataValue, executionContext) + var emptyOutput model.MigrationUnitGroupListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), migrationUnitGroupsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationUnitGroupListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *migrationUnitGroupsClient) Reorder(groupIdParam string, reorderMigrationRequestParam model.ReorderMigrationRequest) error { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(migrationUnitGroupsReorderInputType(), typeConverter) + sv.AddStructField("GroupId", groupIdParam) + sv.AddStructField("ReorderMigrationRequest", reorderMigrationRequestParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := migrationUnitGroupsReorderRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.migration_unit_groups", "reorder", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (mIface *migrationUnitGroupsClient) Update(groupIdParam string, migrationUnitGroupParam model.MigrationUnitGroup) (model.MigrationUnitGroup, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(migrationUnitGroupsUpdateInputType(), typeConverter) + sv.AddStructField("GroupId", groupIdParam) + sv.AddStructField("MigrationUnitGroup", migrationUnitGroupParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationUnitGroup + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := migrationUnitGroupsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.migration_unit_groups", "update", inputDataValue, executionContext) + var emptyOutput model.MigrationUnitGroup + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), migrationUnitGroupsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationUnitGroup), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/MigrationUnitGroupsStatusClient.go b/services/nsxt-mp/nsx/migration/MigrationUnitGroupsStatusClient.go new file mode 100644 index 000000000..ac5680784 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/MigrationUnitGroupsStatusClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MigrationUnitGroupsStatus +// Used by client-side stubs. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MigrationUnitGroupsStatusClient interface { + + // Get migration status for migration unit groups + // + // @param componentTypeParam Component type based on which migration unit groups to be filtered (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.MigrationUnitGroupStatusListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Getall(componentTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.MigrationUnitGroupStatusListResult, error) +} + +type migrationUnitGroupsStatusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMigrationUnitGroupsStatusClient(connector client.Connector) *migrationUnitGroupsStatusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.migration_unit_groups_status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "getall": core.NewMethodIdentifier(interfaceIdentifier, "getall"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := migrationUnitGroupsStatusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *migrationUnitGroupsStatusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *migrationUnitGroupsStatusClient) Getall(componentTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.MigrationUnitGroupStatusListResult, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(migrationUnitGroupsStatusGetallInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationUnitGroupStatusListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := migrationUnitGroupsStatusGetallRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.migration_unit_groups_status", "getall", inputDataValue, executionContext) + var emptyOutput model.MigrationUnitGroupStatusListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), migrationUnitGroupsStatusGetallOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationUnitGroupStatusListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/MigrationUnitGroupsStatusTypes.go b/services/nsxt-mp/nsx/migration/MigrationUnitGroupsStatusTypes.go new file mode 100644 index 000000000..d549e1e66 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/MigrationUnitGroupsStatusTypes.go @@ -0,0 +1,98 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MigrationUnitGroupsStatus. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func migrationUnitGroupsStatusGetallInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func migrationUnitGroupsStatusGetallOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationUnitGroupStatusListResultBindingType) +} + +func migrationUnitGroupsStatusGetallRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["component_type"] = "component_type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/migration-unit-groups-status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/MigrationUnitGroupsTypes.go b/services/nsxt-mp/nsx/migration/MigrationUnitGroupsTypes.go new file mode 100644 index 000000000..25b29c059 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/MigrationUnitGroupsTypes.go @@ -0,0 +1,429 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MigrationUnitGroups. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func migrationUnitGroupsAddmigrationunitsInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["group_id"] = bindings.NewStringType() + fields["migration_unit_list"] = bindings.NewReferenceType(model.MigrationUnitListBindingType) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["migration_unit_list"] = "MigrationUnitList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func migrationUnitGroupsAddmigrationunitsOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationUnitListBindingType) +} + +func migrationUnitGroupsAddmigrationunitsRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["group_id"] = bindings.NewStringType() + fields["migration_unit_list"] = bindings.NewReferenceType(model.MigrationUnitListBindingType) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["migration_unit_list"] = "MigrationUnitList" + paramsTypeMap["group_id"] = bindings.NewStringType() + paramsTypeMap["migration_unit_list"] = bindings.NewReferenceType(model.MigrationUnitListBindingType) + paramsTypeMap["groupId"] = bindings.NewStringType() + pathParams["group_id"] = "groupId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=add_migration_units", + "migration_unit_list", + "POST", + "/api/v1/migration/migration-unit-groups/{groupId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func migrationUnitGroupsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["migration_unit_group"] = bindings.NewReferenceType(model.MigrationUnitGroupBindingType) + fieldNameMap["migration_unit_group"] = "MigrationUnitGroup" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func migrationUnitGroupsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationUnitGroupBindingType) +} + +func migrationUnitGroupsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["migration_unit_group"] = bindings.NewReferenceType(model.MigrationUnitGroupBindingType) + fieldNameMap["migration_unit_group"] = "MigrationUnitGroup" + paramsTypeMap["migration_unit_group"] = bindings.NewReferenceType(model.MigrationUnitGroupBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "migration_unit_group", + "POST", + "/api/v1/migration/migration-unit-groups", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func migrationUnitGroupsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["group_id"] = bindings.NewStringType() + fieldNameMap["group_id"] = "GroupId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func migrationUnitGroupsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func migrationUnitGroupsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["group_id"] = bindings.NewStringType() + fieldNameMap["group_id"] = "GroupId" + paramsTypeMap["group_id"] = bindings.NewStringType() + paramsTypeMap["groupId"] = bindings.NewStringType() + pathParams["group_id"] = "groupId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/migration/migration-unit-groups/{groupId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func migrationUnitGroupsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["group_id"] = bindings.NewStringType() + fields["summary"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["summary"] = "Summary" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func migrationUnitGroupsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationUnitGroupBindingType) +} + +func migrationUnitGroupsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["group_id"] = bindings.NewStringType() + fields["summary"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["summary"] = "Summary" + paramsTypeMap["group_id"] = bindings.NewStringType() + paramsTypeMap["summary"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["groupId"] = bindings.NewStringType() + pathParams["group_id"] = "groupId" + queryParams["summary"] = "summary" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/migration-unit-groups/{groupId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func migrationUnitGroupsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["summary"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sync"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["summary"] = "Summary" + fieldNameMap["sync"] = "Sync" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func migrationUnitGroupsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationUnitGroupListResultBindingType) +} + +func migrationUnitGroupsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["summary"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sync"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["summary"] = "Summary" + fieldNameMap["sync"] = "Sync" + paramsTypeMap["sync"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["summary"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["summary"] = "summary" + queryParams["component_type"] = "component_type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["sync"] = "sync" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/migration-unit-groups", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func migrationUnitGroupsReorderInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["group_id"] = bindings.NewStringType() + fields["reorder_migration_request"] = bindings.NewReferenceType(model.ReorderMigrationRequestBindingType) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["reorder_migration_request"] = "ReorderMigrationRequest" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func migrationUnitGroupsReorderOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func migrationUnitGroupsReorderRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["group_id"] = bindings.NewStringType() + fields["reorder_migration_request"] = bindings.NewReferenceType(model.ReorderMigrationRequestBindingType) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["reorder_migration_request"] = "ReorderMigrationRequest" + paramsTypeMap["reorder_migration_request"] = bindings.NewReferenceType(model.ReorderMigrationRequestBindingType) + paramsTypeMap["group_id"] = bindings.NewStringType() + paramsTypeMap["groupId"] = bindings.NewStringType() + pathParams["group_id"] = "groupId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=reorder", + "reorder_migration_request", + "POST", + "/api/v1/migration/migration-unit-groups/{groupId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func migrationUnitGroupsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["group_id"] = bindings.NewStringType() + fields["migration_unit_group"] = bindings.NewReferenceType(model.MigrationUnitGroupBindingType) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["migration_unit_group"] = "MigrationUnitGroup" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func migrationUnitGroupsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationUnitGroupBindingType) +} + +func migrationUnitGroupsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["group_id"] = bindings.NewStringType() + fields["migration_unit_group"] = bindings.NewReferenceType(model.MigrationUnitGroupBindingType) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["migration_unit_group"] = "MigrationUnitGroup" + paramsTypeMap["group_id"] = bindings.NewStringType() + paramsTypeMap["migration_unit_group"] = bindings.NewReferenceType(model.MigrationUnitGroupBindingType) + paramsTypeMap["groupId"] = bindings.NewStringType() + pathParams["group_id"] = "groupId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "migration_unit_group", + "PUT", + "/api/v1/migration/migration-unit-groups/{groupId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/MigrationUnitsClient.go b/services/nsxt-mp/nsx/migration/MigrationUnitsClient.go new file mode 100644 index 000000000..d7a4563e5 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/MigrationUnitsClient.go @@ -0,0 +1,153 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MigrationUnits +// Used by client-side stubs. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MigrationUnitsClient interface { + + // Get a specific migration unit + // + // @param migrationUnitIdParam (required) + // @return com.vmware.nsx.model.MigrationUnit + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(migrationUnitIdParam string) (model.MigrationUnit, error) + + // Get migration units + // + // @param componentTypeParam Component type based on which migration units to be filtered (optional) + // @param currentVersionParam Current version of migration unit based on which migration units to be filtered (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param groupIdParam UUID of group based on which migration units to be filtered (optional) + // @param hasWarningsParam Flag to indicate whether to return only migration units with warnings (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param metadataParam Metadata about migration unit to filter on (optional) + // @param migrationUnitTypeParam Migration unit type based on which migration units to be filtered (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.MigrationUnitListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(componentTypeParam *string, currentVersionParam *string, cursorParam *string, groupIdParam *string, hasWarningsParam *bool, includedFieldsParam *string, metadataParam *string, migrationUnitTypeParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.MigrationUnitListResult, error) +} + +type migrationUnitsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMigrationUnitsClient(connector client.Connector) *migrationUnitsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.migration_units") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := migrationUnitsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *migrationUnitsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *migrationUnitsClient) Get(migrationUnitIdParam string) (model.MigrationUnit, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(migrationUnitsGetInputType(), typeConverter) + sv.AddStructField("MigrationUnitId", migrationUnitIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationUnit + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := migrationUnitsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.migration_units", "get", inputDataValue, executionContext) + var emptyOutput model.MigrationUnit + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), migrationUnitsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationUnit), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *migrationUnitsClient) List(componentTypeParam *string, currentVersionParam *string, cursorParam *string, groupIdParam *string, hasWarningsParam *bool, includedFieldsParam *string, metadataParam *string, migrationUnitTypeParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.MigrationUnitListResult, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(migrationUnitsListInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + sv.AddStructField("CurrentVersion", currentVersionParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("GroupId", groupIdParam) + sv.AddStructField("HasWarnings", hasWarningsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("Metadata", metadataParam) + sv.AddStructField("MigrationUnitType", migrationUnitTypeParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationUnitListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := migrationUnitsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.migration_units", "list", inputDataValue, executionContext) + var emptyOutput model.MigrationUnitListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), migrationUnitsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationUnitListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/MigrationUnitsStatsClient.go b/services/nsxt-mp/nsx/migration/MigrationUnitsStatsClient.go new file mode 100644 index 000000000..ef53a223f --- /dev/null +++ b/services/nsxt-mp/nsx/migration/MigrationUnitsStatsClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MigrationUnitsStats +// Used by client-side stubs. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MigrationUnitsStatsClient interface { + + // Get migration units stats + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param syncParam Synchronize before returning migration unit stats (optional, default to false) + // @return com.vmware.nsx.model.MigrationUnitTypeStatsList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, syncParam *bool) (model.MigrationUnitTypeStatsList, error) +} + +type migrationUnitsStatsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMigrationUnitsStatsClient(connector client.Connector) *migrationUnitsStatsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.migration_units_stats") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := migrationUnitsStatsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *migrationUnitsStatsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *migrationUnitsStatsClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, syncParam *bool) (model.MigrationUnitTypeStatsList, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(migrationUnitsStatsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Sync", syncParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationUnitTypeStatsList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := migrationUnitsStatsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.migration_units_stats", "list", inputDataValue, executionContext) + var emptyOutput model.MigrationUnitTypeStatsList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), migrationUnitsStatsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationUnitTypeStatsList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/MigrationUnitsStatsTypes.go b/services/nsxt-mp/nsx/migration/MigrationUnitsStatsTypes.go new file mode 100644 index 000000000..dc3bdf822 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/MigrationUnitsStatsTypes.go @@ -0,0 +1,98 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MigrationUnitsStats. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func migrationUnitsStatsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sync"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["sync"] = "Sync" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func migrationUnitsStatsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationUnitTypeStatsListBindingType) +} + +func migrationUnitsStatsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sync"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["sync"] = "Sync" + paramsTypeMap["sync"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["sync"] = "sync" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/migration-units-stats", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/MigrationUnitsTypes.go b/services/nsxt-mp/nsx/migration/MigrationUnitsTypes.go new file mode 100644 index 000000000..bf250f311 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/MigrationUnitsTypes.go @@ -0,0 +1,178 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MigrationUnits. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func migrationUnitsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["migration_unit_id"] = bindings.NewStringType() + fieldNameMap["migration_unit_id"] = "MigrationUnitId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func migrationUnitsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationUnitBindingType) +} + +func migrationUnitsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["migration_unit_id"] = bindings.NewStringType() + fieldNameMap["migration_unit_id"] = "MigrationUnitId" + paramsTypeMap["migration_unit_id"] = bindings.NewStringType() + paramsTypeMap["migrationUnitId"] = bindings.NewStringType() + pathParams["migration_unit_id"] = "migrationUnitId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/migration-units/{migrationUnitId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func migrationUnitsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["current_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["has_warnings"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["metadata"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["migration_unit_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["current_version"] = "CurrentVersion" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["has_warnings"] = "HasWarnings" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["metadata"] = "Metadata" + fieldNameMap["migration_unit_type"] = "MigrationUnitType" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func migrationUnitsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationUnitListResultBindingType) +} + +func migrationUnitsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["current_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["has_warnings"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["metadata"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["migration_unit_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["current_version"] = "CurrentVersion" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["has_warnings"] = "HasWarnings" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["metadata"] = "Metadata" + fieldNameMap["migration_unit_type"] = "MigrationUnitType" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["has_warnings"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["metadata"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["current_version"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["migration_unit_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["component_type"] = "component_type" + queryParams["migration_unit_type"] = "migration_unit_type" + queryParams["metadata"] = "metadata" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["group_id"] = "group_id" + queryParams["included_fields"] = "included_fields" + queryParams["current_version"] = "current_version" + queryParams["has_warnings"] = "has_warnings" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/migration-units", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/MpToPolicyClient.go b/services/nsxt-mp/nsx/migration/MpToPolicyClient.go new file mode 100644 index 000000000..205040f6f --- /dev/null +++ b/services/nsxt-mp/nsx/migration/MpToPolicyClient.go @@ -0,0 +1,83 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MpToPolicy +// Used by client-side stubs. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MpToPolicyClient interface { + + // This will trigger the migration from mp to policy + // + // @param mpMigrationDataParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(mpMigrationDataParam model.MpMigrationData) error +} + +type mpToPolicyClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMpToPolicyClient(connector client.Connector) *mpToPolicyClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.mp_to_policy") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := mpToPolicyClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *mpToPolicyClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *mpToPolicyClient) Create(mpMigrationDataParam model.MpMigrationData) error { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(mpToPolicyCreateInputType(), typeConverter) + sv.AddStructField("MpMigrationData", mpMigrationDataParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := mpToPolicyCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.mp_to_policy", "create", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/MpToPolicyTypes.go b/services/nsxt-mp/nsx/migration/MpToPolicyTypes.go new file mode 100644 index 000000000..5da8b1fea --- /dev/null +++ b/services/nsxt-mp/nsx/migration/MpToPolicyTypes.go @@ -0,0 +1,67 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MpToPolicy. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func mpToPolicyCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mp_migration_data"] = bindings.NewReferenceType(model.MpMigrationDataBindingType) + fieldNameMap["mp_migration_data"] = "MpMigrationData" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func mpToPolicyCreateOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func mpToPolicyCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["mp_migration_data"] = bindings.NewReferenceType(model.MpMigrationDataBindingType) + fieldNameMap["mp_migration_data"] = "MpMigrationData" + paramsTypeMap["mp_migration_data"] = bindings.NewReferenceType(model.MpMigrationDataBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "mp_migration_data", + "POST", + "/api/v1/migration/mp-to-policy", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/NodesClient.go b/services/nsxt-mp/nsx/migration/NodesClient.go new file mode 100644 index 000000000..71a947726 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/NodesClient.go @@ -0,0 +1,102 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Nodes +// Used by client-side stubs. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NodesClient interface { + + // Get list of nodes. If request parameter component type is specified, then all nodes for that component will be returned. If request parameter component version is specified, then all nodes at that version will be returned. + // + // @param componentTypeParam Component type based on which nodes will be filtered (optional) + // @param componentVersionParam Component version based on which nodes will be filtered (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.NodeInfoListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(componentTypeParam *string, componentVersionParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.NodeInfoListResult, error) +} + +type nodesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNodesClient(connector client.Connector) *nodesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.nodes") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nodesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nodesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nodesClient) List(componentTypeParam *string, componentVersionParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.NodeInfoListResult, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodesListInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + sv.AddStructField("ComponentVersion", componentVersionParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeInfoListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.nodes", "list", inputDataValue, executionContext) + var emptyOutput model.NodeInfoListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nodesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeInfoListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/NodesSummaryClient.go b/services/nsxt-mp/nsx/migration/NodesSummaryClient.go new file mode 100644 index 000000000..ab252b33e --- /dev/null +++ b/services/nsxt-mp/nsx/migration/NodesSummaryClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: NodesSummary +// Used by client-side stubs. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NodesSummaryClient interface { + + // Get summary of nodes, which includes node count for each type and component version. + // @return com.vmware.nsx.model.NodeSummaryList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeSummaryList, error) +} + +type nodesSummaryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNodesSummaryClient(connector client.Connector) *nodesSummaryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.nodes_summary") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nodesSummaryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nodesSummaryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nodesSummaryClient) Get() (model.NodeSummaryList, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodesSummaryGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeSummaryList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodesSummaryGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.nodes_summary", "get", inputDataValue, executionContext) + var emptyOutput model.NodeSummaryList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nodesSummaryGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeSummaryList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/NodesSummaryTypes.go b/services/nsxt-mp/nsx/migration/NodesSummaryTypes.go new file mode 100644 index 000000000..0a3b23118 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/NodesSummaryTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: NodesSummary. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func nodesSummaryGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodesSummaryGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeSummaryListBindingType) +} + +func nodesSummaryGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/nodes-summary", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/NodesTypes.go b/services/nsxt-mp/nsx/migration/NodesTypes.go new file mode 100644 index 000000000..7842d1784 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/NodesTypes.go @@ -0,0 +1,104 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Nodes. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func nodesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["component_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["component_version"] = "ComponentVersion" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeInfoListResultBindingType) +} + +func nodesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["component_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["component_version"] = "ComponentVersion" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["component_version"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["component_type"] = "component_type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["component_version"] = "component_version" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/nodes", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/PlanClient.go b/services/nsxt-mp/nsx/migration/PlanClient.go new file mode 100644 index 000000000..5e0314f6c --- /dev/null +++ b/services/nsxt-mp/nsx/migration/PlanClient.go @@ -0,0 +1,323 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Plan +// Used by client-side stubs. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type PlanClient interface { + + // Resets all migration steps done so far, so that migration can be restarted with new setup details. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Abort() error + + // Continue the migration. Resumes the migration from the point where it was paused. + // + // @param skipParam Skip to migration of next component. (optional, default to false) + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Continue_(skipParam *bool) error + + // This API marks the completion of one execution of migration workflow. This API resets internal execution state and hence needs to be invoked before starting subsequent workflow run. + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Finish() error + + // Pause the migration. Migration will be paused after migration of all the nodes currently in progress is completed either successfully or with failure. User can make changes in the migration plan when the migration is paused. + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Pause() error + + // Reset the migration plan to default plan. User has an option to change the default plan. But if after making changes, user wants to go back to the default plan, this is the way to do so. + // + // @param componentTypeParam Component type (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Reset(componentTypeParam string) error + + // Roll back the migration. Changes applied to target NSX will be reverted. Use the migration status API to monitor progress of roll back. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Rollback() error + + // Start the migration. Migration will start as per the migration plan. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() error + + // This API updates the migration-state of host groups which are part of provided federation site/s. + // + // @param federationSiteMigrationStateParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Updatesitemigrationstate(federationSiteMigrationStateParam model.FederationSiteMigrationState) error +} + +type planClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewPlanClient(connector client.Connector) *planClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.plan") + methodIdentifiers := map[string]core.MethodIdentifier{ + "abort": core.NewMethodIdentifier(interfaceIdentifier, "abort"), + "continue": core.NewMethodIdentifier(interfaceIdentifier, "continue"), + "finish": core.NewMethodIdentifier(interfaceIdentifier, "finish"), + "pause": core.NewMethodIdentifier(interfaceIdentifier, "pause"), + "reset": core.NewMethodIdentifier(interfaceIdentifier, "reset"), + "rollback": core.NewMethodIdentifier(interfaceIdentifier, "rollback"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "updatesitemigrationstate": core.NewMethodIdentifier(interfaceIdentifier, "updatesitemigrationstate"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + pIface := planClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &pIface +} + +func (pIface *planClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := pIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (pIface *planClient) Abort() error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(planAbortInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := planAbortRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.plan", "abort", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *planClient) Continue_(skipParam *bool) error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(planContinue_InputType(), typeConverter) + sv.AddStructField("Skip", skipParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := planContinue_RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.plan", "continue", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *planClient) Finish() error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(planFinishInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := planFinishRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.plan", "finish", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *planClient) Pause() error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(planPauseInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := planPauseRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.plan", "pause", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *planClient) Reset(componentTypeParam string) error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(planResetInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := planResetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.plan", "reset", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *planClient) Rollback() error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(planRollbackInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := planRollbackRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.plan", "rollback", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *planClient) Start() error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(planStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := planStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.plan", "start", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *planClient) Updatesitemigrationstate(federationSiteMigrationStateParam model.FederationSiteMigrationState) error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(planUpdatesitemigrationstateInputType(), typeConverter) + sv.AddStructField("FederationSiteMigrationState", federationSiteMigrationStateParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := planUpdatesitemigrationstateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.plan", "updatesitemigrationstate", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/PlanTypes.go b/services/nsxt-mp/nsx/migration/PlanTypes.go new file mode 100644 index 000000000..2f935cb39 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/PlanTypes.go @@ -0,0 +1,380 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Plan. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func planAbortInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func planAbortOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func planAbortRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=abort", + "", + "POST", + "/api/v1/migration/plan", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func planContinue_InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["skip"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["skip"] = "Skip" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func planContinue_OutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func planContinue_RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["skip"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["skip"] = "Skip" + paramsTypeMap["skip"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["skip"] = "skip" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=continue", + "", + "POST", + "/api/v1/migration/plan", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func planFinishInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func planFinishOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func planFinishRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=finish", + "", + "POST", + "/api/v1/migration/plan", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func planPauseInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func planPauseOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func planPauseRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=pause", + "", + "POST", + "/api/v1/migration/plan", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func planResetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewStringType() + fieldNameMap["component_type"] = "ComponentType" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func planResetOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func planResetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewStringType() + fieldNameMap["component_type"] = "ComponentType" + paramsTypeMap["component_type"] = bindings.NewStringType() + queryParams["component_type"] = "component_type" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=reset", + "", + "POST", + "/api/v1/migration/plan", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func planRollbackInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func planRollbackOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func planRollbackRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=rollback", + "", + "POST", + "/api/v1/migration/plan", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func planStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func planStartOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func planStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/migration/plan", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func planUpdatesitemigrationstateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["federation_site_migration_state"] = bindings.NewReferenceType(model.FederationSiteMigrationStateBindingType) + fieldNameMap["federation_site_migration_state"] = "FederationSiteMigrationState" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func planUpdatesitemigrationstateOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func planUpdatesitemigrationstateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["federation_site_migration_state"] = bindings.NewReferenceType(model.FederationSiteMigrationStateBindingType) + fieldNameMap["federation_site_migration_state"] = "FederationSiteMigrationState" + paramsTypeMap["federation_site_migration_state"] = bindings.NewReferenceType(model.FederationSiteMigrationStateBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=update_site_migration_state", + "federation_site_migration_state", + "POST", + "/api/v1/migration/plan", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/SetupClient.go b/services/nsxt-mp/nsx/migration/SetupClient.go new file mode 100644 index 000000000..2b85e8e70 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/SetupClient.go @@ -0,0 +1,243 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Setup +// Used by client-side stubs. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SetupClient interface { + + // Add ALB endpoint details for non cross VC migration modes. + // + // @param aviEndPointParam (required) + // @throws Unauthenticated Unauthorized + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Addalbinfo(aviEndPointParam model.AviEndPoint) error + + // Add NSX-V to NSX-T site mapping. + // + // @param v2tSiteMappingSpecParam (required) + // @throws Unauthenticated Unauthorized + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Addv2tsitemapping(v2tSiteMappingSpecParam model.V2tSiteMappingSpec) error + + // Get setup details of NSX-V to be migrated. + // @return com.vmware.nsx.model.MigrationSetupInfo + // @throws Unauthenticated Unauthorized + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.MigrationSetupInfo, error) + + // Set the NSX-V ESG to NSX-T Router mapping option. + // + // @param mappingOptionParam Mapping option (required) + // @throws Unauthenticated Unauthorized + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Setesgtoroutermappingoption(mappingOptionParam string) error + + // Provide setup details of NSX-V to be migrated. + // + // @param migrationSetupInfoParam (required) + // @return com.vmware.nsx.model.MigrationSetupInfo + // @throws Unauthenticated Unauthorized + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(migrationSetupInfoParam model.MigrationSetupInfo) (model.MigrationSetupInfo, error) +} + +type setupClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSetupClient(connector client.Connector) *setupClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.setup") + methodIdentifiers := map[string]core.MethodIdentifier{ + "addalbinfo": core.NewMethodIdentifier(interfaceIdentifier, "addalbinfo"), + "addv2tsitemapping": core.NewMethodIdentifier(interfaceIdentifier, "addv2tsitemapping"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "setesgtoroutermappingoption": core.NewMethodIdentifier(interfaceIdentifier, "setesgtoroutermappingoption"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := setupClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *setupClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *setupClient) Addalbinfo(aviEndPointParam model.AviEndPoint) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(setupAddalbinfoInputType(), typeConverter) + sv.AddStructField("AviEndPoint", aviEndPointParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := setupAddalbinfoRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.setup", "addalbinfo", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *setupClient) Addv2tsitemapping(v2tSiteMappingSpecParam model.V2tSiteMappingSpec) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(setupAddv2tsitemappingInputType(), typeConverter) + sv.AddStructField("V2tSiteMappingSpec", v2tSiteMappingSpecParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := setupAddv2tsitemappingRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.setup", "addv2tsitemapping", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *setupClient) Get() (model.MigrationSetupInfo, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(setupGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationSetupInfo + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := setupGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.setup", "get", inputDataValue, executionContext) + var emptyOutput model.MigrationSetupInfo + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), setupGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationSetupInfo), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *setupClient) Setesgtoroutermappingoption(mappingOptionParam string) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(setupSetesgtoroutermappingoptionInputType(), typeConverter) + sv.AddStructField("MappingOption", mappingOptionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := setupSetesgtoroutermappingoptionRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.setup", "setesgtoroutermappingoption", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *setupClient) Update(migrationSetupInfoParam model.MigrationSetupInfo) (model.MigrationSetupInfo, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(setupUpdateInputType(), typeConverter) + sv.AddStructField("MigrationSetupInfo", migrationSetupInfoParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationSetupInfo + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := setupUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.setup", "update", inputDataValue, executionContext) + var emptyOutput model.MigrationSetupInfo + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), setupUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationSetupInfo), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/SetupTypes.go b/services/nsxt-mp/nsx/migration/SetupTypes.go new file mode 100644 index 000000000..ab123aa38 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/SetupTypes.go @@ -0,0 +1,274 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Setup. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``mappingOption`` of method Setup#setesgtoroutermappingoption. +const Setup_SETESGTOROUTERMAPPINGOPTION_MAPPING_OPTION_UI = "UI" + +// Possible value for ``mappingOption`` of method Setup#setesgtoroutermappingoption. +const Setup_SETESGTOROUTERMAPPINGOPTION_MAPPING_OPTION_FILE_UPLOAD = "FILE_UPLOAD" + +// Possible value for ``mappingOption`` of method Setup#setesgtoroutermappingoption. +const Setup_SETESGTOROUTERMAPPINGOPTION_MAPPING_OPTION_NO_MAPPING = "NO_MAPPING" + +func setupAddalbinfoInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["avi_end_point"] = bindings.NewReferenceType(model.AviEndPointBindingType) + fieldNameMap["avi_end_point"] = "AviEndPoint" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func setupAddalbinfoOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func setupAddalbinfoRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["avi_end_point"] = bindings.NewReferenceType(model.AviEndPointBindingType) + fieldNameMap["avi_end_point"] = "AviEndPoint" + paramsTypeMap["avi_end_point"] = bindings.NewReferenceType(model.AviEndPointBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"] = make(map[string]string) + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"]["challenge"] = "WWW-Authenticate" + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=addAlbInfo", + "avi_end_point", + "PUT", + "/api/v1/migration/setup", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.unauthenticated": 401, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func setupAddv2tsitemappingInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["v2t_site_mapping_spec"] = bindings.NewReferenceType(model.V2tSiteMappingSpecBindingType) + fieldNameMap["v2t_site_mapping_spec"] = "V2tSiteMappingSpec" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func setupAddv2tsitemappingOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func setupAddv2tsitemappingRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["v2t_site_mapping_spec"] = bindings.NewReferenceType(model.V2tSiteMappingSpecBindingType) + fieldNameMap["v2t_site_mapping_spec"] = "V2tSiteMappingSpec" + paramsTypeMap["v2t_site_mapping_spec"] = bindings.NewReferenceType(model.V2tSiteMappingSpecBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"] = make(map[string]string) + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"]["challenge"] = "WWW-Authenticate" + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=addV2tSiteMapping", + "v2t_site_mapping_spec", + "PUT", + "/api/v1/migration/setup", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.unauthenticated": 401, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func setupGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func setupGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationSetupInfoBindingType) +} + +func setupGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"] = make(map[string]string) + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"]["challenge"] = "WWW-Authenticate" + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/setup", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.unauthenticated": 401, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func setupSetesgtoroutermappingoptionInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mapping_option"] = bindings.NewStringType() + fieldNameMap["mapping_option"] = "MappingOption" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func setupSetesgtoroutermappingoptionOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func setupSetesgtoroutermappingoptionRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["mapping_option"] = bindings.NewStringType() + fieldNameMap["mapping_option"] = "MappingOption" + paramsTypeMap["mapping_option"] = bindings.NewStringType() + queryParams["mapping_option"] = "mapping_option" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"] = make(map[string]string) + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"]["challenge"] = "WWW-Authenticate" + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=setEsgToRouterMappingOption", + "", + "PUT", + "/api/v1/migration/setup", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.unauthenticated": 401, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func setupUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["migration_setup_info"] = bindings.NewReferenceType(model.MigrationSetupInfoBindingType) + fieldNameMap["migration_setup_info"] = "MigrationSetupInfo" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func setupUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationSetupInfoBindingType) +} + +func setupUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["migration_setup_info"] = bindings.NewReferenceType(model.MigrationSetupInfoBindingType) + fieldNameMap["migration_setup_info"] = "MigrationSetupInfo" + paramsTypeMap["migration_setup_info"] = bindings.NewReferenceType(model.MigrationSetupInfoBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"] = make(map[string]string) + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"]["challenge"] = "WWW-Authenticate" + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "migration_setup_info", + "PUT", + "/api/v1/migration/setup", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.unauthenticated": 401, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/StatusSummaryClient.go b/services/nsxt-mp/nsx/migration/StatusSummaryClient.go new file mode 100644 index 000000000..1f07f3fe3 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/StatusSummaryClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: StatusSummary +// Used by client-side stubs. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusSummaryClient interface { + + // Get migration status summary + // + // @param componentTypeParam Component type based on which migration units to be filtered (optional) + // @return com.vmware.nsx.model.MigrationStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(componentTypeParam *string) (model.MigrationStatus, error) +} + +type statusSummaryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusSummaryClient(connector client.Connector) *statusSummaryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.status_summary") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusSummaryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusSummaryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusSummaryClient) Get(componentTypeParam *string) (model.MigrationStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusSummaryGetInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusSummaryGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.status_summary", "get", inputDataValue, executionContext) + var emptyOutput model.MigrationStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusSummaryGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/StatusSummaryTypes.go b/services/nsxt-mp/nsx/migration/StatusSummaryTypes.go new file mode 100644 index 000000000..252ddace0 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/StatusSummaryTypes.go @@ -0,0 +1,68 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: StatusSummary. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusSummaryGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusSummaryGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationStatusBindingType) +} + +func statusSummaryGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + paramsTypeMap["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["component_type"] = "component_type" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/status-summary", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/SummaryClient.go b/services/nsxt-mp/nsx/migration/SummaryClient.go new file mode 100644 index 000000000..a5661bc53 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/SummaryClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Summary +// Used by client-side stubs. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SummaryClient interface { + + // Get migration summary + // @return com.vmware.nsx.model.MigrationSummary + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.MigrationSummary, error) +} + +type summaryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSummaryClient(connector client.Connector) *summaryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.summary") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := summaryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *summaryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *summaryClient) Get() (model.MigrationSummary, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(summaryGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationSummary + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := summaryGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.summary", "get", inputDataValue, executionContext) + var emptyOutput model.MigrationSummary + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), summaryGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationSummary), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/SummaryTypes.go b/services/nsxt-mp/nsx/migration/SummaryTypes.go new file mode 100644 index 000000000..202b87a7a --- /dev/null +++ b/services/nsxt-mp/nsx/migration/SummaryTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Summary. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func summaryGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func summaryGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationSummaryBindingType) +} + +func summaryGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/summary", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/SwitchClient.go b/services/nsxt-mp/nsx/migration/SwitchClient.go new file mode 100644 index 000000000..1df8e695e --- /dev/null +++ b/services/nsxt-mp/nsx/migration/SwitchClient.go @@ -0,0 +1,132 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Switch +// Used by client-side stubs. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SwitchClient interface { + + // The user is returned the switch (DVS/VSS) set as current scope of migration. + // @return com.vmware.nsx.model.MigrationSwitchInfo + // @throws Unauthenticated Unauthorized + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.MigrationSwitchInfo, error) + + // The user specifies a DVS / VSS as the current scope of migration. + // + // @param migrationSwitchInfoParam (required) + // @return com.vmware.nsx.model.MigrationSwitchInfo + // @throws Unauthenticated Unauthorized + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(migrationSwitchInfoParam model.MigrationSwitchInfo) (model.MigrationSwitchInfo, error) +} + +type switchClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSwitchClient(connector client.Connector) *switchClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.switch") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := switchClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *switchClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *switchClient) Get() (model.MigrationSwitchInfo, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(switchGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationSwitchInfo + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := switchGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.switch", "get", inputDataValue, executionContext) + var emptyOutput model.MigrationSwitchInfo + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), switchGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationSwitchInfo), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *switchClient) Update(migrationSwitchInfoParam model.MigrationSwitchInfo) (model.MigrationSwitchInfo, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(switchUpdateInputType(), typeConverter) + sv.AddStructField("MigrationSwitchInfo", migrationSwitchInfoParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationSwitchInfo + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := switchUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.switch", "update", inputDataValue, executionContext) + var emptyOutput model.MigrationSwitchInfo + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), switchUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationSwitchInfo), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/SwitchTypes.go b/services/nsxt-mp/nsx/migration/SwitchTypes.go new file mode 100644 index 000000000..c9b3c74cc --- /dev/null +++ b/services/nsxt-mp/nsx/migration/SwitchTypes.go @@ -0,0 +1,114 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Switch. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func switchGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func switchGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationSwitchInfoBindingType) +} + +func switchGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"] = make(map[string]string) + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"]["challenge"] = "WWW-Authenticate" + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/switch", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.unauthenticated": 401, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func switchUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["migration_switch_info"] = bindings.NewReferenceType(model.MigrationSwitchInfoBindingType) + fieldNameMap["migration_switch_info"] = "MigrationSwitchInfo" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func switchUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationSwitchInfoBindingType) +} + +func switchUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["migration_switch_info"] = bindings.NewReferenceType(model.MigrationSwitchInfoBindingType) + fieldNameMap["migration_switch_info"] = "MigrationSwitchInfo" + paramsTypeMap["migration_switch_info"] = bindings.NewReferenceType(model.MigrationSwitchInfoBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"] = make(map[string]string) + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"]["challenge"] = "WWW-Authenticate" + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "migration_switch_info", + "PUT", + "/api/v1/migration/switch", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.unauthenticated": 401, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/VmgroupClient.go b/services/nsxt-mp/nsx/migration/VmgroupClient.go new file mode 100644 index 000000000..a045136c6 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/VmgroupClient.go @@ -0,0 +1,119 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Vmgroup +// Used by client-side stubs. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type VmgroupClient interface { + + // For each VM group, the following three high level steps are performed in sequence. 1. Call pre VM group migrate API. 2. Migrate (by vmotion,in place, etc.,) VMs in the VM group. This step will be done by user independent of MC. 3. Call post VM group migrate API with the same VM group id used in the pre VM group migrate API. This API specifically deals with post VM group migrate API. When post VM group migrate API is invoked for a VM group id, MC performs following actions. - Add security tags on the VMs migrated. For the VMs mentioned in the failed VM instance uuids, this operation is skipped. + // + // @param postVmGroupMigrationSpecParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Postmigrate(postVmGroupMigrationSpecParam model.PostVmGroupMigrationSpec) error + + // For each VM group, the following three high level steps are performed in sequence. 1. Call pre VM group migrate API. 2. Migrate (by vmotion,in place, etc.,) VMs in the VM group. This step will be done by user independent of MC. 3. Call post VM group migrate API with the same VM group id used in the pre VM group migrate API. This API specifically deals with pre VM group migrate API. When pre VM group migrate API is invoked for a VM group id, MC performs following actions. - Checks segmentation realization state. - Creates segment ports. - Creates temporary security groups. + // + // @param preVmGroupMigrationSpecParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Premigrate(preVmGroupMigrationSpecParam model.PreVmGroupMigrationSpec) error +} + +type vmgroupClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewVmgroupClient(connector client.Connector) *vmgroupClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.vmgroup") + methodIdentifiers := map[string]core.MethodIdentifier{ + "postmigrate": core.NewMethodIdentifier(interfaceIdentifier, "postmigrate"), + "premigrate": core.NewMethodIdentifier(interfaceIdentifier, "premigrate"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + vIface := vmgroupClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &vIface +} + +func (vIface *vmgroupClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := vIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (vIface *vmgroupClient) Postmigrate(postVmGroupMigrationSpecParam model.PostVmGroupMigrationSpec) error { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(vmgroupPostmigrateInputType(), typeConverter) + sv.AddStructField("PostVmGroupMigrationSpec", postVmGroupMigrationSpecParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := vmgroupPostmigrateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.vmgroup", "postmigrate", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (vIface *vmgroupClient) Premigrate(preVmGroupMigrationSpecParam model.PreVmGroupMigrationSpec) error { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(vmgroupPremigrateInputType(), typeConverter) + sv.AddStructField("PreVmGroupMigrationSpec", preVmGroupMigrationSpecParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := vmgroupPremigrateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.vmgroup", "premigrate", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/VmgroupTypes.go b/services/nsxt-mp/nsx/migration/VmgroupTypes.go new file mode 100644 index 000000000..2fa2b74b7 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/VmgroupTypes.go @@ -0,0 +1,115 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Vmgroup. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func vmgroupPostmigrateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["post_vm_group_migration_spec"] = bindings.NewReferenceType(model.PostVmGroupMigrationSpecBindingType) + fieldNameMap["post_vm_group_migration_spec"] = "PostVmGroupMigrationSpec" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func vmgroupPostmigrateOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func vmgroupPostmigrateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["post_vm_group_migration_spec"] = bindings.NewReferenceType(model.PostVmGroupMigrationSpecBindingType) + fieldNameMap["post_vm_group_migration_spec"] = "PostVmGroupMigrationSpec" + paramsTypeMap["post_vm_group_migration_spec"] = bindings.NewReferenceType(model.PostVmGroupMigrationSpecBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=post_migrate", + "post_vm_group_migration_spec", + "POST", + "/api/v1/migration/vmgroup", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func vmgroupPremigrateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["pre_vm_group_migration_spec"] = bindings.NewReferenceType(model.PreVmGroupMigrationSpecBindingType) + fieldNameMap["pre_vm_group_migration_spec"] = "PreVmGroupMigrationSpec" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func vmgroupPremigrateOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func vmgroupPremigrateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["pre_vm_group_migration_spec"] = bindings.NewReferenceType(model.PreVmGroupMigrationSpecBindingType) + fieldNameMap["pre_vm_group_migration_spec"] = "PreVmGroupMigrationSpec" + paramsTypeMap["pre_vm_group_migration_spec"] = bindings.NewReferenceType(model.PreVmGroupMigrationSpecBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=pre_migrate", + "pre_vm_group_migration_spec", + "POST", + "/api/v1/migration/vmgroup", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/logical_constructs/LogicalConstructsPackageTypes.go b/services/nsxt-mp/nsx/migration/logical_constructs/LogicalConstructsPackageTypes.go new file mode 100644 index 000000000..070c2d5eb --- /dev/null +++ b/services/nsxt-mp/nsx/migration/logical_constructs/LogicalConstructsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.migration.logical_constructs. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_constructs diff --git a/services/nsxt-mp/nsx/migration/logical_constructs/StatsClient.go b/services/nsxt-mp/nsx/migration/logical_constructs/StatsClient.go new file mode 100644 index 000000000..a5ede2963 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/logical_constructs/StatsClient.go @@ -0,0 +1,98 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Stats +// Used by client-side stubs. + +package logical_constructs + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatsClient interface { + + // Get migration stats for logical constructs phase. This API can be polled for getting runtime progress of the migration from source to target. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.LogicalConstructMigrationStatsListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Getall(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LogicalConstructMigrationStatsListResult, error) +} + +type statsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatsClient(connector client.Connector) *statsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.logical_constructs.stats") + methodIdentifiers := map[string]core.MethodIdentifier{ + "getall": core.NewMethodIdentifier(interfaceIdentifier, "getall"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statsClient) Getall(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.LogicalConstructMigrationStatsListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statsGetallInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LogicalConstructMigrationStatsListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statsGetallRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.logical_constructs.stats", "getall", inputDataValue, executionContext) + var emptyOutput model.LogicalConstructMigrationStatsListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statsGetallOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LogicalConstructMigrationStatsListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/logical_constructs/StatsTypes.go b/services/nsxt-mp/nsx/migration/logical_constructs/StatsTypes.go new file mode 100644 index 000000000..db084bb46 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/logical_constructs/StatsTypes.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Stats. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package logical_constructs + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statsGetallInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statsGetallOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LogicalConstructMigrationStatsListResultBindingType) +} + +func statsGetallRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/logical-constructs/stats", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/migration_unit_groups/AggregateInfoClient.go b/services/nsxt-mp/nsx/migration/migration_unit_groups/AggregateInfoClient.go new file mode 100644 index 000000000..59b996c29 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/migration_unit_groups/AggregateInfoClient.go @@ -0,0 +1,104 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: AggregateInfo +// Used by client-side stubs. + +package migration_unit_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AggregateInfoClient interface { + + // Return information of all migration unit groups in the migration plan. If request parameter summary is set to true, then only count of migration units will be returned, migration units list will be empty. If request parameter component type is specified, then all migration unit groups for that component will be returned. + // + // @param componentTypeParam Component type based on which migration unit groups to be filtered (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param summaryParam Flag indicating whether to return summary (optional, default to false) + // @param syncParam Synchronize before returning migration unit groups (optional, default to false) + // @return com.vmware.nsx.model.MigrationUnitGroupAggregateInfoListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(componentTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, summaryParam *bool, syncParam *bool) (model.MigrationUnitGroupAggregateInfoListResult, error) +} + +type aggregateInfoClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAggregateInfoClient(connector client.Connector) *aggregateInfoClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.migration_unit_groups.aggregate_info") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := aggregateInfoClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *aggregateInfoClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *aggregateInfoClient) List(componentTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, summaryParam *bool, syncParam *bool) (model.MigrationUnitGroupAggregateInfoListResult, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(aggregateInfoListInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Summary", summaryParam) + sv.AddStructField("Sync", syncParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationUnitGroupAggregateInfoListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := aggregateInfoListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.migration_unit_groups.aggregate_info", "list", inputDataValue, executionContext) + var emptyOutput model.MigrationUnitGroupAggregateInfoListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), aggregateInfoListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationUnitGroupAggregateInfoListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/migration_unit_groups/AggregateInfoTypes.go b/services/nsxt-mp/nsx/migration/migration_unit_groups/AggregateInfoTypes.go new file mode 100644 index 000000000..9bd5ecf66 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/migration_unit_groups/AggregateInfoTypes.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: AggregateInfo. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration_unit_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func aggregateInfoListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["summary"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sync"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["summary"] = "Summary" + fieldNameMap["sync"] = "Sync" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func aggregateInfoListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationUnitGroupAggregateInfoListResultBindingType) +} + +func aggregateInfoListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["summary"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sync"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["summary"] = "Summary" + fieldNameMap["sync"] = "Sync" + paramsTypeMap["sync"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["summary"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["summary"] = "summary" + queryParams["component_type"] = "component_type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["sync"] = "sync" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/migration-unit-groups/aggregate-info", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/migration_unit_groups/MigrationUnitClient.go b/services/nsxt-mp/nsx/migration/migration_unit_groups/MigrationUnitClient.go new file mode 100644 index 000000000..2e4425f8c --- /dev/null +++ b/services/nsxt-mp/nsx/migration/migration_unit_groups/MigrationUnitClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MigrationUnit +// Used by client-side stubs. + +package migration_unit_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MigrationUnitClient interface { + + // Reorder an migration unit within the migration unit group by placing it before/after the specified migration unit + // + // @param groupIdParam (required) + // @param migrationUnitIdParam (required) + // @param reorderMigrationRequestParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Reorder(groupIdParam string, migrationUnitIdParam string, reorderMigrationRequestParam model.ReorderMigrationRequest) error +} + +type migrationUnitClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMigrationUnitClient(connector client.Connector) *migrationUnitClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.migration_unit_groups.migration_unit") + methodIdentifiers := map[string]core.MethodIdentifier{ + "reorder": core.NewMethodIdentifier(interfaceIdentifier, "reorder"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := migrationUnitClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *migrationUnitClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *migrationUnitClient) Reorder(groupIdParam string, migrationUnitIdParam string, reorderMigrationRequestParam model.ReorderMigrationRequest) error { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(migrationUnitReorderInputType(), typeConverter) + sv.AddStructField("GroupId", groupIdParam) + sv.AddStructField("MigrationUnitId", migrationUnitIdParam) + sv.AddStructField("ReorderMigrationRequest", reorderMigrationRequestParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := migrationUnitReorderRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.migration_unit_groups.migration_unit", "reorder", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/migration_unit_groups/MigrationUnitGroupsPackageTypes.go b/services/nsxt-mp/nsx/migration/migration_unit_groups/MigrationUnitGroupsPackageTypes.go new file mode 100644 index 000000000..65fe7e614 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/migration_unit_groups/MigrationUnitGroupsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.migration.migration_unit_groups. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration_unit_groups diff --git a/services/nsxt-mp/nsx/migration/migration_unit_groups/MigrationUnitTypes.go b/services/nsxt-mp/nsx/migration/migration_unit_groups/MigrationUnitTypes.go new file mode 100644 index 000000000..fc7ca1433 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/migration_unit_groups/MigrationUnitTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MigrationUnit. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration_unit_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func migrationUnitReorderInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["group_id"] = bindings.NewStringType() + fields["migration_unit_id"] = bindings.NewStringType() + fields["reorder_migration_request"] = bindings.NewReferenceType(model.ReorderMigrationRequestBindingType) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["migration_unit_id"] = "MigrationUnitId" + fieldNameMap["reorder_migration_request"] = "ReorderMigrationRequest" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func migrationUnitReorderOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func migrationUnitReorderRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["group_id"] = bindings.NewStringType() + fields["migration_unit_id"] = bindings.NewStringType() + fields["reorder_migration_request"] = bindings.NewReferenceType(model.ReorderMigrationRequestBindingType) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["migration_unit_id"] = "MigrationUnitId" + fieldNameMap["reorder_migration_request"] = "ReorderMigrationRequest" + paramsTypeMap["reorder_migration_request"] = bindings.NewReferenceType(model.ReorderMigrationRequestBindingType) + paramsTypeMap["group_id"] = bindings.NewStringType() + paramsTypeMap["migration_unit_id"] = bindings.NewStringType() + paramsTypeMap["groupId"] = bindings.NewStringType() + paramsTypeMap["migrationUnitId"] = bindings.NewStringType() + pathParams["group_id"] = "groupId" + pathParams["migration_unit_id"] = "migrationUnitId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=reorder", + "reorder_migration_request", + "POST", + "/api/v1/migration/migration-unit-groups/{groupId}/migration-unit/{migrationUnitId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/migration_unit_groups/StatusClient.go b/services/nsxt-mp/nsx/migration/migration_unit_groups/StatusClient.go new file mode 100644 index 000000000..4bb9e6693 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/migration_unit_groups/StatusClient.go @@ -0,0 +1,102 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package migration_unit_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Get migration status for migration units in the specified group. User can specify whether to show only the migration units with errors. + // + // @param groupIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param hasErrorsParam Flag to indicate whether to return only migration units with errors (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.MigrationUnitStatusListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(groupIdParam string, cursorParam *string, hasErrorsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.MigrationUnitStatusListResult, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.migration_unit_groups.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) List(groupIdParam string, cursorParam *string, hasErrorsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.MigrationUnitStatusListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusListInputType(), typeConverter) + sv.AddStructField("GroupId", groupIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("HasErrors", hasErrorsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationUnitStatusListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.migration_unit_groups.status", "list", inputDataValue, executionContext) + var emptyOutput model.MigrationUnitStatusListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationUnitStatusListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/migration_unit_groups/StatusTypes.go b/services/nsxt-mp/nsx/migration/migration_unit_groups/StatusTypes.go new file mode 100644 index 000000000..5b36f9ea6 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/migration_unit_groups/StatusTypes.go @@ -0,0 +1,105 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration_unit_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["has_errors"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["has_errors"] = "HasErrors" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationUnitStatusListResultBindingType) +} + +func statusListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["has_errors"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["has_errors"] = "HasErrors" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["group_id"] = bindings.NewStringType() + paramsTypeMap["has_errors"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["groupId"] = bindings.NewStringType() + pathParams["group_id"] = "groupId" + queryParams["cursor"] = "cursor" + queryParams["has_errors"] = "has_errors" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/migration-unit-groups/{groupId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/migration_units/AggregateInfoClient.go b/services/nsxt-mp/nsx/migration/migration_units/AggregateInfoClient.go new file mode 100644 index 000000000..4b7c40dfd --- /dev/null +++ b/services/nsxt-mp/nsx/migration/migration_units/AggregateInfoClient.go @@ -0,0 +1,108 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: AggregateInfo +// Used by client-side stubs. + +package migration_units + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AggregateInfoClient interface { + + // Get migration units aggregate-info + // + // @param componentTypeParam Component type based on which migration units to be filtered (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param groupIdParam Identifier of group based on which migration units to be filtered (optional) + // @param hasErrorsParam Flag to indicate whether to return only migration units with errors (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param metadataParam Metadata about migration unit to filter on (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param selectionStatusParam Flag to indicate whether to return only selected, only deselected or both type of migration units (optional, default to ALL) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.MigrationUnitAggregateInfoListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(componentTypeParam *string, cursorParam *string, groupIdParam *string, hasErrorsParam *bool, includedFieldsParam *string, metadataParam *string, pageSizeParam *int64, selectionStatusParam *string, sortAscendingParam *bool, sortByParam *string) (model.MigrationUnitAggregateInfoListResult, error) +} + +type aggregateInfoClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAggregateInfoClient(connector client.Connector) *aggregateInfoClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.migration_units.aggregate_info") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := aggregateInfoClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *aggregateInfoClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *aggregateInfoClient) List(componentTypeParam *string, cursorParam *string, groupIdParam *string, hasErrorsParam *bool, includedFieldsParam *string, metadataParam *string, pageSizeParam *int64, selectionStatusParam *string, sortAscendingParam *bool, sortByParam *string) (model.MigrationUnitAggregateInfoListResult, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(aggregateInfoListInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("GroupId", groupIdParam) + sv.AddStructField("HasErrors", hasErrorsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("Metadata", metadataParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SelectionStatus", selectionStatusParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationUnitAggregateInfoListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := aggregateInfoListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.migration_units.aggregate_info", "list", inputDataValue, executionContext) + var emptyOutput model.MigrationUnitAggregateInfoListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), aggregateInfoListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationUnitAggregateInfoListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/migration_units/AggregateInfoTypes.go b/services/nsxt-mp/nsx/migration/migration_units/AggregateInfoTypes.go new file mode 100644 index 000000000..9d178f9b5 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/migration_units/AggregateInfoTypes.go @@ -0,0 +1,131 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: AggregateInfo. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration_units + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``selectionStatus`` of method AggregateInfo#list. +const AggregateInfo_LIST_SELECTION_STATUS_SELECTED = "SELECTED" + +// Possible value for ``selectionStatus`` of method AggregateInfo#list. +const AggregateInfo_LIST_SELECTION_STATUS_DESELECTED = "DESELECTED" + +// Possible value for ``selectionStatus`` of method AggregateInfo#list. +const AggregateInfo_LIST_SELECTION_STATUS_ALL = "ALL" + +func aggregateInfoListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["has_errors"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["metadata"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["selection_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["has_errors"] = "HasErrors" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["metadata"] = "Metadata" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["selection_status"] = "SelectionStatus" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func aggregateInfoListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationUnitAggregateInfoListResultBindingType) +} + +func aggregateInfoListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["has_errors"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["metadata"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["selection_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["has_errors"] = "HasErrors" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["metadata"] = "Metadata" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["selection_status"] = "SelectionStatus" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["selection_status"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["has_errors"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["metadata"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["has_errors"] = "has_errors" + queryParams["component_type"] = "component_type" + queryParams["metadata"] = "metadata" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["group_id"] = "group_id" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["selection_status"] = "selection_status" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/migration-units/aggregate-info", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/migration_units/MigrationUnitsPackageTypes.go b/services/nsxt-mp/nsx/migration/migration_units/MigrationUnitsPackageTypes.go new file mode 100644 index 000000000..43f0a04cf --- /dev/null +++ b/services/nsxt-mp/nsx/migration/migration_units/MigrationUnitsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.migration.migration_units. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration_units diff --git a/services/nsxt-mp/nsx/migration/mp_policy_promotion/HistoryClient.go b/services/nsxt-mp/nsx/migration/mp_policy_promotion/HistoryClient.go new file mode 100644 index 000000000..d18dac9e5 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/mp_policy_promotion/HistoryClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: History +// Used by client-side stubs. + +package mp_policy_promotion + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type HistoryClient interface { + + // This api is used to get migration history. + // @return com.vmware.nsx.model.MPPolicyPromotionHistoryList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.MPPolicyPromotionHistoryList, error) +} + +type historyClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewHistoryClient(connector client.Connector) *historyClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.mp_policy_promotion.history") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + hIface := historyClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &hIface +} + +func (hIface *historyClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := hIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (hIface *historyClient) Get() (model.MPPolicyPromotionHistoryList, error) { + typeConverter := hIface.connector.TypeConverter() + executionContext := hIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(historyGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MPPolicyPromotionHistoryList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := historyGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + hIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := hIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.mp_policy_promotion.history", "get", inputDataValue, executionContext) + var emptyOutput model.MPPolicyPromotionHistoryList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), historyGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MPPolicyPromotionHistoryList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), hIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/mp_policy_promotion/HistoryTypes.go b/services/nsxt-mp/nsx/migration/mp_policy_promotion/HistoryTypes.go new file mode 100644 index 000000000..25ca87ba6 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/mp_policy_promotion/HistoryTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: History. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package mp_policy_promotion + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func historyGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func historyGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MPPolicyPromotionHistoryListBindingType) +} + +func historyGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/mp-policy-promotion/history", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/mp_policy_promotion/MpPolicyPromotionPackageTypes.go b/services/nsxt-mp/nsx/migration/mp_policy_promotion/MpPolicyPromotionPackageTypes.go new file mode 100644 index 000000000..ebb373a74 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/mp_policy_promotion/MpPolicyPromotionPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.migration.mp_policy_promotion. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package mp_policy_promotion diff --git a/services/nsxt-mp/nsx/migration/mp_policy_promotion/StateClient.go b/services/nsxt-mp/nsx/migration/mp_policy_promotion/StateClient.go new file mode 100644 index 000000000..fc5722992 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/mp_policy_promotion/StateClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: State +// Used by client-side stubs. + +package mp_policy_promotion + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StateClient interface { + + // This api is used to get promotion state. + // @return com.vmware.nsx.model.MPPolicyPromotionState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.MPPolicyPromotionState, error) +} + +type stateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStateClient(connector client.Connector) *stateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.mp_policy_promotion.state") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := stateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *stateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *stateClient) Get() (model.MPPolicyPromotionState, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(stateGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MPPolicyPromotionState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.mp_policy_promotion.state", "get", inputDataValue, executionContext) + var emptyOutput model.MPPolicyPromotionState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MPPolicyPromotionState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/mp_policy_promotion/StateTypes.go b/services/nsxt-mp/nsx/migration/mp_policy_promotion/StateTypes.go new file mode 100644 index 000000000..a217dcad6 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/mp_policy_promotion/StateTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: State. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package mp_policy_promotion + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func stateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MPPolicyPromotionStateBindingType) +} + +func stateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/mp-policy-promotion/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/mp_to_policy/CancelClient.go b/services/nsxt-mp/nsx/migration/mp_to_policy/CancelClient.go new file mode 100644 index 000000000..d891f344f --- /dev/null +++ b/services/nsxt-mp/nsx/migration/mp_to_policy/CancelClient.go @@ -0,0 +1,79 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Cancel +// Used by client-side stubs. + +package mp_to_policy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +const _ = core.SupportedByRuntimeVersion1 + +type CancelClient interface { + + // This will cancel the on-going promotion and system will be restored to original state as before promotion. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create() error +} + +type cancelClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewCancelClient(connector client.Connector) *cancelClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.mp_to_policy.cancel") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := cancelClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *cancelClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *cancelClient) Create() error { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(cancelCreateInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := cancelCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.mp_to_policy.cancel", "create", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/mp_to_policy/CancelTypes.go b/services/nsxt-mp/nsx/migration/mp_to_policy/CancelTypes.go new file mode 100644 index 000000000..95648c722 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/mp_to_policy/CancelTypes.go @@ -0,0 +1,61 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Cancel. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package mp_to_policy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "reflect" +) + +func cancelCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func cancelCreateOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func cancelCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "POST", + "/api/v1/migration/mp-to-policy/cancel", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/mp_to_policy/FeedbackClient.go b/services/nsxt-mp/nsx/migration/mp_to_policy/FeedbackClient.go new file mode 100644 index 000000000..d25bbf0ce --- /dev/null +++ b/services/nsxt-mp/nsx/migration/mp_to_policy/FeedbackClient.go @@ -0,0 +1,106 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Feedback +// Used by client-side stubs. + +package mp_to_policy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type FeedbackClient interface { + + // To get MP2Policy promotion feedback. This gives all the validation errors or failures during PRECHECK / APPLY phase. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param locationParam Location flag (optional, default to CURRENT) + // @param mpDisplayNameParam Specify the mp resource display name to filter corresponding feedbacks. (optional) + // @param mpIdParam Specify the mp resource id to filter corresponding feedbacks. (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param resourceTypeParam Specify the mp resource type to filter corresponding feedbacks. (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.FeedBackListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, locationParam *string, mpDisplayNameParam *string, mpIdParam *string, pageSizeParam *int64, resourceTypeParam *string, sortAscendingParam *bool, sortByParam *string) (model.FeedBackListResult, error) +} + +type feedbackClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewFeedbackClient(connector client.Connector) *feedbackClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.mp_to_policy.feedback") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + fIface := feedbackClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &fIface +} + +func (fIface *feedbackClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := fIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (fIface *feedbackClient) List(cursorParam *string, includedFieldsParam *string, locationParam *string, mpDisplayNameParam *string, mpIdParam *string, pageSizeParam *int64, resourceTypeParam *string, sortAscendingParam *bool, sortByParam *string) (model.FeedBackListResult, error) { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(feedbackListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("Location", locationParam) + sv.AddStructField("MpDisplayName", mpDisplayNameParam) + sv.AddStructField("MpId", mpIdParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("ResourceType", resourceTypeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FeedBackListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := feedbackListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.mp_to_policy.feedback", "list", inputDataValue, executionContext) + var emptyOutput model.FeedBackListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), feedbackListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FeedBackListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/mp_to_policy/FeedbackTypes.go b/services/nsxt-mp/nsx/migration/mp_to_policy/FeedbackTypes.go new file mode 100644 index 000000000..07774fa91 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/mp_to_policy/FeedbackTypes.go @@ -0,0 +1,122 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Feedback. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package mp_to_policy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``location`` of method Feedback#list. +const Feedback_LIST_LOCATION_CURRENT = "CURRENT" + +// Possible value for ``location`` of method Feedback#list. +const Feedback_LIST_LOCATION_ARCHIVED = "ARCHIVED" + +func feedbackListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["location"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["mp_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["mp_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["location"] = "Location" + fieldNameMap["mp_display_name"] = "MpDisplayName" + fieldNameMap["mp_id"] = "MpId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["resource_type"] = "ResourceType" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func feedbackListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FeedBackListResultBindingType) +} + +func feedbackListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["location"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["mp_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["mp_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["location"] = "Location" + fieldNameMap["mp_display_name"] = "MpDisplayName" + fieldNameMap["mp_id"] = "MpId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["resource_type"] = "ResourceType" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["mp_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["location"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["mp_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["mp_id"] = "mp_id" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["resource_type"] = "resource_type" + queryParams["location"] = "location" + queryParams["sort_by"] = "sort_by" + queryParams["mp_display_name"] = "mp_display_name" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/mp-to-policy/feedback", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/mp_to_policy/MpToPolicyPackageTypes.go b/services/nsxt-mp/nsx/migration/mp_to_policy/MpToPolicyPackageTypes.go new file mode 100644 index 000000000..8a65e7288 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/mp_to_policy/MpToPolicyPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.migration.mp_to_policy. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package mp_to_policy diff --git a/services/nsxt-mp/nsx/migration/mp_to_policy/StatsClient.go b/services/nsxt-mp/nsx/migration/mp_to_policy/StatsClient.go new file mode 100644 index 000000000..f9be982fe --- /dev/null +++ b/services/nsxt-mp/nsx/migration/mp_to_policy/StatsClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Stats +// Used by client-side stubs. + +package mp_to_policy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatsClient interface { + + // To get MP2Policy promotion stats. This gives detailed information about promotion progess per resource type like what's the promotion status, how many resources has been promoted etc. + // + // @param locationParam Location flag (optional, default to CURRENT) + // @param prePromotionParam Flag to indicate whether to get collection stats before triggering promotion (optional, default to false) + // @return com.vmware.nsx.model.MigrationStatsResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(locationParam *string, prePromotionParam *bool) (model.MigrationStatsResult, error) +} + +type statsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatsClient(connector client.Connector) *statsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.mp_to_policy.stats") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statsClient) Get(locationParam *string, prePromotionParam *bool) (model.MigrationStatsResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statsGetInputType(), typeConverter) + sv.AddStructField("Location", locationParam) + sv.AddStructField("PrePromotion", prePromotionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationStatsResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.mp_to_policy.stats", "get", inputDataValue, executionContext) + var emptyOutput model.MigrationStatsResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationStatsResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/mp_to_policy/StatsTypes.go b/services/nsxt-mp/nsx/migration/mp_to_policy/StatsTypes.go new file mode 100644 index 000000000..b4c77f29e --- /dev/null +++ b/services/nsxt-mp/nsx/migration/mp_to_policy/StatsTypes.go @@ -0,0 +1,80 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Stats. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package mp_to_policy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``location`` of method Stats#get. +const Stats_GET_LOCATION_CURRENT = "CURRENT" + +// Possible value for ``location`` of method Stats#get. +const Stats_GET_LOCATION_ARCHIVED = "ARCHIVED" + +func statsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["location"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["pre_promotion"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["location"] = "Location" + fieldNameMap["pre_promotion"] = "PrePromotion" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationStatsResultBindingType) +} + +func statsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["location"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["pre_promotion"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["location"] = "Location" + fieldNameMap["pre_promotion"] = "PrePromotion" + paramsTypeMap["location"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["pre_promotion"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["pre_promotion"] = "pre_promotion" + queryParams["location"] = "location" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/mp-to-policy/stats", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/plan/PlanPackageTypes.go b/services/nsxt-mp/nsx/migration/plan/PlanPackageTypes.go new file mode 100644 index 000000000..3d41ce58d --- /dev/null +++ b/services/nsxt-mp/nsx/migration/plan/PlanPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.migration.plan. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package plan diff --git a/services/nsxt-mp/nsx/migration/plan/SettingsClient.go b/services/nsxt-mp/nsx/migration/plan/SettingsClient.go new file mode 100644 index 000000000..68fed782d --- /dev/null +++ b/services/nsxt-mp/nsx/migration/plan/SettingsClient.go @@ -0,0 +1,135 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Settings +// Used by client-side stubs. + +package plan + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SettingsClient interface { + + // Get the migration plan settings for the component. + // + // @param componentTypeParam (required) + // @return com.vmware.nsx.model.MigrationPlanSettings + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(componentTypeParam string) (model.MigrationPlanSettings, error) + + // Update the migration plan settings for the component. + // + // @param componentTypeParam (required) + // @param migrationPlanSettingsParam (required) + // @return com.vmware.nsx.model.MigrationPlanSettings + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(componentTypeParam string, migrationPlanSettingsParam model.MigrationPlanSettings) (model.MigrationPlanSettings, error) +} + +type settingsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSettingsClient(connector client.Connector) *settingsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.plan.settings") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := settingsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *settingsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *settingsClient) Get(componentTypeParam string) (model.MigrationPlanSettings, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(settingsGetInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationPlanSettings + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := settingsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.plan.settings", "get", inputDataValue, executionContext) + var emptyOutput model.MigrationPlanSettings + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), settingsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationPlanSettings), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *settingsClient) Update(componentTypeParam string, migrationPlanSettingsParam model.MigrationPlanSettings) (model.MigrationPlanSettings, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(settingsUpdateInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + sv.AddStructField("MigrationPlanSettings", migrationPlanSettingsParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MigrationPlanSettings + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := settingsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.plan.settings", "update", inputDataValue, executionContext) + var emptyOutput model.MigrationPlanSettings + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), settingsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MigrationPlanSettings), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/plan/SettingsTypes.go b/services/nsxt-mp/nsx/migration/plan/SettingsTypes.go new file mode 100644 index 000000000..e3eec45b2 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/plan/SettingsTypes.go @@ -0,0 +1,124 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Settings. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package plan + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func settingsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewStringType() + fieldNameMap["component_type"] = "ComponentType" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func settingsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationPlanSettingsBindingType) +} + +func settingsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewStringType() + fieldNameMap["component_type"] = "ComponentType" + paramsTypeMap["component_type"] = bindings.NewStringType() + paramsTypeMap["componentType"] = bindings.NewStringType() + pathParams["component_type"] = "componentType" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/plan/{componentType}/settings", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func settingsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewStringType() + fields["migration_plan_settings"] = bindings.NewReferenceType(model.MigrationPlanSettingsBindingType) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["migration_plan_settings"] = "MigrationPlanSettings" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func settingsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MigrationPlanSettingsBindingType) +} + +func settingsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewStringType() + fields["migration_plan_settings"] = bindings.NewReferenceType(model.MigrationPlanSettingsBindingType) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["migration_plan_settings"] = "MigrationPlanSettings" + paramsTypeMap["component_type"] = bindings.NewStringType() + paramsTypeMap["migration_plan_settings"] = bindings.NewReferenceType(model.MigrationPlanSettingsBindingType) + paramsTypeMap["componentType"] = bindings.NewStringType() + pathParams["component_type"] = "componentType" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "migration_plan_settings", + "PUT", + "/api/v1/migration/plan/{componentType}/settings", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/migration/plan/SiteMigrationStateClient.go b/services/nsxt-mp/nsx/migration/plan/SiteMigrationStateClient.go new file mode 100644 index 000000000..6f2fba851 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/plan/SiteMigrationStateClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: SiteMigrationState +// Used by client-side stubs. + +package plan + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SiteMigrationStateClient interface { + + // This API returns the migration-state of all the federation sites. + // @return com.vmware.nsx.model.FederationSiteMigrationState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.FederationSiteMigrationState, error) +} + +type siteMigrationStateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSiteMigrationStateClient(connector client.Connector) *siteMigrationStateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.migration.plan.site_migration_state") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := siteMigrationStateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *siteMigrationStateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *siteMigrationStateClient) Get() (model.FederationSiteMigrationState, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(siteMigrationStateGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FederationSiteMigrationState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := siteMigrationStateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.migration.plan.site_migration_state", "get", inputDataValue, executionContext) + var emptyOutput model.FederationSiteMigrationState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), siteMigrationStateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FederationSiteMigrationState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/migration/plan/SiteMigrationStateTypes.go b/services/nsxt-mp/nsx/migration/plan/SiteMigrationStateTypes.go new file mode 100644 index 000000000..bf2fd5423 --- /dev/null +++ b/services/nsxt-mp/nsx/migration/plan/SiteMigrationStateTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: SiteMigrationState. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package plan + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func siteMigrationStateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func siteMigrationStateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FederationSiteMigrationStateBindingType) +} + +func siteMigrationStateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/migration/plan/site-migration-state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/mirror_sessions/MirrorSessionsPackageTypes.go b/services/nsxt-mp/nsx/mirror_sessions/MirrorSessionsPackageTypes.go new file mode 100644 index 000000000..945427567 --- /dev/null +++ b/services/nsxt-mp/nsx/mirror_sessions/MirrorSessionsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.mirror_sessions. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package mirror_sessions diff --git a/services/nsxt-mp/nsx/mirror_sessions/MirrorStackStatusClient.go b/services/nsxt-mp/nsx/mirror_sessions/MirrorStackStatusClient.go new file mode 100644 index 000000000..be6d47499 --- /dev/null +++ b/services/nsxt-mp/nsx/mirror_sessions/MirrorStackStatusClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MirrorStackStatus +// Used by client-side stubs. + +package mirror_sessions + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MirrorStackStatusClient interface { + + // Get the mirror stack status on given remote L3 mirror session + // + // @param mirrorSessionIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.MirrorStackStatusListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(mirrorSessionIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.MirrorStackStatusListResult, error) +} + +type mirrorStackStatusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMirrorStackStatusClient(connector client.Connector) *mirrorStackStatusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.mirror_sessions.mirror_stack_status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := mirrorStackStatusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *mirrorStackStatusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *mirrorStackStatusClient) List(mirrorSessionIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.MirrorStackStatusListResult, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(mirrorStackStatusListInputType(), typeConverter) + sv.AddStructField("MirrorSessionId", mirrorSessionIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MirrorStackStatusListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := mirrorStackStatusListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.mirror_sessions.mirror_stack_status", "list", inputDataValue, executionContext) + var emptyOutput model.MirrorStackStatusListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), mirrorStackStatusListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MirrorStackStatusListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/mirror_sessions/MirrorStackStatusTypes.go b/services/nsxt-mp/nsx/mirror_sessions/MirrorStackStatusTypes.go new file mode 100644 index 000000000..6ef1dd957 --- /dev/null +++ b/services/nsxt-mp/nsx/mirror_sessions/MirrorStackStatusTypes.go @@ -0,0 +1,99 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MirrorStackStatus. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package mirror_sessions + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func mirrorStackStatusListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mirror_session_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mirror_session_id"] = "MirrorSessionId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func mirrorStackStatusListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MirrorStackStatusListResultBindingType) +} + +func mirrorStackStatusListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["mirror_session_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mirror_session_id"] = "MirrorSessionId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["mirror_session_id"] = bindings.NewStringType() + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["mirrorSessionId"] = bindings.NewStringType() + pathParams["mirror_session_id"] = "mirrorSessionId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/mirror-sessions/{mirrorSessionId}/mirror-stack-status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/model/ModelPackageTypes.go b/services/nsxt-mp/nsx/model/ModelPackageTypes.go new file mode 100644 index 000000000..848394efd --- /dev/null +++ b/services/nsxt-mp/nsx/model/ModelPackageTypes.go @@ -0,0 +1,100187 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.model. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package model + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/log" + "reflect" +) + +// An NSService element that represents an ALG protocol +type ALGTypeNSService struct { + // Possible values are: + // + // * ALGTypeNSService#ALGTypeNSService_ALG_ORACLE_TNS + // * ALGTypeNSService#ALGTypeNSService_ALG_FTP + // * ALGTypeNSService#ALGTypeNSService_ALG_SUN_RPC_TCP + // * ALGTypeNSService#ALGTypeNSService_ALG_SUN_RPC_UDP + // * ALGTypeNSService#ALGTypeNSService_ALG_MS_RPC_TCP + // * ALGTypeNSService#ALGTypeNSService_ALG_MS_RPC_UDP + // * ALGTypeNSService#ALGTypeNSService_ALG_NBNS_BROADCAST + // * ALGTypeNSService#ALGTypeNSService_ALG_NBDG_BROADCAST + // * ALGTypeNSService#ALGTypeNSService_ALG_TFTP + // + // The Application Layer Gateway (ALG) protocol. Please note, protocol NBNS_BROADCAST and NBDG_BROADCAST are deprecated. Please use UDP protocol and create L4 Port Set type of service instead. + Alg *string + // The destination_port cannot be empty and must be a single value. format: port-or-range + DestinationPorts []string + // Source ports format: port-or-range + SourcePorts []string + // Possible values are: + // + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_ETHERTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_IPPROTOCOLNSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_IGMPTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_ICMPTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_ALGTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_L4PORTSETNSSERVICE + // + // The specific type of NSServiceElement + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ALGTypeNSService__TYPE_IDENTIFIER = "ALGTypeNSService" +const ALGTypeNSService_ALG_ORACLE_TNS = "ORACLE_TNS" +const ALGTypeNSService_ALG_FTP = "FTP" +const ALGTypeNSService_ALG_SUN_RPC_TCP = "SUN_RPC_TCP" +const ALGTypeNSService_ALG_SUN_RPC_UDP = "SUN_RPC_UDP" +const ALGTypeNSService_ALG_MS_RPC_TCP = "MS_RPC_TCP" +const ALGTypeNSService_ALG_MS_RPC_UDP = "MS_RPC_UDP" +const ALGTypeNSService_ALG_NBNS_BROADCAST = "NBNS_BROADCAST" +const ALGTypeNSService_ALG_NBDG_BROADCAST = "NBDG_BROADCAST" +const ALGTypeNSService_ALG_TFTP = "TFTP" + +func (s *ALGTypeNSService) GetType__() bindings.BindingType { + return ALGTypeNSServiceBindingType() +} + +func (s *ALGTypeNSService) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ALGTypeNSService._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AcceptableComponentVersion struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // List of component versions + AcceptableVersions []string + // Possible values are: + // + // * AcceptableComponentVersion#AcceptableComponentVersion_COMPONENT_TYPE_HOST + // * AcceptableComponentVersion#AcceptableComponentVersion_COMPONENT_TYPE_EDGE + // * AcceptableComponentVersion#AcceptableComponentVersion_COMPONENT_TYPE_CCP + // * AcceptableComponentVersion#AcceptableComponentVersion_COMPONENT_TYPE_MP + // + // Node type + ComponentType *string +} + +const AcceptableComponentVersion_COMPONENT_TYPE_HOST = "HOST" +const AcceptableComponentVersion_COMPONENT_TYPE_EDGE = "EDGE" +const AcceptableComponentVersion_COMPONENT_TYPE_CCP = "CCP" +const AcceptableComponentVersion_COMPONENT_TYPE_MP = "MP" + +func (s *AcceptableComponentVersion) GetType__() bindings.BindingType { + return AcceptableComponentVersionBindingType() +} + +func (s *AcceptableComponentVersion) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AcceptableComponentVersion._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AcceptableComponentVersionList struct { + // Acceptable version whitelist for different components + Results []AcceptableComponentVersion +} + +func (s *AcceptableComponentVersionList) GetType__() bindings.BindingType { + return AcceptableComponentVersionListBindingType() +} + +func (s *AcceptableComponentVersionList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AcceptableComponentVersionList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Resources managed during restore process +type ActionableResource struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // A resource reference on which actions can be performed format: hostname-or-ip + IpAddress *string +} + +func (s *ActionableResource) GetType__() bindings.BindingType { + return ActionableResourceBindingType() +} + +func (s *ActionableResource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ActionableResource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ActionableResourceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List results + Results []ActionableResource +} + +func (s *ActionableResourceListResult) GetType__() bindings.BindingType { + return ActionableResourceListResultBindingType() +} + +func (s *ActionableResourceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ActionableResourceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ActiveStandbySyncStatus struct { + // Description of the status. + Description *string + FullSyncStatus *FullSyncStatus + // Indicates whether the data is consistent. Always returned as true when queried on an active Global Manager node. + IsDataConsistent *bool + // Percentage estimate of synchronization progress. Ranges from 0 to 100. This value is only returned when queried on an active Global Manager node. format: int64 + PercentageCompleted *int64 + // Number of entries pending synchronization. This value is only returned when queried on an active Global Manager node. format: int64 + RemainingEntriesToSend *int64 + // Name of standby site. + StandbySite *string + // Possible values are: + // + // * ActiveStandbySyncStatus#ActiveStandbySyncStatus_STATUS_UNAVAILABLE + // * ActiveStandbySyncStatus#ActiveStandbySyncStatus_STATUS_ERROR + // * ActiveStandbySyncStatus#ActiveStandbySyncStatus_STATUS_ONGOING + // * ActiveStandbySyncStatus#ActiveStandbySyncStatus_STATUS_NOT_STARTED + // + // Status of synchronization between active and standby Global Manager nodes. + Status *string + // Possible values are: + // + // * ActiveStandbySyncStatus#ActiveStandbySyncStatus_SYNC_TYPE_UNAVAILABLE + // * ActiveStandbySyncStatus#ActiveStandbySyncStatus_SYNC_TYPE_DELTA_SYNC + // * ActiveStandbySyncStatus#ActiveStandbySyncStatus_SYNC_TYPE_FULL_SYNC + // + // Type of synchronization currently in effect between active and standby Global Manager nodes. + SyncType *string +} + +const ActiveStandbySyncStatus_STATUS_UNAVAILABLE = "UNAVAILABLE" +const ActiveStandbySyncStatus_STATUS_ERROR = "ERROR" +const ActiveStandbySyncStatus_STATUS_ONGOING = "ONGOING" +const ActiveStandbySyncStatus_STATUS_NOT_STARTED = "NOT_STARTED" +const ActiveStandbySyncStatus_SYNC_TYPE_UNAVAILABLE = "UNAVAILABLE" +const ActiveStandbySyncStatus_SYNC_TYPE_DELTA_SYNC = "DELTA_SYNC" +const ActiveStandbySyncStatus_SYNC_TYPE_FULL_SYNC = "FULL_SYNC" + +func (s *ActiveStandbySyncStatus) GetType__() bindings.BindingType { + return ActiveStandbySyncStatusBindingType() +} + +func (s *ActiveStandbySyncStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ActiveStandbySyncStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AddClusterNodeSpec struct { + ControllerRoleConfig *AddControllerNodeSpec + // Display name for the node + DisplayName *string + // External identifier of the node + ExternalId *string + MgrRoleConfig *AddManagementNodeSpec +} + +func (s *AddClusterNodeSpec) GetType__() bindings.BindingType { + return AddClusterNodeSpecBindingType() +} + +func (s *AddClusterNodeSpec) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AddClusterNodeSpec._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Contains a list of cluster node VM deployment requests and optionally a clustering configuration. +type AddClusterNodeVMInfo struct { + ClusteringConfig *data.StructValue + // Cluster node VM deployment requests to be deployed by the Manager. + DeploymentRequests []ClusterNodeVMDeploymentRequest +} + +func (s *AddClusterNodeVMInfo) GetType__() bindings.BindingType { + return AddClusterNodeVMInfoBindingType() +} + +func (s *AddClusterNodeVMInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AddClusterNodeVMInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AddControllerNodeSpec struct { + ClusteringParams *ClusteringInfo + // Deprecated. Do not supply a value for this property. + ControlPlaneServerCertificate *string + HostMsgClientInfo *MsgClientInfo + MpaMsgClientInfo *MsgClientInfo + // Only use this if an id for the node already exists with MP. If not specified, then the node_id will be set to a random id. + NodeId *string + // Possible values are: + // + // * AddControllerNodeSpec#AddControllerNodeSpec_TYPE_ADDCONTROLLERNODESPEC + // + // must be set to AddControllerNodeSpec + Type_ *string +} + +const AddControllerNodeSpec_TYPE_ADDCONTROLLERNODESPEC = "AddControllerNodeSpec" + +func (s *AddControllerNodeSpec) GetType__() bindings.BindingType { + return AddControllerNodeSpecBindingType() +} + +func (s *AddControllerNodeSpec) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AddControllerNodeSpec._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Contains a list of NSX-Intelligence cluster node VM deployment requests and optionally a clustering configuration. +type AddIntelligenceClusterNodeVMInfo struct { + // Intelligence Cluster node VM deployment requests to be deployed by NSX. + DeploymentRequests []IntelligenceClusterNodeVMDeploymentRequest +} + +func (s *AddIntelligenceClusterNodeVMInfo) GetType__() bindings.BindingType { + return AddIntelligenceClusterNodeVMInfoBindingType() +} + +func (s *AddIntelligenceClusterNodeVMInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AddIntelligenceClusterNodeVMInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AddManagementNodeSpec struct { + // The certificate thumbprint of the remote node. + CertThumbprint *string + MpaMsgClientInfo *MsgClientInfo + // The password to be used to authenticate with the remote node. + Password *string + // The host address of the remote node to which to send this join request. format: ip + RemoteAddress *string + // Possible values are: + // + // * AddManagementNodeSpec#AddManagementNodeSpec_TYPE_ADDMANAGEMENTNODESPEC + // + // must be set to AddManagementNodeSpec + Type_ *string + // The username to be used to authenticate with the remote node. + UserName *string +} + +const AddManagementNodeSpec_TYPE_ADDMANAGEMENTNODESPEC = "AddManagementNodeSpec" + +func (s *AddManagementNodeSpec) GetType__() bindings.BindingType { + return AddManagementNodeSpecBindingType() +} + +func (s *AddManagementNodeSpec) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AddManagementNodeSpec._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// An address binding entry is a combination of the IP-MAC-VLAN binding for a logical port. The address bindings can be obtained via various methods like ARP snooping, DHCP snooping etc. or by user configuration. +type AddressBindingEntry struct { + Binding *PacketAddressClassifier + // Timestamp at which the binding was discovered via snooping or manually specified by the user format: int64 + BindingTimestamp *int64 + // Possible values are: + // + // * AddressBindingEntry#AddressBindingEntry_SOURCE_INVALID + // * AddressBindingEntry#AddressBindingEntry_SOURCE_UNKNOWN + // * AddressBindingEntry#AddressBindingEntry_SOURCE_USER_DEFINED + // * AddressBindingEntry#AddressBindingEntry_SOURCE_ARP_SNOOPING + // * AddressBindingEntry#AddressBindingEntry_SOURCE_DHCP_SNOOPING + // * AddressBindingEntry#AddressBindingEntry_SOURCE_VM_TOOLS + // * AddressBindingEntry#AddressBindingEntry_SOURCE_ND_SNOOPING + // * AddressBindingEntry#AddressBindingEntry_SOURCE_DHCPV6_SNOOPING + // * AddressBindingEntry#AddressBindingEntry_SOURCE_VM_TOOLS_V6 + // + // Source from which the address binding entry was obtained + Source *string +} + +const AddressBindingEntry_SOURCE_INVALID = "INVALID" +const AddressBindingEntry_SOURCE_UNKNOWN = "UNKNOWN" +const AddressBindingEntry_SOURCE_USER_DEFINED = "USER_DEFINED" +const AddressBindingEntry_SOURCE_ARP_SNOOPING = "ARP_SNOOPING" +const AddressBindingEntry_SOURCE_DHCP_SNOOPING = "DHCP_SNOOPING" +const AddressBindingEntry_SOURCE_VM_TOOLS = "VM_TOOLS" +const AddressBindingEntry_SOURCE_ND_SNOOPING = "ND_SNOOPING" +const AddressBindingEntry_SOURCE_DHCPV6_SNOOPING = "DHCPV6_SNOOPING" +const AddressBindingEntry_SOURCE_VM_TOOLS_V6 = "VM_TOOLS_V6" + +func (s *AddressBindingEntry) GetType__() bindings.BindingType { + return AddressBindingEntryBindingType() +} + +func (s *AddressBindingEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AddressBindingEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AdvanceClusterRestoreInput struct { + // Unique id of an instruction (as returned by the GET /restore/status call) for which input is to be provided + Id *string + // List of resources for which the instruction is applicable. + Resources []SelectableResourceReference +} + +func (s *AdvanceClusterRestoreInput) GetType__() bindings.BindingType { + return AdvanceClusterRestoreInputBindingType() +} + +func (s *AdvanceClusterRestoreInput) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AdvanceClusterRestoreInput._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AdvanceClusterRestoreRequest struct { + // List of instructions and their associated data + Data []AdvanceClusterRestoreInput +} + +func (s *AdvanceClusterRestoreRequest) GetType__() bindings.BindingType { + return AdvanceClusterRestoreRequestBindingType() +} + +func (s *AdvanceClusterRestoreRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AdvanceClusterRestoreRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AdvertiseRule struct { + // Possible values are: + // + // * AdvertiseRule#AdvertiseRule_ACTION_DENY + // * AdvertiseRule#AdvertiseRule_ACTION_ALLOW + // + // ALLOW action enables the advertisment and DENY action disables the advertisement of a filtered routes to the connected TIER0 router. + Action *string + // Description + Description *string + // Display name + DisplayName *string + // network(CIDR) to be routed format: ip-cidr-block + Networks []string + RuleFilter *AdvertisementRuleFilter +} + +const AdvertiseRule_ACTION_DENY = "DENY" +const AdvertiseRule_ACTION_ALLOW = "ALLOW" + +func (s *AdvertiseRule) GetType__() bindings.BindingType { + return AdvertiseRuleBindingType() +} + +func (s *AdvertiseRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AdvertiseRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AdvertiseRuleList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Logical router id + LogicalRouterId *string + // List of advertisement rules + Rules []AdvertiseRule +} + +func (s *AdvertiseRuleList) GetType__() bindings.BindingType { + return AdvertiseRuleListBindingType() +} + +func (s *AdvertiseRuleList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AdvertiseRuleList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Advertisement config for different types of routes which need to be advertised from TIER1 logical router to the linked TIER0 logical router +type AdvertisementConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Flag to advertise all routes of dns forwarder listener ips and source ips + AdvertiseDnsForwarder *bool + // Flag to advertise all IPSec VPN local endpoint ips to linked TIER0 logical router + AdvertiseIpsecLocalIp *bool + // Flag to advertise all lb SNAT ips + AdvertiseLbSnatIp *bool + // Flag to advertise lb vip ips + AdvertiseLbVip *bool + // Flag to advertise all routes of nat + AdvertiseNatRoutes *bool + // Flag to advertise all connected routes + AdvertiseNsxConnectedRoutes *bool + // Flag to advertise all static routes + AdvertiseStaticRoutes *bool + // Flag to enable this configuration + Enabled *bool + // TIER1 logical router id on which to enable this configuration + LogicalRouterId *string +} + +func (s *AdvertisementConfig) GetType__() bindings.BindingType { + return AdvertisementConfigBindingType() +} + +func (s *AdvertisementConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AdvertisementConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// To filter the routes advertised by the TIER1 LR to TIER0 LR. Filtering will be based on the type of route and the prefix operator configured. +type AdvertisementRuleFilter struct { + // Possible values are: + // + // * AdvertisementRuleFilter#AdvertisementRuleFilter_MATCH_ROUTE_TYPES_ANY + // * AdvertisementRuleFilter#AdvertisementRuleFilter_MATCH_ROUTE_TYPES_STATIC + // * AdvertisementRuleFilter#AdvertisementRuleFilter_MATCH_ROUTE_TYPES_T1_STATIC + // * AdvertisementRuleFilter#AdvertisementRuleFilter_MATCH_ROUTE_TYPES_NSX_CONNECTED + // * AdvertisementRuleFilter#AdvertisementRuleFilter_MATCH_ROUTE_TYPES_T1_CONNECTED + // * AdvertisementRuleFilter#AdvertisementRuleFilter_MATCH_ROUTE_TYPES_T1_NAT + // * AdvertisementRuleFilter#AdvertisementRuleFilter_MATCH_ROUTE_TYPES_T1_LB_VIP + // * AdvertisementRuleFilter#AdvertisementRuleFilter_MATCH_ROUTE_TYPES_T1_LB_SNAT + // * AdvertisementRuleFilter#AdvertisementRuleFilter_MATCH_ROUTE_TYPES_T1_DNSFORWARDER + // * AdvertisementRuleFilter#AdvertisementRuleFilter_MATCH_ROUTE_TYPES_T1_IPSEC_LOCAL_IP + // + // Array of route types to filter routes + MatchRouteTypes []string + // Possible values are: + // + // * AdvertisementRuleFilter#AdvertisementRuleFilter_PREFIX_OPERATOR_GE + // * AdvertisementRuleFilter#AdvertisementRuleFilter_PREFIX_OPERATOR_EQ + // + // GE prefix operator filters all the routes having network subset of any of the networks configured in Advertise rule. EQ prefix operator filter all the routes having network equal to any of the network configured in Advertise rule. + PrefixOperator *string +} + +const AdvertisementRuleFilter_MATCH_ROUTE_TYPES_ANY = "ANY" +const AdvertisementRuleFilter_MATCH_ROUTE_TYPES_STATIC = "STATIC" +const AdvertisementRuleFilter_MATCH_ROUTE_TYPES_T1_STATIC = "T1_STATIC" +const AdvertisementRuleFilter_MATCH_ROUTE_TYPES_NSX_CONNECTED = "NSX_CONNECTED" +const AdvertisementRuleFilter_MATCH_ROUTE_TYPES_T1_CONNECTED = "T1_CONNECTED" +const AdvertisementRuleFilter_MATCH_ROUTE_TYPES_T1_NAT = "T1_NAT" +const AdvertisementRuleFilter_MATCH_ROUTE_TYPES_T1_LB_VIP = "T1_LB_VIP" +const AdvertisementRuleFilter_MATCH_ROUTE_TYPES_T1_LB_SNAT = "T1_LB_SNAT" +const AdvertisementRuleFilter_MATCH_ROUTE_TYPES_T1_DNSFORWARDER = "T1_DNSFORWARDER" +const AdvertisementRuleFilter_MATCH_ROUTE_TYPES_T1_IPSEC_LOCAL_IP = "T1_IPSEC_LOCAL_IP" +const AdvertisementRuleFilter_PREFIX_OPERATOR_GE = "GE" +const AdvertisementRuleFilter_PREFIX_OPERATOR_EQ = "EQ" + +func (s *AdvertisementRuleFilter) GetType__() bindings.BindingType { + return AdvertisementRuleFilterBindingType() +} + +func (s *AdvertisementRuleFilter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AdvertisementRuleFilter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AgentStatus struct { + // Possible values are: + // + // * AgentStatus#AgentStatus_NAME_AGENT + // * AgentStatus#AgentStatus_NAME_OPSAGENT + // * AgentStatus#AgentStatus_NAME_CFGAGENT + // * AgentStatus#AgentStatus_NAME_NESTDB + // + // Agent name + Name *string + // Possible values are: + // + // * AgentStatus#AgentStatus_STATUS_UP + // * AgentStatus#AgentStatus_STATUS_DOWN + // * AgentStatus#AgentStatus_STATUS_UNKNOWN + // + // Agent status + Status *string +} + +const AgentStatus_NAME_AGENT = "NSX_AGENT" +const AgentStatus_NAME_OPSAGENT = "NSX_OPSAGENT" +const AgentStatus_NAME_CFGAGENT = "NSX_CFGAGENT" +const AgentStatus_NAME_NESTDB = "NSX_NESTDB" +const AgentStatus_STATUS_UP = "UP" +const AgentStatus_STATUS_DOWN = "DOWN" +const AgentStatus_STATUS_UNKNOWN = "UNKNOWN" + +func (s *AgentStatus) GetType__() bindings.BindingType { + return AgentStatusBindingType() +} + +func (s *AgentStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AgentStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AgentStatusCount struct { + // List of agent statuses belonging to the transport node + Agents []AgentStatus + // Down count format: int32 + DownCount *int64 + // Possible values are: + // + // * AgentStatusCount#AgentStatusCount_STATUS_UP + // * AgentStatusCount#AgentStatusCount_STATUS_DOWN + // * AgentStatusCount#AgentStatusCount_STATUS_UNKNOWN + // + // Roll-up agent status + Status *string + // Up count format: int32 + UpCount *int64 +} + +const AgentStatusCount_STATUS_UP = "UP" +const AgentStatusCount_STATUS_DOWN = "DOWN" +const AgentStatusCount_STATUS_UNKNOWN = "UNKNOWN" + +func (s *AgentStatusCount) GetType__() bindings.BindingType { + return AgentStatusCountBindingType() +} + +func (s *AgentStatusCount) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AgentStatusCount._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AggregatedDataCounter struct { + RxBytes *DataCounter + RxPackets *DataCounter + TxBytes *DataCounter + TxPackets *DataCounter +} + +func (s *AggregatedDataCounter) GetType__() bindings.BindingType { + return AggregatedDataCounterBindingType() +} + +func (s *AggregatedDataCounter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AggregatedDataCounter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AggregatedDataCounterEx struct { + RxBytes *DataCounter + RxPackets *DataCounter + TxBytes *DataCounter + TxPackets *DataCounter + DroppedBySecurityPackets *PacketsDroppedBySecurity + MacLearning *MacLearningCounters +} + +func (s *AggregatedDataCounterEx) GetType__() bindings.BindingType { + return AggregatedDataCounterExBindingType() +} + +func (s *AggregatedDataCounterEx) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AggregatedDataCounterEx._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AggregatedLogicalRouterPortCounters struct { + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + Rx *LogicalRouterPortCounters + Tx *LogicalRouterPortCounters +} + +func (s *AggregatedLogicalRouterPortCounters) GetType__() bindings.BindingType { + return AggregatedLogicalRouterPortCountersBindingType() +} + +func (s *AggregatedLogicalRouterPortCounters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AggregatedLogicalRouterPortCounters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type Alarm struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Detailed description of Alarm. This is the same detailed description as the corresponding Event identified by feature_name.event_type. + Description *string + // Defaults to ID if not set + DisplayName *string + // ID that uniquely identifies an Alarm. + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If alarm_source_type = INTENT_PATH, this field will contain a list of intent paths for the entity that the event instance applies to. If alarm_source_type = ENTITY_ID, this field will contain a list with a single item identifying the entity id that the event instance applies to. + AlarmSource []string + // Possible values are: + // + // * Alarm#Alarm_ALARM_SOURCE_TYPE_INTENT_PATH + // * Alarm#Alarm_ALARM_SOURCE_TYPE_ENTITY_ID + // + // Type of alarm source of the Event instance. Can be one of - INTENT_PATH, ENTITY_ID. + AlarmSourceType *string + // The entity that the Event instance applies to. Note entity_id may not be included in a response body. For example, the cpu_high Event may not return an entity_id. + EntityId *string + // The entity type that the Event instance applies to. + EntityResourceType *string + // Name of Event, e.g. manager_cpu_usage_high, certificate_expired. + EventType *string + // Display name of Event type. + EventTypeDisplayName *string + // Display name of feature defining this Event. + FeatureDisplayName *string + // Feature defining this Event, e.g. manager_health, certificates. + FeatureName *string + // Indicates when the corresponding Event instance was last reported in milliseconds since epoch. format: int64 + LastReportedTime *int64 + // Display name of node that the event instance applies to. + NodeDisplayName *string + // The UUID of the node that the Event instance applies to. + NodeId *string + // IP addresses of node that the event instance applies to. + NodeIpAddresses []string + // The resource type of node that the Event instance applies to eg. ClusterNodeConfig, TransportNode. + NodeResourceType *string + // Recommended action for Alarm. This is the same action as the corresponding Event identified by feature_name.event_type. + RecommendedAction *string + // The number of reoccurrences since this alarm has been SUPPRESSED. format: int64 + ReoccurrencesWhileSuppressed *int64 + // User ID of the user that set the status value to RESOLVED. This value can be SYSTEM to indicate that the system resolved the Alarm, for example when the system determines CPU usage is no longer high and the cpu_high Alarm is no longer applicable. This property is only returned when the status value is RESOLVED. + ResolvedBy *string + // Indicates when the Alarm was resolved in milliseconds since epoch. This property is only returned when the status value is RESOLVED. format: int64 + ResolvedTime *int64 + // Runtime data for Alarm. When an alarming condition occurs, there may be additional data of interest when triaging the underlying issue, for example, output from system commands captured at the time of the error. Note, the contents of this property are not localized. + RuntimeData *string + // Possible values are: + // + // * Alarm#Alarm_SEVERITY_CRITICAL + // * Alarm#Alarm_SEVERITY_HIGH + // * Alarm#Alarm_SEVERITY_MEDIUM + // * Alarm#Alarm_SEVERITY_LOW + // + // Severity of the Alarm.Can be one of - CRITICAL, HIGH, MEDIUM, LOW. + Severity *string + // Possible values are: + // + // * Alarm#Alarm_STATUS_OPEN + // * Alarm#Alarm_STATUS_ACKNOWLEDGED + // * Alarm#Alarm_STATUS_SUPPRESSED + // * Alarm#Alarm_STATUS_RESOLVED + // + // Indicate the status which the Alarm is in. + Status *string + // Summary description of Alarm. This is the same summary description as the corresponding Event identified by feature_name.event_type. + Summary *string + // The time period between suppress_start_time and suppress_start_time + suppress_duration (specified in hours) an Alarm is SUPPRESSED. This property is only returned when the status value is SUPPRESSED. format: int64 + SuppressDuration *int64 + // Indicates when the Alarm was suppressed in milliseconds since epoch. This property is only returned when the status value is SUPPRESSED. format: int64 + SuppressStartTime *int64 + // User ID of the user that set the status value to SUPPRESSED. This property is only returned when the status value is SUPPRESSED. + SuppressedBy *string +} + +const Alarm_ALARM_SOURCE_TYPE_INTENT_PATH = "INTENT_PATH" +const Alarm_ALARM_SOURCE_TYPE_ENTITY_ID = "ENTITY_ID" +const Alarm_SEVERITY_CRITICAL = "CRITICAL" +const Alarm_SEVERITY_HIGH = "HIGH" +const Alarm_SEVERITY_MEDIUM = "MEDIUM" +const Alarm_SEVERITY_LOW = "LOW" +const Alarm_STATUS_OPEN = "OPEN" +const Alarm_STATUS_ACKNOWLEDGED = "ACKNOWLEDGED" +const Alarm_STATUS_SUPPRESSED = "SUPPRESSED" +const Alarm_STATUS_RESOLVED = "RESOLVED" + +func (s *Alarm) GetType__() bindings.BindingType { + return AlarmBindingType() +} + +func (s *Alarm) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Alarm._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AlarmsListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of alarms known to the system + Results []Alarm +} + +func (s *AlarmsListResult) GetType__() bindings.BindingType { + return AlarmsListResultBindingType() +} + +func (s *AlarmsListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AlarmsListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A list of the statuses of all the groups in the cluster. +type AllClusterGroupStatus struct { + // UUID of the cluster + ClusterId *string + // Array of groups and their statuses + Groups []ClusterGroupStatus + // Possible values are: + // + // * AllClusterGroupStatus#AllClusterGroupStatus_OVERALL_STATUS_STABLE + // * AllClusterGroupStatus#AllClusterGroupStatus_OVERALL_STATUS_DEGRADED + // * AllClusterGroupStatus#AllClusterGroupStatus_OVERALL_STATUS_UNAVAILABLE + // + // Overall status of the cluster + OverallStatus *string +} + +const AllClusterGroupStatus_OVERALL_STATUS_STABLE = "STABLE" +const AllClusterGroupStatus_OVERALL_STATUS_DEGRADED = "DEGRADED" +const AllClusterGroupStatus_OVERALL_STATUS_UNAVAILABLE = "UNAVAILABLE" + +func (s *AllClusterGroupStatus) GetType__() bindings.BindingType { + return AllClusterGroupStatusBindingType() +} + +func (s *AllClusterGroupStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AllClusterGroupStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AllocatedService struct { + // Additional properties of a service, say the sub_pool_size and sub_pool_type for a LoadBalancer. + AllocationDetails []KeyValuePair + // Possible values are: + // + // * AllocatedService#AllocatedService_HIGH_AVAILABILITY_STATUS_ACTIVE + // * AllocatedService#AllocatedService_HIGH_AVAILABILITY_STATUS_STANDBY + // * AllocatedService#AllocatedService_HIGH_AVAILABILITY_STATUS_DOWN + // * AllocatedService#AllocatedService_HIGH_AVAILABILITY_STATUS_SYNC + // * AllocatedService#AllocatedService_HIGH_AVAILABILITY_STATUS_UNKNOWN + // + // Represents the active or the standby state of the service. + HighAvailabilityStatus *string + ServiceReference *ResourceReference +} + +const AllocatedService_HIGH_AVAILABILITY_STATUS_ACTIVE = "ACTIVE" +const AllocatedService_HIGH_AVAILABILITY_STATUS_STANDBY = "STANDBY" +const AllocatedService_HIGH_AVAILABILITY_STATUS_DOWN = "DOWN" +const AllocatedService_HIGH_AVAILABILITY_STATUS_SYNC = "SYNC" +const AllocatedService_HIGH_AVAILABILITY_STATUS_UNKNOWN = "UNKNOWN" + +func (s *AllocatedService) GetType__() bindings.BindingType { + return AllocatedServiceBindingType() +} + +func (s *AllocatedService) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AllocatedService._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Auto place TIER1 logical routers, DHCP and MDProxy contexts on two edge nodes (active and standby) from different failure domains. +type AllocationBasedOnFailureDomain struct { + // Enable placement algorithm to consider failure domain of edge transport nodes and place active and standby contexts in different failure domains. + Enabled *bool + // Possible values are: + // + // * AllocationRuleAction#AllocationRuleAction_ACTION_TYPE_ALLOCATIONBASEDONFAILUREDOMAIN + // + // Set action for each allocation rule on edge cluster which will help in auto placement. + ActionType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const AllocationBasedOnFailureDomain__TYPE_IDENTIFIER = "AllocationBasedOnFailureDomain" + +func (s *AllocationBasedOnFailureDomain) GetType__() bindings.BindingType { + return AllocationBasedOnFailureDomainBindingType() +} + +func (s *AllocationBasedOnFailureDomain) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AllocationBasedOnFailureDomain._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Allocation parameters for the IP address (e.g. specific IP address) can be specified. Tags, display_name and description attributes are not supported in this release. +type AllocationIpAddress struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Address that is allocated from pool format: ip + AllocationId *string +} + +func (s *AllocationIpAddress) GetType__() bindings.BindingType { + return AllocationIpAddressBindingType() +} + +func (s *AllocationIpAddress) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AllocationIpAddress._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AllocationIpAddressListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Pool allocation list results + Results []AllocationIpAddress +} + +func (s *AllocationIpAddressListResult) GetType__() bindings.BindingType { + return AllocationIpAddressListResultBindingType() +} + +func (s *AllocationIpAddressListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AllocationIpAddressListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AllocationPool struct { + // Represents the number of acitve services running on the edge node. format: int32 + ActiveServiceCount *int64 + // Represents the number of standby services running on the edge node. format: int32 + StandbyServiceCount *int64 + // Allocation details of sub-pools configured on edge node. + SubPools []SubPool +} + +func (s *AllocationPool) GetType__() bindings.BindingType { + return AllocationPoolBindingType() +} + +func (s *AllocationPool) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AllocationPool._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Allocation rule on edge cluster which will be considered in auto placement of TIER1 logical routers, DHCP and MDProxy. +type AllocationRule struct { + Action *data.StructValue +} + +func (s *AllocationRule) GetType__() bindings.BindingType { + return AllocationRuleBindingType() +} + +func (s *AllocationRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AllocationRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Define action for each allocation rule which added on edge cluster. +type AllocationRuleAction struct { + // Possible values are: + // + // * AllocationRuleAction#AllocationRuleAction_ACTION_TYPE_ALLOCATIONBASEDONFAILUREDOMAIN + // + // Set action for each allocation rule on edge cluster which will help in auto placement. + ActionType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const AllocationRuleAction__TYPE_IDENTIFIER = "AllocationRuleAction" +const AllocationRuleAction_ACTION_TYPE_ALLOCATIONBASEDONFAILUREDOMAIN = "AllocationBasedOnFailureDomain" + +func (s *AllocationRuleAction) GetType__() bindings.BindingType { + return AllocationRuleActionBindingType() +} + +func (s *AllocationRuleAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AllocationRuleAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Antrea container cluster and its nodes requiring a support bundle +type AntreaContainerClusterNode struct { + // The UUID of the container cluster + ClusterId *string + // List of at most 200 container node UUIDs requiring a support bundle + Nodes []string +} + +func (s *AntreaContainerClusterNode) GetType__() bindings.BindingType { + return AntreaContainerClusterNodeBindingType() +} + +func (s *AntreaContainerClusterNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AntreaContainerClusterNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AntreaSupportBundleContainerNode struct { + // List of AntreaContainerClusterNodes identifying container clusters and their nodes + Clusters []AntreaContainerClusterNode + // Possible values are: + // + // * SupportBundleContainerNode#SupportBundleContainerNode_CONTAINER_TYPE_ANTREA + // + // Support bundle container type + ContainerType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const AntreaSupportBundleContainerNode__TYPE_IDENTIFIER = "AntreaSupportBundleContainerNode" + +func (s *AntreaSupportBundleContainerNode) GetType__() bindings.BindingType { + return AntreaSupportBundleContainerNodeBindingType() +} + +func (s *AntreaSupportBundleContainerNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AntreaSupportBundleContainerNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// APH information. +type AphInfo struct { + // IP address of APH service + Address *string + // PEM Certificate of APH service + Certificate *string + // FQDN, only returned by GET /sites and GET /sites/self + Fqdn *string + // Node ID of the APH service + NodeId *string + // Port of APH service format: int64 + Port *int64 + // whether or not fqdn flag is on + UseFqdn *bool + // ID of the APH service + Uuid *string +} + +func (s *AphInfo) GetType__() bindings.BindingType { + return AphInfoBindingType() +} + +func (s *AphInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AphInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Detailed information about an API Error +type ApiError struct { + // Further details about the error + Details *string + // A numeric error code format: int64 + ErrorCode *int64 + // Additional data about the error + ErrorData *data.StructValue + // A description of the error + ErrorMessage *string + // The module name where the error occurred + ModuleName *string + // Other errors related to this error + RelatedErrors []RelatedApiError +} + +func (s *ApiError) GetType__() bindings.BindingType { + return ApiErrorBindingType() +} + +func (s *ApiError) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ApiError._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Properties that affect the configuration of the NSX API service. +type ApiServiceConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Identifies whether basic authentication is enabled or disabled in API calls. + BasicAuthenticationEnabled *bool + // The TLS cipher suites that the API service will negotiate. + CipherSuites []CipherSuite + // The maximum number of concurrent API requests that will be serviced for a given authenticated client. If the number of API requests being processed exceeds this limit, new API requests will be refused and a 503 Service Unavailable response will be returned to the client. To disable API concurrency limiting, set this value to 0. format: int64 + ClientApiConcurrencyLimit *int64 + // The maximum number of API requests that will be serviced per second for a given authenticated client. If more API requests are received than can be serviced, a 429 Too Many Requests HTTP response will be returned. To disable API rate limiting, set this value to 0. format: int64 + ClientApiRateLimit *int64 + // NSX connection timeout, in seconds. To disable timeout, set to 0. format: int64 + ConnectionTimeout *int64 + // Identifies whether cookie-based authentication is enabled or disabled in API calls. When cookie-based authentication is disabled, new sessions cannot be created via /api/session/create. + CookieBasedAuthenticationEnabled *bool + // The maximum number of concurrent API requests that will be serviced. If the number of API requests being processed exceeds this limit, new API requests will be refused and a 503 Service Unavailable response will be returned to the client. To disable API concurrency limiting, set this value to 0. format: int64 + GlobalApiConcurrencyLimit *int64 + // The list of IP addresses which are not subjected to a lockout on failed login attempts. format: ip + LockoutImmuneAddresses []string + // The TLS protocol versions that the API service will negotiate. + ProtocolVersions []ProtocolVersion + // Host name or IP address to use for redirect location headers, or empty string to derive from current request. To disable, set redirect_host to the empty string (\"\"). + RedirectHost *string + // NSX session inactivity timeout format: int64 + SessionTimeout *int64 +} + +func (s *ApiServiceConfig) GetType__() bindings.BindingType { + return ApiServiceConfigBindingType() +} + +func (s *ApiServiceConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ApiServiceConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Display the latency data by given appliance node +type ApplianceLatencyData struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Display the Appliance id. + Id *string + // Latency Data list. + LatencyData []ApplianceLatencyDataItem + // Display the appliance name. + Name *string + // Timestamp of last modification. format: int64 + Timestamp *int64 +} + +func (s *ApplianceLatencyData) GetType__() bindings.BindingType { + return ApplianceLatencyDataBindingType() +} + +func (s *ApplianceLatencyData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ApplianceLatencyData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Describes appliance latency data in detail. +type ApplianceLatencyDataItem struct { + // Display the appliance node id. + DestinationNodeId *string + // Display the appliance node ip. + DestinationNodeIp *string + // Display the appliance node name. + DestinationNodeName *string + // Display the percentage of lost packet. + PacketLossPercent *string + // Display the received packets. format: int64 + PacketReceived *int64 + // Display the transmitted packets in Ping format: int64 + PacketTransmitted *int64 + // Display the average Round Trip Time in milliseconds. + RttAvg *float64 + // Display the max Round Trip Time in milliseconds. + RttMax *float64 + // Display the mean Round Trip Time in milliseconds. + RttMdev *float64 + // Display the min Round Trip Time in milliseconds. + RttMin *float64 + // Display the appliance node ip. + SourceNodeIp *string + // Possible values are: + // + // * ApplianceLatencyDataItem#ApplianceLatencyDataItem_STATUS_UP + // * ApplianceLatencyDataItem#ApplianceLatencyDataItem_STATUS_DOWN + // + // Display the connection status between source node and destination node. + Status *string + // Display the total time of sending and receiving packets in milliseconds. format: int64 + TotalTime *int64 +} + +const ApplianceLatencyDataItem_STATUS_UP = "UP" +const ApplianceLatencyDataItem_STATUS_DOWN = "DOWN" + +func (s *ApplianceLatencyDataItem) GetType__() bindings.BindingType { + return ApplianceLatencyDataItemBindingType() +} + +func (s *ApplianceLatencyDataItem) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ApplianceLatencyDataItem._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of process data +type ApplianceLatencyListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Total appliance latency count format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Display the appliance latency data list. + Results []ApplianceLatencyData +} + +func (s *ApplianceLatencyListResult) GetType__() bindings.BindingType { + return ApplianceLatencyListResultBindingType() +} + +func (s *ApplianceLatencyListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ApplianceLatencyListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Appliance management task query results +type ApplianceManagementTaskListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Task property results + Results []ApplianceManagementTaskProperties +} + +func (s *ApplianceManagementTaskListResult) GetType__() bindings.BindingType { + return ApplianceManagementTaskListResultBindingType() +} + +func (s *ApplianceManagementTaskListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ApplianceManagementTaskListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Appliance management task properties +type ApplianceManagementTaskProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // True if response for asynchronous request is available + AsyncResponseAvailable *bool + // True if this task can be canceled + Cancelable *bool + // Description of the task + Description *string + // Details about the task if known + Details *data.StructValue + // The end time of the task in epoch milliseconds format: int64 + EndTime *int64 + // Identifier for this task + Id *string + // A message describing the disposition of the task + Message *string + // Task progress if known, from 0 to 100 format: int64 + Progress *int64 + // HTTP request method + RequestMethod *string + // URI of the method invocation that spawned this task + RequestUri *string + // The start time of the task in epoch milliseconds format: int64 + StartTime *int64 + // Possible values are: + // + // * ApplianceManagementTaskProperties#ApplianceManagementTaskProperties_STATUS_RUNNING + // * ApplianceManagementTaskProperties#ApplianceManagementTaskProperties_STATUS_ERROR + // * ApplianceManagementTaskProperties#ApplianceManagementTaskProperties_STATUS_SUCCESS + // * ApplianceManagementTaskProperties#ApplianceManagementTaskProperties_STATUS_CANCELING + // * ApplianceManagementTaskProperties#ApplianceManagementTaskProperties_STATUS_CANCELED + // * ApplianceManagementTaskProperties#ApplianceManagementTaskProperties_STATUS_KILLED + // + // Current status of the task + Status *string + // Name of the user who created this task + User *string +} + +const ApplianceManagementTaskProperties_STATUS_RUNNING = "running" +const ApplianceManagementTaskProperties_STATUS_ERROR = "error" +const ApplianceManagementTaskProperties_STATUS_SUCCESS = "success" +const ApplianceManagementTaskProperties_STATUS_CANCELING = "canceling" +const ApplianceManagementTaskProperties_STATUS_CANCELED = "canceled" +const ApplianceManagementTaskProperties_STATUS_KILLED = "killed" + +func (s *ApplianceManagementTaskProperties) GetType__() bindings.BindingType { + return ApplianceManagementTaskPropertiesBindingType() +} + +func (s *ApplianceManagementTaskProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ApplianceManagementTaskProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of process data in given appliance node +type ApplianceProcessData struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Display the Appliance id. + Id *string + // Display the appliance name. + Name *string + // Timestamp of last modification. format: int64 + Timestamp *int64 + // Display the total count of process. format: int64 + TopProcessByCpuCount *int64 + // Display the top process list by CPU. + TopProcessByCpuList []ProcessInformation + // Display the total count of process. format: int64 + TopProcessByMemCount *int64 + // Display the top process list by memory. + TopProcessByMemList []ProcessInformation +} + +func (s *ApplianceProcessData) GetType__() bindings.BindingType { + return ApplianceProcessDataBindingType() +} + +func (s *ApplianceProcessData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ApplianceProcessData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of process data +type ApplianceProcessListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Display the appliance process list. + Results []ApplianceProcessData +} + +func (s *ApplianceProcessListResult) GetType__() bindings.BindingType { + return ApplianceProcessListResultBindingType() +} + +func (s *ApplianceProcessListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ApplianceProcessListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Entity lists where the profile will be enabled on. +type AppliedTos struct { + // Logical Port List + LogicalPorts []ResourceReference + // Logical Switch List + LogicalSwitches []ResourceReference + // NSGroup List + Nsgroups []ResourceReference +} + +func (s *AppliedTos) GetType__() bindings.BindingType { + return AppliedTosBindingType() +} + +func (s *AppliedTos) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AppliedTos._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ArpHeader struct { + // The destination IP address format: ipv4 + DstIp *string + // Possible values are: + // + // * ArpHeader#ArpHeader_OP_CODE_REQUEST + // * ArpHeader#ArpHeader_OP_CODE_REPLY + // + // This field specifies the nature of the Arp message being sent. + OpCode *string + // This field specifies the IP address of the sender. If omitted, the src_ip is set to 0.0.0.0. format: ipv4 + SrcIp *string +} + +const ArpHeader_OP_CODE_REQUEST = "ARP_REQUEST" +const ArpHeader_OP_CODE_REPLY = "ARP_REPLY" + +func (s *ArpHeader) GetType__() bindings.BindingType { + return ArpHeaderBindingType() +} + +func (s *ArpHeader) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ArpHeader._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This type can be specified in ip assignment spec of host switch if DHCP based IP assignment is desired for host switch virtual tunnel endpoints. +type AssignedByDhcp struct { + // Possible values are: + // + // * IpAssignmentSpec#IpAssignmentSpec_RESOURCE_TYPE_STATICIPPOOLSPEC + // * IpAssignmentSpec#IpAssignmentSpec_RESOURCE_TYPE_STATICIPLISTSPEC + // * IpAssignmentSpec#IpAssignmentSpec_RESOURCE_TYPE_ASSIGNEDBYDHCP + // * IpAssignmentSpec#IpAssignmentSpec_RESOURCE_TYPE_STATICIPMACLISTSPEC + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const AssignedByDhcp__TYPE_IDENTIFIER = "AssignedByDhcp" + +func (s *AssignedByDhcp) GetType__() bindings.BindingType { + return AssignedByDhcpBindingType() +} + +func (s *AssignedByDhcp) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AssignedByDhcp._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AssociationListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged Collection of ResourceReference + Results []ResourceReference +} + +func (s *AssociationListResult) GetType__() bindings.BindingType { + return AssociationListResultBindingType() +} + +func (s *AssociationListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AssociationListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The Attached interface is only effective for the port on Bare metal server. +type AttachedInterface struct { + // The name of application interface + AppIntfName *string + // Gateway IP format: ip + DefaultGateway *string + // IP configuration on migrate_intf will migrate to app_intf_name. It is used for Management and Application sharing the same IP. + MigrateIntf *string + // Routing rules + RoutingTable []string +} + +func (s *AttachedInterface) GetType__() bindings.BindingType { + return AttachedInterfaceBindingType() +} + +func (s *AttachedInterface) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AttachedInterface._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AttachmentContext struct { + // Possible values are: + // + // * AttachmentContext#AttachmentContext_ALLOCATE_ADDRESSES_IPPOOL + // * AttachmentContext#AttachmentContext_ALLOCATE_ADDRESSES_MACPOOL + // * AttachmentContext#AttachmentContext_ALLOCATE_ADDRESSES_BOTH + // * AttachmentContext#AttachmentContext_ALLOCATE_ADDRESSES_NONE + // * AttachmentContext#AttachmentContext_ALLOCATE_ADDRESSES_DHCP + // + // A flag to indicate whether to allocate addresses from allocation pools bound to the parent logical switch. + AllocateAddresses *string + // Used to identify which concrete class it is + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const AttachmentContext__TYPE_IDENTIFIER = "AttachmentContext" +const AttachmentContext_ALLOCATE_ADDRESSES_IPPOOL = "IpPool" +const AttachmentContext_ALLOCATE_ADDRESSES_MACPOOL = "MacPool" +const AttachmentContext_ALLOCATE_ADDRESSES_BOTH = "Both" +const AttachmentContext_ALLOCATE_ADDRESSES_NONE = "None" +const AttachmentContext_ALLOCATE_ADDRESSES_DHCP = "Dhcp" + +func (s *AttachmentContext) GetType__() bindings.BindingType { + return AttachmentContextBindingType() +} + +func (s *AttachmentContext) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AttachmentContext._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Attribute specific to a partner. There attributes are passed on to the partner appliance and is opaque to the NSX Manager. The Attributes used by the partner applicance. +type Attribute struct { + // Possible values are: + // + // * Attribute#Attribute_ATTRIBUTE_TYPE_IP_ADDRESS + // * Attribute#Attribute_ATTRIBUTE_TYPE_PORT + // * Attribute#Attribute_ATTRIBUTE_TYPE_PASSWORD + // * Attribute#Attribute_ATTRIBUTE_TYPE_STRING + // * Attribute#Attribute_ATTRIBUTE_TYPE_LONG + // * Attribute#Attribute_ATTRIBUTE_TYPE_BOOLEAN + // + // Attribute Type can be of any of the allowed enum type. + AttributeType *string + // Attribute display name string value. + DisplayName *string + // Attribute key string value. + Key *string + // Read only Attribute cannot be overdidden by service instance/deployment. + ReadOnly *bool + // Attribute value string value. + Value *string +} + +const Attribute_ATTRIBUTE_TYPE_IP_ADDRESS = "IP_ADDRESS" +const Attribute_ATTRIBUTE_TYPE_PORT = "PORT" +const Attribute_ATTRIBUTE_TYPE_PASSWORD = "PASSWORD" +const Attribute_ATTRIBUTE_TYPE_STRING = "STRING" +const Attribute_ATTRIBUTE_TYPE_LONG = "LONG" +const Attribute_ATTRIBUTE_TYPE_BOOLEAN = "BOOLEAN" + +func (s *Attribute) GetType__() bindings.BindingType { + return AttributeBindingType() +} + +func (s *Attribute) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Attribute._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Audit log in RFC5424 format +type AuditLog struct { + // Application name field of the log + Appname *string + // Facility field of the log format: int64 + Facility *int64 + // Full log with both header and message + FullLog *string + // Hostname field of the log + Hostname *string + // Message field of the log + Message *string + // Message ID field of the log + Msgid *string + // Priority field of the log format: int64 + Priority *int64 + // Process ID field of the log format: int64 + Procid *int64 + StructData *StructuredData + // Date and time in UTC of the log + Timestamp *string +} + +func (s *AuditLog) GetType__() bindings.BindingType { + return AuditLogBindingType() +} + +func (s *AuditLog) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AuditLog._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Audit log collection results +type AuditLogListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Timestamp of the last full audit log collection + LastFullSyncTimestamp *string + // Audit log results + Results []AuditLog +} + +func (s *AuditLogListResult) GetType__() bindings.BindingType { + return AuditLogListResultBindingType() +} + +func (s *AuditLogListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AuditLogListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AuditLogRequest struct { + // Include logs with timstamps not past the age limit in days format: int64 + LogAgeLimit *int64 + // Audit logs should meet the filter condition + LogFilter *string + // Possible values are: + // + // * AuditLogRequest#AuditLogRequest_LOG_FILTER_TYPE_TEXT + // * AuditLogRequest#AuditLogRequest_LOG_FILTER_TYPE_REGEX + // + // Type of log filter + LogFilterType *string +} + +const AuditLogRequest_LOG_FILTER_TYPE_TEXT = "TEXT" +const AuditLogRequest_LOG_FILTER_TYPE_REGEX = "REGEX" + +func (s *AuditLogRequest) GetType__() bindings.BindingType { + return AuditLogRequestBindingType() +} + +func (s *AuditLogRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AuditLogRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Configuration of authentication policies for the NSX node +type AuthenticationPolicyProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Once a lockout occurs, the account remains locked out of the API for this time period. Only applies to NSX Manager nodes. Ignored on other node types. format: int64 + ApiFailedAuthLockoutPeriod *int64 + // In order to trigger an account lockout, all authentication failures must occur in this time window. If the reset period expires, the failed login count is reset to zero. Only applies to NSX Manager nodes. Ignored on other node types. format: int64 + ApiFailedAuthResetPeriod *int64 + // Only applies to NSX Manager nodes. Ignored on other node types. format: int64 + ApiMaxAuthFailures *int64 + // Once a lockout occurs, the account remains locked out of the CLI for this time period. While the lockout period is in effect, additional authentication attempts restart the lockout period, even if a valid password is specified. format: int64 + CliFailedAuthLockoutPeriod *int64 + // Number of authentication failures that trigger CLI lockout format: int64 + CliMaxAuthFailures *int64 + // Minimum number of characters required in account passwords format: int64 + MinimumPasswordLength *int64 +} + +func (s *AuthenticationPolicyProperties) GetType__() bindings.BindingType { + return AuthenticationPolicyPropertiesBindingType() +} + +func (s *AuthenticationPolicyProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AuthenticationPolicyProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type AuthenticationScheme struct { + // Authentication scheme name + SchemeName *string +} + +func (s *AuthenticationScheme) GetType__() bindings.BindingType { + return AuthenticationSchemeBindingType() +} + +func (s *AuthenticationScheme) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AuthenticationScheme._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Health check performed by system automatically on a specific transport zone. For overlay based zone, health check is performed on corresponding N-VDS of each transport node with the VLAN and MTU specified by uplink profile of N-VDS for the node. For VLAN based zone, health check is performed on corresponding N-VDS of each transport node with MTU specified by uplink profile of N-VDS for the node and VLAN specified by all logical switches in this zone. +type AutomaticHealthCheck struct { + Result *HealthCheckResult + // ID of the transport zone where this automatic health check is performed. + TransportZoneId *string +} + +func (s *AutomaticHealthCheck) GetType__() bindings.BindingType { + return AutomaticHealthCheckBindingType() +} + +func (s *AutomaticHealthCheck) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AutomaticHealthCheck._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Automatic health check list result for query with list parameters. +type AutomaticHealthCheckListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Automatic Health Check List + Results []AutomaticHealthCheck +} + +func (s *AutomaticHealthCheckListResult) GetType__() bindings.BindingType { + return AutomaticHealthCheckListResultBindingType() +} + +func (s *AutomaticHealthCheckListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AutomaticHealthCheckListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Toggle to enable/disable automatic health check. +type AutomaticHealthCheckToggle struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Status of automatic health check + Enabled *bool +} + +func (s *AutomaticHealthCheckToggle) GetType__() bindings.BindingType { + return AutomaticHealthCheckToggleBindingType() +} + +func (s *AutomaticHealthCheckToggle) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AutomaticHealthCheckToggle._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Details about the AVI LB endpoint +type AviEndPoint struct { + // IP address of the AVI LB endpoint. format: hostname-or-ip + AviEndpointIp *string + // Password for AVI LB endpoint. + AviEndpointPassword *string + // AVI LB endpoint port. format: int32 + AviEndpointPort *int64 + // Username for AVI LB endpoint. + AviEndpointUsername *string +} + +func (s *AviEndPoint) GetType__() bindings.BindingType { + return AviEndPointBindingType() +} + +func (s *AviEndPoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AviEndPoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents X and Y axes of a graph. For a multi-graph, the same axes are shared by all the graphs. +type Axes struct { + XLabel *Label + // A list of X-Axis Labels with condition support. If needed, this property can be used to provide a list of x-axis label with condition support. For a label with single condition,'x-label' property can be used. + XLabels []Label + // A list of Y-Axis unit Labels with condition support. If needed, this property can be used to provide a list of y-axis unit label with condition support. This unit label can be used to display the point value along with units like percentage, milliseconds etc. + YAxisUnitLabels []Label + // A list of Y-Axis unit with condition support. If needed, this property can be used to provide a list of y-axis unit with condition support. This unit could be like percentage, seconds, milliseconds etc. + YAxisUnits []AxisUnit + YLabel *Label + // A list of Y-Axis Labels with condition support. If needed, this property can be used to provide a list of y-axis label with condition support. For a label with single condition,'y-label' property can be used. + YLabels []Label +} + +func (s *Axes) GetType__() bindings.BindingType { + return AxesBindingType() +} + +func (s *Axes) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Axes._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents X and Y axis unit of a graph. +type AxisUnit struct { + // If the condition is met then the above unit will be displayed. to UI. If no condition is provided, then the unit will be displayed unconditionally. + Condition *string + // Possible values are: + // + // * AxisUnit#AxisUnit_UNIT_COUNT + // * AxisUnit#AxisUnit_UNIT_PERCENT + // * AxisUnit#AxisUnit_UNIT_BYTES + // * AxisUnit#AxisUnit_UNIT_MILLISECONDS + // * AxisUnit#AxisUnit_UNIT_SECONDS + // * AxisUnit#AxisUnit_UNIT_MINUTE + // * AxisUnit#AxisUnit_UNIT_HOUR + // * AxisUnit#AxisUnit_UNIT_DAY + // * AxisUnit#AxisUnit_UNIT_KILO_BYTES + // * AxisUnit#AxisUnit_UNIT_MEGA_BYTES + // * AxisUnit#AxisUnit_UNIT_GIGA_BYTES + // + // An Axis unit. + Unit *string +} + +const AxisUnit_UNIT_COUNT = "COUNT" +const AxisUnit_UNIT_PERCENT = "PERCENT" +const AxisUnit_UNIT_BYTES = "BYTES" +const AxisUnit_UNIT_MILLISECONDS = "MILLISECONDS" +const AxisUnit_UNIT_SECONDS = "SECONDS" +const AxisUnit_UNIT_MINUTE = "MINUTE" +const AxisUnit_UNIT_HOUR = "HOUR" +const AxisUnit_UNIT_DAY = "DAY" +const AxisUnit_UNIT_KILO_BYTES = "KILO_BYTES" +const AxisUnit_UNIT_MEGA_BYTES = "MEGA_BYTES" +const AxisUnit_UNIT_GIGA_BYTES = "GIGA_BYTES" + +func (s *AxisUnit) GetType__() bindings.BindingType { + return AxisUnitBindingType() +} + +func (s *AxisUnit) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for AxisUnit._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BFDDiagnosticCount struct { + // Number of tunnels with administratively down diagnostic message format: int64 + AdministrativelyDownCount *int64 + // Number of tunnels with concatenated path down diagnostic message format: int64 + ConcatenatedPathDownCount *int64 + // Number of tunnels with control detection time expired diagnostic message format: int64 + ControlDetectionTimeExpiredCount *int64 + // Number of tunnels with echo function failed diagnostic message format: int64 + EchoFunctionFailedCount *int64 + // Number of tunnels with forwarding plane reset diagnostic message format: int64 + ForwardingPlaneResetCount *int64 + // Number of tunnels neighbor signaled session down format: int64 + NeighborSignaledSessionDownCount *int64 + // Number of tunnels with no diagnostic format: int64 + NoDiagnosticCount *int64 + // Number of tunnels with path down diagnostic message format: int64 + PathDownCount *int64 + // Number of tunnels with reverse concatenated path down diagnostic message format: int64 + ReverseConcatenatedPathDownCount *int64 +} + +func (s *BFDDiagnosticCount) GetType__() bindings.BindingType { + return BFDDiagnosticCountBindingType() +} + +func (s *BFDDiagnosticCount) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BFDDiagnosticCount._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// BFD information +type BFDProperties struct { + // True if tunnel is active in a gateway HA setup + Active *bool + // A short message indicating what the BFD session thinks is wrong in case of a problem + Diagnostic *string + // True if the BFD session believes this interface may be used to forward traffic + Forwarding *bool + // A short message indicating what the remote interface's BFD session thinks is wrong in case of a problem + RemoteDiagnostic *string + // Possible values are: + // + // * BFDProperties#BFDProperties_REMOTE_STATE_UNKNOWN_STATE + // * BFDProperties#BFDProperties_REMOTE_STATE_ADMIN_DOWN + // * BFDProperties#BFDProperties_REMOTE_STATE_DOWN + // * BFDProperties#BFDProperties_REMOTE_STATE_INIT + // * BFDProperties#BFDProperties_REMOTE_STATE_UP + // + // State of the remote interface's BFD session + RemoteState *string + // Possible values are: + // + // * BFDProperties#BFDProperties_STATE_UNKNOWN_STATE + // * BFDProperties#BFDProperties_STATE_ADMIN_DOWN + // * BFDProperties#BFDProperties_STATE_DOWN + // * BFDProperties#BFDProperties_STATE_INIT + // * BFDProperties#BFDProperties_STATE_UP + // + // State of the BFD session + State *string +} + +const BFDProperties_REMOTE_STATE_UNKNOWN_STATE = "UNKNOWN_STATE" +const BFDProperties_REMOTE_STATE_ADMIN_DOWN = "ADMIN_DOWN" +const BFDProperties_REMOTE_STATE_DOWN = "DOWN" +const BFDProperties_REMOTE_STATE_INIT = "INIT" +const BFDProperties_REMOTE_STATE_UP = "UP" +const BFDProperties_STATE_UNKNOWN_STATE = "UNKNOWN_STATE" +const BFDProperties_STATE_ADMIN_DOWN = "ADMIN_DOWN" +const BFDProperties_STATE_DOWN = "DOWN" +const BFDProperties_STATE_INIT = "INIT" +const BFDProperties_STATE_UP = "UP" + +func (s *BFDProperties) GetType__() bindings.BindingType { + return BFDPropertiesBindingType() +} + +func (s *BFDProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BFDProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BFDStatusCount struct { + // Number of tunnels in BFD admin down state format: int32 + BfdAdminDownCount *int64 + // Number of tunnels in BFD down state format: int32 + BfdDownCount *int64 + // Number of tunnels in BFD init state format: int32 + BfdInitCount *int64 + // Number of tunnels in BFD up state format: int32 + BfdUpCount *int64 +} + +func (s *BFDStatusCount) GetType__() bindings.BindingType { + return BFDStatusCountBindingType() +} + +func (s *BFDStatusCount) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BFDStatusCount._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BGPCommunityList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Array of BGP communities + Communities []string + // Possible values are: + // + // * BGPCommunityList#BGPCommunityList_COMMUNITY_TYPE_NORMALBGPCOMMUNITY + // * BGPCommunityList#BGPCommunityList_COMMUNITY_TYPE_LARGEBGPCOMMUNITY + // + // BGP community type. It has two types as NormalBGPCommunity BGP normal community which includes well-known community name as well as community value in range from [1-4294967295] or value in aa:nn format(aa/nn range from 1-65535). LargeBGPCommunity BGP large community which includes community value in aa:bb:nn format where aa, bb, nn are unsigned integers in the range [1-4294967295]. + CommunityType *string + // Logical router id + LogicalRouterId *string +} + +const BGPCommunityList_COMMUNITY_TYPE_NORMALBGPCOMMUNITY = "NormalBGPCommunity" +const BGPCommunityList_COMMUNITY_TYPE_LARGEBGPCOMMUNITY = "LargeBGPCommunity" + +func (s *BGPCommunityList) GetType__() bindings.BindingType { + return BGPCommunityListBindingType() +} + +func (s *BGPCommunityList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BGPCommunityList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BGPCommunityListListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paginated list of bgp community lists + Results []BGPCommunityList +} + +func (s *BGPCommunityListListResult) GetType__() bindings.BindingType { + return BGPCommunityListListResultBindingType() +} + +func (s *BGPCommunityListListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BGPCommunityListListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Configuration for taking manual/automated backup +type BackupConfiguration struct { + // A number of seconds after a last backup, that needs to pass, before a topology change will trigger a generation of a new cluster/node backups. If parameter is not provided, then changes in a topology will not trigger a generation of cluster/node backups. format: int64 + AfterInventoryUpdateInterval *int64 + // true if automated backup is enabled + BackupEnabled *bool + BackupSchedule *data.StructValue + // The minimum number of seconds between each upload of the inventory summary to backup server. format: int64 + InventorySummaryInterval *int64 + // Passphrase used to encrypt backup files. The passphrase specified must be at least 8 characters in length and must contain at least one lowercase, one uppercase, one numeric character and one special character (any other non-space character). + Passphrase *string + RemoteFileServer *RemoteFileServer +} + +func (s *BackupConfiguration) GetType__() bindings.BindingType { + return BackupConfigurationBindingType() +} + +func (s *BackupConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BackupConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Past backup operation details +type BackupOperationHistory struct { + // Statuses of previous cluser backups + ClusterBackupStatuses []BackupOperationStatus + // Statuses of previous inventory backups + InventoryBackupStatuses []BackupOperationStatus + // Statuses of previous node backups + NodeBackupStatuses []BackupOperationStatus +} + +func (s *BackupOperationHistory) GetType__() bindings.BindingType { + return BackupOperationHistoryBindingType() +} + +func (s *BackupOperationHistory) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BackupOperationHistory._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Backup operation status +type BackupOperationStatus struct { + // Unique identifier of a backup + BackupId *string + // Time when operation was ended format: int64 + EndTime *int64 + // Possible values are: + // + // * BackupOperationStatus#BackupOperationStatus_ERROR_CODE_BACKUP_NOT_RUN_ON_MASTER + // * BackupOperationStatus#BackupOperationStatus_ERROR_CODE_BACKUP_SERVER_UNREACHABLE + // * BackupOperationStatus#BackupOperationStatus_ERROR_CODE_BACKUP_AUTHENTICATION_FAILURE + // * BackupOperationStatus#BackupOperationStatus_ERROR_CODE_BACKUP_PERMISSION_ERROR + // * BackupOperationStatus#BackupOperationStatus_ERROR_CODE_BACKUP_TIMEOUT + // * BackupOperationStatus#BackupOperationStatus_ERROR_CODE_BACKUP_BAD_FINGERPRINT + // * BackupOperationStatus#BackupOperationStatus_ERROR_CODE_BACKUP_GENERIC_ERROR + // * BackupOperationStatus#BackupOperationStatus_ERROR_CODE_UPGRADE_IN_PROGRESS + // + // Error code + ErrorCode *string + // Error code details + ErrorMessage *string + // Time when operation was started format: int64 + StartTime *int64 + // True if backup is successfully completed, else false + Success *bool +} + +const BackupOperationStatus_ERROR_CODE_BACKUP_NOT_RUN_ON_MASTER = "BACKUP_NOT_RUN_ON_MASTER" +const BackupOperationStatus_ERROR_CODE_BACKUP_SERVER_UNREACHABLE = "BACKUP_SERVER_UNREACHABLE" +const BackupOperationStatus_ERROR_CODE_BACKUP_AUTHENTICATION_FAILURE = "BACKUP_AUTHENTICATION_FAILURE" +const BackupOperationStatus_ERROR_CODE_BACKUP_PERMISSION_ERROR = "BACKUP_PERMISSION_ERROR" +const BackupOperationStatus_ERROR_CODE_BACKUP_TIMEOUT = "BACKUP_TIMEOUT" +const BackupOperationStatus_ERROR_CODE_BACKUP_BAD_FINGERPRINT = "BACKUP_BAD_FINGERPRINT" +const BackupOperationStatus_ERROR_CODE_BACKUP_GENERIC_ERROR = "BACKUP_GENERIC_ERROR" +const BackupOperationStatus_ERROR_CODE_UPGRADE_IN_PROGRESS = "UPGRADE_IN_PROGRESS" + +func (s *BackupOperationStatus) GetType__() bindings.BindingType { + return BackupOperationStatusBindingType() +} + +func (s *BackupOperationStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BackupOperationStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Data for a single backup/restore card +type BackupOverview struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of timestamps of backed-up cluster files + Results []ClusterBackupInfo + BackupConfig *BackupConfiguration + BackupOperationHistory *BackupOperationHistory + CurrentBackupOperationStatus *CurrentBackupOperationStatus + RestoreStatus *ClusterRestoreStatus +} + +func (s *BackupOverview) GetType__() bindings.BindingType { + return BackupOverviewBindingType() +} + +func (s *BackupOverview) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BackupOverview._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Abstract base type for Weekly or Interval Backup Schedule +type BackupSchedule struct { + // Possible values are: + // + // * BackupSchedule#BackupSchedule_RESOURCE_TYPE_WEEKLYBACKUPSCHEDULE + // * BackupSchedule#BackupSchedule_RESOURCE_TYPE_INTERVALBACKUPSCHEDULE + // + // Schedule type + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const BackupSchedule__TYPE_IDENTIFIER = "BackupSchedule" +const BackupSchedule_RESOURCE_TYPE_WEEKLYBACKUPSCHEDULE = "WeeklyBackupSchedule" +const BackupSchedule_RESOURCE_TYPE_INTERVALBACKUPSCHEDULE = "IntervalBackupSchedule" + +func (s *BackupSchedule) GetType__() bindings.BindingType { + return BackupScheduleBindingType() +} + +func (s *BackupSchedule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BackupSchedule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BackupUiFramesInfo struct { + // Possible values are: + // + // * BackupUiFramesInfo#BackupUiFramesInfo_ACTIVE_GM_ACTIVE + // * BackupUiFramesInfo#BackupUiFramesInfo_ACTIVE_GM_STANDBY + // * BackupUiFramesInfo#BackupUiFramesInfo_ACTIVE_GM_NONE + // * BackupUiFramesInfo#BackupUiFramesInfo_ACTIVE_GM_INVALID + // + // Does site have active GM + ActiveGm *string + // Possible values are: + // + // * BackupUiFramesInfo#BackupUiFramesInfo_API_ENDPOINT_GLOBAL_MANAGER + // * BackupUiFramesInfo#BackupUiFramesInfo_API_ENDPOINT_NSXAPI + // * BackupUiFramesInfo#BackupUiFramesInfo_API_ENDPOINT_ICA + // + // prefix to be used for api call + ApiEndpoint *string + // Possible values are: + // + // * BackupUiFramesInfo#BackupUiFramesInfo_FRAME_TYPE_GLOBAL_MANAGER + // * BackupUiFramesInfo#BackupUiFramesInfo_FRAME_TYPE_LOCAL_MANAGER + // * BackupUiFramesInfo#BackupUiFramesInfo_FRAME_TYPE_LOCAL_LOCAL_MANAGER + // * BackupUiFramesInfo#BackupUiFramesInfo_FRAME_TYPE_NSX_INTELLIGENCE + // + // Type of service, for which backup is handled + FrameType *string + // Id of the site + SiteId *string + // Version of the site + SiteVersion *string +} + +const BackupUiFramesInfo_ACTIVE_GM_ACTIVE = "ACTIVE" +const BackupUiFramesInfo_ACTIVE_GM_STANDBY = "STANDBY" +const BackupUiFramesInfo_ACTIVE_GM_NONE = "NONE" +const BackupUiFramesInfo_ACTIVE_GM_INVALID = "INVALID" +const BackupUiFramesInfo_API_ENDPOINT_GLOBAL_MANAGER = "global-manager" +const BackupUiFramesInfo_API_ENDPOINT_NSXAPI = "nsxapi" +const BackupUiFramesInfo_API_ENDPOINT_ICA = "ica" +const BackupUiFramesInfo_FRAME_TYPE_GLOBAL_MANAGER = "GLOBAL_MANAGER" +const BackupUiFramesInfo_FRAME_TYPE_LOCAL_MANAGER = "LOCAL_MANAGER" +const BackupUiFramesInfo_FRAME_TYPE_LOCAL_LOCAL_MANAGER = "LOCAL_LOCAL_MANAGER" +const BackupUiFramesInfo_FRAME_TYPE_NSX_INTELLIGENCE = "NSX_INTELLIGENCE" + +func (s *BackupUiFramesInfo) GetType__() bindings.BindingType { + return BackupUiFramesInfoBindingType() +} + +func (s *BackupUiFramesInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BackupUiFramesInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BackupUiFramesInfoList struct { + // List of backup frames(and metadata) to be displayed in UI + BackupFramesList []BackupUiFramesInfo +} + +func (s *BackupUiFramesInfoList) GetType__() bindings.BindingType { + return BackupUiFramesInfoListBindingType() +} + +func (s *BackupUiFramesInfoList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BackupUiFramesInfoList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BaseFirewallProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLSESSIONTIMERPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLCPUMEMTHRESHOLDSPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLFLOODPROTECTIONPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLDNSPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_GENERALSECURITYSETTINGSPROFILE + // + // Resource type to use as profile type + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const BaseFirewallProfile__TYPE_IDENTIFIER = "BaseFirewallProfile" +const BaseFirewallProfile_RESOURCE_TYPE_FIREWALLSESSIONTIMERPROFILE = "FirewallSessionTimerProfile" +const BaseFirewallProfile_RESOURCE_TYPE_FIREWALLCPUMEMTHRESHOLDSPROFILE = "FirewallCpuMemThresholdsProfile" +const BaseFirewallProfile_RESOURCE_TYPE_FIREWALLFLOODPROTECTIONPROFILE = "FirewallFloodProtectionProfile" +const BaseFirewallProfile_RESOURCE_TYPE_FIREWALLDNSPROFILE = "FirewallDnsProfile" +const BaseFirewallProfile_RESOURCE_TYPE_GENERALSECURITYSETTINGSPROFILE = "GeneralSecuritySettingsProfile" + +func (s *BaseFirewallProfile) GetType__() bindings.BindingType { + return BaseFirewallProfileBindingType() +} + +func (s *BaseFirewallProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BaseFirewallProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BaseHostSwitchProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * BaseHostSwitchProfile#BaseHostSwitchProfile_RESOURCE_TYPE_UPLINKHOSTSWITCHPROFILE + // * BaseHostSwitchProfile#BaseHostSwitchProfile_RESOURCE_TYPE_LLDPHOSTSWITCHPROFILE + // * BaseHostSwitchProfile#BaseHostSwitchProfile_RESOURCE_TYPE_NIOCPROFILE + // * BaseHostSwitchProfile#BaseHostSwitchProfile_RESOURCE_TYPE_EXTRACONFIGHOSTSWITCHPROFILE + // + // Supported HostSwitch profiles. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + RequiredCapabilities []string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const BaseHostSwitchProfile__TYPE_IDENTIFIER = "BaseHostSwitchProfile" +const BaseHostSwitchProfile_RESOURCE_TYPE_UPLINKHOSTSWITCHPROFILE = "UplinkHostSwitchProfile" +const BaseHostSwitchProfile_RESOURCE_TYPE_LLDPHOSTSWITCHPROFILE = "LldpHostSwitchProfile" +const BaseHostSwitchProfile_RESOURCE_TYPE_NIOCPROFILE = "NiocProfile" +const BaseHostSwitchProfile_RESOURCE_TYPE_EXTRACONFIGHOSTSWITCHPROFILE = "ExtraConfigHostSwitchProfile" + +func (s *BaseHostSwitchProfile) GetType__() bindings.BindingType { + return BaseHostSwitchProfileBindingType() +} + +func (s *BaseHostSwitchProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BaseHostSwitchProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BaseNodeAggregateInfo struct { + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Array of Node interface statistic properties + NodeInterfaceProperties []NodeInterfaceProperties + // Array of Node network interface statistic properties + NodeInterfaceStatistics []NodeInterfaceStatisticsProperties + NodeStatus *ClusterNodeStatus + // Time series of the node's system properties + NodeStatusProperties []NodeStatusProperties +} + +func (s *BaseNodeAggregateInfo) GetType__() bindings.BindingType { + return BaseNodeAggregateInfoBindingType() +} + +func (s *BaseNodeAggregateInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BaseNodeAggregateInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BasePktCapResource struct { + // Type of packet capture resource + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const BasePktCapResource__TYPE_IDENTIFIER = "BasePktCapResource" + +func (s *BasePktCapResource) GetType__() bindings.BindingType { + return BasePktCapResourceBindingType() +} + +func (s *BasePktCapResource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BasePktCapResource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The deployment of a registered service. service instance is instantiation of service. +type BaseServiceInstance struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * BaseServiceInstance#BaseServiceInstance_RESOURCE_TYPE_SERVICEINSTANCE + // * BaseServiceInstance#BaseServiceInstance_RESOURCE_TYPE_BYODSERVICEINSTANCE + // * BaseServiceInstance#BaseServiceInstance_RESOURCE_TYPE_VIRTUALSERVICEINSTANCE + // + // ServiceInstance is used when NSX handles the lifecyle of appliance. Deployment and appliance related all the information is necessary. ByodServiceInstance is a custom instance to be used when NSX is not handling the lifecycles of appliance/s. User will manage their own appliance (BYOD) to connect with NSX. VirtualServiceInstance is a a custom instance to be used when NSX is not handling the lifecycle of an appliance and when the user is not bringing their own appliance. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * BaseServiceInstance#BaseServiceInstance_ON_FAILURE_POLICY_ALLOW + // * BaseServiceInstance#BaseServiceInstance_ON_FAILURE_POLICY_BLOCK + // + // Failure policy of the service instance - if it has to be different from the service. By default the service instance inherits the FailurePolicy of the service it belongs to. + OnFailurePolicy *string + // The Service to which the service instance is associated. + ServiceId *string + // Possible values are: + // + // * BaseServiceInstance#BaseServiceInstance_TRANSPORT_TYPE_L2_BRIDGE + // * BaseServiceInstance#BaseServiceInstance_TRANSPORT_TYPE_L3_ROUTED + // * BaseServiceInstance#BaseServiceInstance_TRANSPORT_TYPE_NSH + // * BaseServiceInstance#BaseServiceInstance_TRANSPORT_TYPE_NA + // + // Transport to be used by this service instance for deploying the Service-VM. This field is to be set Not Applicable(NA) if the service only caters to functionality EPP(Endpoint Protection) and MPS. + TransportType *string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const BaseServiceInstance__TYPE_IDENTIFIER = "BaseServiceInstance" +const BaseServiceInstance_RESOURCE_TYPE_SERVICEINSTANCE = "ServiceInstance" +const BaseServiceInstance_RESOURCE_TYPE_BYODSERVICEINSTANCE = "ByodServiceInstance" +const BaseServiceInstance_RESOURCE_TYPE_VIRTUALSERVICEINSTANCE = "VirtualServiceInstance" +const BaseServiceInstance_ON_FAILURE_POLICY_ALLOW = "ALLOW" +const BaseServiceInstance_ON_FAILURE_POLICY_BLOCK = "BLOCK" +const BaseServiceInstance_TRANSPORT_TYPE_L2_BRIDGE = "L2_BRIDGE" +const BaseServiceInstance_TRANSPORT_TYPE_L3_ROUTED = "L3_ROUTED" +const BaseServiceInstance_TRANSPORT_TYPE_NSH = "NSH" +const BaseServiceInstance_TRANSPORT_TYPE_NA = "NA" + +func (s *BaseServiceInstance) GetType__() bindings.BindingType { + return BaseServiceInstanceBindingType() +} + +func (s *BaseServiceInstance) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BaseServiceInstance._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Base Service Profile +type BaseServiceProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Service Profile type, for example 'GiServiceProfile', 'ServiceInsertionServiceProfile' + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const BaseServiceProfile__TYPE_IDENTIFIER = "BaseServiceProfile" + +func (s *BaseServiceProfile) GetType__() bindings.BindingType { + return BaseServiceProfileBindingType() +} + +func (s *BaseServiceProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BaseServiceProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BaseSwitchingProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + RequiredCapabilities []string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const BaseSwitchingProfile__TYPE_IDENTIFIER = "BaseSwitchingProfile" + +func (s *BaseSwitchingProfile) GetType__() bindings.BindingType { + return BaseSwitchingProfileBindingType() +} + +func (s *BaseSwitchingProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BaseSwitchingProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BasicAuthenticationScheme struct { + // Possible values are: + // + // * BasicAuthenticationScheme#BasicAuthenticationScheme_SCHEME_NAME_BASIC + // + // Authentication scheme name + SchemeName *string + // Password to authenticate with + Password *string + // User name to authenticate with + Username *string +} + +const BasicAuthenticationScheme_SCHEME_NAME_BASIC = "basic" + +func (s *BasicAuthenticationScheme) GetType__() bindings.BindingType { + return BasicAuthenticationSchemeBindingType() +} + +func (s *BasicAuthenticationScheme) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BasicAuthenticationScheme._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A set of operations to be performed in a single batch +type BatchRequest struct { + // Continue even if an error is encountered. + ContinueOnError *bool + Requests []BatchRequestItem +} + +func (s *BatchRequest) GetType__() bindings.BindingType { + return BatchRequestBindingType() +} + +func (s *BatchRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BatchRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A single request within a batch of operations +type BatchRequestItem struct { + Body *data.StructValue + // Possible values are: + // + // * BatchRequestItem#BatchRequestItem_METHOD_GET + // * BatchRequestItem#BatchRequestItem_METHOD_POST + // * BatchRequestItem#BatchRequestItem_METHOD_PUT + // * BatchRequestItem#BatchRequestItem_METHOD_DELETE + // * BatchRequestItem#BatchRequestItem_METHOD_PATCH + // + // http method type + Method *string + // relative uri (path and args), of the call including resource id (if this is a POST/DELETE), exclude hostname and port and prefix, exploded form of parameters + Uri *string +} + +const BatchRequestItem_METHOD_GET = "GET" +const BatchRequestItem_METHOD_POST = "POST" +const BatchRequestItem_METHOD_PUT = "PUT" +const BatchRequestItem_METHOD_DELETE = "DELETE" +const BatchRequestItem_METHOD_PATCH = "PATCH" + +func (s *BatchRequestItem) GetType__() bindings.BindingType { + return BatchRequestItemBindingType() +} + +func (s *BatchRequestItem) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BatchRequestItem._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The reponse to a batch operation +type BatchResponse struct { + // Indicates if any of the APIs failed + HasErrors *bool + // Bulk list results + Results []BatchResponseItem + // Optional flag indicating that all items were rolled back even if succeeded initially + RolledBack *bool +} + +func (s *BatchResponse) GetType__() bindings.BindingType { + return BatchResponseBindingType() +} + +func (s *BatchResponse) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BatchResponse._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A single respose in a list of batched responses +type BatchResponseItem struct { + // object returned by api + Body *data.StructValue + // http status code format: int64 + Code *int64 + // The headers returned by the API call + Headers *data.StructValue +} + +func (s *BatchResponseItem) GetType__() bindings.BindingType { + return BatchResponseItemBindingType() +} + +func (s *BatchResponseItem) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BatchResponseItem._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// BFD configuration for LogicalRouter +type BfdConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Number of times a packet is missed before BFD declares the neighbor down. format: int64 + DeclareDeadMultiple *int64 + // Flag to enable BFD for this LogicalRouter + Enabled *bool + // Logical router id + LogicalRouterId *string + // the time interval (in milliseconds) between heartbeat packets for BFD when receiving heartbeats. format: int64 + ReceiveInterval *int64 + // the time interval (in milliseconds) between heartbeat packets for BFD when sending heartbeats. format: int64 + TransmitInterval *int64 +} + +func (s *BfdConfig) GetType__() bindings.BindingType { + return BfdConfigBindingType() +} + +func (s *BfdConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BfdConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// BFD configuration for the given Peer. +type BfdConfigParameters struct { + // Number of times a packet is missed before BFD declares the neighbor down. format: int64 + DeclareDeadMultiple *int64 + // The time interval (in milliseconds) between heartbeat packets for BFD when receiving heartbeats.| For edge cluster type of bare metal, this value should be >= 50ms.| For edge cluster type of virtual machine or hybrid, this value should be >= 500ms. format: int64 + ReceiveInterval *int64 + // The time interval (in milliseconds) between heartbeat packets for BFD when sending heartbeats.| For edge cluster type of bare metal, this value should be >= 300ms.| For edge cluster type of virtual machine or hybrid, this value should be >= 1000ms. format: int64 + TransmitInterval *int64 +} + +func (s *BfdConfigParameters) GetType__() bindings.BindingType { + return BfdConfigParametersBindingType() +} + +func (s *BfdConfigParameters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BfdConfigParameters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Profile for BFD health monitoring +type BfdHealthMonitoringProfile struct { + // Whether the heartbeat is enabled. A POST or PUT request with \"enabled\" false (with no probe intervals) will set (POST) or reset (PUT) the probe_interval to their default value. + Enabled *bool + // The flag is to turn on/off latency. A POST or PUT request with \"latency_enabled\" true will enable NSX to send the networking latency data to thrid-party monitoring tools like vRNI. + LatencyEnabled *bool + // The time interval (in millisec) between probe packets for tunnels between transport nodes. format: int64 + ProbeInterval *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * TransportZoneProfile#TransportZoneProfile_RESOURCE_TYPE_BFDHEALTHMONITORINGPROFILE + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const BfdHealthMonitoringProfile__TYPE_IDENTIFIER = "BfdHealthMonitoringProfile" + +func (s *BfdHealthMonitoringProfile) GetType__() bindings.BindingType { + return BfdHealthMonitoringProfileBindingType() +} + +func (s *BfdHealthMonitoringProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BfdHealthMonitoringProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BgpAddressFamily struct { + // Count of in prefixes format: int64 + InPrefixCount *int64 + // Count of out prefixes format: int64 + OutPrefixCount *int64 + // Possible values are: + // + // * BgpAddressFamily#BgpAddressFamily_TYPE_IPV4_UNICAST + // * BgpAddressFamily#BgpAddressFamily_TYPE_VPNV4_UNICAST + // * BgpAddressFamily#BgpAddressFamily_TYPE_IPV6_UNICAST + // * BgpAddressFamily#BgpAddressFamily_TYPE_L2VPN_EVPN + // + // BGP address family type + Type_ *string +} + +const BgpAddressFamily_TYPE_IPV4_UNICAST = "IPV4_UNICAST" +const BgpAddressFamily_TYPE_VPNV4_UNICAST = "VPNV4_UNICAST" +const BgpAddressFamily_TYPE_IPV6_UNICAST = "IPV6_UNICAST" +const BgpAddressFamily_TYPE_L2VPN_EVPN = "L2VPN_EVPN" + +func (s *BgpAddressFamily) GetType__() bindings.BindingType { + return BgpAddressFamilyBindingType() +} + +func (s *BgpAddressFamily) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpAddressFamily._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// BGP configuration for Tier0 logical router. We create BGP configuration while creation of Tier0 logical router. +type BgpConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // For VRF logical router, the as_num from parent logical router will be effective. + AsNum *string + // This is a deprecated property, Please use 'as_num' instead. For VRF logical router, the as_number from parent logical router will be effective. format: int64 + AsNumber *int64 + // While creation of BGP config this flag will be set to true User can change this value while updating BGP config. If this property is not specified in the payload, the default value will be considered as true. + Ecmp *bool + // While creation of BGP config this flag will be set to - true for Tier0 logical router with Active-Active high-availability mode - false for Tier0 logical router with Active-Standby high-availanility mode. User can change this value while updating the config. If this property is not specified in the payload, the default value will be considered as false irrespective of the high-availability mode. + Enabled *bool + // Flag to enable graceful restart. This field is deprecated, kindly use graceful_restart_config parameter for graceful restart configuration. If both parameters are set and consistent with each other [i.e. graceful_restart=false and graceful_restart_mode=HELPER_ONLY OR graceful_restart=true and graceful_restart_mode=GR_AND_HELPER] then this is allowed, but if inconsistent with each other then this is not allowed and validation error will be thrown. For VRF logical router, the settings from parent logical router will be effective. + GracefulRestart *bool + GracefulRestartConfig *GracefulRestartConfig + InterSrIbgp *InterSRRoutingConfig + // Logical router id + LogicalRouterId *string + // For TIER0 logical router, default is true. For VRF logical router, the settings from parent logical router will be effective. + MultipathRelax *bool + // List of routes to be aggregated + RouteAggregation []BgpRouteAggregation +} + +func (s *BgpConfig) GetType__() bindings.BindingType { + return BgpConfigBindingType() +} + +func (s *BgpConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BgpNeighbor struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // User can enable the neighbor for the specific address families and also define filters per address family. When the neighbor is created, it is default enabled for IPV4_UNICAST address family for backward compatibility reasons. User can change that if required, by defining the address family configuration. + AddressFamilies []BgpNeighborAddressFamily + // Flag to enable allowas_in option for BGP neighbor + AllowAsIn *bool + BfdConfig *BfdConfigParameters + // Flag to enable BFD for this BGP Neighbor. Enable this if the neighbor supports BFD as this will lead to faster convergence. + EnableBfd *bool + // Flag to enable this BGP Neighbor + Enabled *bool + // This is a deprecated property, Please use 'address_family' instead. + FilterInIpprefixlistId *string + // This is a deprecated property, Please use 'address_family' instead. + FilterInRoutemapId *string + // This is a deprecated property, Please use 'address_family' instead. + FilterOutIpprefixlistId *string + // This is a deprecated property, Please use 'address_family' instead. + FilterOutRoutemapId *string + // Possible values are: + // + // * BgpNeighbor#BgpNeighbor_GRACEFUL_RESTART_MODE_DISABLE + // * BgpNeighbor#BgpNeighbor_GRACEFUL_RESTART_MODE_HELPER_ONLY + // * BgpNeighbor#BgpNeighbor_GRACEFUL_RESTART_MODE_GR_AND_HELPER + // + // BGP Graceful Restart mode. If specified, then it will take precedence over global Graceful Restart mode configured in logical router BgpConfig otherwise BgpConfig level Graceful Restart mode will be applicable for peer. + GracefulRestartMode *string + // Wait period (seconds) before declaring peer dead format: int64 + HoldDownTimer *int64 + // Frequency (seconds) with which keep alive messages are sent to peers format: int64 + KeepAliveTimer *int64 + // Logical router id + LogicalRouterId *string + // This value is set on TTL(time to live) of BGP header. When router receives the BGP packet, it decrements the TTL. The default value of TTL is one when BPG request is initiated.So in the case of a BGP peer multiple hops away and and value of TTL is one, then next router in the path will decrement the TTL to 0, realize it cant forward the packet and will drop it. If the hop count value to reach neighbor is equal to or less than the maximum_hop_limit value then intermediate router decrements the TTL count by one and forwards the request to BGP neighour. If the hop count value is greater than the maximum_hop_limit value then intermediate router discards the request when TTL becomes 0. format: int32 + MaximumHopLimit *int64 + // Neighbor IP Address format: ip + NeighborAddress *string + // User can create (POST) the neighbor with or without the password. The view (GET) on the neighbor, would never reveal if the password is set or not. The password can be set later using edit neighbor workFlow (PUT) On the edit neighbor (PUT), if the user does not specify the password property, the older value is retained. Maximum length of this field is 32 characters. + Password *string + // This is a deprecated property, Please use 'remote_as_num' instead. format: int64 + RemoteAs *int64 + // 4 Byte ASN of the neighbor in ASPLAIN/ASDOT Format + RemoteAsNum *string + // Deprecated - do not provide a value for this field. Use source_addresses instead. format: ip + SourceAddress *string + // BGP neighborship will be formed from all these source addresses to this neighbour. format: ip + SourceAddresses []string +} + +const BgpNeighbor_GRACEFUL_RESTART_MODE_DISABLE = "DISABLE" +const BgpNeighbor_GRACEFUL_RESTART_MODE_HELPER_ONLY = "HELPER_ONLY" +const BgpNeighbor_GRACEFUL_RESTART_MODE_GR_AND_HELPER = "GR_AND_HELPER" + +func (s *BgpNeighbor) GetType__() bindings.BindingType { + return BgpNeighborBindingType() +} + +func (s *BgpNeighbor) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpNeighbor._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BgpNeighborAddressFamily struct { + // Enable this address family + Enabled *bool + // Id of the IPPrefix List to be used for IN direction filter + InFilterIpprefixlistId *string + // Id of the RouteMap to be used for IN direction filter + InFilterRoutemapId *string + // Maximum number of routes supported on the address family format: int64 + MaximumRoutes *int64 + // Id of the IPPrefixList to be used for OUT direction filter + OutFilterIpprefixlistId *string + // Id of the RouteMap to be used for OUT direction filter + OutFilterRoutemapId *string + // Possible values are: + // + // * BgpNeighborAddressFamily#BgpNeighborAddressFamily_TYPE_IPV4_UNICAST + // * BgpNeighborAddressFamily#BgpNeighborAddressFamily_TYPE_VPNV4_UNICAST + // * BgpNeighborAddressFamily#BgpNeighborAddressFamily_TYPE_IPV6_UNICAST + // * BgpNeighborAddressFamily#BgpNeighborAddressFamily_TYPE_L2VPN_EVPN + // + // Address family type + Type_ *string +} + +const BgpNeighborAddressFamily_TYPE_IPV4_UNICAST = "IPV4_UNICAST" +const BgpNeighborAddressFamily_TYPE_VPNV4_UNICAST = "VPNV4_UNICAST" +const BgpNeighborAddressFamily_TYPE_IPV6_UNICAST = "IPV6_UNICAST" +const BgpNeighborAddressFamily_TYPE_L2VPN_EVPN = "L2VPN_EVPN" + +func (s *BgpNeighborAddressFamily) GetType__() bindings.BindingType { + return BgpNeighborAddressFamilyBindingType() +} + +func (s *BgpNeighborAddressFamily) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpNeighborAddressFamily._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BgpNeighborListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paginated list of bgp neighbors + Results []BgpNeighbor +} + +func (s *BgpNeighborListResult) GetType__() bindings.BindingType { + return BgpNeighborListResultBindingType() +} + +func (s *BgpNeighborListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpNeighborListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// BGP neighbor learned/advertised route details. +type BgpNeighborRouteDetails struct { + // Logical router id + LogicalRouterId *string + // BGP neighbor peer IP address. format: ip + NeighborAddress *string + // BGP neighbor id + NeighborId *string + // Array of BGP neighbor route details per transport node. + PerTransportNodeRoutes []RoutesPerTransportNode +} + +func (s *BgpNeighborRouteDetails) GetType__() bindings.BindingType { + return BgpNeighborRouteDetailsBindingType() +} + +func (s *BgpNeighborRouteDetails) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpNeighborRouteDetails._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// BGP neighbor learned/advertised route details. +type BgpNeighborRouteDetailsCsvRecord struct { + // BGP AS path attribute. + AsPath *string + // BGP Local Preference attribute. format: int64 + LocalPref *int64 + // Logical router id + LogicalRouterId *string + // BGP Multi Exit Discriminator attribute. format: int64 + Med *int64 + // BGP neighbor peer IP address. format: ip + NeighborAddress *string + // BGP neighbor id + NeighborId *string + // CIDR network address. format: ip-cidr-block + Network *string + // Next hop IP address. format: ip + NextHop *string + // BGP neighbor source address. format: ip + SourceAddress *string + // Transport node id + TransportNodeId *string + // BGP Weight attribute. format: int64 + Weight *int64 +} + +func (s *BgpNeighborRouteDetailsCsvRecord) GetType__() bindings.BindingType { + return BgpNeighborRouteDetailsCsvRecordBindingType() +} + +func (s *BgpNeighborRouteDetailsCsvRecord) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpNeighborRouteDetailsCsvRecord._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BgpNeighborRouteDetailsInCsvFormat struct { + // File name set by HTTP server if API returns CSV result as a file. + FileName *string + Results []BgpNeighborRouteDetailsCsvRecord +} + +func (s *BgpNeighborRouteDetailsInCsvFormat) GetType__() bindings.BindingType { + return BgpNeighborRouteDetailsInCsvFormatBindingType() +} + +func (s *BgpNeighborRouteDetailsInCsvFormat) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpNeighborRouteDetailsInCsvFormat._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BgpNeighborStatus struct { + // Address families of BGP neighbor + AddressFamilies []BgpAddressFamily + // BGP capabilities sent to BGP neighbor. + AnnouncedCapabilities []string + // Count of connection drop format: int64 + ConnectionDropCount *int64 + // Possible values are: + // + // * BgpNeighborStatus#BgpNeighborStatus_CONNECTION_STATE_INVALID + // * BgpNeighborStatus#BgpNeighborStatus_CONNECTION_STATE_IDLE + // * BgpNeighborStatus#BgpNeighborStatus_CONNECTION_STATE_CONNECT + // * BgpNeighborStatus#BgpNeighborStatus_CONNECTION_STATE_ACTIVE + // * BgpNeighborStatus#BgpNeighborStatus_CONNECTION_STATE_OPEN_SENT + // * BgpNeighborStatus#BgpNeighborStatus_CONNECTION_STATE_OPEN_CONFIRM + // * BgpNeighborStatus#BgpNeighborStatus_CONNECTION_STATE_ESTABLISHED + // * BgpNeighborStatus#BgpNeighborStatus_CONNECTION_STATE_UNKNOWN + // + // Current state of the BGP session. + ConnectionState *string + // Count of connections established format: int64 + EstablishedConnectionCount *int64 + // Current state of graceful restart where graceful_restart = true indicates graceful restart is enabled and graceful_restart = false indicates graceful restart is disabled. This is deprecated field, use graceful_restart_mode instead. + GracefulRestart *bool + // Current state of graceful restart of BGP neighbor. Possible values are - 1. GR_AND_HELPER - Graceful restart with Helper 2. HELPER_ONLY - Helper only 3. DISABLE - Disabled + GracefulRestartMode *string + // Time in ms to wait for HELLO from BGP peer. If a HELLO packet is not seen from BGP Peer withing hold_time then BGP neighbor will be marked as down. format: int64 + HoldTime *int64 + // Time in ms to wait for HELLO packet from BGP peer format: int64 + KeepAliveInterval *int64 + // TCP port number of Local BGP connection format: int64 + LocalPort *int64 + // Logical router component(Service Router/Distributed Router) id + LrComponentId *string + // Count of messages received from the neighbor format: int64 + MessagesReceived *int64 + // Count of messages sent to the neighbor format: int64 + MessagesSent *int64 + // BGP capabilities negotiated with BGP neighbor. + NegotiatedCapability []string + // The IP of the BGP neighbor format: ip + NeighborAddress *string + // Router ID of the BGP neighbor. format: ip + NeighborRouterId *string + // AS number of the BGP neighbor + RemoteAsNumber *string + // TCP port number of remote BGP Connection format: int64 + RemotePort *int64 + RemoteSite *ResourceReference + // The Ip address of logical port format: ip + SourceAddress *string + // Time(in seconds) since connection was established. format: int64 + TimeSinceEstablished *int64 + // Sum of in prefixes counts across all address families. format: int64 + TotalInPrefixCount *int64 + // Sum of out prefixes counts across all address families. format: int64 + TotalOutPrefixCount *int64 + TransportNode *ResourceReference + // Possible values are: + // + // * BgpNeighborStatus#BgpNeighborStatus_TYPE_INTER_SR + // * BgpNeighborStatus#BgpNeighborStatus_TYPE_USER + // + // BGP neighbor type + Type_ *string +} + +const BgpNeighborStatus_CONNECTION_STATE_INVALID = "INVALID" +const BgpNeighborStatus_CONNECTION_STATE_IDLE = "IDLE" +const BgpNeighborStatus_CONNECTION_STATE_CONNECT = "CONNECT" +const BgpNeighborStatus_CONNECTION_STATE_ACTIVE = "ACTIVE" +const BgpNeighborStatus_CONNECTION_STATE_OPEN_SENT = "OPEN_SENT" +const BgpNeighborStatus_CONNECTION_STATE_OPEN_CONFIRM = "OPEN_CONFIRM" +const BgpNeighborStatus_CONNECTION_STATE_ESTABLISHED = "ESTABLISHED" +const BgpNeighborStatus_CONNECTION_STATE_UNKNOWN = "UNKNOWN" +const BgpNeighborStatus_TYPE_INTER_SR = "INTER_SR" +const BgpNeighborStatus_TYPE_USER = "USER" + +func (s *BgpNeighborStatus) GetType__() bindings.BindingType { + return BgpNeighborStatusBindingType() +} + +func (s *BgpNeighborStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpNeighborStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BgpNeighborStatusLiteDto struct { + // Possible values are: + // + // * BgpNeighborStatusLiteDto#BgpNeighborStatusLiteDto_CONNECTION_STATE_INVALID + // * BgpNeighborStatusLiteDto#BgpNeighborStatusLiteDto_CONNECTION_STATE_IDLE + // * BgpNeighborStatusLiteDto#BgpNeighborStatusLiteDto_CONNECTION_STATE_CONNECT + // * BgpNeighborStatusLiteDto#BgpNeighborStatusLiteDto_CONNECTION_STATE_ACTIVE + // * BgpNeighborStatusLiteDto#BgpNeighborStatusLiteDto_CONNECTION_STATE_OPEN_SENT + // * BgpNeighborStatusLiteDto#BgpNeighborStatusLiteDto_CONNECTION_STATE_OPEN_CONFIRM + // * BgpNeighborStatusLiteDto#BgpNeighborStatusLiteDto_CONNECTION_STATE_ESTABLISHED + // * BgpNeighborStatusLiteDto#BgpNeighborStatusLiteDto_CONNECTION_STATE_UNKNOWN + // + // Current state of the BGP session. + ConnectionState *string + // Ip address of BGP neighbor. format: ip + NeighborAddress *string + RemoteSite *ResourceReference + // Source Ip address. format: ip + SourceAddress *string +} + +const BgpNeighborStatusLiteDto_CONNECTION_STATE_INVALID = "INVALID" +const BgpNeighborStatusLiteDto_CONNECTION_STATE_IDLE = "IDLE" +const BgpNeighborStatusLiteDto_CONNECTION_STATE_CONNECT = "CONNECT" +const BgpNeighborStatusLiteDto_CONNECTION_STATE_ACTIVE = "ACTIVE" +const BgpNeighborStatusLiteDto_CONNECTION_STATE_OPEN_SENT = "OPEN_SENT" +const BgpNeighborStatusLiteDto_CONNECTION_STATE_OPEN_CONFIRM = "OPEN_CONFIRM" +const BgpNeighborStatusLiteDto_CONNECTION_STATE_ESTABLISHED = "ESTABLISHED" +const BgpNeighborStatusLiteDto_CONNECTION_STATE_UNKNOWN = "UNKNOWN" + +func (s *BgpNeighborStatusLiteDto) GetType__() bindings.BindingType { + return BgpNeighborStatusLiteDtoBindingType() +} + +func (s *BgpNeighborStatusLiteDto) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpNeighborStatusLiteDto._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BgpNeighborsStatusListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Timestamp when the data was last updated, unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // Logical router id + LogicalRouterId *string + // Name of the logical router + LogicalRouterName *string + // Status of BGP neighbors of the logical router + Results []BgpNeighborStatus +} + +func (s *BgpNeighborsStatusListResult) GetType__() bindings.BindingType { + return BgpNeighborsStatusListResultBindingType() +} + +func (s *BgpNeighborsStatusListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpNeighborsStatusListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BgpRouteAggregation struct { + // cidr of the aggregate address format: ip-cidr-block + Prefix *string + // Flag to send only summarized route + SummaryOnly *bool +} + +func (s *BgpRouteAggregation) GetType__() bindings.BindingType { + return BgpRouteAggregationBindingType() +} + +func (s *BgpRouteAggregation) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BgpRouteAggregation._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BinaryPacketData struct { + // Up to 1000 bytes of payload may be supplied (with a base64-encoded length of 1336 bytes.) Additional bytes of traceflow metadata will be appended to the payload. The payload must contain all headers (Ethernet, IP, etc). Note that VLAN is not supported in the logical space. Hence, payload must not contain 802.1Q headers. + Payload *string + // If the requested frame_size is too small (given the payload and traceflow metadata requirement of 16 bytes), the traceflow request will fail with an appropriate message. The frame will be zero padded to the requested size. format: int64 + FrameSize *int64 + // Possible values are: + // + // * PacketData#PacketData_RESOURCE_TYPE_BINARYPACKETDATA + // * PacketData#PacketData_RESOURCE_TYPE_FIELDSPACKETDATA + // + // Packet configuration + ResourceType string + // A flag, when set true, indicates that the traceflow packet is of L3 routing. + Routed *bool + // Possible values are: + // + // * PacketData#PacketData_TRANSPORT_TYPE_BROADCAST + // * PacketData#PacketData_TRANSPORT_TYPE_UNICAST + // * PacketData#PacketData_TRANSPORT_TYPE_MULTICAST + // * PacketData#PacketData_TRANSPORT_TYPE_UNKNOWN + // + // This type takes effect only for IP packet. + TransportType *string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const BinaryPacketData__TYPE_IDENTIFIER = "BinaryPacketData" + +func (s *BinaryPacketData) GetType__() bindings.BindingType { + return BinaryPacketDataBindingType() +} + +func (s *BinaryPacketData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BinaryPacketData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// BPDU filter configuration +type BpduFilter struct { + // Indicates whether BPDU filter is enabled + Enabled *bool + // Pre-defined list of allowed MAC addresses to be excluded from BPDU filtering + WhiteList []string +} + +func (s *BpduFilter) GetType__() bindings.BindingType { + return BpduFilterBindingType() +} + +func (s *BpduFilter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BpduFilter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A bridge endpoint can be created on a bridge cluster or on an edge cluster. Few of the properties of this class will not be used depending on the type of bridge endpoint being created. When creating a bridge endpoint on a bridge cluster, following propeties will be used: vlan, bridge_cluster_id and ha_enable. Similarly, for creating a bridge endpoint on an edge cluster following properties will be used: vlan, bridge_endpoint_profile_id and vlan_transport_zone_id. +type BridgeEndpoint struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // This field will not be used if an edge cluster is being used for the bridge endpoint + BridgeClusterId *string + // This field will not be used if a bridge cluster is being used for the bridge endpoint + BridgeEndpointProfileId *string + // This field will not be used if an edge cluster is being used for the bridge endpoint + HaEnable *bool + // This name has to be one of the switching uplink teaming policy names listed inside the TransportZone. If this field is not specified, bridge will use the first pnic in host-switch config. This field will not be used if a bridge cluster is being used for the bridge endpoint + UplinkTeamingPolicyName *string + // This property is used for VLAN specification of bridge endpoint. It's mutually exclusive with 'vlan_trunk_spec', either 'vlan' or 'vlan_trunk_spec' should be specified. format: int64 + Vlan *int64 + // This field will not be used if a bridge cluster is being used for the bridge endpoint + VlanTransportZoneId *string + VlanTrunkSpec *VlanTrunkSpec +} + +func (s *BridgeEndpoint) GetType__() bindings.BindingType { + return BridgeEndpointBindingType() +} + +func (s *BridgeEndpoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BridgeEndpoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Bridge Endpoint queries result +type BridgeEndpointListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // BridgeEndpoint Results + Results []BridgeEndpoint +} + +func (s *BridgeEndpointListResult) GetType__() bindings.BindingType { + return BridgeEndpointListResultBindingType() +} + +func (s *BridgeEndpointListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BridgeEndpointListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Bridge Endpoint Profile +type BridgeEndpointProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // UUID of the edge cluster for this bridge endpoint + EdgeClusterId *string + // First index will be used as the preferred member format: int32 + EdgeClusterMemberIndexes []int64 + // Possible values are: + // + // * BridgeEndpointProfile#BridgeEndpointProfile_FAILOVER_MODE_PREEMPTIVE + // * BridgeEndpointProfile#BridgeEndpointProfile_FAILOVER_MODE_NON_PREEMPTIVE + // + // Faileover mode can be preemmptive or non-preemptive + FailoverMode *string + // Possible values are: + // + // * BridgeEndpointProfile#BridgeEndpointProfile_HIGH_AVAILABILITY_MODE_STANDBY + // + // High avaialability mode can be active-active or active-standby + HighAvailabilityMode *string +} + +const BridgeEndpointProfile_FAILOVER_MODE_PREEMPTIVE = "PREEMPTIVE" +const BridgeEndpointProfile_FAILOVER_MODE_NON_PREEMPTIVE = "NON_PREEMPTIVE" +const BridgeEndpointProfile_HIGH_AVAILABILITY_MODE_STANDBY = "ACTIVE_STANDBY" + +func (s *BridgeEndpointProfile) GetType__() bindings.BindingType { + return BridgeEndpointProfileBindingType() +} + +func (s *BridgeEndpointProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BridgeEndpointProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Bridge Endpoint Profile queries result +type BridgeEndpointProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // BridgeEndpointProfile Results + Results []BridgeEndpointProfile +} + +func (s *BridgeEndpointProfileListResult) GetType__() bindings.BindingType { + return BridgeEndpointProfileListResultBindingType() +} + +func (s *BridgeEndpointProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BridgeEndpointProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BridgeEndpointStatistics struct { + RxBytes *DataCounter + RxPackets *DataCounter + TxBytes *DataCounter + TxPackets *DataCounter + // The id of the bridge endpoint + EndpointId *string + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 +} + +func (s *BridgeEndpointStatistics) GetType__() bindings.BindingType { + return BridgeEndpointStatisticsBindingType() +} + +func (s *BridgeEndpointStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BridgeEndpointStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type BridgeEndpointStatus struct { + // The Ids of the transport nodes which actively serve the endpoint. + ActiveNodes []string + // The id of the bridge endpoint + EndpointId *string + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 +} + +func (s *BridgeEndpointStatus) GetType__() bindings.BindingType { + return BridgeEndpointStatusBindingType() +} + +func (s *BridgeEndpointStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BridgeEndpointStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Profile for BFD HA cluster setting +type BridgeHighAvailabilityClusterProfile struct { + // the time interval (in millisec) between probe packets for heartbeat purpose format: int64 + BfdProbeInterval *int64 + // whether the heartbeat is enabled + Enable *bool + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * ClusterProfile#ClusterProfile_RESOURCE_TYPE_EDGEHIGHAVAILABILITYPROFILE + // * ClusterProfile#ClusterProfile_RESOURCE_TYPE_BRIDGEHIGHAVAILABILITYCLUSTERPROFILE + // + // Supported cluster profiles. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const BridgeHighAvailabilityClusterProfile__TYPE_IDENTIFIER = "BridgeHighAvailabilityClusterProfile" + +func (s *BridgeHighAvailabilityClusterProfile) GetType__() bindings.BindingType { + return BridgeHighAvailabilityClusterProfileBindingType() +} + +func (s *BridgeHighAvailabilityClusterProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BridgeHighAvailabilityClusterProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Information about a management plane node this transport node is configured to communicate with +type BrokerProperties struct { + // Fully qualified domain name of the message bus broker on the management plane node. + BrokerFqdn *string + // IP address or hostname of the message bus broker on the management plane node. format: hostname-or-ipv4 + BrokerIpAddress *string + // Indicates whether this broker is the master. + BrokerIsMaster *string + // Port number of the message bus broker on the management plane node. + BrokerPort *string + // Certificate thumbprint of the message bus broker on the management plane node. + BrokerSslCertThumbprint *string + // Type of host running the broker. + BrokerVirtualHost *string +} + +func (s *BrokerProperties) GetType__() bindings.BindingType { + return BrokerPropertiesBindingType() +} + +func (s *BrokerProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BrokerProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Identifier of the bundle. +type BundleId struct { + // Identifier of bundle upload + BundleId *string +} + +func (s *BundleId) GetType__() bindings.BindingType { + return BundleIdBindingType() +} + +func (s *BundleId) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BundleId._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Contains a list of bundle-ids. +type BundleIds struct { + // Id of a bundle whose upload was failed. + Failed *string + // Id of a bundle whose upload is in-progress. + InProgress *string + // Id of a bundle whose upload is successful. + Successful *string +} + +func (s *BundleIds) GetType__() bindings.BindingType { + return BundleIdsBindingType() +} + +func (s *BundleIds) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BundleIds._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Describes whether bundle upload is allowed or not. +type BundleUploadPermission struct { + // Reason for not allowing upload. + Reason *string + // Flag indication whether upload is allowed or not. + UploadAllowed *bool +} + +func (s *BundleUploadPermission) GetType__() bindings.BindingType { + return BundleUploadPermissionBindingType() +} + +func (s *BundleUploadPermission) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BundleUploadPermission._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Upload status of bundle uploaded from local or remote location. +type BundleUploadStatus struct { + // Name of the uploaded bundle. + BundleName *string + // Detailed status of bundle upload. + DetailedStatus *string + // Percent of bundle uploaded from remote location. + Percent *float64 + // Possible values are: + // + // * BundleUploadStatus#BundleUploadStatus_STATUS_UPLOADING + // * BundleUploadStatus#BundleUploadStatus_STATUS_VERIFYING + // * BundleUploadStatus#BundleUploadStatus_STATUS_SUCCESS + // * BundleUploadStatus#BundleUploadStatus_STATUS_FAILED + // + // Current status of bundle upload. + Status *string + // URL for uploading bundle. + Url *string +} + +const BundleUploadStatus_STATUS_UPLOADING = "UPLOADING" +const BundleUploadStatus_STATUS_VERIFYING = "VERIFYING" +const BundleUploadStatus_STATUS_SUCCESS = "SUCCESS" +const BundleUploadStatus_STATUS_FAILED = "FAILED" + +func (s *BundleUploadStatus) GetType__() bindings.BindingType { + return BundleUploadStatusBindingType() +} + +func (s *BundleUploadStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for BundleUploadStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// ByodServiceInstance is a custom instance to be used when NSX is not handling the lifecycles of appliance/s. User will manage their own appliance (BYOD) to connect with NSX. +type ByodServiceInstance struct { + // Possible values are: + // + // * ByodServiceInstance#ByodServiceInstance_DEPLOYMENT_MODE_STAND_ALONE + // * ByodServiceInstance#ByodServiceInstance_DEPLOYMENT_MODE_ACTIVE_STANDBY + // + // Deployment mode specifies where the partner appliance will be deployed in HA or non-HA i.e standalone mode. + DeploymentMode *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * BaseServiceInstance#BaseServiceInstance_RESOURCE_TYPE_SERVICEINSTANCE + // * BaseServiceInstance#BaseServiceInstance_RESOURCE_TYPE_BYODSERVICEINSTANCE + // * BaseServiceInstance#BaseServiceInstance_RESOURCE_TYPE_VIRTUALSERVICEINSTANCE + // + // ServiceInstance is used when NSX handles the lifecyle of appliance. Deployment and appliance related all the information is necessary. ByodServiceInstance is a custom instance to be used when NSX is not handling the lifecycles of appliance/s. User will manage their own appliance (BYOD) to connect with NSX. VirtualServiceInstance is a a custom instance to be used when NSX is not handling the lifecycle of an appliance and when the user is not bringing their own appliance. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * BaseServiceInstance#BaseServiceInstance_ON_FAILURE_POLICY_ALLOW + // * BaseServiceInstance#BaseServiceInstance_ON_FAILURE_POLICY_BLOCK + // + // Failure policy of the service instance - if it has to be different from the service. By default the service instance inherits the FailurePolicy of the service it belongs to. + OnFailurePolicy *string + // The Service to which the service instance is associated. + ServiceId *string + // Possible values are: + // + // * BaseServiceInstance#BaseServiceInstance_TRANSPORT_TYPE_L2_BRIDGE + // * BaseServiceInstance#BaseServiceInstance_TRANSPORT_TYPE_L3_ROUTED + // * BaseServiceInstance#BaseServiceInstance_TRANSPORT_TYPE_NSH + // * BaseServiceInstance#BaseServiceInstance_TRANSPORT_TYPE_NA + // + // Transport to be used by this service instance for deploying the Service-VM. This field is to be set Not Applicable(NA) if the service only caters to functionality EPP(Endpoint Protection) and MPS. + TransportType *string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ByodServiceInstance__TYPE_IDENTIFIER = "ByodServiceInstance" +const ByodServiceInstance_DEPLOYMENT_MODE_STAND_ALONE = "STAND_ALONE" +const ByodServiceInstance_DEPLOYMENT_MODE_ACTIVE_STANDBY = "ACTIVE_STANDBY" + +func (s *ByodServiceInstance) GetType__() bindings.BindingType { + return ByodServiceInstanceBindingType() +} + +func (s *ByodServiceInstance) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ByodServiceInstance._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Status of CCP upgrade +type CCPUpgradeStatus struct { + // This field indicates whether we can perform upgrade rollback. + CanRollback *bool + // Can the upgrade of the remaining units in this component be skipped + CanSkip *bool + // Component type for the upgrade status + ComponentType *string + CurrentVersionNodeSummary *NodeSummaryList + // Details about the upgrade status + Details *string + // Number of nodes of the type and at the component version format: int32 + NodeCountAtTargetVersion *int64 + // Indicator of upgrade progress in percentage + PercentComplete *float64 + PreUpgradeStatus *UpgradeChecksExecutionStatus + // Possible values are: + // + // * CCPUpgradeStatus#CCPUpgradeStatus_STATUS_SUCCESS + // * CCPUpgradeStatus#CCPUpgradeStatus_STATUS_FAILED + // * CCPUpgradeStatus#CCPUpgradeStatus_STATUS_IN_PROGRESS + // * CCPUpgradeStatus#CCPUpgradeStatus_STATUS_NOT_STARTED + // * CCPUpgradeStatus#CCPUpgradeStatus_STATUS_PAUSING + // * CCPUpgradeStatus#CCPUpgradeStatus_STATUS_PAUSED + // + // Upgrade status of component + Status *string + // Target component version + TargetComponentVersion *string +} + +const CCPUpgradeStatus_STATUS_SUCCESS = "SUCCESS" +const CCPUpgradeStatus_STATUS_FAILED = "FAILED" +const CCPUpgradeStatus_STATUS_IN_PROGRESS = "IN_PROGRESS" +const CCPUpgradeStatus_STATUS_NOT_STARTED = "NOT_STARTED" +const CCPUpgradeStatus_STATUS_PAUSING = "PAUSING" +const CCPUpgradeStatus_STATUS_PAUSED = "PAUSED" + +func (s *CCPUpgradeStatus) GetType__() bindings.BindingType { + return CCPUpgradeStatusBindingType() +} + +func (s *CCPUpgradeStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CCPUpgradeStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Relative to the form factor pre-defined reservation value. We recommended that you use the predefined measures of CPU reservation shares to reduce the CPU reservation of a VM. Reservation shares are relative to the default form-factor value. Though absolute values for CPU reservation is supported, we advise to use this option with caution as incorrect or high reservation values could lead to deployment failure or lead to resource starvation for other VMs running on the same host. +type CPUReservation struct { + // The CPU reservation in MHz is the guaranteed minimum amount of clock cycles that the vmkernel CPU scheduler will give the Edge VM in case of contention. If an Edge VM is not using its reserved resources, then other machines can use them thus preventing waste of CPU cycles on the physical host. Note: We recommend use of reservation_in_shares instead of this absolute configuration. When you specify this value, set reservation_in_shares to LOW_PRIORITY. format: int32 + ReservationInMhz *int64 + // Possible values are: + // + // * CPUReservation#CPUReservation_RESERVATION_IN_SHARES_EXTRA_HIGH_PRIORITY + // * CPUReservation#CPUReservation_RESERVATION_IN_SHARES_HIGH_PRIORITY + // * CPUReservation#CPUReservation_RESERVATION_IN_SHARES_NORMAL_PRIORITY + // * CPUReservation#CPUReservation_RESERVATION_IN_SHARES_LOW_PRIORITY + // + // Shares specify the relative importance of a virtual machine on a given host. When you assign shares to a virtual machine, you always specify the priority for that virtual machine relative to other powered-on virtual machines on the same host. The default priority for shares is HIGH_PRIORITY. + ReservationInShares *string +} + +const CPUReservation_RESERVATION_IN_SHARES_EXTRA_HIGH_PRIORITY = "EXTRA_HIGH_PRIORITY" +const CPUReservation_RESERVATION_IN_SHARES_HIGH_PRIORITY = "HIGH_PRIORITY" +const CPUReservation_RESERVATION_IN_SHARES_NORMAL_PRIORITY = "NORMAL_PRIORITY" +const CPUReservation_RESERVATION_IN_SHARES_LOW_PRIORITY = "LOW_PRIORITY" + +func (s *CPUReservation) GetType__() bindings.BindingType { + return CPUReservationBindingType() +} + +func (s *CPUReservation) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CPUReservation._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// CallbackAuthenticationScheme describes how notification requests should authenticate to the server. +type CallbackAuthenticationScheme struct { + // Certificate ID with a valid certificate and private key, procured from trust-management API. + CertificateId *string + // Password to use if scheme_name is BASIC_AUTH. + Password *string + // Possible values are: + // + // * CallbackAuthenticationScheme#CallbackAuthenticationScheme_SCHEME_NAME_BASIC_AUTH + // * CallbackAuthenticationScheme#CallbackAuthenticationScheme_SCHEME_NAME_CERTIFICATE + // + // Authentication scheme to use when making notification requests to the partner console. Specify one of BASIC_AUTH or CERTIFICATE. + SchemeName *string + // Username to use if scheme_name is BASIC_AUTH. + Username *string +} + +const CallbackAuthenticationScheme_SCHEME_NAME_BASIC_AUTH = "BASIC_AUTH" +const CallbackAuthenticationScheme_SCHEME_NAME_CERTIFICATE = "CERTIFICATE" + +func (s *CallbackAuthenticationScheme) GetType__() bindings.BindingType { + return CallbackAuthenticationSchemeBindingType() +} + +func (s *CallbackAuthenticationScheme) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CallbackAuthenticationScheme._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type CapacityDashboardUsage struct { + // Indicate the current usage count of object type. format: int64 + CurrentUsageCount *int64 + // Current usage percentage for object type + CurrentUsagePercentage *float64 + // Display name for NSX object type. + DisplayName *string + // This is the maximum supported count for object type in consideration. format: int64 + MaxSupportedCount *int64 + // This indicates the maximum threshold percentage for object type. + MaxThresholdPercentage *float64 + // This indicates the minimum threshold percentage for object type. + MinThresholdPercentage *float64 + // Possible values are: + // + // * CapacityDashboardUsage#CapacityDashboardUsage_SEVERITY_INFO + // * CapacityDashboardUsage#CapacityDashboardUsage_SEVERITY_WARNING + // * CapacityDashboardUsage#CapacityDashboardUsage_SEVERITY_CRITICAL + // * CapacityDashboardUsage#CapacityDashboardUsage_SEVERITY_ERROR + // + // Severity calculated from percentage usage + Severity *string + // Indicate the object type for which usage is calculated. + UsageType *string +} + +const CapacityDashboardUsage_SEVERITY_INFO = "INFO" +const CapacityDashboardUsage_SEVERITY_WARNING = "WARNING" +const CapacityDashboardUsage_SEVERITY_CRITICAL = "CRITICAL" +const CapacityDashboardUsage_SEVERITY_ERROR = "ERROR" + +func (s *CapacityDashboardUsage) GetType__() bindings.BindingType { + return CapacityDashboardUsageBindingType() +} + +func (s *CapacityDashboardUsage) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CapacityDashboardUsage._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type CapacityThreshold struct { + // Set the maximum threshold percentage. Specify a value between 0 and 100. Usage percentage above this value is tagged as critical. + MaxThresholdPercentage *float64 + // Set the minimum threshold percentage. Specify a value between 0 and 100. Usage percentage above this value is tagged as warning. + MinThresholdPercentage *float64 + // Indicate the object type for which threshold is to be set. + ThresholdType *string +} + +func (s *CapacityThreshold) GetType__() bindings.BindingType { + return CapacityThresholdBindingType() +} + +func (s *CapacityThreshold) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CapacityThreshold._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type CapacityThresholdList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // List of capacity thresholds for NSX Objects + CapacityThresholds []CapacityThreshold +} + +func (s *CapacityThresholdList) GetType__() bindings.BindingType { + return CapacityThresholdListBindingType() +} + +func (s *CapacityThresholdList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CapacityThresholdList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// usage of each capacity type ex. vm, cpu +type CapacityUsage struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // type of the capacity field + CapacityType *string + // count of number of items of capacity_type format: int64 + UsageCount *int64 +} + +func (s *CapacityUsage) GetType__() bindings.BindingType { + return CapacityUsageBindingType() +} + +func (s *CapacityUsage) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CapacityUsage._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type CapacityUsageMetaInfo struct { + // Timestamp at which capacity usage was last calculated format: int64 + LastUpdatedTimestamp *int64 + // Indicates the maximum global threshold percentage + MaxGlobalThresholdPercentage *float64 + // Indicates the minimum global threshold percentage + MinGlobalThresholdPercentage *float64 +} + +func (s *CapacityUsageMetaInfo) GetType__() bindings.BindingType { + return CapacityUsageMetaInfoBindingType() +} + +func (s *CapacityUsageMetaInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CapacityUsageMetaInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type CapacityUsageResponse struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // List of capacity usage for NSX Objects + CapacityUsage []CapacityDashboardUsage + // Meta data for capacity usage statistics + MetaInfo *data.StructValue + // Types for which usage data was not reported + UnreportedUsageTypes []string +} + +func (s *CapacityUsageResponse) GetType__() bindings.BindingType { + return CapacityUsageResponseBindingType() +} + +func (s *CapacityUsageResponse) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CapacityUsageResponse._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Central Config properties +type CentralConfigProperties struct { + // Override Central Config + LocalOverride *bool +} + +func (s *CentralConfigProperties) GetType__() bindings.BindingType { + return CentralConfigPropertiesBindingType() +} + +func (s *CentralConfigProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CentralConfigProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Central Node Config profile for NSX nodes. This set of properties will be pushed to NSX Manager and Edge nodes. SNMP properties will be pushed to KVM Hypervisors in addition to Manager and Edge nodes. +type CentralNodeConfigProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + Ntp *NtpProperties + Snmp *SnmpProperties + Syslog *SyslogProperties + // Timezone to be set for NSX nodes. Only timezone strings listed in the Time Zone database (https://www.iana.org/time-zones) are allowed. + Timezone *string +} + +func (s *CentralNodeConfigProfile) GetType__() bindings.BindingType { + return CentralNodeConfigProfileBindingType() +} + +func (s *CentralNodeConfigProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CentralNodeConfigProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Paged collection of Central Node Config profiles. +type CentralNodeConfigProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Central Node Config profiles + Results []CentralNodeConfigProfile +} + +func (s *CentralNodeConfigProfileListResult) GetType__() bindings.BindingType { + return CentralNodeConfigProfileListResultBindingType() +} + +func (s *CentralNodeConfigProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CentralNodeConfigProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type Certificate struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // List of X509Certificates. + Details []X509Certificate + // Whether we have the private key for this certificate. + HasPrivateKey *bool + // PEM encoded certificate data. + PemEncoded *string + // Possible values are: + // + // * Certificate#Certificate_PURPOSE_CA + // + // Purpose of this certificate. Can be empty or set to \"signing-ca\". + Purpose *string + // List of node IDs with services, that are using this certificate. + UsedBy []NodeIdServicesMap +} + +const Certificate_PURPOSE_CA = "signing-ca" + +func (s *Certificate) GetType__() bindings.BindingType { + return CertificateBindingType() +} + +func (s *Certificate) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Certificate._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Result of checking a certificate +type CertificateCheckingStatus struct { + // Error message when checking the certificate. + ErrorMessage *string + // Possible values are: + // + // * CertificateCheckingStatus#CertificateCheckingStatus_STATUS_OK + // * CertificateCheckingStatus#CertificateCheckingStatus_STATUS_CRL_NOT_READY + // * CertificateCheckingStatus#CertificateCheckingStatus_STATUS_REJECTED + // * CertificateCheckingStatus#CertificateCheckingStatus_STATUS_ERROR + // + // Status of the checked certificate. + Status *string +} + +const CertificateCheckingStatus_STATUS_OK = "OK" +const CertificateCheckingStatus_STATUS_CRL_NOT_READY = "CRL_NOT_READY" +const CertificateCheckingStatus_STATUS_REJECTED = "REJECTED" +const CertificateCheckingStatus_STATUS_ERROR = "ERROR" + +func (s *CertificateCheckingStatus) GetType__() bindings.BindingType { + return CertificateCheckingStatusBindingType() +} + +func (s *CertificateCheckingStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CertificateCheckingStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type CertificateKeyPair struct { + Certificate *SecurityCertificate + // The private key must include the enclosing \"-----BEGIN RSA PRIVATE KEY-----\" and \"-----END RSA PRIVATE KEY-----\". An empty string is returned in read responses. + RsaPrivateKey *string +} + +func (s *CertificateKeyPair) GetType__() bindings.BindingType { + return CertificateKeyPairBindingType() +} + +func (s *CertificateKeyPair) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CertificateKeyPair._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Certificate queries result +type CertificateList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Certificate list. + Results []Certificate +} + +func (s *CertificateList) GetType__() bindings.BindingType { + return CertificateListBindingType() +} + +func (s *CertificateList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CertificateList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type CertificateProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // True if this is for a cluster certificate + ClusterCertificate *bool + // Possible values are: + // + // * CertificateProfile#CertificateProfile_EXTENDED_KEY_USAGE_SERVER + // * CertificateProfile#CertificateProfile_EXTENDED_KEY_USAGE_CLIENT + // + // Indicating whether this certificate is used for server-auth, client-auth or both. + ExtendedKeyUsage []string + // List of types of node this certificate applies to. + NodeType []string + // Certificate Profile Name + ProfileName *string + // Possible values are: + // + // * CertificateProfile#CertificateProfile_SERVICE_TYPE_MGMT_CLUSTER + // * CertificateProfile#CertificateProfile_SERVICE_TYPE_MGMT_PLANE + // * CertificateProfile#CertificateProfile_SERVICE_TYPE_API + // * CertificateProfile#CertificateProfile_SERVICE_TYPE_NOTIFICATION_COLLECTOR + // * CertificateProfile#CertificateProfile_SERVICE_TYPE_SYSLOG_SERVER + // * CertificateProfile#CertificateProfile_SERVICE_TYPE_RSYSLOG_CLIENT + // * CertificateProfile#CertificateProfile_SERVICE_TYPE_APH + // * CertificateProfile#CertificateProfile_SERVICE_TYPE_GLOBAL_MANAGER + // * CertificateProfile#CertificateProfile_SERVICE_TYPE_LOCAL_MANAGER + // * CertificateProfile#CertificateProfile_SERVICE_TYPE_CLIENT_AUTH + // * CertificateProfile#CertificateProfile_SERVICE_TYPE_RMQ + // * CertificateProfile#CertificateProfile_SERVICE_TYPE_K8S_MSG_CLIENT + // * CertificateProfile#CertificateProfile_SERVICE_TYPE_WEB_PROXY + // + // Unique Service Type + ServiceType *string + // True if the certificate used for this service-type cannot be used anywhere else. + UniqueUse *bool +} + +const CertificateProfile_EXTENDED_KEY_USAGE_SERVER = "SERVER" +const CertificateProfile_EXTENDED_KEY_USAGE_CLIENT = "CLIENT" +const CertificateProfile_SERVICE_TYPE_MGMT_CLUSTER = "MGMT_CLUSTER" +const CertificateProfile_SERVICE_TYPE_MGMT_PLANE = "MGMT_PLANE" +const CertificateProfile_SERVICE_TYPE_API = "API" +const CertificateProfile_SERVICE_TYPE_NOTIFICATION_COLLECTOR = "NOTIFICATION_COLLECTOR" +const CertificateProfile_SERVICE_TYPE_SYSLOG_SERVER = "SYSLOG_SERVER" +const CertificateProfile_SERVICE_TYPE_RSYSLOG_CLIENT = "RSYSLOG_CLIENT" +const CertificateProfile_SERVICE_TYPE_APH = "APH" +const CertificateProfile_SERVICE_TYPE_GLOBAL_MANAGER = "GLOBAL_MANAGER" +const CertificateProfile_SERVICE_TYPE_LOCAL_MANAGER = "LOCAL_MANAGER" +const CertificateProfile_SERVICE_TYPE_CLIENT_AUTH = "CLIENT_AUTH" +const CertificateProfile_SERVICE_TYPE_RMQ = "RMQ" +const CertificateProfile_SERVICE_TYPE_K8S_MSG_CLIENT = "K8S_MSG_CLIENT" +const CertificateProfile_SERVICE_TYPE_WEB_PROXY = "WEB_PROXY" + +func (s *CertificateProfile) GetType__() bindings.BindingType { + return CertificateProfileBindingType() +} + +func (s *CertificateProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CertificateProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// CertificateProfile query result +type CertificateProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // CertificateProfile list. + Results []CertificateProfile +} + +func (s *CertificateProfileListResult) GetType__() bindings.BindingType { + return CertificateProfileListResultBindingType() +} + +func (s *CertificateProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CertificateProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// TLS cipher suite +type CipherSuite struct { + // Enable status for this cipher suite + Enabled *bool + // Name of the TLS cipher suite + Name *string +} + +func (s *CipherSuite) GetType__() bindings.BindingType { + return CipherSuiteBindingType() +} + +func (s *CipherSuite) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CipherSuite._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// DHCP classless static route option. +type ClasslessStaticRoute struct { + // Destination network in CIDR format. format: address-or-block-or-range + Network *string + // IP address of next hop of the route. format: ip + NextHop *string +} + +func (s *ClasslessStaticRoute) GetType__() bindings.BindingType { + return ClasslessStaticRouteBindingType() +} + +func (s *ClasslessStaticRoute) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClasslessStaticRoute._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ClientSslProfileBinding struct { + // authentication depth is used to set the verification depth in the client certificates chain. format: int64 + CertificateChainDepth *int64 + // Possible values are: + // + // * ClientSslProfileBinding#ClientSslProfileBinding_CLIENT_AUTH_REQUIRED + // * ClientSslProfileBinding#ClientSslProfileBinding_CLIENT_AUTH_IGNORE + // + // client authentication mode + ClientAuth *string + // If client auth type is REQUIRED, client certificate must be signed by one of the trusted Certificate Authorities (CAs), also referred to as root CAs, whose self signed certificates are specified. + ClientAuthCaIds []string + // A Certificate Revocation List (CRL) can be specified in the client-side SSL profile binding to disallow compromised client certificates. + ClientAuthCrlIds []string + // A default certificate should be specified which will be used if the server does not host multiple hostnames on the same IP address or if the client does not support SNI extension. + DefaultCertificateId *string + // Client-side SSL profile binding allows multiple certificates, for different hostnames, to be bound to the same virtual server. + SniCertificateIds []string + // Client SSL profile defines reusable, application-independent client side SSL properties. + SslProfileId *string +} + +const ClientSslProfileBinding_CLIENT_AUTH_REQUIRED = "REQUIRED" +const ClientSslProfileBinding_CLIENT_AUTH_IGNORE = "IGNORE" + +func (s *ClientSslProfileBinding) GetType__() bindings.BindingType { + return ClientSslProfileBindingBindingType() +} + +func (s *ClientSslProfileBinding) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClientSslProfileBinding._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Stores the information about cloud native service instance. +type CloudNativeServiceInstance struct { + // Id of service instance fetched from public cloud. + ExternalId *string + // Type of cloud native service. + ServiceType *string + Source *ResourceReference + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Specifies list of scope of discovered resource. e.g. if VHC path is associated with principal identity, who owns the discovered resource, then scope id will be VHC path and scope type will be VHC. + Scope []DiscoveredResourceScope + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +func (s *CloudNativeServiceInstance) GetType__() bindings.BindingType { + return CloudNativeServiceInstanceBindingType() +} + +func (s *CloudNativeServiceInstance) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CloudNativeServiceInstance._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Stores a list of cloud native service instances and information about them. NSX supported service instances are currently limited to Relational Database Service (RDS),Elastic Load Balancing (ELB). +type CloudNativeServiceInstanceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of cloud native service instances + Results []CloudNativeServiceInstance +} + +func (s *CloudNativeServiceInstanceListResult) GetType__() bindings.BindingType { + return CloudNativeServiceInstanceListResultBindingType() +} + +func (s *CloudNativeServiceInstanceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CloudNativeServiceInstanceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Cluster backup details +type ClusterBackupInfo struct { + // IP address or FQDN of the node from which the backup was taken format: hostname-or-ip + IpAddress *string + // ID of the node from which the backup was taken + NodeId *string + // Possible values are: + // + // * ClusterBackupInfo#ClusterBackupInfo_RESTORE_TYPE_REGULAR_RESTORE + // * ClusterBackupInfo#ClusterBackupInfo_RESTORE_TYPE_POLICY_ONLY_RESTORE + // + // Type of restore allowed + RestoreType []string + // timestamp of the cluster backup file format: int64 + Timestamp *int64 +} + +const ClusterBackupInfo_RESTORE_TYPE_REGULAR_RESTORE = "REGULAR_RESTORE" +const ClusterBackupInfo_RESTORE_TYPE_POLICY_ONLY_RESTORE = "POLICY_ONLY_RESTORE" + +func (s *ClusterBackupInfo) GetType__() bindings.BindingType { + return ClusterBackupInfoBindingType() +} + +func (s *ClusterBackupInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterBackupInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ClusterBackupInfoListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of timestamps of backed-up cluster files + Results []ClusterBackupInfo +} + +func (s *ClusterBackupInfoListResult) GetType__() bindings.BindingType { + return ClusterBackupInfoListResultBindingType() +} + +func (s *ClusterBackupInfoListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterBackupInfoListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Cluster Certificate ID +type ClusterCertificateId struct { + // Certificate ID + CertificateId *string +} + +func (s *ClusterCertificateId) GetType__() bindings.BindingType { + return ClusterCertificateIdBindingType() +} + +func (s *ClusterCertificateId) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterCertificateId._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ClusterConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Unique identifier of this cluster + ClusterId *string + // True if control cluster nodes may be added or removed + ControlClusterChangesAllowed *bool + // True if management cluster nodes may be added or removed + MgmtClusterChangesAllowed *bool + // Configuration of each node in cluster + Nodes []ClusterNodeInfo +} + +func (s *ClusterConfig) GetType__() bindings.BindingType { + return ClusterConfigBindingType() +} + +func (s *ClusterConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The configuration of the NSX cluster. The cluster configuration consists of a list of cluster node attributes. +type ClusterConfiguration struct { + // UUID of the cluster + ClusterId *string + // Cluster configuration version format: int64 + ConfigVersion *int64 + // Nodes in the cluster configuration + Nodes []ClusterNode +} + +func (s *ClusterConfiguration) GetType__() bindings.BindingType { + return ClusterConfigurationBindingType() +} + +func (s *ClusterConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This type contains the attributes and status of a group member. +type ClusterGroupMemberStatus struct { + // FQDN of the group member format: hostname + MemberFqdn *string + // IP of the group member format: ip + MemberIp *string + // Possible values are: + // + // * ClusterGroupMemberStatus#ClusterGroupMemberStatus_MEMBER_STATUS_UP + // * ClusterGroupMemberStatus#ClusterGroupMemberStatus_MEMBER_STATUS_DOWN + // * ClusterGroupMemberStatus#ClusterGroupMemberStatus_MEMBER_STATUS_UNKNOWN + // + // Status of the group member + MemberStatus *string + // UUID of the group member + MemberUuid *string +} + +const ClusterGroupMemberStatus_MEMBER_STATUS_UP = "UP" +const ClusterGroupMemberStatus_MEMBER_STATUS_DOWN = "DOWN" +const ClusterGroupMemberStatus_MEMBER_STATUS_UNKNOWN = "UNKNOWN" + +func (s *ClusterGroupMemberStatus) GetType__() bindings.BindingType { + return ClusterGroupMemberStatusBindingType() +} + +func (s *ClusterGroupMemberStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterGroupMemberStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Each cluster node entity provides multiple services. When working in a group, each service can elect a cluster node entity to be the leader of the service. Leader election helps in coordination of the service. The leader holds a renewable lease on the leadership for a fixed period of time. The lease version is incremented every time the leadership lease is renewed. This type contains the attributes of a leader. +type ClusterGroupServiceLeader struct { + // Member UUID of the leader + LeaderUuid *string + // Number of times the lease has been renewed format: int64 + LeaseVersion *int64 + // Name of the service + ServiceName *string +} + +func (s *ClusterGroupServiceLeader) GetType__() bindings.BindingType { + return ClusterGroupServiceLeaderBindingType() +} + +func (s *ClusterGroupServiceLeader) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterGroupServiceLeader._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This type contains the attributes and status of a group. +type ClusterGroupStatus struct { + // UUID of the group + GroupId *string + // Possible values are: + // + // * ClusterGroupStatus#ClusterGroupStatus_GROUP_STATUS_STABLE + // * ClusterGroupStatus#ClusterGroupStatus_GROUP_STATUS_DEGRADED + // * ClusterGroupStatus#ClusterGroupStatus_GROUP_STATUS_UNSTABLE + // * ClusterGroupStatus#ClusterGroupStatus_GROUP_STATUS_UNAVAILABLE + // + // Group status + GroupStatus *string + // Possible values are: + // + // * ClusterGroupStatus#ClusterGroupStatus_GROUP_TYPE_MANAGER + // * ClusterGroupStatus#ClusterGroupStatus_GROUP_TYPE_CONTROLLER + // * ClusterGroupStatus#ClusterGroupStatus_GROUP_TYPE_POLICY + // * ClusterGroupStatus#ClusterGroupStatus_GROUP_TYPE_HTTPS + // * ClusterGroupStatus#ClusterGroupStatus_GROUP_TYPE_DATASTORE + // * ClusterGroupStatus#ClusterGroupStatus_GROUP_TYPE_CLUSTER_BOOT_MANAGER + // * ClusterGroupStatus#ClusterGroupStatus_GROUP_TYPE_GLOBAL_MANAGER + // * ClusterGroupStatus#ClusterGroupStatus_GROUP_TYPE_ASYNC_REPLICATOR + // * ClusterGroupStatus#ClusterGroupStatus_GROUP_TYPE_MONITORING + // * ClusterGroupStatus#ClusterGroupStatus_GROUP_TYPE_IDPS_REPORTING + // * ClusterGroupStatus#ClusterGroupStatus_GROUP_TYPE_CORFU_NONCONFIG + // * ClusterGroupStatus#ClusterGroupStatus_GROUP_TYPE_CM_INVENTORY + // * ClusterGroupStatus#ClusterGroupStatus_GROUP_TYPE_MESSAGING_MANAGER + // + // Type of the group + GroupType *string + // Array of group leaders and their attributes + Leaders []ClusterGroupServiceLeader + // Array of group members and their statuses + Members []ClusterGroupMemberStatus +} + +const ClusterGroupStatus_GROUP_STATUS_STABLE = "STABLE" +const ClusterGroupStatus_GROUP_STATUS_DEGRADED = "DEGRADED" +const ClusterGroupStatus_GROUP_STATUS_UNSTABLE = "UNSTABLE" +const ClusterGroupStatus_GROUP_STATUS_UNAVAILABLE = "UNAVAILABLE" +const ClusterGroupStatus_GROUP_TYPE_MANAGER = "MANAGER" +const ClusterGroupStatus_GROUP_TYPE_CONTROLLER = "CONTROLLER" +const ClusterGroupStatus_GROUP_TYPE_POLICY = "POLICY" +const ClusterGroupStatus_GROUP_TYPE_HTTPS = "HTTPS" +const ClusterGroupStatus_GROUP_TYPE_DATASTORE = "DATASTORE" +const ClusterGroupStatus_GROUP_TYPE_CLUSTER_BOOT_MANAGER = "CLUSTER_BOOT_MANAGER" +const ClusterGroupStatus_GROUP_TYPE_GLOBAL_MANAGER = "GLOBAL_MANAGER" +const ClusterGroupStatus_GROUP_TYPE_ASYNC_REPLICATOR = "ASYNC_REPLICATOR" +const ClusterGroupStatus_GROUP_TYPE_MONITORING = "MONITORING" +const ClusterGroupStatus_GROUP_TYPE_IDPS_REPORTING = "IDPS_REPORTING" +const ClusterGroupStatus_GROUP_TYPE_CORFU_NONCONFIG = "CORFU_NONCONFIG" +const ClusterGroupStatus_GROUP_TYPE_CM_INVENTORY = "CM-INVENTORY" +const ClusterGroupStatus_GROUP_TYPE_MESSAGING_MANAGER = "MESSAGING-MANAGER" + +func (s *ClusterGroupStatus) GetType__() bindings.BindingType { + return ClusterGroupStatusBindingType() +} + +func (s *ClusterGroupStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterGroupStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The type provides the information of a non-running cluster node required for the initialization of a management cluster. The administrator needs to start this node for management cluster to initialize properly (or decommission it explicitly). +type ClusterInitializationNodeInfo struct { + // The (internal) disk-store ID of the member + DiskStoreId *string + // The IP address (or domain name) of the cluster node + HostAddress *string +} + +func (s *ClusterInitializationNodeInfo) GetType__() bindings.BindingType { + return ClusterInitializationNodeInfoBindingType() +} + +func (s *ClusterInitializationNodeInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterInitializationNodeInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This type contains attributes of a cluster node that are relevant to the Cluster Boot Manager. +type ClusterNode struct { + // Entities on the node + Entities []ClusterNodeEntity + // UUID of the node + NodeUuid *string + // Possible values are: + // + // * ClusterNode#ClusterNode_STATUS_JOINING + // * ClusterNode#ClusterNode_STATUS_JOINED + // * ClusterNode#ClusterNode_STATUS_REMOVING + // * ClusterNode#ClusterNode_STATUS_REMOVED + // + // Current clustering status of the node + Status *string +} + +const ClusterNode_STATUS_JOINING = "JOINING" +const ClusterNode_STATUS_JOINED = "JOINED" +const ClusterNode_STATUS_REMOVING = "REMOVING" +const ClusterNode_STATUS_REMOVED = "REMOVED" + +func (s *ClusterNode) GetType__() bindings.BindingType { + return ClusterNodeBindingType() +} + +func (s *ClusterNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ClusterNodeConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The IP and port for the appliance management API service on this node + ApplianceMgmtListenAddr *string + ControllerRole *ControllerClusterRoleConfig + // Internal identifier provided by the node + ExternalId *string + ManagerRole *ManagementClusterRoleConfig +} + +func (s *ClusterNodeConfig) GetType__() bindings.BindingType { + return ClusterNodeConfigBindingType() +} + +func (s *ClusterNodeConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterNodeConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ClusterNodeConfigListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Cluster node configuration results + Results []ClusterNodeConfig +} + +func (s *ClusterNodeConfigListResult) GetType__() bindings.BindingType { + return ClusterNodeConfigListResultBindingType() +} + +func (s *ClusterNodeConfigListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterNodeConfigListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// NSX Cluster is made up of multiple cluster nodes. Each node can perform multiple functions, commonly referred to as roles. Cluster node entities are processes running in a cluster node that assist in the performance of a role. Cluster Boot Manager is a daemon that securely bootstraps and configures the entities. This type contains attributes of a cluster node entity that are relevant to the Cluster Boot Manager. +type ClusterNodeEntity struct { + // Public certificate of the entity in PEM format + Certificate *string + // Possible values are: + // + // * ClusterNodeEntity#ClusterNodeEntity_ENTITY_TYPE_MANAGER + // * ClusterNodeEntity#ClusterNodeEntity_ENTITY_TYPE_CONTROLLER + // * ClusterNodeEntity#ClusterNodeEntity_ENTITY_TYPE_POLICY + // * ClusterNodeEntity#ClusterNodeEntity_ENTITY_TYPE_HTTPS + // * ClusterNodeEntity#ClusterNodeEntity_ENTITY_TYPE_CLUSTER_BOOT_MANAGER + // * ClusterNodeEntity#ClusterNodeEntity_ENTITY_TYPE_DATASTORE + // * ClusterNodeEntity#ClusterNodeEntity_ENTITY_TYPE_GLOBAL_MANAGER + // * ClusterNodeEntity#ClusterNodeEntity_ENTITY_TYPE_ASYNC_REPLICATOR + // * ClusterNodeEntity#ClusterNodeEntity_ENTITY_TYPE_MONITORING + // * ClusterNodeEntity#ClusterNodeEntity_ENTITY_TYPE_IDPS_REPORTING + // * ClusterNodeEntity#ClusterNodeEntity_ENTITY_TYPE_CORFU_NONCONFIG + // * ClusterNodeEntity#ClusterNodeEntity_ENTITY_TYPE_UPGRADE_COORDINATOR + // * ClusterNodeEntity#ClusterNodeEntity_ENTITY_TYPE_CM_INVENTORY + // * ClusterNodeEntity#ClusterNodeEntity_ENTITY_TYPE_MESSAGING_MANAGER + // + // Type of the entity + EntityType *string + // UUID of the entity + EntityUuid *string + // Domain name the entity binds to format: hostname + Fqdn *string + // IP address the entity binds to + IpAddress *string + // Port the entity binds to format: int64 + Port *int64 + // Subnet mask prefix length of the entity binds to format: int64 + SubnetPrefixLength *int64 +} + +const ClusterNodeEntity_ENTITY_TYPE_MANAGER = "MANAGER" +const ClusterNodeEntity_ENTITY_TYPE_CONTROLLER = "CONTROLLER" +const ClusterNodeEntity_ENTITY_TYPE_POLICY = "POLICY" +const ClusterNodeEntity_ENTITY_TYPE_HTTPS = "HTTPS" +const ClusterNodeEntity_ENTITY_TYPE_CLUSTER_BOOT_MANAGER = "CLUSTER_BOOT_MANAGER" +const ClusterNodeEntity_ENTITY_TYPE_DATASTORE = "DATASTORE" +const ClusterNodeEntity_ENTITY_TYPE_GLOBAL_MANAGER = "GLOBAL_MANAGER" +const ClusterNodeEntity_ENTITY_TYPE_ASYNC_REPLICATOR = "ASYNC_REPLICATOR" +const ClusterNodeEntity_ENTITY_TYPE_MONITORING = "MONITORING" +const ClusterNodeEntity_ENTITY_TYPE_IDPS_REPORTING = "IDPS_REPORTING" +const ClusterNodeEntity_ENTITY_TYPE_CORFU_NONCONFIG = "CORFU_NONCONFIG" +const ClusterNodeEntity_ENTITY_TYPE_UPGRADE_COORDINATOR = "UPGRADE_COORDINATOR" +const ClusterNodeEntity_ENTITY_TYPE_CM_INVENTORY = "CM-INVENTORY" +const ClusterNodeEntity_ENTITY_TYPE_MESSAGING_MANAGER = "MESSAGING-MANAGER" + +func (s *ClusterNodeEntity) GetType__() bindings.BindingType { + return ClusterNodeEntityBindingType() +} + +func (s *ClusterNodeEntity) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterNodeEntity._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ClusterNodeInfo struct { + ApiListenAddr *ServiceEndpoint + ApplianceConnectionInfo *ServiceEndpoint + // Certificate and thumbprint of all entities + Certificates []NodeCertificateInfo + ControlPlaneListenAddr *ServiceEndpoint + // The display name of this node + DisplayName *string + // Service endpoint of all entities + Entities []NodeEntityInfo + // The fqdn of this node + Fqdn *string + // Messaging client of all entities + MsgClients []NodeMessagingClientInfo + // Unique identifier of this node + NodeUuid *string + // Possible values are: + // + // * ClusterNodeInfo#ClusterNodeInfo_STATUS_JOINING + // * ClusterNodeInfo#ClusterNodeInfo_STATUS_JOINED + // * ClusterNodeInfo#ClusterNodeInfo_STATUS_REMOVING + // * ClusterNodeInfo#ClusterNodeInfo_STATUS_REMOVED + // + // Node clustering status + Status *string +} + +const ClusterNodeInfo_STATUS_JOINING = "JOINING" +const ClusterNodeInfo_STATUS_JOINED = "JOINED" +const ClusterNodeInfo_STATUS_REMOVING = "REMOVING" +const ClusterNodeInfo_STATUS_REMOVED = "REMOVED" + +func (s *ClusterNodeInfo) GetType__() bindings.BindingType { + return ClusterNodeInfoBindingType() +} + +func (s *ClusterNodeInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterNodeInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ClusterNodeStatus struct { + ControlClusterStatus *ControlClusterNodeStatus + MgmtClusterStatus *ManagementClusterNodeStatus + SystemStatus *NodeStatusProperties + // Software version running on node + Version *string +} + +func (s *ClusterNodeStatus) GetType__() bindings.BindingType { + return ClusterNodeStatusBindingType() +} + +func (s *ClusterNodeStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterNodeStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Contains info used to configure the VM on deployment +type ClusterNodeVMDeploymentConfig struct { + // Possible values are: + // + // * ClusterNodeVMDeploymentConfig#ClusterNodeVMDeploymentConfig_PLACEMENT_TYPE_VSPHERECLUSTERNODEVMDEPLOYMENTCONFIG + // + // Specifies the config for the platform through which to deploy the VM + PlacementType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ClusterNodeVMDeploymentConfig__TYPE_IDENTIFIER = "ClusterNodeVMDeploymentConfig" +const ClusterNodeVMDeploymentConfig_PLACEMENT_TYPE_VSPHERECLUSTERNODEVMDEPLOYMENTCONFIG = "VsphereClusterNodeVMDeploymentConfig" + +func (s *ClusterNodeVMDeploymentConfig) GetType__() bindings.BindingType { + return ClusterNodeVMDeploymentConfigBindingType() +} + +func (s *ClusterNodeVMDeploymentConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterNodeVMDeploymentConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Deployment progress state of node VM. This Object contains name of current deployment step and overall progress percentage. +type ClusterNodeVMDeploymentProgressState struct { + // Name of the current running step of deployment + CurrentStepTitle *string + // Overall progress percentage of deployment completed format: int64 + Progress *int64 +} + +func (s *ClusterNodeVMDeploymentProgressState) GetType__() bindings.BindingType { + return ClusterNodeVMDeploymentProgressStateBindingType() +} + +func (s *ClusterNodeVMDeploymentProgressState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterNodeVMDeploymentProgressState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Contains the deployment information for a cluster node VM soon to be deployed or already deployed by the Manager +type ClusterNodeVMDeploymentRequest struct { + DeploymentConfig *data.StructValue + // Possible values are: + // + // * ClusterNodeVMDeploymentRequest#ClusterNodeVMDeploymentRequest_FORM_FACTOR_SMALL + // * ClusterNodeVMDeploymentRequest#ClusterNodeVMDeploymentRequest_FORM_FACTOR_MEDIUM + // * ClusterNodeVMDeploymentRequest#ClusterNodeVMDeploymentRequest_FORM_FACTOR_LARGE + // + // Specifies the desired \"size\" of the VM + FormFactor *string + // Possible values are: + // + // * ClusterNodeVMDeploymentRequest#ClusterNodeVMDeploymentRequest_ROLES_CONTROLLER + // * ClusterNodeVMDeploymentRequest#ClusterNodeVMDeploymentRequest_ROLES_MANAGER + // + // List of cluster node role (or roles) which the VM should take on. They specify what type (or types) of cluster node which the new VM should act as. Currently both CONTROLLER and MANAGER must be provided, since this permutation is the only one supported now. + Roles []string + UserSettings *NodeUserSettings + // ID of the VM maintained internally and used to recognize it. Note: This is automatically generated and cannot be modified. + VmId *string +} + +const ClusterNodeVMDeploymentRequest_FORM_FACTOR_SMALL = "SMALL" +const ClusterNodeVMDeploymentRequest_FORM_FACTOR_MEDIUM = "MEDIUM" +const ClusterNodeVMDeploymentRequest_FORM_FACTOR_LARGE = "LARGE" +const ClusterNodeVMDeploymentRequest_ROLES_CONTROLLER = "CONTROLLER" +const ClusterNodeVMDeploymentRequest_ROLES_MANAGER = "MANAGER" + +func (s *ClusterNodeVMDeploymentRequest) GetType__() bindings.BindingType { + return ClusterNodeVMDeploymentRequestBindingType() +} + +func (s *ClusterNodeVMDeploymentRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterNodeVMDeploymentRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of ClusterNodeVMDeploymentRequests +type ClusterNodeVMDeploymentRequestList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Array of existing ClusterNodeVMDeploymentRequests + Results []ClusterNodeVMDeploymentRequest +} + +func (s *ClusterNodeVMDeploymentRequestList) GetType__() bindings.BindingType { + return ClusterNodeVMDeploymentRequestListBindingType() +} + +func (s *ClusterNodeVMDeploymentRequestList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterNodeVMDeploymentRequestList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Contains up-to-date information relating to an auto-deployed VM, including its status and (potentially) an error message. +type ClusterNodeVMDeploymentStatusReport struct { + DeploymentProgressState *VMDeploymentProgressState + // In case of auto-deployment-related failure, the code for the error will be stored here. format: int64 + FailureCode *int64 + // In case of auto-deployment-related failure, an error message will be stored here. + FailureMessage *string + // Possible values are: + // + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_UNKNOWN_STATE + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_VM_DEPLOYMENT_QUEUED + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_VM_DEPLOYMENT_IN_PROGRESS + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_VM_DEPLOYMENT_FAILED + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_VM_POWER_ON_IN_PROGRESS + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_VM_POWER_ON_FAILED + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_WAITING_TO_REGISTER_VM + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_VM_REGISTRATION_FAILED + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_VM_WAITING_TO_CLUSTER + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_VM_WAITING_TO_COME_ONLINE + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_VM_ONLINE_FAILED + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_VM_CLUSTERING_IN_PROGRESS + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_VM_CLUSTERING_FAILED + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_VM_CLUSTERING_SUCCESSFUL + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_WAITING_TO_UNDEPLOY_VM + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_VM_DECLUSTER_IN_PROGRESS + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_VM_DECLUSTER_FAILED + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_VM_DECLUSTER_SUCCESSFUL + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_VM_POWER_OFF_IN_PROGRESS + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_VM_POWER_OFF_FAILED + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_VM_UNDEPLOY_IN_PROGRESS + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_VM_UNDEPLOY_FAILED + // * ClusterNodeVMDeploymentStatusReport#ClusterNodeVMDeploymentStatusReport_STATUS_VM_UNDEPLOY_SUCCESSFUL + // + // Status of the addition or deletion of an auto-deployed cluster node VM. + Status *string +} + +const ClusterNodeVMDeploymentStatusReport_STATUS_UNKNOWN_STATE = "UNKNOWN_STATE" +const ClusterNodeVMDeploymentStatusReport_STATUS_VM_DEPLOYMENT_QUEUED = "VM_DEPLOYMENT_QUEUED" +const ClusterNodeVMDeploymentStatusReport_STATUS_VM_DEPLOYMENT_IN_PROGRESS = "VM_DEPLOYMENT_IN_PROGRESS" +const ClusterNodeVMDeploymentStatusReport_STATUS_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const ClusterNodeVMDeploymentStatusReport_STATUS_VM_POWER_ON_IN_PROGRESS = "VM_POWER_ON_IN_PROGRESS" +const ClusterNodeVMDeploymentStatusReport_STATUS_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const ClusterNodeVMDeploymentStatusReport_STATUS_WAITING_TO_REGISTER_VM = "WAITING_TO_REGISTER_VM" +const ClusterNodeVMDeploymentStatusReport_STATUS_VM_REGISTRATION_FAILED = "VM_REGISTRATION_FAILED" +const ClusterNodeVMDeploymentStatusReport_STATUS_VM_WAITING_TO_CLUSTER = "VM_WAITING_TO_CLUSTER" +const ClusterNodeVMDeploymentStatusReport_STATUS_VM_WAITING_TO_COME_ONLINE = "VM_WAITING_TO_COME_ONLINE" +const ClusterNodeVMDeploymentStatusReport_STATUS_VM_ONLINE_FAILED = "VM_ONLINE_FAILED" +const ClusterNodeVMDeploymentStatusReport_STATUS_VM_CLUSTERING_IN_PROGRESS = "VM_CLUSTERING_IN_PROGRESS" +const ClusterNodeVMDeploymentStatusReport_STATUS_VM_CLUSTERING_FAILED = "VM_CLUSTERING_FAILED" +const ClusterNodeVMDeploymentStatusReport_STATUS_VM_CLUSTERING_SUCCESSFUL = "VM_CLUSTERING_SUCCESSFUL" +const ClusterNodeVMDeploymentStatusReport_STATUS_WAITING_TO_UNDEPLOY_VM = "WAITING_TO_UNDEPLOY_VM" +const ClusterNodeVMDeploymentStatusReport_STATUS_VM_DECLUSTER_IN_PROGRESS = "VM_DECLUSTER_IN_PROGRESS" +const ClusterNodeVMDeploymentStatusReport_STATUS_VM_DECLUSTER_FAILED = "VM_DECLUSTER_FAILED" +const ClusterNodeVMDeploymentStatusReport_STATUS_VM_DECLUSTER_SUCCESSFUL = "VM_DECLUSTER_SUCCESSFUL" +const ClusterNodeVMDeploymentStatusReport_STATUS_VM_POWER_OFF_IN_PROGRESS = "VM_POWER_OFF_IN_PROGRESS" +const ClusterNodeVMDeploymentStatusReport_STATUS_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const ClusterNodeVMDeploymentStatusReport_STATUS_VM_UNDEPLOY_IN_PROGRESS = "VM_UNDEPLOY_IN_PROGRESS" +const ClusterNodeVMDeploymentStatusReport_STATUS_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const ClusterNodeVMDeploymentStatusReport_STATUS_VM_UNDEPLOY_SUCCESSFUL = "VM_UNDEPLOY_SUCCESSFUL" + +func (s *ClusterNodeVMDeploymentStatusReport) GetType__() bindings.BindingType { + return ClusterNodeVMDeploymentStatusReportBindingType() +} + +func (s *ClusterNodeVMDeploymentStatusReport) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterNodeVMDeploymentStatusReport._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ClusterProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * ClusterProfile#ClusterProfile_RESOURCE_TYPE_EDGEHIGHAVAILABILITYPROFILE + // * ClusterProfile#ClusterProfile_RESOURCE_TYPE_BRIDGEHIGHAVAILABILITYCLUSTERPROFILE + // + // Supported cluster profiles. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ClusterProfile__TYPE_IDENTIFIER = "ClusterProfile" +const ClusterProfile_RESOURCE_TYPE_EDGEHIGHAVAILABILITYPROFILE = "EdgeHighAvailabilityProfile" +const ClusterProfile_RESOURCE_TYPE_BRIDGEHIGHAVAILABILITYCLUSTERPROFILE = "BridgeHighAvailabilityClusterProfile" + +func (s *ClusterProfile) GetType__() bindings.BindingType { + return ClusterProfileBindingType() +} + +func (s *ClusterProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Cluster Profile queries result +type ClusterProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Cluster Profile Results + Results []*data.StructValue +} + +func (s *ClusterProfileListResult) GetType__() bindings.BindingType { + return ClusterProfileListResultBindingType() +} + +func (s *ClusterProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ClusterProfileTypeIdEntry struct { + // key value + ProfileId *string + // Possible values are: + // + // * ClusterProfileTypeIdEntry#ClusterProfileTypeIdEntry_RESOURCE_TYPE_EDGEHIGHAVAILABILITYPROFILE + // * ClusterProfileTypeIdEntry#ClusterProfileTypeIdEntry_RESOURCE_TYPE_BRIDGEHIGHAVAILABILITYCLUSTERPROFILE + // + // Supported cluster profiles. + ResourceType *string +} + +const ClusterProfileTypeIdEntry_RESOURCE_TYPE_EDGEHIGHAVAILABILITYPROFILE = "EdgeHighAvailabilityProfile" +const ClusterProfileTypeIdEntry_RESOURCE_TYPE_BRIDGEHIGHAVAILABILITYCLUSTERPROFILE = "BridgeHighAvailabilityClusterProfile" + +func (s *ClusterProfileTypeIdEntry) GetType__() bindings.BindingType { + return ClusterProfileTypeIdEntryBindingType() +} + +func (s *ClusterProfileTypeIdEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterProfileTypeIdEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Cluster restore status +type ClusterRestoreStatus struct { + // Timestamp when backup was initiated in epoch millisecond format: int64 + BackupTimestamp *int64 + // The list of allowed endpoints, based on the current state of the restore process + Endpoints []ResourceLink + // Unique id for backup request + Id *string + // Instructions for users to reconcile Restore operations + Instructions []InstructionInfo + // Possible values are: + // + // * ClusterRestoreStatus#ClusterRestoreStatus_NOT_ALLOWED_ACTIONS_UPDATES + // + // List of actions that are not allowed + NotAllowedActions []string + // Timestamp when restore was completed in epoch millisecond format: int64 + RestoreEndTime *int64 + // Timestamp when restore was started in epoch millisecond format: int64 + RestoreStartTime *int64 + Status *GlobalRestoreStatus + Step *RestoreStep + // Total number of steps in the entire restore process format: int64 + TotalSteps *int64 +} + +const ClusterRestoreStatus_NOT_ALLOWED_ACTIONS_UPDATES = "VC_UPDATES" + +func (s *ClusterRestoreStatus) GetType__() bindings.BindingType { + return ClusterRestoreStatusBindingType() +} + +func (s *ClusterRestoreStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterRestoreStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ClusterRoleConfig struct { + // Possible values are: + // + // * ClusterRoleConfig#ClusterRoleConfig_TYPE_MANAGEMENTCLUSTERROLECONFIG + // * ClusterRoleConfig#ClusterRoleConfig_TYPE_CONTROLLERCLUSTERROLECONFIG + // + // Type of this role configuration + Type_ *string +} + +const ClusterRoleConfig_TYPE_MANAGEMENTCLUSTERROLECONFIG = "ManagementClusterRoleConfig" +const ClusterRoleConfig_TYPE_CONTROLLERCLUSTERROLECONFIG = "ControllerClusterRoleConfig" + +func (s *ClusterRoleConfig) GetType__() bindings.BindingType { + return ClusterRoleConfigBindingType() +} + +func (s *ClusterRoleConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterRoleConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ClusterStatus struct { + // Unique identifier of this cluster + ClusterId *string + ControlClusterStatus *ControllerClusterStatus + DetailedClusterStatus *AllClusterGroupStatus + MgmtClusterStatus *ManagementClusterStatus +} + +func (s *ClusterStatus) GetType__() bindings.BindingType { + return ClusterStatusBindingType() +} + +func (s *ClusterStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Cluster virtual IP properties +type ClusterVirtualIpProperties struct { + // Virtual IP address, 0.0.0.0 if not configured + IpAddress *string +} + +func (s *ClusterVirtualIpProperties) GetType__() bindings.BindingType { + return ClusterVirtualIpPropertiesBindingType() +} + +func (s *ClusterVirtualIpProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusterVirtualIpProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Configuration for automatically joining a cluster node to the cluster after it is deployed. ClusteringConfig is required if any of the deployment nodes has CONTROLLER role. +type ClusteringConfig struct { + // Possible values are: + // + // * ClusteringConfig#ClusteringConfig_CLUSTERING_TYPE_CONTROLCLUSTERINGCONFIG + // + // Specifies the type of clustering config to be used. + ClusteringType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ClusteringConfig__TYPE_IDENTIFIER = "ClusteringConfig" +const ClusteringConfig_CLUSTERING_TYPE_CONTROLCLUSTERINGCONFIG = "ControlClusteringConfig" + +func (s *ClusteringConfig) GetType__() bindings.BindingType { + return ClusteringConfigBindingType() +} + +func (s *ClusteringConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusteringConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Clustering parameters for the controller cluster +type ClusteringInfo struct { + // Property to indicate if the node must join an existing cluster. + JoinToExistingCluster *bool + // Shared secret of the cluster. + SharedSecret *string +} + +func (s *ClusteringInfo) GetType__() bindings.BindingType { + return ClusteringInfoBindingType() +} + +func (s *ClusteringInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClusteringInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ClustersAggregateInfo struct { + ClusterStatus *AllClusterGroupStatus + // Array of Controller Nodes + ControllerCluster []ControllerNodeAggregateInfo + // Array of Management Nodes + ManagementCluster []ManagementNodeAggregateInfo +} + +func (s *ClustersAggregateInfo) GetType__() bindings.BindingType { + return ClustersAggregateInfoBindingType() +} + +func (s *ClustersAggregateInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ClustersAggregateInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents a column of the Grid +type ColumnItem struct { + // Identifies the column and used for fetching content upon an user click or drilldown. If column identifier is not provided, the column's data will not participate in searches and drilldowns. + ColumnIdentifier *string + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. + DrilldownId *string + // Field from which values of the column will be derived. + Field *string + // If set to true, hides the column + Hidden *bool + Label *Label + // Hyperlink of the specified UI page that provides details. If drilldown_id is provided, then navigation cannot be used. + Navigation *string + // Render configuration to be applied, if any. + RenderConfiguration []RenderConfiguration + // If true, the value of the column are sorted in ascending order. Otherwise, in descending order. + SortAscending *bool + // Sorting on column is based on the sort_key. sort_key represents the field in the output data on which sort is requested. + SortKey *string + // Multi-line text to be shown on tooltip while hovering over a cell in the grid. + Tooltip []Tooltip + // Possible values are: + // + // * ColumnItem#ColumnItem_TYPE_STRING + // * ColumnItem#ColumnItem_TYPE_NUMBER + // * ColumnItem#ColumnItem_TYPE_DATE + // + // Data type of the field. + Type_ *string +} + +const ColumnItem_TYPE_STRING = "String" +const ColumnItem_TYPE_NUMBER = "Number" +const ColumnItem_TYPE_DATE = "Date" + +func (s *ColumnItem) GetType__() bindings.BindingType { + return ColumnItemBindingType() +} + +func (s *ColumnItem) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ColumnItem._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Community match expression +type CommunityMatchExpression struct { + // Array of community match operations + Expression []CommunityMatchOperation + // Possible values are: + // + // * CommunityMatchExpression#CommunityMatchExpression_OPERATOR_AND + // + // Operator for evaluating community match expressions. AND logical AND operator + Operator *string +} + +const CommunityMatchExpression_OPERATOR_AND = "AND" + +func (s *CommunityMatchExpression) GetType__() bindings.BindingType { + return CommunityMatchExpressionBindingType() +} + +func (s *CommunityMatchExpression) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CommunityMatchExpression._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Community match operation +type CommunityMatchOperation struct { + // ID of BGP community list. This value is not required when match_operator is MATCH_REGEX otherwise required. + CommunityListId *string + // Possible values are: + // + // * CommunityMatchOperation#CommunityMatchOperation_MATCH_OPERATOR_ANY + // * CommunityMatchOperation#CommunityMatchOperation_MATCH_OPERATOR_ALL + // * CommunityMatchOperation#CommunityMatchOperation_MATCH_OPERATOR_EXACT + // * CommunityMatchOperation#CommunityMatchOperation_MATCH_OPERATOR_NONE + // * CommunityMatchOperation#CommunityMatchOperation_MATCH_OPERATOR_REGEX + // * CommunityMatchOperation#CommunityMatchOperation_MATCH_OPERATOR_LARGE_COMMUNITY_REGEX + // + // Match operator for communities from provided community list id. MATCH_ANY will match any community MATCH_ALL will match all communities MATCH_EXACT will do exact match on community MATCH_NONE [operator not supported] will not match any community MATCH_REGEX will match normal communities by evaluating regular expression MATCH_LARGE_COMMUNITY_REGEX will match large communities by evaluating regular expression + MatchOperator *string + // Regular expression to match BGP communities. If match_operator is MATCH_REGEX then this value must be specified. + RegularExpression *string +} + +const CommunityMatchOperation_MATCH_OPERATOR_ANY = "MATCH_ANY" +const CommunityMatchOperation_MATCH_OPERATOR_ALL = "MATCH_ALL" +const CommunityMatchOperation_MATCH_OPERATOR_EXACT = "MATCH_EXACT" +const CommunityMatchOperation_MATCH_OPERATOR_NONE = "MATCH_NONE" +const CommunityMatchOperation_MATCH_OPERATOR_REGEX = "MATCH_REGEX" +const CommunityMatchOperation_MATCH_OPERATOR_LARGE_COMMUNITY_REGEX = "MATCH_LARGE_COMMUNITY_REGEX" + +func (s *CommunityMatchOperation) GetType__() bindings.BindingType { + return CommunityMatchOperationBindingType() +} + +func (s *CommunityMatchOperation) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CommunityMatchOperation._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ComponentMigrationStatus struct { + // Can the migration of the remaining units in this component be skipped + CanSkip *bool + // Component type for the migration status + ComponentType *string + // Details about the migration status + Details *string + // Indicator of migration progress in percentage + PercentComplete *float64 + // Possible values are: + // + // * ComponentMigrationStatus#ComponentMigrationStatus_STATUS_SUCCESS + // * ComponentMigrationStatus#ComponentMigrationStatus_STATUS_FAILED + // * ComponentMigrationStatus#ComponentMigrationStatus_STATUS_IN_PROGRESS + // * ComponentMigrationStatus#ComponentMigrationStatus_STATUS_NOT_STARTED + // * ComponentMigrationStatus#ComponentMigrationStatus_STATUS_PAUSING + // * ComponentMigrationStatus#ComponentMigrationStatus_STATUS_PAUSED + // + // Migration status of component + Status *string +} + +const ComponentMigrationStatus_STATUS_SUCCESS = "SUCCESS" +const ComponentMigrationStatus_STATUS_FAILED = "FAILED" +const ComponentMigrationStatus_STATUS_IN_PROGRESS = "IN_PROGRESS" +const ComponentMigrationStatus_STATUS_NOT_STARTED = "NOT_STARTED" +const ComponentMigrationStatus_STATUS_PAUSING = "PAUSING" +const ComponentMigrationStatus_STATUS_PAUSED = "PAUSED" + +func (s *ComponentMigrationStatus) GetType__() bindings.BindingType { + return ComponentMigrationStatusBindingType() +} + +func (s *ComponentMigrationStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ComponentMigrationStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ComponentTargetVersion struct { + ComponentType *string + TargetVersion *string +} + +func (s *ComponentTargetVersion) GetType__() bindings.BindingType { + return ComponentTargetVersionBindingType() +} + +func (s *ComponentTargetVersion) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ComponentTargetVersion._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Meta-data of pre/post-upgrade checks for a component +type ComponentUpgradeChecksInfo struct { + // Component type of the pre/post-upgrade checks + ComponentType *string + // Collection of post-upgrade checks + PostUpgradeChecksInfo []UpgradeCheckInfo + // Collection of pre-upgrade checks + PreUpgradeChecksInfo []UpgradeCheckInfo +} + +func (s *ComponentUpgradeChecksInfo) GetType__() bindings.BindingType { + return ComponentUpgradeChecksInfoBindingType() +} + +func (s *ComponentUpgradeChecksInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ComponentUpgradeChecksInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ComponentUpgradeChecksInfoListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Collection of info of pre/post-upgrade checks for components + Results []ComponentUpgradeChecksInfo +} + +func (s *ComponentUpgradeChecksInfoListResult) GetType__() bindings.BindingType { + return ComponentUpgradeChecksInfoListResultBindingType() +} + +func (s *ComponentUpgradeChecksInfoListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ComponentUpgradeChecksInfoListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ComponentUpgradeStatus struct { + // This field indicates whether we can perform upgrade rollback. + CanRollback *bool + // Can the upgrade of the remaining units in this component be skipped + CanSkip *bool + // Component type for the upgrade status + ComponentType *string + CurrentVersionNodeSummary *NodeSummaryList + // Details about the upgrade status + Details *string + // Number of nodes of the type and at the component version format: int32 + NodeCountAtTargetVersion *int64 + // Indicator of upgrade progress in percentage + PercentComplete *float64 + PreUpgradeStatus *UpgradeChecksExecutionStatus + // Possible values are: + // + // * ComponentUpgradeStatus#ComponentUpgradeStatus_STATUS_SUCCESS + // * ComponentUpgradeStatus#ComponentUpgradeStatus_STATUS_FAILED + // * ComponentUpgradeStatus#ComponentUpgradeStatus_STATUS_IN_PROGRESS + // * ComponentUpgradeStatus#ComponentUpgradeStatus_STATUS_NOT_STARTED + // * ComponentUpgradeStatus#ComponentUpgradeStatus_STATUS_PAUSING + // * ComponentUpgradeStatus#ComponentUpgradeStatus_STATUS_PAUSED + // + // Upgrade status of component + Status *string + // Target component version + TargetComponentVersion *string +} + +const ComponentUpgradeStatus_STATUS_SUCCESS = "SUCCESS" +const ComponentUpgradeStatus_STATUS_FAILED = "FAILED" +const ComponentUpgradeStatus_STATUS_IN_PROGRESS = "IN_PROGRESS" +const ComponentUpgradeStatus_STATUS_NOT_STARTED = "NOT_STARTED" +const ComponentUpgradeStatus_STATUS_PAUSING = "PAUSING" +const ComponentUpgradeStatus_STATUS_PAUSED = "PAUSED" + +func (s *ComponentUpgradeStatus) GetType__() bindings.BindingType { + return ComponentUpgradeStatusBindingType() +} + +func (s *ComponentUpgradeStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ComponentUpgradeStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ComputeCollection struct { + // Local Id of the compute collection in the Compute Manager + CmLocalId *string + // External ID of the ComputeCollection in the source Compute manager, e.g. mo-ref in VC + ExternalId *string + // Id of the compute manager from where this Compute Collection was discovered + OriginId *string + // Key-Value map of additional specific properties of compute collection in the Compute Manager + OriginProperties []KeyValuePair + // ComputeCollection type like VC_Cluster. Here the Compute Manager type prefix would help in differentiating similar named Compute Collection types from different Compute Managers + OriginType *string + // Id of the owner of compute collection in the Compute Manager + OwnerId *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Specifies list of scope of discovered resource. e.g. if VHC path is associated with principal identity, who owns the discovered resource, then scope id will be VHC path and scope type will be VHC. + Scope []DiscoveredResourceScope + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +func (s *ComputeCollection) GetType__() bindings.BindingType { + return ComputeCollectionBindingType() +} + +func (s *ComputeCollection) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ComputeCollection._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Compute Collection list result +type ComputeCollectionListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Compute Collection list results + Results []ComputeCollection +} + +func (s *ComputeCollectionListResult) GetType__() bindings.BindingType { + return ComputeCollectionListResultBindingType() +} + +func (s *ComputeCollectionListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ComputeCollectionListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of network interfaces for all discovered nodes in compute collection +type ComputeCollectionNetworkInterfacesListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of discovered node with network interfaces + Results []DiscoveredNodeNetworkInterfaces +} + +func (s *ComputeCollectionNetworkInterfacesListResult) GetType__() bindings.BindingType { + return ComputeCollectionNetworkInterfacesListResultBindingType() +} + +func (s *ComputeCollectionNetworkInterfacesListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ComputeCollectionNetworkInterfacesListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ComputeManager struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * ComputeManager#ComputeManager_ACCESS_LEVEL_FOR_OIDC_FULL + // * ComputeManager#ComputeManager_ACCESS_LEVEL_FOR_OIDC_LIMITED + // + // Specifies the maximum access level allowed for calls from compute manager to NSX using the OIDC provider. + AccessLevelForOidc *string + // Enable this flag to create service account user on compute manager. This is required by features such as vSphere Lifecycle Manager for authentication with vAPIs from nsx. + CreateServiceAccount *bool + Credential *data.StructValue + // Key-Value map of additional specific properties of compute manager + OriginProperties []KeyValuePair + // Compute manager type like vCenter + OriginType *string + // Specifies https port of the reverse proxy to connect to compute manager. For e.g. In case of VC, this port can be retrieved from this config file /etc/vmware-rhttpproxy/config.xml. format: int64 + ReverseProxyHttpsPort *int64 + // IP address or hostname of compute manager format: hostname-or-ip + Server *string + // If the compute manager is VC and need to set set as OIDC provider for NSX then this flag should be set as true. This is specific to wcp feature, should be enabled when this feature is being used. + SetAsOidcProvider *bool +} + +const ComputeManager_ACCESS_LEVEL_FOR_OIDC_FULL = "FULL" +const ComputeManager_ACCESS_LEVEL_FOR_OIDC_LIMITED = "LIMITED" + +func (s *ComputeManager) GetType__() bindings.BindingType { + return ComputeManagerBindingType() +} + +func (s *ComputeManager) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ComputeManager._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of compute managers +type ComputeManagerListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of compute managers + Results []ComputeManager +} + +func (s *ComputeManagerListResult) GetType__() bindings.BindingType { + return ComputeManagerListResultBindingType() +} + +func (s *ComputeManagerListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ComputeManagerListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Runtime status information of the compute manager +type ComputeManagerStatus struct { + // Errors when connecting with compute manager + ConnectionErrors []ErrorInfo + // Possible values are: + // + // * ComputeManagerStatus#ComputeManagerStatus_CONNECTION_STATUS_UP + // * ComputeManagerStatus#ComputeManagerStatus_CONNECTION_STATUS_DOWN + // * ComputeManagerStatus#ComputeManagerStatus_CONNECTION_STATUS_CONNECTING + // + // Status of connection with the compute manager + ConnectionStatus *string + // Details about connection status + ConnectionStatusDetails *string + // Timestamp of the last successful update of Inventory, in epoch milliseconds. format: int64 + LastSyncTime *int64 + // If Compute manager is trusted as authorization server, then this Id will be Id of corresponding oidc end point. + OidcEndPointId *string + // Errors when registering with compute manager + RegistrationErrors []ErrorInfo + // Possible values are: + // + // * ComputeManagerStatus#ComputeManagerStatus_REGISTRATION_STATUS_REGISTERED + // * ComputeManagerStatus#ComputeManagerStatus_REGISTRATION_STATUS_UNREGISTERED + // * ComputeManagerStatus#ComputeManagerStatus_REGISTRATION_STATUS_REGISTERING + // * ComputeManagerStatus#ComputeManagerStatus_REGISTRATION_STATUS_REGISTERED_WITH_ERRORS + // + // Registration status of compute manager + RegistrationStatus *string + // Version of the compute manager + Version *string +} + +const ComputeManagerStatus_CONNECTION_STATUS_UP = "UP" +const ComputeManagerStatus_CONNECTION_STATUS_DOWN = "DOWN" +const ComputeManagerStatus_CONNECTION_STATUS_CONNECTING = "CONNECTING" +const ComputeManagerStatus_REGISTRATION_STATUS_REGISTERED = "REGISTERED" +const ComputeManagerStatus_REGISTRATION_STATUS_UNREGISTERED = "UNREGISTERED" +const ComputeManagerStatus_REGISTRATION_STATUS_REGISTERING = "REGISTERING" +const ComputeManagerStatus_REGISTRATION_STATUS_REGISTERED_WITH_ERRORS = "REGISTERED_WITH_ERRORS" + +func (s *ComputeManagerStatus) GetType__() bindings.BindingType { + return ComputeManagerStatusBindingType() +} + +func (s *ComputeManagerStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ComputeManagerStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Details where NVDS will be migrated to +type ComputeManagerTopology struct { + // Identifier of vcenter where VDS will be created + ComputeManagerId *string + // Datacenter, VDS mapping + Dvswitch []VdsTopology +} + +func (s *ComputeManagerTopology) GetType__() bindings.BindingType { + return ComputeManagerTopologyBindingType() +} + +func (s *ComputeManagerTopology) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ComputeManagerTopology._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ConditionalForwarderZone struct { + // The source ip used by the fowarder of the zone. If no source ip specified, the ip address of listener of the DNS forwarder will be used. format: ipv4 + SourceIp *string + // Ip address of the upstream DNS servers the DNS forwarder accesses. format: ipv4 + UpstreamServers []string + // A forwarder domain name should be a valid FQDN. If reverse lookup is needed for this zone, reverse lookup domain name like X.in-addr.arpa can be defined. Here the X represents a subnet. + DomainNames []string +} + +func (s *ConditionalForwarderZone) GetType__() bindings.BindingType { + return ConditionalForwarderZoneBindingType() +} + +func (s *ConditionalForwarderZone) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ConditionalForwarderZone._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Describes status of configuration of an entity +type ConfigurationState struct { + // Array of configuration state of various sub systems + Details []ConfigurationStateElement + // Error code format: int64 + FailureCode *int64 + // Error message in case of failure + FailureMessage *string + // Possible values are: + // + // * ConfigurationState#ConfigurationState_STATE_PENDING + // * ConfigurationState#ConfigurationState_STATE_IN_PROGRESS + // * ConfigurationState#ConfigurationState_STATE_SUCCESS + // * ConfigurationState#ConfigurationState_STATE_FAILED + // * ConfigurationState#ConfigurationState_STATE_PARTIAL_SUCCESS + // * ConfigurationState#ConfigurationState_STATE_ORPHANED + // * ConfigurationState#ConfigurationState_STATE_UNKNOWN + // * ConfigurationState#ConfigurationState_STATE_ERROR + // * ConfigurationState#ConfigurationState_STATE_IN_SYNC + // * ConfigurationState#ConfigurationState_STATE_NOT_AVAILABLE + // * ConfigurationState#ConfigurationState_STATE_VM_DEPLOYMENT_QUEUED + // * ConfigurationState#ConfigurationState_STATE_VM_DEPLOYMENT_IN_PROGRESS + // * ConfigurationState#ConfigurationState_STATE_VM_DEPLOYMENT_FAILED + // * ConfigurationState#ConfigurationState_STATE_VM_POWER_ON_IN_PROGRESS + // * ConfigurationState#ConfigurationState_STATE_VM_POWER_ON_FAILED + // * ConfigurationState#ConfigurationState_STATE_REGISTRATION_PENDING + // * ConfigurationState#ConfigurationState_STATE_NODE_NOT_READY + // * ConfigurationState#ConfigurationState_STATE_NODE_READY + // * ConfigurationState#ConfigurationState_STATE_VM_POWER_OFF_IN_PROGRESS + // * ConfigurationState#ConfigurationState_STATE_VM_POWER_OFF_FAILED + // * ConfigurationState#ConfigurationState_STATE_VM_UNDEPLOY_IN_PROGRESS + // * ConfigurationState#ConfigurationState_STATE_VM_UNDEPLOY_FAILED + // * ConfigurationState#ConfigurationState_STATE_VM_UNDEPLOY_SUCCESSFUL + // * ConfigurationState#ConfigurationState_STATE_EDGE_CONFIG_ERROR + // * ConfigurationState#ConfigurationState_STATE_VM_DEPLOYMENT_RESTARTED + // * ConfigurationState#ConfigurationState_STATE_REGISTRATION_FAILED + // * ConfigurationState#ConfigurationState_STATE_TRANSPORT_NODE_SYNC_PENDING + // * ConfigurationState#ConfigurationState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING + // * ConfigurationState#ConfigurationState_STATE_EDGE_HARDWARE_NOT_SUPPORTED + // * ConfigurationState#ConfigurationState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED + // * ConfigurationState#ConfigurationState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER + // * ConfigurationState#ConfigurationState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED + // * ConfigurationState#ConfigurationState_STATE_NO_PNIC_PREPARED_IN_EDGE + // * ConfigurationState#ConfigurationState_STATE_APPLIANCE_INTERNAL_ERROR + // * ConfigurationState#ConfigurationState_STATE_VTEP_DHCP_NOT_SUPPORTED + // * ConfigurationState#ConfigurationState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE + // * ConfigurationState#ConfigurationState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED + // * ConfigurationState#ConfigurationState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND + // * ConfigurationState#ConfigurationState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED + // * ConfigurationState#ConfigurationState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY + // * ConfigurationState#ConfigurationState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM + // * ConfigurationState#ConfigurationState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM + // * ConfigurationState#ConfigurationState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM + // * ConfigurationState#ConfigurationState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE + // * ConfigurationState#ConfigurationState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE + // * ConfigurationState#ConfigurationState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED + // * ConfigurationState#ConfigurationState_STATE_NO_PNIC_SPECIFIED_IN_TN + // * ConfigurationState#ConfigurationState_STATE_INVALID_PNIC_DEVICE_NAME + // * ConfigurationState#ConfigurationState_STATE_TRANSPORT_NODE_READY + // * ConfigurationState#ConfigurationState_STATE_VM_NETWORK_EDIT_PENDING + // * ConfigurationState#ConfigurationState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY + // * ConfigurationState#ConfigurationState_STATE_MPA_DISCONNECTED + // * ConfigurationState#ConfigurationState_STATE_VM_RENAME_PENDING + // * ConfigurationState#ConfigurationState_STATE_VM_CONFIG_EDIT_PENDING + // * ConfigurationState#ConfigurationState_STATE_VM_NETWORK_EDIT_FAILED + // * ConfigurationState#ConfigurationState_STATE_VM_RENAME_FAILED + // * ConfigurationState#ConfigurationState_STATE_VM_CONFIG_EDIT_FAILED + // * ConfigurationState#ConfigurationState_STATE_VM_CONFIG_DISCREPANCY + // * ConfigurationState#ConfigurationState_STATE_VM_NODE_REFRESH_FAILED + // * ConfigurationState#ConfigurationState_STATE_VM_PLACEMENT_REFRESH_FAILED + // * ConfigurationState#ConfigurationState_STATE_REGISTRATION_TIMEDOUT + // * ConfigurationState#ConfigurationState_STATE_REPLACE_FAILED + // * ConfigurationState#ConfigurationState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED + // * ConfigurationState#ConfigurationState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING + // * ConfigurationState#ConfigurationState_STATE_DELETE_VM_IN_REDEPLOY_FAILED + // * ConfigurationState#ConfigurationState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED + // * ConfigurationState#ConfigurationState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE + // * ConfigurationState#ConfigurationState_STATE_VM_RESOURCE_RESERVATION_FAILED + // * ConfigurationState#ConfigurationState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER + // * ConfigurationState#ConfigurationState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING + // * ConfigurationState#ConfigurationState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE + // * ConfigurationState#ConfigurationState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE + // * ConfigurationState#ConfigurationState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE + // * ConfigurationState#ConfigurationState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE + // * ConfigurationState#ConfigurationState_STATE_COMPUTE_MANAGER_NOT_FOUND + // * ConfigurationState#ConfigurationState_STATE_DELETE_IN_PROGRESS + // + // Gives details of state of desired configuration. Additional enums with more details on progress/success/error states are sent for edge node. The success states are NODE_READY and TRANSPORT_NODE_READY, pending states are {VM_DEPLOYMENT_QUEUED, VM_DEPLOYMENT_IN_PROGRESS, REGISTRATION_PENDING} and other values indicate failures. \"in_sync\" state indicates that the desired configuration has been received by the host to which it applies, but is not yet in effect. When the configuration is actually in effect, the state will change to \"success\". Please note, failed state is deprecated. + State *string +} + +const ConfigurationState_STATE_PENDING = "pending" +const ConfigurationState_STATE_IN_PROGRESS = "in_progress" +const ConfigurationState_STATE_SUCCESS = "success" +const ConfigurationState_STATE_FAILED = "failed" +const ConfigurationState_STATE_PARTIAL_SUCCESS = "partial_success" +const ConfigurationState_STATE_ORPHANED = "orphaned" +const ConfigurationState_STATE_UNKNOWN = "unknown" +const ConfigurationState_STATE_ERROR = "error" +const ConfigurationState_STATE_IN_SYNC = "in_sync" +const ConfigurationState_STATE_NOT_AVAILABLE = "NOT_AVAILABLE" +const ConfigurationState_STATE_VM_DEPLOYMENT_QUEUED = "VM_DEPLOYMENT_QUEUED" +const ConfigurationState_STATE_VM_DEPLOYMENT_IN_PROGRESS = "VM_DEPLOYMENT_IN_PROGRESS" +const ConfigurationState_STATE_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const ConfigurationState_STATE_VM_POWER_ON_IN_PROGRESS = "VM_POWER_ON_IN_PROGRESS" +const ConfigurationState_STATE_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const ConfigurationState_STATE_REGISTRATION_PENDING = "REGISTRATION_PENDING" +const ConfigurationState_STATE_NODE_NOT_READY = "NODE_NOT_READY" +const ConfigurationState_STATE_NODE_READY = "NODE_READY" +const ConfigurationState_STATE_VM_POWER_OFF_IN_PROGRESS = "VM_POWER_OFF_IN_PROGRESS" +const ConfigurationState_STATE_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const ConfigurationState_STATE_VM_UNDEPLOY_IN_PROGRESS = "VM_UNDEPLOY_IN_PROGRESS" +const ConfigurationState_STATE_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const ConfigurationState_STATE_VM_UNDEPLOY_SUCCESSFUL = "VM_UNDEPLOY_SUCCESSFUL" +const ConfigurationState_STATE_EDGE_CONFIG_ERROR = "EDGE_CONFIG_ERROR" +const ConfigurationState_STATE_VM_DEPLOYMENT_RESTARTED = "VM_DEPLOYMENT_RESTARTED" +const ConfigurationState_STATE_REGISTRATION_FAILED = "REGISTRATION_FAILED" +const ConfigurationState_STATE_TRANSPORT_NODE_SYNC_PENDING = "TRANSPORT_NODE_SYNC_PENDING" +const ConfigurationState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING = "TRANSPORT_NODE_CONFIGURATION_MISSING" +const ConfigurationState_STATE_EDGE_HARDWARE_NOT_SUPPORTED = "EDGE_HARDWARE_NOT_SUPPORTED" +const ConfigurationState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED = "MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED" +const ConfigurationState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER = "TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER" +const ConfigurationState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED = "TZ_ENDPOINTS_NOT_SPECIFIED" +const ConfigurationState_STATE_NO_PNIC_PREPARED_IN_EDGE = "NO_PNIC_PREPARED_IN_EDGE" +const ConfigurationState_STATE_APPLIANCE_INTERNAL_ERROR = "APPLIANCE_INTERNAL_ERROR" +const ConfigurationState_STATE_VTEP_DHCP_NOT_SUPPORTED = "VTEP_DHCP_NOT_SUPPORTED" +const ConfigurationState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE = "UNSUPPORTED_HOST_SWITCH_PROFILE" +const ConfigurationState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED = "UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED" +const ConfigurationState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND = "HOSTSWITCH_PROFILE_NOT_FOUND" +const ConfigurationState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED = "LLDP_SEND_ENABLED_NOT_SUPPORTED" +const ConfigurationState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY = "UNSUPPORTED_NAMED_TEAMING_POLICY" +const ConfigurationState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM = "LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM" +const ConfigurationState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM = "LACP_NOT_SUPPORTED_FOR_EDGE_VM" +const ConfigurationState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM = "STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM" +const ConfigurationState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE = "MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE" +const ConfigurationState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE = "UNSUPPORTED_LACP_LB_ALGO_FOR_NODE" +const ConfigurationState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED = "EDGE_NODE_VERSION_NOT_SUPPORTED" +const ConfigurationState_STATE_NO_PNIC_SPECIFIED_IN_TN = "NO_PNIC_SPECIFIED_IN_TN" +const ConfigurationState_STATE_INVALID_PNIC_DEVICE_NAME = "INVALID_PNIC_DEVICE_NAME" +const ConfigurationState_STATE_TRANSPORT_NODE_READY = "TRANSPORT_NODE_READY" +const ConfigurationState_STATE_VM_NETWORK_EDIT_PENDING = "VM_NETWORK_EDIT_PENDING" +const ConfigurationState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY = "UNSUPPORTED_DEFAULT_TEAMING_POLICY" +const ConfigurationState_STATE_MPA_DISCONNECTED = "MPA_DISCONNECTED" +const ConfigurationState_STATE_VM_RENAME_PENDING = "VM_RENAME_PENDING" +const ConfigurationState_STATE_VM_CONFIG_EDIT_PENDING = "VM_CONFIG_EDIT_PENDING" +const ConfigurationState_STATE_VM_NETWORK_EDIT_FAILED = "VM_NETWORK_EDIT_FAILED" +const ConfigurationState_STATE_VM_RENAME_FAILED = "VM_RENAME_FAILED" +const ConfigurationState_STATE_VM_CONFIG_EDIT_FAILED = "VM_CONFIG_EDIT_FAILED" +const ConfigurationState_STATE_VM_CONFIG_DISCREPANCY = "VM_CONFIG_DISCREPANCY" +const ConfigurationState_STATE_VM_NODE_REFRESH_FAILED = "VM_NODE_REFRESH_FAILED" +const ConfigurationState_STATE_VM_PLACEMENT_REFRESH_FAILED = "VM_PLACEMENT_REFRESH_FAILED" +const ConfigurationState_STATE_REGISTRATION_TIMEDOUT = "REGISTRATION_TIMEDOUT" +const ConfigurationState_STATE_REPLACE_FAILED = "REPLACE_FAILED" +const ConfigurationState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED = "UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED" +const ConfigurationState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING = "LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING" +const ConfigurationState_STATE_DELETE_VM_IN_REDEPLOY_FAILED = "DELETE_VM_IN_REDEPLOY_FAILED" +const ConfigurationState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED = "DEPLOY_VM_IN_REDEPLOY_FAILED" +const ConfigurationState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE = "INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE" +const ConfigurationState_STATE_VM_RESOURCE_RESERVATION_FAILED = "VM_RESOURCE_RESERVATION_FAILED" +const ConfigurationState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER = "DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER" +const ConfigurationState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING = "DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING" +const ConfigurationState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE = "EDGE_NODE_SETTINGS_MISMATCH_RESOLVE" +const ConfigurationState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE = "EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE" +const ConfigurationState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE = "EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE" +const ConfigurationState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE = "EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE" +const ConfigurationState_STATE_COMPUTE_MANAGER_NOT_FOUND = "COMPUTE_MANAGER_NOT_FOUND" +const ConfigurationState_STATE_DELETE_IN_PROGRESS = "DELETE_IN_PROGRESS" + +func (s *ConfigurationState) GetType__() bindings.BindingType { + return ConfigurationStateBindingType() +} + +func (s *ConfigurationState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ConfigurationState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Describes status of configuration of an entity +type ConfigurationStateElement struct { + // Error code format: int64 + FailureCode *int64 + // Error message in case of failure + FailureMessage *string + // Possible values are: + // + // * ConfigurationStateElement#ConfigurationStateElement_STATE_IN_PROGRESS + // * ConfigurationStateElement#ConfigurationStateElement_STATE_SUCCESS + // * ConfigurationStateElement#ConfigurationStateElement_STATE_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_PARTIAL_SUCCESS + // * ConfigurationStateElement#ConfigurationStateElement_STATE_IN_SYNC + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_DEPLOYMENT_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_POWER_ON_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_POWER_OFF_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_UNDEPLOY_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_REPLACE_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING + // * ConfigurationStateElement#ConfigurationStateElement_STATE_DELETE_VM_IN_REDEPLOY_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE + // * ConfigurationStateElement#ConfigurationStateElement_STATE_EDGE_CONFIG_ERROR + // * ConfigurationStateElement#ConfigurationStateElement_STATE_REGISTRATION_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING + // * ConfigurationStateElement#ConfigurationStateElement_STATE_EDGE_HARDWARE_NOT_SUPPORTED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER + // * ConfigurationStateElement#ConfigurationStateElement_STATE_TZ_ENDPOINTS_NOT_SPECIFIED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_NO_PNIC_PREPARED_IN_EDGE + // * ConfigurationStateElement#ConfigurationStateElement_STATE_APPLIANCE_INTERNAL_ERROR + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VTEP_DHCP_NOT_SUPPORTED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE + // * ConfigurationStateElement#ConfigurationStateElement_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_HOSTSWITCH_PROFILE_NOT_FOUND + // * ConfigurationStateElement#ConfigurationStateElement_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY + // * ConfigurationStateElement#ConfigurationStateElement_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM + // * ConfigurationStateElement#ConfigurationStateElement_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM + // * ConfigurationStateElement#ConfigurationStateElement_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM + // * ConfigurationStateElement#ConfigurationStateElement_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE + // * ConfigurationStateElement#ConfigurationStateElement_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE + // * ConfigurationStateElement#ConfigurationStateElement_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_NO_PNIC_SPECIFIED_IN_TN + // * ConfigurationStateElement#ConfigurationStateElement_STATE_INVALID_PNIC_DEVICE_NAME + // * ConfigurationStateElement#ConfigurationStateElement_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY + // * ConfigurationStateElement#ConfigurationStateElement_STATE_MPA_DISCONNECTED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_NETWORK_EDIT_PENDING + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_RENAME_PENDING + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_CONFIG_EDIT_PENDING + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_NETWORK_EDIT_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_RENAME_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_CONFIG_EDIT_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_CONFIG_DISCREPANCY + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_NODE_REFRESH_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_VM_PLACEMENT_REFRESH_FAILED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_NOT_AVAILABLE + // * ConfigurationStateElement#ConfigurationStateElement_STATE_REGISTRATION_TIMEDOUT + // * ConfigurationStateElement#ConfigurationStateElement_STATE_PENDING + // * ConfigurationStateElement#ConfigurationStateElement_STATE_ORPHANED + // * ConfigurationStateElement#ConfigurationStateElement_STATE_UNKNOWN + // * ConfigurationStateElement#ConfigurationStateElement_STATE_ERROR + // + // State of configuration on this sub system + State *string + // URI of backing resource on sub system + SubSystemAddress *string + // Identifier of backing resource on sub system + SubSystemId *string + // Name of backing resource on sub system + SubSystemName *string + // Type of backing resource on sub system + SubSystemType *string +} + +const ConfigurationStateElement_STATE_IN_PROGRESS = "in_progress" +const ConfigurationStateElement_STATE_SUCCESS = "success" +const ConfigurationStateElement_STATE_FAILED = "failed" +const ConfigurationStateElement_STATE_PARTIAL_SUCCESS = "partial_success" +const ConfigurationStateElement_STATE_IN_SYNC = "in_sync" +const ConfigurationStateElement_STATE_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const ConfigurationStateElement_STATE_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const ConfigurationStateElement_STATE_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const ConfigurationStateElement_STATE_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const ConfigurationStateElement_STATE_REPLACE_FAILED = "REPLACE_FAILED" +const ConfigurationStateElement_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED = "UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED" +const ConfigurationStateElement_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING = "LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING" +const ConfigurationStateElement_STATE_DELETE_VM_IN_REDEPLOY_FAILED = "DELETE_VM_IN_REDEPLOY_FAILED" +const ConfigurationStateElement_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED = "DEPLOY_VM_IN_REDEPLOY_FAILED" +const ConfigurationStateElement_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE = "INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE" +const ConfigurationStateElement_STATE_EDGE_CONFIG_ERROR = "EDGE_CONFIG_ERROR" +const ConfigurationStateElement_STATE_REGISTRATION_FAILED = "REGISTRATION_FAILED" +const ConfigurationStateElement_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING = "TRANSPORT_NODE_CONFIGURATION_MISSING" +const ConfigurationStateElement_STATE_EDGE_HARDWARE_NOT_SUPPORTED = "EDGE_HARDWARE_NOT_SUPPORTED" +const ConfigurationStateElement_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED = "MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED" +const ConfigurationStateElement_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER = "TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER" +const ConfigurationStateElement_STATE_TZ_ENDPOINTS_NOT_SPECIFIED = "TZ_ENDPOINTS_NOT_SPECIFIED" +const ConfigurationStateElement_STATE_NO_PNIC_PREPARED_IN_EDGE = "NO_PNIC_PREPARED_IN_EDGE" +const ConfigurationStateElement_STATE_APPLIANCE_INTERNAL_ERROR = "APPLIANCE_INTERNAL_ERROR" +const ConfigurationStateElement_STATE_VTEP_DHCP_NOT_SUPPORTED = "VTEP_DHCP_NOT_SUPPORTED" +const ConfigurationStateElement_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE = "UNSUPPORTED_HOST_SWITCH_PROFILE" +const ConfigurationStateElement_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED = "UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED" +const ConfigurationStateElement_STATE_HOSTSWITCH_PROFILE_NOT_FOUND = "HOSTSWITCH_PROFILE_NOT_FOUND" +const ConfigurationStateElement_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED = "LLDP_SEND_ENABLED_NOT_SUPPORTED" +const ConfigurationStateElement_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY = "UNSUPPORTED_NAMED_TEAMING_POLICY" +const ConfigurationStateElement_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM = "LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM" +const ConfigurationStateElement_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM = "LACP_NOT_SUPPORTED_FOR_EDGE_VM" +const ConfigurationStateElement_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM = "STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM" +const ConfigurationStateElement_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE = "MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE" +const ConfigurationStateElement_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE = "UNSUPPORTED_LACP_LB_ALGO_FOR_NODE" +const ConfigurationStateElement_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED = "EDGE_NODE_VERSION_NOT_SUPPORTED" +const ConfigurationStateElement_STATE_NO_PNIC_SPECIFIED_IN_TN = "NO_PNIC_SPECIFIED_IN_TN" +const ConfigurationStateElement_STATE_INVALID_PNIC_DEVICE_NAME = "INVALID_PNIC_DEVICE_NAME" +const ConfigurationStateElement_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY = "UNSUPPORTED_DEFAULT_TEAMING_POLICY" +const ConfigurationStateElement_STATE_MPA_DISCONNECTED = "MPA_DISCONNECTED" +const ConfigurationStateElement_STATE_VM_NETWORK_EDIT_PENDING = "VM_NETWORK_EDIT_PENDING" +const ConfigurationStateElement_STATE_VM_RENAME_PENDING = "VM_RENAME_PENDING" +const ConfigurationStateElement_STATE_VM_CONFIG_EDIT_PENDING = "VM_CONFIG_EDIT_PENDING" +const ConfigurationStateElement_STATE_VM_NETWORK_EDIT_FAILED = "VM_NETWORK_EDIT_FAILED" +const ConfigurationStateElement_STATE_VM_RENAME_FAILED = "VM_RENAME_FAILED" +const ConfigurationStateElement_STATE_VM_CONFIG_EDIT_FAILED = "VM_CONFIG_EDIT_FAILED" +const ConfigurationStateElement_STATE_VM_CONFIG_DISCREPANCY = "VM_CONFIG_DISCREPANCY" +const ConfigurationStateElement_STATE_VM_NODE_REFRESH_FAILED = "VM_NODE_REFRESH_FAILED" +const ConfigurationStateElement_STATE_VM_PLACEMENT_REFRESH_FAILED = "VM_PLACEMENT_REFRESH_FAILED" +const ConfigurationStateElement_STATE_NOT_AVAILABLE = "NOT_AVAILABLE" +const ConfigurationStateElement_STATE_REGISTRATION_TIMEDOUT = "REGISTRATION_TIMEDOUT" +const ConfigurationStateElement_STATE_PENDING = "pending" +const ConfigurationStateElement_STATE_ORPHANED = "orphaned" +const ConfigurationStateElement_STATE_UNKNOWN = "unknown" +const ConfigurationStateElement_STATE_ERROR = "error" + +func (s *ConfigurationStateElement) GetType__() bindings.BindingType { + return ConfigurationStateElementBindingType() +} + +func (s *ConfigurationStateElement) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ConfigurationStateElement._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ConsolidatedEffectiveIPAddressMemberListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged Collection of site wise consolidated effective ip addresses for the given NSGroup + Results []EffectiveIPInfo +} + +func (s *ConsolidatedEffectiveIPAddressMemberListResult) GetType__() bindings.BindingType { + return ConsolidatedEffectiveIPAddressMemberListResultBindingType() +} + +func (s *ConsolidatedEffectiveIPAddressMemberListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ConsolidatedEffectiveIPAddressMemberListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Container application within a project. +type ContainerApplication struct { + // Identifier of the container cluster this container application belongs to. + ContainerClusterId *string + // Identifier of the project which this container application belongs to. + ContainerProjectId *string + // Identifier of the container application on container cluster e.g. PCF app id, k8s service id. + ExternalId *string + // List of network errors related to container application. + NetworkErrors []NetworkError + // Possible values are: + // + // * ContainerApplication#ContainerApplication_NETWORK_STATUS_HEALTHY + // * ContainerApplication#ContainerApplication_NETWORK_STATUS_UNHEALTHY + // + // Network status of container application. + NetworkStatus *string + // Array of additional specific properties of container application in key-value format. + OriginProperties []KeyValuePair + // Possible values are: + // + // * ContainerApplication#ContainerApplication_STATUS_UNKNOWN + // * ContainerApplication#ContainerApplication_STATUS_HEALTHY + // * ContainerApplication#ContainerApplication_STATUS_UP + // * ContainerApplication#ContainerApplication_STATUS_DOWN + // * ContainerApplication#ContainerApplication_STATUS_DEGRADED + // + // Status of the container application. + Status *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Specifies list of scope of discovered resource. e.g. if VHC path is associated with principal identity, who owns the discovered resource, then scope id will be VHC path and scope type will be VHC. + Scope []DiscoveredResourceScope + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ContainerApplication__TYPE_IDENTIFIER = "ContainerApplication" +const ContainerApplication_NETWORK_STATUS_HEALTHY = "HEALTHY" +const ContainerApplication_NETWORK_STATUS_UNHEALTHY = "UNHEALTHY" +const ContainerApplication_STATUS_UNKNOWN = "UNKNOWN" +const ContainerApplication_STATUS_HEALTHY = "HEALTHY" +const ContainerApplication_STATUS_UP = "UP" +const ContainerApplication_STATUS_DOWN = "DOWN" +const ContainerApplication_STATUS_DEGRADED = "DEGRADED" + +func (s *ContainerApplication) GetType__() bindings.BindingType { + return ContainerApplicationBindingType() +} + +func (s *ContainerApplication) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerApplication._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Container application instance within a project. +type ContainerApplicationInstance struct { + // Cluster node id where application instance is running. + ClusterNodeId *string + // List of identifiers of the container application. + ContainerApplicationIds []string + // Identifier of the container cluster this application instance belongs to. + ContainerClusterId *string + // Identifier of the container project which this container application instance belongs to. + ContainerProjectId *string + // Identifier of the container application instance on container cluster. + ExternalId *string + // List of network errors related to container application instance. + NetworkErrors []NetworkError + // Possible values are: + // + // * ContainerApplicationInstance#ContainerApplicationInstance_NETWORK_STATUS_HEALTHY + // * ContainerApplicationInstance#ContainerApplicationInstance_NETWORK_STATUS_UNHEALTHY + // + // Network status of container application instance. + NetworkStatus *string + // Array of additional specific properties of container application instance in key-value format. + OriginProperties []KeyValuePair + // Possible values are: + // + // * ContainerApplicationInstance#ContainerApplicationInstance_STATUS_UNKNOWN + // * ContainerApplicationInstance#ContainerApplicationInstance_STATUS_HEALTHY + // * ContainerApplicationInstance#ContainerApplicationInstance_STATUS_UP + // * ContainerApplicationInstance#ContainerApplicationInstance_STATUS_DOWN + // * ContainerApplicationInstance#ContainerApplicationInstance_STATUS_DEGRADED + // + // Status of the container application instance. + Status *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Specifies list of scope of discovered resource. e.g. if VHC path is associated with principal identity, who owns the discovered resource, then scope id will be VHC path and scope type will be VHC. + Scope []DiscoveredResourceScope + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ContainerApplicationInstance__TYPE_IDENTIFIER = "ContainerApplicationInstance" +const ContainerApplicationInstance_NETWORK_STATUS_HEALTHY = "HEALTHY" +const ContainerApplicationInstance_NETWORK_STATUS_UNHEALTHY = "UNHEALTHY" +const ContainerApplicationInstance_STATUS_UNKNOWN = "UNKNOWN" +const ContainerApplicationInstance_STATUS_HEALTHY = "HEALTHY" +const ContainerApplicationInstance_STATUS_UP = "UP" +const ContainerApplicationInstance_STATUS_DOWN = "DOWN" +const ContainerApplicationInstance_STATUS_DEGRADED = "DEGRADED" + +func (s *ContainerApplicationInstance) GetType__() bindings.BindingType { + return ContainerApplicationInstanceBindingType() +} + +func (s *ContainerApplicationInstance) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerApplicationInstance._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ContainerApplicationInstanceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of Container Applications + Results []ContainerApplicationInstance +} + +func (s *ContainerApplicationInstanceListResult) GetType__() bindings.BindingType { + return ContainerApplicationInstanceListResultBindingType() +} + +func (s *ContainerApplicationInstanceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerApplicationInstanceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ContainerApplicationListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of Container Applications + Results []ContainerApplication +} + +func (s *ContainerApplicationListResult) GetType__() bindings.BindingType { + return ContainerApplicationListResultBindingType() +} + +func (s *ContainerApplicationListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerApplicationListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Details of container cluster. +type ContainerCluster struct { + // Possible values are: + // + // * ContainerCluster#ContainerCluster_CLUSTER_TYPE_PAS + // * ContainerCluster#ContainerCluster_CLUSTER_TYPE_PKS + // * ContainerCluster#ContainerCluster_CLUSTER_TYPE_KUBERNETES + // * ContainerCluster#ContainerCluster_CLUSTER_TYPE_OPENSHIFT + // * ContainerCluster#ContainerCluster_CLUSTER_TYPE_WCP + // * ContainerCluster#ContainerCluster_CLUSTER_TYPE_WCP_GUEST + // * ContainerCluster#ContainerCluster_CLUSTER_TYPE_AKS + // * ContainerCluster#ContainerCluster_CLUSTER_TYPE_EKS + // * ContainerCluster#ContainerCluster_CLUSTER_TYPE_TKGM + // * ContainerCluster#ContainerCluster_CLUSTER_TYPE_TKGI + // * ContainerCluster#ContainerCluster_CLUSTER_TYPE_GKE + // * ContainerCluster#ContainerCluster_CLUSTER_TYPE_GARDENER + // * ContainerCluster#ContainerCluster_CLUSTER_TYPE_RANCHER + // * ContainerCluster#ContainerCluster_CLUSTER_TYPE_TAS + // * ContainerCluster#ContainerCluster_CLUSTER_TYPE_OTHER + // + // Type of the container cluster. In case of creating container cluster first time, it is expected to pass the valid cluster-type. In case of update, if there is no change in cluster-type, then this field can be omitted in the request. + ClusterType *string + // Possible values are: + // + // * ContainerCluster#ContainerCluster_CNI_TYPE_NCP + // * ContainerCluster#ContainerCluster_CNI_TYPE_ANTREA + // * ContainerCluster#ContainerCluster_CNI_TYPE_OTHER + // + // Specifies Container Network Interface type for container cluster. + CniType *string + // External identifier of the container cluster. + ExternalId *string + Infrastructure *ContainerInfrastructureInfo + // List of network errors related to container cluster. + NetworkErrors []NetworkError + // Possible values are: + // + // * ContainerCluster#ContainerCluster_NETWORK_STATUS_HEALTHY + // * ContainerCluster#ContainerCluster_NETWORK_STATUS_UNHEALTHY + // + // Network status of container cluster. + NetworkStatus *string + // Array of additional specific properties of container cluster in key-value format. + OriginProperties []KeyValuePair + // Specifies supervisor container project identifier for cluster. + SupervisorProjectId *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Specifies list of scope of discovered resource. e.g. if VHC path is associated with principal identity, who owns the discovered resource, then scope id will be VHC path and scope type will be VHC. + Scope []DiscoveredResourceScope + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ContainerCluster__TYPE_IDENTIFIER = "ContainerCluster" +const ContainerCluster_CLUSTER_TYPE_PAS = "PAS" +const ContainerCluster_CLUSTER_TYPE_PKS = "PKS" +const ContainerCluster_CLUSTER_TYPE_KUBERNETES = "Kubernetes" +const ContainerCluster_CLUSTER_TYPE_OPENSHIFT = "Openshift" +const ContainerCluster_CLUSTER_TYPE_WCP = "WCP" +const ContainerCluster_CLUSTER_TYPE_WCP_GUEST = "WCP_Guest" +const ContainerCluster_CLUSTER_TYPE_AKS = "AKS" +const ContainerCluster_CLUSTER_TYPE_EKS = "EKS" +const ContainerCluster_CLUSTER_TYPE_TKGM = "TKGm" +const ContainerCluster_CLUSTER_TYPE_TKGI = "TKGi" +const ContainerCluster_CLUSTER_TYPE_GKE = "GKE" +const ContainerCluster_CLUSTER_TYPE_GARDENER = "Gardener" +const ContainerCluster_CLUSTER_TYPE_RANCHER = "Rancher" +const ContainerCluster_CLUSTER_TYPE_TAS = "TAS" +const ContainerCluster_CLUSTER_TYPE_OTHER = "Other" +const ContainerCluster_CNI_TYPE_NCP = "NCP" +const ContainerCluster_CNI_TYPE_ANTREA = "Antrea" +const ContainerCluster_CNI_TYPE_OTHER = "Other" +const ContainerCluster_NETWORK_STATUS_HEALTHY = "HEALTHY" +const ContainerCluster_NETWORK_STATUS_UNHEALTHY = "UNHEALTHY" + +func (s *ContainerCluster) GetType__() bindings.BindingType { + return ContainerClusterBindingType() +} + +func (s *ContainerCluster) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerCluster._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ContainerClusterListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of Container Clusters + Results []ContainerCluster +} + +func (s *ContainerClusterListResult) GetType__() bindings.BindingType { + return ContainerClusterListResultBindingType() +} + +func (s *ContainerClusterListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerClusterListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Details of container cluster node i.e. container host. +type ContainerClusterNode struct { + // Possible values are: + // + // * ContainerClusterNode#ContainerClusterNode_CNI_AGENT_STATUS_HEALTHY + // * ContainerClusterNode#ContainerClusterNode_CNI_AGENT_STATUS_UNHEALTHY + // + // Specifies Container Network Interface agent status of container cluster node. + CniAgentStatus *string + // External identifier of the container cluster. + ContainerClusterId *string + // External identifier of the container cluster node in K8S/PAS. + ExternalId *string + // List of IP addresses of container cluster node. format: ip + IpAddresses []string + // List of network errors related to container cluster node. + NetworkErrors []NetworkError + // Possible values are: + // + // * ContainerClusterNode#ContainerClusterNode_NETWORK_STATUS_HEALTHY + // * ContainerClusterNode#ContainerClusterNode_NETWORK_STATUS_UNHEALTHY + // + // Network status of container cluster node. + NetworkStatus *string + // Array of additional specific properties of container cluster node in key-value format. + OriginProperties []KeyValuePair + // Specifies identifier of container cluster node given by infrastructure provider of container cluster. e.g. in case of vSpehere, it will be instance uuid of worker node virtual machine. + ProviderId *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Specifies list of scope of discovered resource. e.g. if VHC path is associated with principal identity, who owns the discovered resource, then scope id will be VHC path and scope type will be VHC. + Scope []DiscoveredResourceScope + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ContainerClusterNode__TYPE_IDENTIFIER = "ContainerClusterNode" +const ContainerClusterNode_CNI_AGENT_STATUS_HEALTHY = "HEALTHY" +const ContainerClusterNode_CNI_AGENT_STATUS_UNHEALTHY = "UNHEALTHY" +const ContainerClusterNode_NETWORK_STATUS_HEALTHY = "HEALTHY" +const ContainerClusterNode_NETWORK_STATUS_UNHEALTHY = "UNHEALTHY" + +func (s *ContainerClusterNode) GetType__() bindings.BindingType { + return ContainerClusterNodeBindingType() +} + +func (s *ContainerClusterNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerClusterNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ContainerClusterNodeListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of container cluster nodes + Results []ContainerClusterNode +} + +func (s *ContainerClusterNodeListResult) GetType__() bindings.BindingType { + return ContainerClusterNodeListResultBindingType() +} + +func (s *ContainerClusterNodeListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerClusterNodeListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ContainerClusterStatus struct { + // Identifier of the container cluster. + ClusterId *string + // Detail information on status. + Detail *string + // Display the cluster check interval in seconds. format: int32 + Interval *int64 + // Possible values are: + // + // * ContainerClusterStatus#ContainerClusterStatus_STATUS_UNKNOWN + // * ContainerClusterStatus#ContainerClusterStatus_STATUS_HEALTHY + // * ContainerClusterStatus#ContainerClusterStatus_STATUS_DOWN + // * ContainerClusterStatus#ContainerClusterStatus_STATUS_DEGRADED + // + // Display the container cluster status. + Status *string +} + +const ContainerClusterStatus_STATUS_UNKNOWN = "UNKNOWN" +const ContainerClusterStatus_STATUS_HEALTHY = "HEALTHY" +const ContainerClusterStatus_STATUS_DOWN = "DOWN" +const ContainerClusterStatus_STATUS_DEGRADED = "DEGRADED" + +func (s *ContainerClusterStatus) GetType__() bindings.BindingType { + return ContainerClusterStatusBindingType() +} + +func (s *ContainerClusterStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerClusterStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of the Container cluster +type ContainerClusterStatusList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Container cluster list. + Results []ContainerClusterSummary +} + +func (s *ContainerClusterStatusList) GetType__() bindings.BindingType { + return ContainerClusterStatusListBindingType() +} + +func (s *ContainerClusterStatusList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerClusterStatusList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ContainerClusterSummary struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Identifier of the container cluster. + ClusterId *string + // Display the container cluster name + ClusterName *string + // Detail information on status. + Detail *string + // Possible values are: + // + // * ContainerClusterSummary#ContainerClusterSummary_STATUS_UNKNOWN + // * ContainerClusterSummary#ContainerClusterSummary_STATUS_HEALTHY + // * ContainerClusterSummary#ContainerClusterSummary_STATUS_DOWN + // * ContainerClusterSummary#ContainerClusterSummary_STATUS_DEGRADED + // + // Display the container cluster status. + Status *string + // Possible values are: + // + // * ContainerClusterSummary#ContainerClusterSummary_TYPE_PAS + // * ContainerClusterSummary#ContainerClusterSummary_TYPE_PKS + // * ContainerClusterSummary#ContainerClusterSummary_TYPE_KUBERNETES + // * ContainerClusterSummary#ContainerClusterSummary_TYPE_OPENSHIFT + // * ContainerClusterSummary#ContainerClusterSummary_TYPE_WCP + // * ContainerClusterSummary#ContainerClusterSummary_TYPE_OTHER + // + // Container cluster type. + Type_ *string +} + +const ContainerClusterSummary_STATUS_UNKNOWN = "UNKNOWN" +const ContainerClusterSummary_STATUS_HEALTHY = "HEALTHY" +const ContainerClusterSummary_STATUS_DOWN = "DOWN" +const ContainerClusterSummary_STATUS_DEGRADED = "DEGRADED" +const ContainerClusterSummary_TYPE_PAS = "PAS" +const ContainerClusterSummary_TYPE_PKS = "PKS" +const ContainerClusterSummary_TYPE_KUBERNETES = "Kubernetes" +const ContainerClusterSummary_TYPE_OPENSHIFT = "Openshift" +const ContainerClusterSummary_TYPE_WCP = "WCP" +const ContainerClusterSummary_TYPE_OTHER = "Other" + +func (s *ContainerClusterSummary) GetType__() bindings.BindingType { + return ContainerClusterSummaryBindingType() +} + +func (s *ContainerClusterSummary) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerClusterSummary._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents a container to group widgets that belong to a common category or have a common purpose. +type ContainerConfiguration struct { + Header *Header + // Labels for the container. + Labels []Label + Layout *Layout + // Hyperlink of the specified UI page that provides details. + Navigation *string + // If not specified, creates an empty container. + Widgets []WidgetItem + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_TIMERANGEDROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_SPACERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LEGENDWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration, CustomFilterWidgetConfiguration, TimeRangeDropdownFilterWidgetConfiguration, SpacerWidgetConfiguration, LegendWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If the condition is met then the widget will be displayed to UI. If no condition is provided, then the widget will be displayed unconditionally. + Condition *string + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + FeatureSet *FeatureSet + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. This field is deprecated instead use 'filters' property. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + // A List of filter applied to this widget configuration. This will be used to identify the filters applied to this widget. + Filters []string + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + Legend *Legend + // List of plotting configuration for a given widget. Widget plotting configurations which are common across all the widgets types should be define here. + PlotConfigs []WidgetPlotConfiguration + // Represents the vertical span of the widget / container. 1 Row span is equal to 20px. format: int32 + Rowspan *int64 + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // If the value of this field is set to true then card header will be displayed otherwise only card will be displayed without header. + ShowHeader *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ContainerConfiguration__TYPE_IDENTIFIER = "ContainerConfiguration" + +func (s *ContainerConfiguration) GetType__() bindings.BindingType { + return ContainerConfigurationBindingType() +} + +func (s *ContainerConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Details of infrastructure hosting the container cluster e.g. vSphere, AWS, VMC etc.. +type ContainerInfrastructureInfo struct { + // Possible values are: + // + // * ContainerInfrastructureInfo#ContainerInfrastructureInfo_INFRA_TYPE_VSPHERE + // * ContainerInfrastructureInfo#ContainerInfrastructureInfo_INFRA_TYPE_AWS + // * ContainerInfrastructureInfo#ContainerInfrastructureInfo_INFRA_TYPE_AZURE + // * ContainerInfrastructureInfo#ContainerInfrastructureInfo_INFRA_TYPE_GOOGLE + // * ContainerInfrastructureInfo#ContainerInfrastructureInfo_INFRA_TYPE_VMC + // * ContainerInfrastructureInfo#ContainerInfrastructureInfo_INFRA_TYPE_KVM + // * ContainerInfrastructureInfo#ContainerInfrastructureInfo_INFRA_TYPE_BAREMETAL + // + // Type of the infrastructure. + InfraType *string +} + +const ContainerInfrastructureInfo_INFRA_TYPE_VSPHERE = "vSphere" +const ContainerInfrastructureInfo_INFRA_TYPE_AWS = "AWS" +const ContainerInfrastructureInfo_INFRA_TYPE_AZURE = "Azure" +const ContainerInfrastructureInfo_INFRA_TYPE_GOOGLE = "Google" +const ContainerInfrastructureInfo_INFRA_TYPE_VMC = "VMC" +const ContainerInfrastructureInfo_INFRA_TYPE_KVM = "KVM" +const ContainerInfrastructureInfo_INFRA_TYPE_BAREMETAL = "Baremetal" + +func (s *ContainerInfrastructureInfo) GetType__() bindings.BindingType { + return ContainerInfrastructureInfoBindingType() +} + +func (s *ContainerInfrastructureInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerInfrastructureInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Details of Container Ingress Policy. +type ContainerIngressPolicy struct { + // List of identifiers of the container application , on which ingress policy is applied. e.g. IDs of all services on which the ingress is applied in kubernetes. + ContainerApplicationIds []string + // Identifier of the container cluster this ingress policy belongs to. + ContainerClusterId *string + // Identifier of the project which this container ingress belongs to. + ContainerProjectId *string + // Identifier of the container ingress policy. + ExternalId *string + // List of network errors related to container ingress. + NetworkErrors []NetworkError + // Possible values are: + // + // * ContainerIngressPolicy#ContainerIngressPolicy_NETWORK_STATUS_HEALTHY + // * ContainerIngressPolicy#ContainerIngressPolicy_NETWORK_STATUS_UNHEALTHY + // + // Network status of container ingress. + NetworkStatus *string + // Array of additional specific properties of container ingress in key-value format. + OriginProperties []KeyValuePair + // Container ingress policy specification. + Spec *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Specifies list of scope of discovered resource. e.g. if VHC path is associated with principal identity, who owns the discovered resource, then scope id will be VHC path and scope type will be VHC. + Scope []DiscoveredResourceScope + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ContainerIngressPolicy__TYPE_IDENTIFIER = "ContainerIngressPolicy" +const ContainerIngressPolicy_NETWORK_STATUS_HEALTHY = "HEALTHY" +const ContainerIngressPolicy_NETWORK_STATUS_UNHEALTHY = "UNHEALTHY" + +func (s *ContainerIngressPolicy) GetType__() bindings.BindingType { + return ContainerIngressPolicyBindingType() +} + +func (s *ContainerIngressPolicy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerIngressPolicy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ContainerIngressPolicyListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of Container Ingress Policy specs + Results []ContainerIngressPolicy +} + +func (s *ContainerIngressPolicyListResult) GetType__() bindings.BindingType { + return ContainerIngressPolicyListResultBindingType() +} + +func (s *ContainerIngressPolicyListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerIngressPolicyListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Network policy applied to container. +type ContainerNetworkPolicy struct { + // Identifier of the container cluster this network policy belongs to. + ContainerClusterId *string + // Identifier of the project which this network policy belongs to. + ContainerProjectId *string + // Identifier of the container network policy. + ExternalId *string + // List of network errors related to container network policy. + NetworkErrors []NetworkError + // Possible values are: + // + // * ContainerNetworkPolicy#ContainerNetworkPolicy_NETWORK_STATUS_HEALTHY + // * ContainerNetworkPolicy#ContainerNetworkPolicy_NETWORK_STATUS_UNHEALTHY + // + // Network status of container network policy. + NetworkStatus *string + // Array of additional specific properties of container network policy in key-value format. + OriginProperties []KeyValuePair + // Possible values are: + // + // * ContainerNetworkPolicy#ContainerNetworkPolicy_POLICY_TYPE_NETWORK_POLICY + // * ContainerNetworkPolicy#ContainerNetworkPolicy_POLICY_TYPE_ASG + // * ContainerNetworkPolicy#ContainerNetworkPolicy_POLICY_TYPE_ACNP + // * ContainerNetworkPolicy#ContainerNetworkPolicy_POLICY_TYPE_ANP + // + // Type e.g. Network Policy, ASG. + PolicyType *string + // Container network policy specification. + Spec *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Specifies list of scope of discovered resource. e.g. if VHC path is associated with principal identity, who owns the discovered resource, then scope id will be VHC path and scope type will be VHC. + Scope []DiscoveredResourceScope + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ContainerNetworkPolicy__TYPE_IDENTIFIER = "ContainerNetworkPolicy" +const ContainerNetworkPolicy_NETWORK_STATUS_HEALTHY = "HEALTHY" +const ContainerNetworkPolicy_NETWORK_STATUS_UNHEALTHY = "UNHEALTHY" +const ContainerNetworkPolicy_POLICY_TYPE_NETWORK_POLICY = "NETWORK_POLICY" +const ContainerNetworkPolicy_POLICY_TYPE_ASG = "ASG" +const ContainerNetworkPolicy_POLICY_TYPE_ACNP = "ACNP" +const ContainerNetworkPolicy_POLICY_TYPE_ANP = "ANP" + +func (s *ContainerNetworkPolicy) GetType__() bindings.BindingType { + return ContainerNetworkPolicyBindingType() +} + +func (s *ContainerNetworkPolicy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerNetworkPolicy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ContainerNetworkPolicyListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of Container Network Policy specs + Results []ContainerNetworkPolicy +} + +func (s *ContainerNetworkPolicyListResult) GetType__() bindings.BindingType { + return ContainerNetworkPolicyListResultBindingType() +} + +func (s *ContainerNetworkPolicyListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerNetworkPolicyListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Details of org/namespace within a container cluster. +type ContainerProject struct { + // Identifier of the container cluster to which this project/namespace belongs. + ContainerClusterId *string + // External identifier of the container project. + ExternalId *string + // List of network errors related to container project. + NetworkErrors []NetworkError + // Possible values are: + // + // * ContainerProject#ContainerProject_NETWORK_STATUS_HEALTHY + // * ContainerProject#ContainerProject_NETWORK_STATUS_UNHEALTHY + // + // Network status of container project. + NetworkStatus *string + // Array of additional specific properties of container project in key-value format. + OriginProperties []KeyValuePair + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Specifies list of scope of discovered resource. e.g. if VHC path is associated with principal identity, who owns the discovered resource, then scope id will be VHC path and scope type will be VHC. + Scope []DiscoveredResourceScope + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ContainerProject__TYPE_IDENTIFIER = "ContainerProject" +const ContainerProject_NETWORK_STATUS_HEALTHY = "HEALTHY" +const ContainerProject_NETWORK_STATUS_UNHEALTHY = "UNHEALTHY" + +func (s *ContainerProject) GetType__() bindings.BindingType { + return ContainerProjectBindingType() +} + +func (s *ContainerProject) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerProject._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ContainerProjectListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of projects + Results []ContainerProject +} + +func (s *ContainerProjectListResult) GetType__() bindings.BindingType { + return ContainerProjectListResultBindingType() +} + +func (s *ContainerProjectListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ContainerProjectListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ControlClusterNodeStatus struct { + // Possible values are: + // + // * ControlClusterNodeStatus#ControlClusterNodeStatus_CONTROL_CLUSTER_STATUS_CONNECTED + // * ControlClusterNodeStatus#ControlClusterNodeStatus_CONTROL_CLUSTER_STATUS_DISCONNECTED + // * ControlClusterNodeStatus#ControlClusterNodeStatus_CONTROL_CLUSTER_STATUS_UNKNOWN + // + // Status of this node's connection to the control cluster + ControlClusterStatus *string + MgmtConnectionStatus *MgmtConnStatus +} + +const ControlClusterNodeStatus_CONTROL_CLUSTER_STATUS_CONNECTED = "CONNECTED" +const ControlClusterNodeStatus_CONTROL_CLUSTER_STATUS_DISCONNECTED = "DISCONNECTED" +const ControlClusterNodeStatus_CONTROL_CLUSTER_STATUS_UNKNOWN = "UNKNOWN" + +func (s *ControlClusterNodeStatus) GetType__() bindings.BindingType { + return ControlClusterNodeStatusBindingType() +} + +func (s *ControlClusterNodeStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ControlClusterNodeStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Config for joining cluster nodes VMs to a control cluster +type ControlClusteringConfig struct { + // Specifies whether or not the cluster node VM should try to join to the existing control cluster or initialize a new one. Only required in uncertainty case, i.e. when there are manually- deployed controllers that are registered but not connected to the cluster and no auto-deployed controllers are part of the cluster. + JoinToExistingCluster *bool + // Shared secret to be used when joining the cluster node VM to a control cluster or for initializing a new cluster with the VM. Must contain at least 4 unique characters and be at least 6 characters long. + SharedSecret *string + // Possible values are: + // + // * ClusteringConfig#ClusteringConfig_CLUSTERING_TYPE_CONTROLCLUSTERINGCONFIG + // + // Specifies the type of clustering config to be used. + ClusteringType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ControlClusteringConfig__TYPE_IDENTIFIER = "ControlClusteringConfig" + +func (s *ControlClusteringConfig) GetType__() bindings.BindingType { + return ControlClusteringConfigBindingType() +} + +func (s *ControlClusteringConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ControlClusteringConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ControlConnStatus struct { + // IP address of the control Node. + ControlNodeIp *string + // Possible values are: + // + // * ControlConnStatus#ControlConnStatus_FAILURE_STATUS_CONNECTION_REFUSED + // * ControlConnStatus#ControlConnStatus_FAILURE_STATUS_INCOMPLETE_HOST_CERT + // * ControlConnStatus#ControlConnStatus_FAILURE_STATUS_INCOMPLETE_CONTROLLER_CERT + // * ControlConnStatus#ControlConnStatus_FAILURE_STATUS_CONTROLLER_REJECTED_HOST_CERT + // * ControlConnStatus#ControlConnStatus_FAILURE_STATUS_HOST_REJECTED_CONTROLLER_CERT + // * ControlConnStatus#ControlConnStatus_FAILURE_STATUS_KEEP_ALIVE_TIMEOUT + // * ControlConnStatus#ControlConnStatus_FAILURE_STATUS_OTHER_SSL_ERROR + // * ControlConnStatus#ControlConnStatus_FAILURE_STATUS_OTHER_ERROR + // + // Failure status of the control Node for e.g CONNECTION_REFUSED,INCOMPLETE_HOST_CERT. + FailureStatus *string + // Possible values are: + // + // * ControlConnStatus#ControlConnStatus_STATUS_UP + // * ControlConnStatus#ControlConnStatus_STATUS_DOWN + // + // Status of the control Node for e.g UP, DOWN. + Status *string +} + +const ControlConnStatus_FAILURE_STATUS_CONNECTION_REFUSED = "CONNECTION_REFUSED" +const ControlConnStatus_FAILURE_STATUS_INCOMPLETE_HOST_CERT = "INCOMPLETE_HOST_CERT" +const ControlConnStatus_FAILURE_STATUS_INCOMPLETE_CONTROLLER_CERT = "INCOMPLETE_CONTROLLER_CERT" +const ControlConnStatus_FAILURE_STATUS_CONTROLLER_REJECTED_HOST_CERT = "CONTROLLER_REJECTED_HOST_CERT" +const ControlConnStatus_FAILURE_STATUS_HOST_REJECTED_CONTROLLER_CERT = "HOST_REJECTED_CONTROLLER_CERT" +const ControlConnStatus_FAILURE_STATUS_KEEP_ALIVE_TIMEOUT = "KEEP_ALIVE_TIMEOUT" +const ControlConnStatus_FAILURE_STATUS_OTHER_SSL_ERROR = "OTHER_SSL_ERROR" +const ControlConnStatus_FAILURE_STATUS_OTHER_ERROR = "OTHER_ERROR" +const ControlConnStatus_STATUS_UP = "UP" +const ControlConnStatus_STATUS_DOWN = "DOWN" + +func (s *ControlConnStatus) GetType__() bindings.BindingType { + return ControlConnStatusBindingType() +} + +func (s *ControlConnStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ControlConnStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ControllerClusterRoleConfig struct { + // Possible values are: + // + // * ControllerClusterRoleConfig#ControllerClusterRoleConfig_TYPE_MANAGEMENTCLUSTERROLECONFIG + // * ControllerClusterRoleConfig#ControllerClusterRoleConfig_TYPE_CONTROLLERCLUSTERROLECONFIG + // + // Type of this role configuration + Type_ *string + ControlClusterListenAddr *ServiceEndpoint + ControlPlaneListenAddr *ServiceEndpoint + HostMsgClientInfo *MsgClientInfo + MpaMsgClientInfo *MsgClientInfo +} + +const ControllerClusterRoleConfig_TYPE_MANAGEMENTCLUSTERROLECONFIG = "ManagementClusterRoleConfig" +const ControllerClusterRoleConfig_TYPE_CONTROLLERCLUSTERROLECONFIG = "ControllerClusterRoleConfig" + +func (s *ControllerClusterRoleConfig) GetType__() bindings.BindingType { + return ControllerClusterRoleConfigBindingType() +} + +func (s *ControllerClusterRoleConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ControllerClusterRoleConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ControllerClusterStatus struct { + // Possible values are: + // + // * ControllerClusterStatus#ControllerClusterStatus_STATUS_NO_CONTROLLERS + // * ControllerClusterStatus#ControllerClusterStatus_STATUS_UNSTABLE + // * ControllerClusterStatus#ControllerClusterStatus_STATUS_DEGRADED + // * ControllerClusterStatus#ControllerClusterStatus_STATUS_STABLE + // * ControllerClusterStatus#ControllerClusterStatus_STATUS_UNKNOWN + // + // The current status of the controller cluster + Status *string +} + +const ControllerClusterStatus_STATUS_NO_CONTROLLERS = "NO_CONTROLLERS" +const ControllerClusterStatus_STATUS_UNSTABLE = "UNSTABLE" +const ControllerClusterStatus_STATUS_DEGRADED = "DEGRADED" +const ControllerClusterStatus_STATUS_STABLE = "STABLE" +const ControllerClusterStatus_STATUS_UNKNOWN = "UNKNOWN" + +func (s *ControllerClusterStatus) GetType__() bindings.BindingType { + return ControllerClusterStatusBindingType() +} + +func (s *ControllerClusterStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ControllerClusterStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ControllerNodeAggregateInfo struct { + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Array of Node interface statistic properties + NodeInterfaceProperties []NodeInterfaceProperties + // Array of Node network interface statistic properties + NodeInterfaceStatistics []NodeInterfaceStatisticsProperties + NodeStatus *ClusterNodeStatus + // Time series of the node's system properties + NodeStatusProperties []NodeStatusProperties + RoleConfig *ControllerClusterRoleConfig +} + +func (s *ControllerNodeAggregateInfo) GetType__() bindings.BindingType { + return ControllerNodeAggregateInfoBindingType() +} + +func (s *ControllerNodeAggregateInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ControllerNodeAggregateInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Controller profiler properties +type ControllerProfilerProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // True for enabling controller profiler, False for disabling controller profiler. + Enabled *bool +} + +func (s *ControllerProfilerProperties) GetType__() bindings.BindingType { + return ControllerProfilerPropertiesBindingType() +} + +func (s *ControllerProfilerProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ControllerProfilerProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type CopyFromRemoteFileProperties struct { + // Server port format: int64 + Port *int64 + // Remote server hostname or IP address + Server *string + // URI of file to copy + Uri *string + Protocol *data.StructValue +} + +func (s *CopyFromRemoteFileProperties) GetType__() bindings.BindingType { + return CopyFromRemoteFilePropertiesBindingType() +} + +func (s *CopyFromRemoteFileProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CopyFromRemoteFileProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type CopyRemoteFileProperties struct { + // Server port format: int64 + Port *int64 + // Remote server hostname or IP address + Server *string + // URI of file to copy + Uri *string +} + +func (s *CopyRemoteFileProperties) GetType__() bindings.BindingType { + return CopyRemoteFilePropertiesBindingType() +} + +func (s *CopyRemoteFileProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CopyRemoteFileProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type CopyToRemoteFileProperties struct { + // Server port format: int64 + Port *int64 + // Remote server hostname or IP address + Server *string + // URI of file to copy + Uri *string + Protocol *data.StructValue +} + +func (s *CopyToRemoteFileProperties) GetType__() bindings.BindingType { + return CopyToRemoteFilePropertiesBindingType() +} + +func (s *CopyToRemoteFileProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CopyToRemoteFileProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Non Uniform Memory Access (NUMA) nodes and Logical cpu cores (Lcores) per NUMA node configuration for Enhanced Networking Stack enabled HostSwitch. +type CpuCoreConfigForEnhancedNetworkingStackSwitch struct { + // Number of Logical cpu cores (Lcores) to be placed on a specified NUMA node format: int32 + NumLcores *int64 + // Unique index of the Non Uniform Memory Access (NUMA) node format: int32 + NumaNodeIndex *int64 +} + +func (s *CpuCoreConfigForEnhancedNetworkingStackSwitch) GetType__() bindings.BindingType { + return CpuCoreConfigForEnhancedNetworkingStackSwitchBindingType() +} + +func (s *CpuCoreConfigForEnhancedNetworkingStackSwitch) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CpuCoreConfigForEnhancedNetworkingStackSwitch._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// CPU usage of DPDK and non-DPDK cores +type CpuUsage struct { + // Indicates the average usage of all DPDK cores in percentage. + AvgCpuCoreUsageDpdk *float64 + // Indicates the average usage of all non-DPDK cores in percentage. + AvgCpuCoreUsageNonDpdk *float64 + // Indicates the highest CPU utilization value among DPDK cores in percentage. + HighestCpuCoreUsageDpdk *float64 + // Indicates the highest cpu utilization value among non_dpdk cores in percentage. + HighestCpuCoreUsageNonDpdk *float64 +} + +func (s *CpuUsage) GetType__() bindings.BindingType { + return CpuUsageBindingType() +} + +func (s *CpuUsage) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CpuUsage._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type CreateRemoteDirectoryProperties struct { + // Server port format: int64 + Port *int64 + // Remote server hostname or IP address + Server *string + // URI of file to copy + Uri *string + Protocol *SftpProtocol +} + +func (s *CreateRemoteDirectoryProperties) GetType__() bindings.BindingType { + return CreateRemoteDirectoryPropertiesBindingType() +} + +func (s *CreateRemoteDirectoryProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CreateRemoteDirectoryProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type Crl struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * Crl#Crl_CRL_TYPE_ONECRL + // * Crl#Crl_CRL_TYPE_X509 + // + // The type of the CRL. It can be \"OneCRL\" or \"X509\" (default). + CrlType *string + Details *X509Crl + // Certificates revoked by issuer and serial number + DetailsRevokedByIssuerAndSerialNumber []IssuerSerialNumber + // Certificates revoked by subject and public key hash + DetailsRevokedBySubjectAndPublicKeyHash []SubjectPublicKeyHash + // JSON-encoded OneCRL-like object + OneCrl *string + // PEM encoded CRL data. + PemEncoded *string +} + +const Crl_CRL_TYPE_ONECRL = "OneCRL" +const Crl_CRL_TYPE_X509 = "X509" + +func (s *Crl) GetType__() bindings.BindingType { + return CrlBindingType() +} + +func (s *Crl) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Crl._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Reference to a CRL Distribution Point where to fetch a CRL +type CrlDistributionPoint struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // CRL Distribution Point URI where to fetch the CRL. + CdpUri *string + // Issuer of the CRL, referring to the CA. + Issuer *string +} + +func (s *CrlDistributionPoint) GetType__() bindings.BindingType { + return CrlDistributionPointBindingType() +} + +func (s *CrlDistributionPoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CrlDistributionPoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// CrlDistributionPoint query result +type CrlDistributionPointList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // CrlDistributionPoint list. + Results []CrlDistributionPoint +} + +func (s *CrlDistributionPointList) GetType__() bindings.BindingType { + return CrlDistributionPointListBindingType() +} + +func (s *CrlDistributionPointList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CrlDistributionPointList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Reference to a CRL Distribution Point where to fetch a CRL +type CrlDistributionPointStatus struct { + // Error message when fetching the CRL failed. + ErrorMessage *string + // Possible values are: + // + // * CrlDistributionPointStatus#CrlDistributionPointStatus_STATUS_NOT_READY + // * CrlDistributionPointStatus#CrlDistributionPointStatus_STATUS_FETCHING + // * CrlDistributionPointStatus#CrlDistributionPointStatus_STATUS_READY + // * CrlDistributionPointStatus#CrlDistributionPointStatus_STATUS_ERROR + // + // Status of the fetched CRL for this CrlDistributionPoint + Status *string +} + +const CrlDistributionPointStatus_STATUS_NOT_READY = "NOT_READY" +const CrlDistributionPointStatus_STATUS_FETCHING = "FETCHING" +const CrlDistributionPointStatus_STATUS_READY = "READY" +const CrlDistributionPointStatus_STATUS_ERROR = "ERROR" + +func (s *CrlDistributionPointStatus) GetType__() bindings.BindingType { + return CrlDistributionPointStatusBindingType() +} + +func (s *CrlDistributionPointStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CrlDistributionPointStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Crl queries result +type CrlList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // CRL list. + Results []Crl +} + +func (s *CrlList) GetType__() bindings.BindingType { + return CrlListBindingType() +} + +func (s *CrlList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CrlList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type CrlObjectData struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * CrlObjectData#CrlObjectData_CRL_TYPE_ONECRL + // * CrlObjectData#CrlObjectData_CRL_TYPE_X509 + // + // The type of the CRL. It can be \"OneCRL\" or \"X509\" (default). + CrlType *string + // JSON-encoded OneCRL-like object + OneCrl *string + // PEM encoded CRL data. + PemEncoded *string +} + +const CrlObjectData_CRL_TYPE_ONECRL = "OneCRL" +const CrlObjectData_CRL_TYPE_X509 = "X509" + +func (s *CrlObjectData) GetType__() bindings.BindingType { + return CrlObjectDataBindingType() +} + +func (s *CrlObjectData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CrlObjectData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Request Type to get a CRL's PEM file. +type CrlPemRequestType struct { + // CRL Distribution Point URI where to fetch the CRL. + CdpUri *string +} + +func (s *CrlPemRequestType) GetType__() bindings.BindingType { + return CrlPemRequestTypeBindingType() +} + +func (s *CrlPemRequestType) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CrlPemRequestType._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type CryptoAlgorithm struct { + // Supported key sizes for the algorithm. format: int64 + KeySize []int64 + // Crypto algorithm name. + Name *string +} + +func (s *CryptoAlgorithm) GetType__() bindings.BindingType { + return CryptoAlgorithmBindingType() +} + +func (s *CryptoAlgorithm) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CryptoAlgorithm._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type Csr struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * Csr#Csr_ALGORITHM_RSA + // + // Cryptographic algorithm (asymmetric) used by the public key for data encryption. + Algorithm *string + // Whether the CSR is for a CA certificate. + IsCa *bool + // Size measured in bits of the public key used in a cryptographic algorithm. format: int64 + KeySize *int64 + // PEM encoded certificate data. + PemEncoded *string + Subject *Principal +} + +const Csr_ALGORITHM_RSA = "RSA" + +func (s *Csr) GetType__() bindings.BindingType { + return CsrBindingType() +} + +func (s *Csr) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Csr._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Extended certificate signing request body +type CsrExt struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * CsrExt#CsrExt_ALGORITHM_RSA + // + // Cryptographic algorithm (asymmetric) used by the public key for data encryption. + Algorithm *string + // Whether the CSR is for a CA certificate. + IsCa *bool + // Size measured in bits of the public key used in a cryptographic algorithm. format: int64 + KeySize *int64 + // PEM encoded certificate data. + PemEncoded *string + Subject *Principal + Extensions *CsrExtensions +} + +const CsrExt_ALGORITHM_RSA = "RSA" + +func (s *CsrExt) GetType__() bindings.BindingType { + return CsrExtBindingType() +} + +func (s *CsrExt) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CsrExt._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Collection of various x509 v3 extensions to be added to a CSR +type CsrExtensions struct { + SubjectAltNames *SubjectAltNames +} + +func (s *CsrExtensions) GetType__() bindings.BindingType { + return CsrExtensionsBindingType() +} + +func (s *CsrExtensions) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CsrExtensions._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Csr queries result +type CsrList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // CSR list. + Results []Csr +} + +func (s *CsrList) GetType__() bindings.BindingType { + return CsrListBindingType() +} + +func (s *CsrList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CsrList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// CSR data with days valid +type CsrWithDaysValid struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * CsrWithDaysValid#CsrWithDaysValid_ALGORITHM_RSA + // + // Cryptographic algorithm (asymmetric) used by the public key for data encryption. + Algorithm *string + // Whether the CSR is for a CA certificate. + IsCa *bool + // Size measured in bits of the public key used in a cryptographic algorithm. format: int64 + KeySize *int64 + // PEM encoded certificate data. + PemEncoded *string + Subject *Principal + // Number of days the certificate will be valid, default 825 days format: int64 + DaysValid *int64 +} + +const CsrWithDaysValid_ALGORITHM_RSA = "RSA" + +func (s *CsrWithDaysValid) GetType__() bindings.BindingType { + return CsrWithDaysValidBindingType() +} + +func (s *CsrWithDaysValid) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CsrWithDaysValid._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Base type for CSV result. +type CsvListResult struct { + // File name set by HTTP server if API returns CSV result as a file. + FileName *string +} + +func (s *CsvListResult) GetType__() bindings.BindingType { + return CsvListResultBindingType() +} + +func (s *CsvListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CsvListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Base type for CSV records. +type CsvRecord struct { +} + +func (s *CsvRecord) GetType__() bindings.BindingType { + return CsvRecordBindingType() +} + +func (s *CsvRecord) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CsvRecord._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Current backup operation status +type CurrentBackupOperationStatus struct { + // Unique identifier of current backup + BackupId *string + // Possible values are: + // + // * CurrentBackupOperationStatus#CurrentBackupOperationStatus_CURRENT_STEP_CLUSTER_BACKUP + // * CurrentBackupOperationStatus#CurrentBackupOperationStatus_CURRENT_STEP_NODE_BACKUP + // + // Current step of operation + CurrentStep *string + // Additional human-readable status information about current step + CurrentStepMessage *string + // Time when operation is expected to end format: int64 + EndTime *int64 + // Possible values are: + // + // * CurrentBackupOperationStatus#CurrentBackupOperationStatus_OPERATION_TYPE_NONE + // * CurrentBackupOperationStatus#CurrentBackupOperationStatus_OPERATION_TYPE_BACKUP + // + // Type of operation that is in progress. Returns none if no operation is in progress, in which case none of the other fields will be set. + OperationType *string + // Time when operation was started format: int64 + StartTime *int64 +} + +const CurrentBackupOperationStatus_CURRENT_STEP_CLUSTER_BACKUP = "BACKUP_CREATING_CLUSTER_BACKUP" +const CurrentBackupOperationStatus_CURRENT_STEP_NODE_BACKUP = "BACKUP_CREATING_NODE_BACKUP" +const CurrentBackupOperationStatus_OPERATION_TYPE_NONE = "NONE" +const CurrentBackupOperationStatus_OPERATION_TYPE_BACKUP = "BACKUP" + +func (s *CurrentBackupOperationStatus) GetType__() bindings.BindingType { + return CurrentBackupOperationStatusBindingType() +} + +func (s *CurrentBackupOperationStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CurrentBackupOperationStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The current global barrier number of the realized state +type CurrentRealizationStateBarrier struct { + // Gives the current global barrier number for NSX format: int64 + CurrentBarrierNumber *int64 +} + +func (s *CurrentRealizationStateBarrier) GetType__() bindings.BindingType { + return CurrentRealizationStateBarrierBindingType() +} + +func (s *CurrentRealizationStateBarrier) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CurrentRealizationStateBarrier._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents configuration for custom filter widget. For this widget the data source is not applicable. It defines ui identifer for filter UI component and render it on dashboard view. This configuration can only be used for system owned widgets. +type CustomFilterWidgetConfiguration struct { + // User defined filter component selector to be rendered inside view/container. + UiComponentIdentifier *string + // Alias to be used when emitting filter value. + Alias *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_TIMERANGEDROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_SPACERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LEGENDWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration, CustomFilterWidgetConfiguration, TimeRangeDropdownFilterWidgetConfiguration, SpacerWidgetConfiguration, LegendWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If the condition is met then the widget will be displayed to UI. If no condition is provided, then the widget will be displayed unconditionally. + Condition *string + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + FeatureSet *FeatureSet + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. This field is deprecated instead use 'filters' property. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + // A List of filter applied to this widget configuration. This will be used to identify the filters applied to this widget. + Filters []string + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + Legend *Legend + // List of plotting configuration for a given widget. Widget plotting configurations which are common across all the widgets types should be define here. + PlotConfigs []WidgetPlotConfiguration + // Represents the vertical span of the widget / container. 1 Row span is equal to 20px. format: int32 + Rowspan *int64 + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // If the value of this field is set to true then card header will be displayed otherwise only card will be displayed without header. + ShowHeader *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} + +func (s *CustomFilterWidgetConfiguration) GetType__() bindings.BindingType { + return CustomFilterWidgetConfigurationBindingType() +} + +func (s *CustomFilterWidgetConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CustomFilterWidgetConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents configuration for custom widget. For this widget the data source is not applicable. It defines ui identifer to identify UI component and render it on dashboard view. This configuration can only be used for system owned widgets. +type CustomWidgetConfiguration struct { + // User defined component selector to be rendered inside view/container. + UiComponentIdentifier *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_TIMERANGEDROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_SPACERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LEGENDWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration, CustomFilterWidgetConfiguration, TimeRangeDropdownFilterWidgetConfiguration, SpacerWidgetConfiguration, LegendWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If the condition is met then the widget will be displayed to UI. If no condition is provided, then the widget will be displayed unconditionally. + Condition *string + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + FeatureSet *FeatureSet + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. This field is deprecated instead use 'filters' property. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + // A List of filter applied to this widget configuration. This will be used to identify the filters applied to this widget. + Filters []string + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + Legend *Legend + // List of plotting configuration for a given widget. Widget plotting configurations which are common across all the widgets types should be define here. + PlotConfigs []WidgetPlotConfiguration + // Represents the vertical span of the widget / container. 1 Row span is equal to 20px. format: int32 + Rowspan *int64 + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // If the value of this field is set to true then card header will be displayed otherwise only card will be displayed without header. + ShowHeader *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const CustomWidgetConfiguration__TYPE_IDENTIFIER = "CustomWidgetConfiguration" + +func (s *CustomWidgetConfiguration) GetType__() bindings.BindingType { + return CustomWidgetConfigurationBindingType() +} + +func (s *CustomWidgetConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for CustomWidgetConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Duplicate address detection profile. +type DADProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * DADProfile#DADProfile_DAD_MODE_LOOSE + // * DADProfile#DADProfile_DAD_MODE_STRICT + // + // DAD Mode + DadMode *string + // Number of Neighbor solicitation packets generated before completing the Duplicate address detection process. format: int64 + NsRetries *int64 + // The time duration in seconds, to wait for Neighbor advertisement after sending the Neighbor solicitation message. format: int64 + WaitTime *int64 +} + +const DADProfile_DAD_MODE_LOOSE = "LOOSE" +const DADProfile_DAD_MODE_STRICT = "STRICT" + +func (s *DADProfile) GetType__() bindings.BindingType { + return DADProfileBindingType() +} + +func (s *DADProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DADProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DADProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paginated list of DADProfile + Results []DADProfile +} + +func (s *DADProfileListResult) GetType__() bindings.BindingType { + return DADProfileListResultBindingType() +} + +func (s *DADProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DADProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of entities excluded for enforcing a service or a feature. +type DSExcludeList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Total number of members present in Exclude List. format: int64 + MemberCount *int64 + // List of members in Exclusion List + Members []ResourceReference +} + +func (s *DSExcludeList) GetType__() bindings.BindingType { + return DSExcludeListBindingType() +} + +func (s *DSExcludeList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DSExcludeList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Parameters to tell where rule/section need to be added. All the params take rule/section Id. +type DSInsertParameters struct { + // Identifier of the anchor rule or section. This is a required field in case operation like 'insert_before' and 'insert_after'. + Id *string + // Possible values are: + // + // * DSInsertParameters#DSInsertParameters_OPERATION_TOP + // * DSInsertParameters#DSInsertParameters_OPERATION_BOTTOM + // * DSInsertParameters#DSInsertParameters_OPERATION_AFTER + // * DSInsertParameters#DSInsertParameters_OPERATION_BEFORE + // + // Operation + Operation *string +} + +const DSInsertParameters_OPERATION_TOP = "insert_top" +const DSInsertParameters_OPERATION_BOTTOM = "insert_bottom" +const DSInsertParameters_OPERATION_AFTER = "insert_after" +const DSInsertParameters_OPERATION_BEFORE = "insert_before" + +func (s *DSInsertParameters) GetType__() bindings.BindingType { + return DSInsertParametersBindingType() +} + +func (s *DSInsertParameters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DSInsertParameters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DSRule struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + Owner *OwnerResourceLink + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Identifier of the resource + Id *string + // The type of this resource. + ResourceType *string + // Possible values are: + // + // * DSRule#DSRule_ACTION_ALLOW + // * DSRule#DSRule_ACTION_DROP + // * DSRule#DSRule_ACTION_REJECT + // * DSRule#DSRule_ACTION_REDIRECT + // * DSRule#DSRule_ACTION_DO_NOT_REDIRECT + // * DSRule#DSRule_ACTION_DETECT + // * DSRule#DSRule_ACTION_ALLOW_CONTINUE + // * DSRule#DSRule_ACTION_DETECT_PREVENT + // + // Action enforced on the packets which matches the distributed service rule. Currently DS Layer supports below actions. ALLOW - Forward any packet when a rule with this action gets a match (Used by Firewall). DROP - Drop any packet when a rule with this action gets a match. Packets won't go further(Used by Firewall). REJECT - Terminate TCP connection by sending TCP reset for a packet when a rule with this action gets a match (Used by Firewall). REDIRECT - Redirect any packet to a partner appliance when a rule with this action gets a match (Used by Service Insertion). DO_NOT_REDIRECT - Do not redirect any packet to a partner appliance when a rule with this action gets a match (Used by Service Insertion). DETECT - Detect IDS Signatures. ALLOW_CONTINUE - Allows rules to jump from this rule. Action on matching rules in the destination category will decide next step. Application is default destination until new categories are supported to jump to. DETECT_PREVENT - Detect and Prevent IDS Signatures. + Action *string + // List of object where rule will be enforced. The section level field overrides this one. Null will be treated as any. + AppliedTos []ResourceReference + // List of the destinations. Null will be treated as any. + Destinations []ResourceReference + // Negation of the destination. + DestinationsExcluded *bool + // Possible values are: + // + // * DSRule#DSRule_DIRECTION_IN + // * DSRule#DSRule_DIRECTION_OUT + // * DSRule#DSRule_DIRECTION_IN_OUT + // + // Rule direction in case of stateless distributed service rules. This will only considered if section level parameter is set to stateless. Default to IN_OUT if not specified. + Direction *string + // Flag to disable rule. Disabled will only be persisted but never provisioned/realized. + Disabled *bool + // Possible values are: + // + // * DSRule#DSRule_IP_PROTOCOL_IPV4 + // * DSRule#DSRule_IP_PROTOCOL_IPV6 + // * DSRule#DSRule_IP_PROTOCOL_IPV4_IPV6 + // + // Type of IP packet that should be matched while enforcing the rule. + IpProtocol *string + // Flag to indicate whether rule is default. + IsDefault *bool + // Flag to enable packet logging. Default is disabled. + Logged *bool + // User notes specific to the rule. + Notes *string + // Priority of the rule. format: int64 + Priority *int64 + // User level field which will be printed in CLI and packet logs. + RuleTag *string + // List of sources. Null will be treated as any. + Sources []ResourceReference + // Negation of the source. + SourcesExcluded *bool +} + +const DSRule_ACTION_ALLOW = "ALLOW" +const DSRule_ACTION_DROP = "DROP" +const DSRule_ACTION_REJECT = "REJECT" +const DSRule_ACTION_REDIRECT = "REDIRECT" +const DSRule_ACTION_DO_NOT_REDIRECT = "DO_NOT_REDIRECT" +const DSRule_ACTION_DETECT = "DETECT" +const DSRule_ACTION_ALLOW_CONTINUE = "ALLOW_CONTINUE" +const DSRule_ACTION_DETECT_PREVENT = "DETECT_PREVENT" +const DSRule_DIRECTION_IN = "IN" +const DSRule_DIRECTION_OUT = "OUT" +const DSRule_DIRECTION_IN_OUT = "IN_OUT" +const DSRule_IP_PROTOCOL_IPV4 = "IPV4" +const DSRule_IP_PROTOCOL_IPV6 = "IPV6" +const DSRule_IP_PROTOCOL_IPV4_IPV6 = "IPV4_IPV6" + +func (s *DSRule) GetType__() bindings.BindingType { + return DSRuleBindingType() +} + +func (s *DSRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DSRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Rule Realization State +type DSRuleState struct { + // Array of configuration state of various sub systems + Details []ConfigurationStateElement + // Error code format: int64 + FailureCode *int64 + // Error message in case of failure + FailureMessage *string + // Possible values are: + // + // * DSRuleState#DSRuleState_STATE_PENDING + // * DSRuleState#DSRuleState_STATE_IN_PROGRESS + // * DSRuleState#DSRuleState_STATE_SUCCESS + // * DSRuleState#DSRuleState_STATE_FAILED + // * DSRuleState#DSRuleState_STATE_PARTIAL_SUCCESS + // * DSRuleState#DSRuleState_STATE_ORPHANED + // * DSRuleState#DSRuleState_STATE_UNKNOWN + // * DSRuleState#DSRuleState_STATE_ERROR + // * DSRuleState#DSRuleState_STATE_IN_SYNC + // * DSRuleState#DSRuleState_STATE_NOT_AVAILABLE + // * DSRuleState#DSRuleState_STATE_VM_DEPLOYMENT_QUEUED + // * DSRuleState#DSRuleState_STATE_VM_DEPLOYMENT_IN_PROGRESS + // * DSRuleState#DSRuleState_STATE_VM_DEPLOYMENT_FAILED + // * DSRuleState#DSRuleState_STATE_VM_POWER_ON_IN_PROGRESS + // * DSRuleState#DSRuleState_STATE_VM_POWER_ON_FAILED + // * DSRuleState#DSRuleState_STATE_REGISTRATION_PENDING + // * DSRuleState#DSRuleState_STATE_NODE_NOT_READY + // * DSRuleState#DSRuleState_STATE_NODE_READY + // * DSRuleState#DSRuleState_STATE_VM_POWER_OFF_IN_PROGRESS + // * DSRuleState#DSRuleState_STATE_VM_POWER_OFF_FAILED + // * DSRuleState#DSRuleState_STATE_VM_UNDEPLOY_IN_PROGRESS + // * DSRuleState#DSRuleState_STATE_VM_UNDEPLOY_FAILED + // * DSRuleState#DSRuleState_STATE_VM_UNDEPLOY_SUCCESSFUL + // * DSRuleState#DSRuleState_STATE_EDGE_CONFIG_ERROR + // * DSRuleState#DSRuleState_STATE_VM_DEPLOYMENT_RESTARTED + // * DSRuleState#DSRuleState_STATE_REGISTRATION_FAILED + // * DSRuleState#DSRuleState_STATE_TRANSPORT_NODE_SYNC_PENDING + // * DSRuleState#DSRuleState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING + // * DSRuleState#DSRuleState_STATE_EDGE_HARDWARE_NOT_SUPPORTED + // * DSRuleState#DSRuleState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED + // * DSRuleState#DSRuleState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER + // * DSRuleState#DSRuleState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED + // * DSRuleState#DSRuleState_STATE_NO_PNIC_PREPARED_IN_EDGE + // * DSRuleState#DSRuleState_STATE_APPLIANCE_INTERNAL_ERROR + // * DSRuleState#DSRuleState_STATE_VTEP_DHCP_NOT_SUPPORTED + // * DSRuleState#DSRuleState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE + // * DSRuleState#DSRuleState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED + // * DSRuleState#DSRuleState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND + // * DSRuleState#DSRuleState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED + // * DSRuleState#DSRuleState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY + // * DSRuleState#DSRuleState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM + // * DSRuleState#DSRuleState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM + // * DSRuleState#DSRuleState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM + // * DSRuleState#DSRuleState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE + // * DSRuleState#DSRuleState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE + // * DSRuleState#DSRuleState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED + // * DSRuleState#DSRuleState_STATE_NO_PNIC_SPECIFIED_IN_TN + // * DSRuleState#DSRuleState_STATE_INVALID_PNIC_DEVICE_NAME + // * DSRuleState#DSRuleState_STATE_TRANSPORT_NODE_READY + // * DSRuleState#DSRuleState_STATE_VM_NETWORK_EDIT_PENDING + // * DSRuleState#DSRuleState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY + // * DSRuleState#DSRuleState_STATE_MPA_DISCONNECTED + // * DSRuleState#DSRuleState_STATE_VM_RENAME_PENDING + // * DSRuleState#DSRuleState_STATE_VM_CONFIG_EDIT_PENDING + // * DSRuleState#DSRuleState_STATE_VM_NETWORK_EDIT_FAILED + // * DSRuleState#DSRuleState_STATE_VM_RENAME_FAILED + // * DSRuleState#DSRuleState_STATE_VM_CONFIG_EDIT_FAILED + // * DSRuleState#DSRuleState_STATE_VM_CONFIG_DISCREPANCY + // * DSRuleState#DSRuleState_STATE_VM_NODE_REFRESH_FAILED + // * DSRuleState#DSRuleState_STATE_VM_PLACEMENT_REFRESH_FAILED + // * DSRuleState#DSRuleState_STATE_REGISTRATION_TIMEDOUT + // * DSRuleState#DSRuleState_STATE_REPLACE_FAILED + // * DSRuleState#DSRuleState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED + // * DSRuleState#DSRuleState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING + // * DSRuleState#DSRuleState_STATE_DELETE_VM_IN_REDEPLOY_FAILED + // * DSRuleState#DSRuleState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED + // * DSRuleState#DSRuleState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE + // * DSRuleState#DSRuleState_STATE_VM_RESOURCE_RESERVATION_FAILED + // * DSRuleState#DSRuleState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER + // * DSRuleState#DSRuleState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING + // * DSRuleState#DSRuleState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE + // * DSRuleState#DSRuleState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE + // * DSRuleState#DSRuleState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE + // * DSRuleState#DSRuleState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE + // * DSRuleState#DSRuleState_STATE_COMPUTE_MANAGER_NOT_FOUND + // * DSRuleState#DSRuleState_STATE_DELETE_IN_PROGRESS + // + // Gives details of state of desired configuration. Additional enums with more details on progress/success/error states are sent for edge node. The success states are NODE_READY and TRANSPORT_NODE_READY, pending states are {VM_DEPLOYMENT_QUEUED, VM_DEPLOYMENT_IN_PROGRESS, REGISTRATION_PENDING} and other values indicate failures. \"in_sync\" state indicates that the desired configuration has been received by the host to which it applies, but is not yet in effect. When the configuration is actually in effect, the state will change to \"success\". Please note, failed state is deprecated. + State *string + // This attribute represents revision number of rule's desired state. format: int64 + RevisionDesired *int64 +} + +const DSRuleState_STATE_PENDING = "pending" +const DSRuleState_STATE_IN_PROGRESS = "in_progress" +const DSRuleState_STATE_SUCCESS = "success" +const DSRuleState_STATE_FAILED = "failed" +const DSRuleState_STATE_PARTIAL_SUCCESS = "partial_success" +const DSRuleState_STATE_ORPHANED = "orphaned" +const DSRuleState_STATE_UNKNOWN = "unknown" +const DSRuleState_STATE_ERROR = "error" +const DSRuleState_STATE_IN_SYNC = "in_sync" +const DSRuleState_STATE_NOT_AVAILABLE = "NOT_AVAILABLE" +const DSRuleState_STATE_VM_DEPLOYMENT_QUEUED = "VM_DEPLOYMENT_QUEUED" +const DSRuleState_STATE_VM_DEPLOYMENT_IN_PROGRESS = "VM_DEPLOYMENT_IN_PROGRESS" +const DSRuleState_STATE_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const DSRuleState_STATE_VM_POWER_ON_IN_PROGRESS = "VM_POWER_ON_IN_PROGRESS" +const DSRuleState_STATE_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const DSRuleState_STATE_REGISTRATION_PENDING = "REGISTRATION_PENDING" +const DSRuleState_STATE_NODE_NOT_READY = "NODE_NOT_READY" +const DSRuleState_STATE_NODE_READY = "NODE_READY" +const DSRuleState_STATE_VM_POWER_OFF_IN_PROGRESS = "VM_POWER_OFF_IN_PROGRESS" +const DSRuleState_STATE_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const DSRuleState_STATE_VM_UNDEPLOY_IN_PROGRESS = "VM_UNDEPLOY_IN_PROGRESS" +const DSRuleState_STATE_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const DSRuleState_STATE_VM_UNDEPLOY_SUCCESSFUL = "VM_UNDEPLOY_SUCCESSFUL" +const DSRuleState_STATE_EDGE_CONFIG_ERROR = "EDGE_CONFIG_ERROR" +const DSRuleState_STATE_VM_DEPLOYMENT_RESTARTED = "VM_DEPLOYMENT_RESTARTED" +const DSRuleState_STATE_REGISTRATION_FAILED = "REGISTRATION_FAILED" +const DSRuleState_STATE_TRANSPORT_NODE_SYNC_PENDING = "TRANSPORT_NODE_SYNC_PENDING" +const DSRuleState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING = "TRANSPORT_NODE_CONFIGURATION_MISSING" +const DSRuleState_STATE_EDGE_HARDWARE_NOT_SUPPORTED = "EDGE_HARDWARE_NOT_SUPPORTED" +const DSRuleState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED = "MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED" +const DSRuleState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER = "TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER" +const DSRuleState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED = "TZ_ENDPOINTS_NOT_SPECIFIED" +const DSRuleState_STATE_NO_PNIC_PREPARED_IN_EDGE = "NO_PNIC_PREPARED_IN_EDGE" +const DSRuleState_STATE_APPLIANCE_INTERNAL_ERROR = "APPLIANCE_INTERNAL_ERROR" +const DSRuleState_STATE_VTEP_DHCP_NOT_SUPPORTED = "VTEP_DHCP_NOT_SUPPORTED" +const DSRuleState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE = "UNSUPPORTED_HOST_SWITCH_PROFILE" +const DSRuleState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED = "UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED" +const DSRuleState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND = "HOSTSWITCH_PROFILE_NOT_FOUND" +const DSRuleState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED = "LLDP_SEND_ENABLED_NOT_SUPPORTED" +const DSRuleState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY = "UNSUPPORTED_NAMED_TEAMING_POLICY" +const DSRuleState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM = "LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM" +const DSRuleState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM = "LACP_NOT_SUPPORTED_FOR_EDGE_VM" +const DSRuleState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM = "STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM" +const DSRuleState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE = "MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE" +const DSRuleState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE = "UNSUPPORTED_LACP_LB_ALGO_FOR_NODE" +const DSRuleState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED = "EDGE_NODE_VERSION_NOT_SUPPORTED" +const DSRuleState_STATE_NO_PNIC_SPECIFIED_IN_TN = "NO_PNIC_SPECIFIED_IN_TN" +const DSRuleState_STATE_INVALID_PNIC_DEVICE_NAME = "INVALID_PNIC_DEVICE_NAME" +const DSRuleState_STATE_TRANSPORT_NODE_READY = "TRANSPORT_NODE_READY" +const DSRuleState_STATE_VM_NETWORK_EDIT_PENDING = "VM_NETWORK_EDIT_PENDING" +const DSRuleState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY = "UNSUPPORTED_DEFAULT_TEAMING_POLICY" +const DSRuleState_STATE_MPA_DISCONNECTED = "MPA_DISCONNECTED" +const DSRuleState_STATE_VM_RENAME_PENDING = "VM_RENAME_PENDING" +const DSRuleState_STATE_VM_CONFIG_EDIT_PENDING = "VM_CONFIG_EDIT_PENDING" +const DSRuleState_STATE_VM_NETWORK_EDIT_FAILED = "VM_NETWORK_EDIT_FAILED" +const DSRuleState_STATE_VM_RENAME_FAILED = "VM_RENAME_FAILED" +const DSRuleState_STATE_VM_CONFIG_EDIT_FAILED = "VM_CONFIG_EDIT_FAILED" +const DSRuleState_STATE_VM_CONFIG_DISCREPANCY = "VM_CONFIG_DISCREPANCY" +const DSRuleState_STATE_VM_NODE_REFRESH_FAILED = "VM_NODE_REFRESH_FAILED" +const DSRuleState_STATE_VM_PLACEMENT_REFRESH_FAILED = "VM_PLACEMENT_REFRESH_FAILED" +const DSRuleState_STATE_REGISTRATION_TIMEDOUT = "REGISTRATION_TIMEDOUT" +const DSRuleState_STATE_REPLACE_FAILED = "REPLACE_FAILED" +const DSRuleState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED = "UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED" +const DSRuleState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING = "LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING" +const DSRuleState_STATE_DELETE_VM_IN_REDEPLOY_FAILED = "DELETE_VM_IN_REDEPLOY_FAILED" +const DSRuleState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED = "DEPLOY_VM_IN_REDEPLOY_FAILED" +const DSRuleState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE = "INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE" +const DSRuleState_STATE_VM_RESOURCE_RESERVATION_FAILED = "VM_RESOURCE_RESERVATION_FAILED" +const DSRuleState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER = "DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER" +const DSRuleState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING = "DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING" +const DSRuleState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE = "EDGE_NODE_SETTINGS_MISMATCH_RESOLVE" +const DSRuleState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE = "EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE" +const DSRuleState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE = "EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE" +const DSRuleState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE = "EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE" +const DSRuleState_STATE_COMPUTE_MANAGER_NOT_FOUND = "COMPUTE_MANAGER_NOT_FOUND" +const DSRuleState_STATE_DELETE_IN_PROGRESS = "DELETE_IN_PROGRESS" + +func (s *DSRuleState) GetType__() bindings.BindingType { + return DSRuleStateBindingType() +} + +func (s *DSRuleState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DSRuleState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DSSection struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // List of objects where the rules in this section will be enforced. This will take precedence over rule level appliedTo. + AppliedTos []ResourceReference + // It is a boolean flag which reflects whether a distributed service section is default section or not. Each Layer 3 and Layer 2 section will have at least and at most one default section. + IsDefault *bool + // Number of rules in this section. format: int64 + RuleCount *int64 + // Possible values are: + // + // * DSSection#DSSection_SECTION_TYPE_LAYER2 + // * DSSection#DSSection_SECTION_TYPE_LAYER3 + // * DSSection#DSSection_SECTION_TYPE_L3REDIRECT + // * DSSection#DSSection_SECTION_TYPE_IDS + // + // Type of the rules which a section can contain. Only homogeneous sections are supported. + SectionType *string + // Stateful or Stateless nature of distributed service section is enforced on all rules inside the section. Layer3 sections can be stateful or stateless. Layer2 sections can only be stateless. + Stateful *bool +} + +const DSSection_SECTION_TYPE_LAYER2 = "LAYER2" +const DSSection_SECTION_TYPE_LAYER3 = "LAYER3" +const DSSection_SECTION_TYPE_L3REDIRECT = "L3REDIRECT" +const DSSection_SECTION_TYPE_IDS = "IDS" + +func (s *DSSection) GetType__() bindings.BindingType { + return DSSectionBindingType() +} + +func (s *DSSection) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DSSection._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DSSectionListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string +} + +func (s *DSSectionListResult) GetType__() bindings.BindingType { + return DSSectionListResultBindingType() +} + +func (s *DSSectionListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DSSectionListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Section query parameters +type DSSectionQueryParameters struct { + // Flag to cascade delete of this object to all it's child objects. + Cascade *bool +} + +func (s *DSSectionQueryParameters) GetType__() bindings.BindingType { + return DSSectionQueryParametersBindingType() +} + +func (s *DSSectionQueryParameters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DSSectionQueryParameters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Section Realization Status +type DSSectionState struct { + // Array of configuration state of various sub systems + Details []ConfigurationStateElement + // Error code format: int64 + FailureCode *int64 + // Error message in case of failure + FailureMessage *string + // Possible values are: + // + // * DSSectionState#DSSectionState_STATE_PENDING + // * DSSectionState#DSSectionState_STATE_IN_PROGRESS + // * DSSectionState#DSSectionState_STATE_SUCCESS + // * DSSectionState#DSSectionState_STATE_FAILED + // * DSSectionState#DSSectionState_STATE_PARTIAL_SUCCESS + // * DSSectionState#DSSectionState_STATE_ORPHANED + // * DSSectionState#DSSectionState_STATE_UNKNOWN + // * DSSectionState#DSSectionState_STATE_ERROR + // * DSSectionState#DSSectionState_STATE_IN_SYNC + // * DSSectionState#DSSectionState_STATE_NOT_AVAILABLE + // * DSSectionState#DSSectionState_STATE_VM_DEPLOYMENT_QUEUED + // * DSSectionState#DSSectionState_STATE_VM_DEPLOYMENT_IN_PROGRESS + // * DSSectionState#DSSectionState_STATE_VM_DEPLOYMENT_FAILED + // * DSSectionState#DSSectionState_STATE_VM_POWER_ON_IN_PROGRESS + // * DSSectionState#DSSectionState_STATE_VM_POWER_ON_FAILED + // * DSSectionState#DSSectionState_STATE_REGISTRATION_PENDING + // * DSSectionState#DSSectionState_STATE_NODE_NOT_READY + // * DSSectionState#DSSectionState_STATE_NODE_READY + // * DSSectionState#DSSectionState_STATE_VM_POWER_OFF_IN_PROGRESS + // * DSSectionState#DSSectionState_STATE_VM_POWER_OFF_FAILED + // * DSSectionState#DSSectionState_STATE_VM_UNDEPLOY_IN_PROGRESS + // * DSSectionState#DSSectionState_STATE_VM_UNDEPLOY_FAILED + // * DSSectionState#DSSectionState_STATE_VM_UNDEPLOY_SUCCESSFUL + // * DSSectionState#DSSectionState_STATE_EDGE_CONFIG_ERROR + // * DSSectionState#DSSectionState_STATE_VM_DEPLOYMENT_RESTARTED + // * DSSectionState#DSSectionState_STATE_REGISTRATION_FAILED + // * DSSectionState#DSSectionState_STATE_TRANSPORT_NODE_SYNC_PENDING + // * DSSectionState#DSSectionState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING + // * DSSectionState#DSSectionState_STATE_EDGE_HARDWARE_NOT_SUPPORTED + // * DSSectionState#DSSectionState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED + // * DSSectionState#DSSectionState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER + // * DSSectionState#DSSectionState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED + // * DSSectionState#DSSectionState_STATE_NO_PNIC_PREPARED_IN_EDGE + // * DSSectionState#DSSectionState_STATE_APPLIANCE_INTERNAL_ERROR + // * DSSectionState#DSSectionState_STATE_VTEP_DHCP_NOT_SUPPORTED + // * DSSectionState#DSSectionState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE + // * DSSectionState#DSSectionState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED + // * DSSectionState#DSSectionState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND + // * DSSectionState#DSSectionState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED + // * DSSectionState#DSSectionState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY + // * DSSectionState#DSSectionState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM + // * DSSectionState#DSSectionState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM + // * DSSectionState#DSSectionState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM + // * DSSectionState#DSSectionState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE + // * DSSectionState#DSSectionState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE + // * DSSectionState#DSSectionState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED + // * DSSectionState#DSSectionState_STATE_NO_PNIC_SPECIFIED_IN_TN + // * DSSectionState#DSSectionState_STATE_INVALID_PNIC_DEVICE_NAME + // * DSSectionState#DSSectionState_STATE_TRANSPORT_NODE_READY + // * DSSectionState#DSSectionState_STATE_VM_NETWORK_EDIT_PENDING + // * DSSectionState#DSSectionState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY + // * DSSectionState#DSSectionState_STATE_MPA_DISCONNECTED + // * DSSectionState#DSSectionState_STATE_VM_RENAME_PENDING + // * DSSectionState#DSSectionState_STATE_VM_CONFIG_EDIT_PENDING + // * DSSectionState#DSSectionState_STATE_VM_NETWORK_EDIT_FAILED + // * DSSectionState#DSSectionState_STATE_VM_RENAME_FAILED + // * DSSectionState#DSSectionState_STATE_VM_CONFIG_EDIT_FAILED + // * DSSectionState#DSSectionState_STATE_VM_CONFIG_DISCREPANCY + // * DSSectionState#DSSectionState_STATE_VM_NODE_REFRESH_FAILED + // * DSSectionState#DSSectionState_STATE_VM_PLACEMENT_REFRESH_FAILED + // * DSSectionState#DSSectionState_STATE_REGISTRATION_TIMEDOUT + // * DSSectionState#DSSectionState_STATE_REPLACE_FAILED + // * DSSectionState#DSSectionState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED + // * DSSectionState#DSSectionState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING + // * DSSectionState#DSSectionState_STATE_DELETE_VM_IN_REDEPLOY_FAILED + // * DSSectionState#DSSectionState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED + // * DSSectionState#DSSectionState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE + // * DSSectionState#DSSectionState_STATE_VM_RESOURCE_RESERVATION_FAILED + // * DSSectionState#DSSectionState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER + // * DSSectionState#DSSectionState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING + // * DSSectionState#DSSectionState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE + // * DSSectionState#DSSectionState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE + // * DSSectionState#DSSectionState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE + // * DSSectionState#DSSectionState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE + // * DSSectionState#DSSectionState_STATE_COMPUTE_MANAGER_NOT_FOUND + // * DSSectionState#DSSectionState_STATE_DELETE_IN_PROGRESS + // + // Gives details of state of desired configuration. Additional enums with more details on progress/success/error states are sent for edge node. The success states are NODE_READY and TRANSPORT_NODE_READY, pending states are {VM_DEPLOYMENT_QUEUED, VM_DEPLOYMENT_IN_PROGRESS, REGISTRATION_PENDING} and other values indicate failures. \"in_sync\" state indicates that the desired configuration has been received by the host to which it applies, but is not yet in effect. When the configuration is actually in effect, the state will change to \"success\". Please note, failed state is deprecated. + State *string + // This attribute represents revision number of section's desired state. format: int64 + RevisionDesired *int64 +} + +const DSSectionState_STATE_PENDING = "pending" +const DSSectionState_STATE_IN_PROGRESS = "in_progress" +const DSSectionState_STATE_SUCCESS = "success" +const DSSectionState_STATE_FAILED = "failed" +const DSSectionState_STATE_PARTIAL_SUCCESS = "partial_success" +const DSSectionState_STATE_ORPHANED = "orphaned" +const DSSectionState_STATE_UNKNOWN = "unknown" +const DSSectionState_STATE_ERROR = "error" +const DSSectionState_STATE_IN_SYNC = "in_sync" +const DSSectionState_STATE_NOT_AVAILABLE = "NOT_AVAILABLE" +const DSSectionState_STATE_VM_DEPLOYMENT_QUEUED = "VM_DEPLOYMENT_QUEUED" +const DSSectionState_STATE_VM_DEPLOYMENT_IN_PROGRESS = "VM_DEPLOYMENT_IN_PROGRESS" +const DSSectionState_STATE_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const DSSectionState_STATE_VM_POWER_ON_IN_PROGRESS = "VM_POWER_ON_IN_PROGRESS" +const DSSectionState_STATE_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const DSSectionState_STATE_REGISTRATION_PENDING = "REGISTRATION_PENDING" +const DSSectionState_STATE_NODE_NOT_READY = "NODE_NOT_READY" +const DSSectionState_STATE_NODE_READY = "NODE_READY" +const DSSectionState_STATE_VM_POWER_OFF_IN_PROGRESS = "VM_POWER_OFF_IN_PROGRESS" +const DSSectionState_STATE_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const DSSectionState_STATE_VM_UNDEPLOY_IN_PROGRESS = "VM_UNDEPLOY_IN_PROGRESS" +const DSSectionState_STATE_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const DSSectionState_STATE_VM_UNDEPLOY_SUCCESSFUL = "VM_UNDEPLOY_SUCCESSFUL" +const DSSectionState_STATE_EDGE_CONFIG_ERROR = "EDGE_CONFIG_ERROR" +const DSSectionState_STATE_VM_DEPLOYMENT_RESTARTED = "VM_DEPLOYMENT_RESTARTED" +const DSSectionState_STATE_REGISTRATION_FAILED = "REGISTRATION_FAILED" +const DSSectionState_STATE_TRANSPORT_NODE_SYNC_PENDING = "TRANSPORT_NODE_SYNC_PENDING" +const DSSectionState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING = "TRANSPORT_NODE_CONFIGURATION_MISSING" +const DSSectionState_STATE_EDGE_HARDWARE_NOT_SUPPORTED = "EDGE_HARDWARE_NOT_SUPPORTED" +const DSSectionState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED = "MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED" +const DSSectionState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER = "TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER" +const DSSectionState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED = "TZ_ENDPOINTS_NOT_SPECIFIED" +const DSSectionState_STATE_NO_PNIC_PREPARED_IN_EDGE = "NO_PNIC_PREPARED_IN_EDGE" +const DSSectionState_STATE_APPLIANCE_INTERNAL_ERROR = "APPLIANCE_INTERNAL_ERROR" +const DSSectionState_STATE_VTEP_DHCP_NOT_SUPPORTED = "VTEP_DHCP_NOT_SUPPORTED" +const DSSectionState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE = "UNSUPPORTED_HOST_SWITCH_PROFILE" +const DSSectionState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED = "UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED" +const DSSectionState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND = "HOSTSWITCH_PROFILE_NOT_FOUND" +const DSSectionState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED = "LLDP_SEND_ENABLED_NOT_SUPPORTED" +const DSSectionState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY = "UNSUPPORTED_NAMED_TEAMING_POLICY" +const DSSectionState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM = "LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM" +const DSSectionState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM = "LACP_NOT_SUPPORTED_FOR_EDGE_VM" +const DSSectionState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM = "STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM" +const DSSectionState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE = "MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE" +const DSSectionState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE = "UNSUPPORTED_LACP_LB_ALGO_FOR_NODE" +const DSSectionState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED = "EDGE_NODE_VERSION_NOT_SUPPORTED" +const DSSectionState_STATE_NO_PNIC_SPECIFIED_IN_TN = "NO_PNIC_SPECIFIED_IN_TN" +const DSSectionState_STATE_INVALID_PNIC_DEVICE_NAME = "INVALID_PNIC_DEVICE_NAME" +const DSSectionState_STATE_TRANSPORT_NODE_READY = "TRANSPORT_NODE_READY" +const DSSectionState_STATE_VM_NETWORK_EDIT_PENDING = "VM_NETWORK_EDIT_PENDING" +const DSSectionState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY = "UNSUPPORTED_DEFAULT_TEAMING_POLICY" +const DSSectionState_STATE_MPA_DISCONNECTED = "MPA_DISCONNECTED" +const DSSectionState_STATE_VM_RENAME_PENDING = "VM_RENAME_PENDING" +const DSSectionState_STATE_VM_CONFIG_EDIT_PENDING = "VM_CONFIG_EDIT_PENDING" +const DSSectionState_STATE_VM_NETWORK_EDIT_FAILED = "VM_NETWORK_EDIT_FAILED" +const DSSectionState_STATE_VM_RENAME_FAILED = "VM_RENAME_FAILED" +const DSSectionState_STATE_VM_CONFIG_EDIT_FAILED = "VM_CONFIG_EDIT_FAILED" +const DSSectionState_STATE_VM_CONFIG_DISCREPANCY = "VM_CONFIG_DISCREPANCY" +const DSSectionState_STATE_VM_NODE_REFRESH_FAILED = "VM_NODE_REFRESH_FAILED" +const DSSectionState_STATE_VM_PLACEMENT_REFRESH_FAILED = "VM_PLACEMENT_REFRESH_FAILED" +const DSSectionState_STATE_REGISTRATION_TIMEDOUT = "REGISTRATION_TIMEDOUT" +const DSSectionState_STATE_REPLACE_FAILED = "REPLACE_FAILED" +const DSSectionState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED = "UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED" +const DSSectionState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING = "LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING" +const DSSectionState_STATE_DELETE_VM_IN_REDEPLOY_FAILED = "DELETE_VM_IN_REDEPLOY_FAILED" +const DSSectionState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED = "DEPLOY_VM_IN_REDEPLOY_FAILED" +const DSSectionState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE = "INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE" +const DSSectionState_STATE_VM_RESOURCE_RESERVATION_FAILED = "VM_RESOURCE_RESERVATION_FAILED" +const DSSectionState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER = "DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER" +const DSSectionState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING = "DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING" +const DSSectionState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE = "EDGE_NODE_SETTINGS_MISMATCH_RESOLVE" +const DSSectionState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE = "EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE" +const DSSectionState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE = "EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE" +const DSSectionState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE = "EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE" +const DSSectionState_STATE_COMPUTE_MANAGER_NOT_FOUND = "COMPUTE_MANAGER_NOT_FOUND" +const DSSectionState_STATE_DELETE_IN_PROGRESS = "DELETE_IN_PROGRESS" + +func (s *DSSectionState) GetType__() bindings.BindingType { + return DSSectionStateBindingType() +} + +func (s *DSSectionState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DSSectionState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DSService struct { + // Will be set to false if the referenced NSX resource has been deleted. + IsValid *bool + // Display name of the NSX resource. + TargetDisplayName *string + // Identifier of the NSX resource. + TargetId *string + // Type of the NSX resource. + TargetType *string + Service *data.StructValue +} + +func (s *DSService) GetType__() bindings.BindingType { + return DSServiceBindingType() +} + +func (s *DSService) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DSService._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The DVS Configuration +type DVSConfig struct { + // host_infra_traffic_res specifies bandwidth allocation for various traffic resources. + HostInfraTrafficRes []ResourceAllocation + // It contains information about VMware specific multiple dynamic LACP groups. + LacpGroupConfigs []LacpGroupConfigInfo + // Enabled or disabled sending LLDP packets + LldpSendEnabled *bool + // Maximum Transmission Unit used for uplinks format: int32 + Mtu *int64 + // The DVS name + Name *string + // Names of uplink ports for this DVS. + UplinkPortNames []string + // The DVS uuid + Uuid *string +} + +func (s *DVSConfig) GetType__() bindings.BindingType { + return DVSConfigBindingType() +} + +func (s *DVSConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DVSConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DailyTelemetrySchedule struct { + // Hour at which data will be collected. Specify a value between 0 through 23. format: int64 + HourOfDay *int64 + // Minute at which data will be collected. Specify a value between 0 through 59. format: int64 + Minutes *int64 + // Specify one of DailyTelemetrySchedule, WeeklyTelemetrySchedule, or MonthlyTelemetrySchedule. + FrequencyType string +} + +func (s *DailyTelemetrySchedule) GetType__() bindings.BindingType { + return DailyTelemetryScheduleBindingType() +} + +func (s *DailyTelemetrySchedule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DailyTelemetrySchedule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DataCounter struct { + // The dropped packets or bytes format: int64 + Dropped *int64 + // The multicast and broadcast packets or bytes format: int64 + MulticastBroadcast *int64 + // The total packets or bytes format: int64 + Total *int64 +} + +func (s *DataCounter) GetType__() bindings.BindingType { + return DataCounterBindingType() +} + +func (s *DataCounter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DataCounter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// An instance of a datasource configuration. +type Datasource struct { + // Name of a datasource instance. + DisplayName *string + KeystoreInfo *KeyStoreInfo + // Array of urls relative to the datasource configuration. For example, api/v1/fabric/nodes is a relative url of nsx-manager instance. + Urls []UrlAlias +} + +func (s *Datasource) GetType__() bindings.BindingType { + return DatasourceBindingType() +} + +func (s *Datasource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Datasource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// An instance of a datasource configuration. +type DefaultFilterValue struct { + // Filter alias. + Alias *string + // Filter default value. + Value *string +} + +func (s *DefaultFilterValue) GetType__() bindings.BindingType { + return DefaultFilterValueBindingType() +} + +func (s *DefaultFilterValue) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DefaultFilterValue._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DeploymentConfig struct { + // Possible values are: + // + // * DeploymentConfig#DeploymentConfig_PLACEMENT_TYPE_VSPHEREDEPLOYMENTCONFIG + PlacementType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const DeploymentConfig__TYPE_IDENTIFIER = "DeploymentConfig" +const DeploymentConfig_PLACEMENT_TYPE_VSPHEREDEPLOYMENTCONFIG = "VsphereDeploymentConfig" + +func (s *DeploymentConfig) GetType__() bindings.BindingType { + return DeploymentConfigBindingType() +} + +func (s *DeploymentConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DeploymentConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Used to provide the deployment spec for Upgrade. +type DeploymentSpecName struct { + // This indicates the deployment spec. + DeploymentSpecName *string +} + +func (s *DeploymentSpecName) GetType__() bindings.BindingType { + return DeploymentSpecNameBindingType() +} + +func (s *DeploymentSpecName) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DeploymentSpecName._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Deployment Template holds the attributes specific to partner for which the service is created. These attributes are opaque to NSX. +type DeploymentTemplate struct { + // List of attributes specific to a partner for which the service is created. There attributes are passed on to the partner appliance and is opaque to the NSX Manager. + Attributes []Attribute + // Deployment Template name. + Name *string +} + +func (s *DeploymentTemplate) GetType__() bindings.BindingType { + return DeploymentTemplateBindingType() +} + +func (s *DeploymentTemplate) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DeploymentTemplate._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Details about the destination NSX manager for the migration +type DestinationNsxApiEndpoint struct { + // IP address or host name of the destination NSX manager to which the config will be migrated. format: hostname-or-ip + DestinationNsxIp *string + // Valid password for connecting to the destination NSX manager. + DestinationNsxPassword *string + // Destination NSX manager port that will be used to apply details. format: int32 + DestinationNsxPort *int64 + // Valid username for connecting to the destination NSX manager. + DestinationNsxUsername *string +} + +func (s *DestinationNsxApiEndpoint) GetType__() bindings.BindingType { + return DestinationNsxApiEndpointBindingType() +} + +func (s *DestinationNsxApiEndpoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DestinationNsxApiEndpoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// DHCP filtering configuration +type DhcpFilter struct { + // Indicates whether DHCP client blocking is enabled + ClientBlockEnabled *bool + // Indicates whether DHCP server blocking is enabled + ServerBlockEnabled *bool + // Indiactes whether DHCP v6 client blocking is enabled + V6ClientBlockEnabled *bool + // Indiactes whether DHCP V6 server blocking is enabled + V6ServerBlockEnabled *bool +} + +func (s *DhcpFilter) GetType__() bindings.BindingType { + return DhcpFilterBindingType() +} + +func (s *DhcpFilter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpFilter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DhcpHeader struct { + // Possible values are: + // + // * DhcpHeader#DhcpHeader_OP_CODE_BOOTREQUEST + // * DhcpHeader#DhcpHeader_OP_CODE_BOOTREPLY + // + // This is used to specify the general type of message. A client sending request to a server uses an op code of BOOTREQUEST, while a server replying uses an op code of BOOTREPLY. + OpCode *string +} + +const DhcpHeader_OP_CODE_BOOTREQUEST = "BOOTREQUEST" +const DhcpHeader_OP_CODE_BOOTREPLY = "BOOTREPLY" + +func (s *DhcpHeader) GetType__() bindings.BindingType { + return DhcpHeaderBindingType() +} + +func (s *DhcpHeader) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpHeader._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// DHCP ip-pool to define dynamic ip allocation ranges. +type DhcpIpPool struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Gateway ip address of the allocation. format: ip + GatewayIp *string + // Lease time, in seconds, [60-(2^32-1)]. Default is 86400. format: int64 + LeaseTime *int64 + Options *DhcpOptions + // Ip-ranges to define dynamic ip allocation ranges. + AllocationRanges []IpPoolRange + // Error threshold. Alert will be raised if the pool usage reaches the given threshold. format: int64 + ErrorThreshold *int64 + // Warning threshold. Alert will be raised if the pool usage reaches the given threshold. format: int64 + WarningThreshold *int64 +} + +func (s *DhcpIpPool) GetType__() bindings.BindingType { + return DhcpIpPoolBindingType() +} + +func (s *DhcpIpPool) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpIpPool._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A paginated list of DHCP ip pools. +type DhcpIpPoolListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // A paginated list of DHCP ip pools. + Results []DhcpIpPool +} + +func (s *DhcpIpPoolListResult) GetType__() bindings.BindingType { + return DhcpIpPoolListResultBindingType() +} + +func (s *DhcpIpPoolListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpIpPoolListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DhcpIpPoolUsage struct { + // allocated number. COULD BE INACCURATE, REFERENCE ONLY. format: int64 + AllocatedNumber *int64 + // allocated percentage. COULD BE INACCURATE, REFERENCE ONLY. format: int64 + AllocatedPercentage *int64 + // uuid of dhcp ip pool + DhcpIpPoolId *string + // pool size format: int64 + PoolSize *int64 +} + +func (s *DhcpIpPoolUsage) GetType__() bindings.BindingType { + return DhcpIpPoolUsageBindingType() +} + +func (s *DhcpIpPoolUsage) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpIpPoolUsage._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DhcpLeasePerIP struct { + // expire time of the lease + ExpireTime *string + // ip address of client + IpAddress *string + // lease time of the ip address, in seconds + LeaseTime *string + // mac address of client + MacAddress *string + // start time of lease + StartTime *string + // subnet of client network + Subnet *string +} + +func (s *DhcpLeasePerIP) GetType__() bindings.BindingType { + return DhcpLeasePerIPBindingType() +} + +func (s *DhcpLeasePerIP) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpLeasePerIP._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DhcpLeases struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // dhcp server uuid + DhcpServerId *string + // The lease info list of the server + Leases []DhcpLeasePerIP + // timestamp of the lease info format: int64 + Timestamp *int64 +} + +func (s *DhcpLeases) GetType__() bindings.BindingType { + return DhcpLeasesBindingType() +} + +func (s *DhcpLeases) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpLeases._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// DHCP option 121 to define classless static route. +type DhcpOption121 struct { + // Classless static route of DHCP option 121. + StaticRoutes []ClasslessStaticRoute +} + +func (s *DhcpOption121) GetType__() bindings.BindingType { + return DhcpOption121BindingType() +} + +func (s *DhcpOption121) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpOption121._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Define DHCP options of the DHCP service. +type DhcpOptions struct { + Option121 *DhcpOption121 + // To define DHCP options other than option 121 in generic format. Please note, only the following options can be defined in generic format. Those other options will be accepted without validation but will not take effect. -------------------------- Code Name -------------------------- 2 Time Offset 6 Domain Name Server 13 Boot File Size 19 Forward On/Off 26 MTU Interface 28 Broadcast Address 35 ARP Timeout 40 NIS Domain 41 NIS Servers 42 NTP Servers 44 NETBIOS Name Srv 45 NETBIOS Dist Srv 46 NETBIOS Node Type 47 NETBIOS Scope 58 Renewal Time 59 Rebinding Time 64 NIS+-Domain-Name 65 NIS+-Server-Addr 66 TFTP Server-Name (used by PXE) 67 Bootfile-Name (used by PXE) 93 PXE: Client system architecture 94 PXE: Client NDI 97 PXE: UUID/UNDI 117 Name Service Search 119 Domain Search 150 TFTP server address (used by PXE) 175 Etherboot 209 PXE Configuration File 210 PXE Path Prefix 211 PXE Reboot Time + Others []GenericDhcpOption +} + +func (s *DhcpOptions) GetType__() bindings.BindingType { + return DhcpOptionsBindingType() +} + +func (s *DhcpOptions) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpOptions._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// DHCP profile to specify edge cluster and members on which the dhcp server will run. A DhcpProfile can be referenced by different logical DHCP servers. +type DhcpProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Edge cluster uuid on which the referencing logical DHCP server runs. + EdgeClusterId *string + // The Edge nodes on which the DHCP servers run. If none is provided, the NSX will auto-select two edge-nodes from the given edge cluster. If only one edge node is provided, the DHCP servers will run without HA support. format: int64 + EdgeClusterMemberIndexes []int64 + // Flag to enable the auto-relocation of standby DHCP Service in case of edge node failure. Only tier 1 and auto placed DHCP servers are considered for the relocation. + EnableStandbyRelocation *bool +} + +func (s *DhcpProfile) GetType__() bindings.BindingType { + return DhcpProfileBindingType() +} + +func (s *DhcpProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A paginated list of DHCP profiles. +type DhcpProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // A paginated list of logical DHCP profiles. + Results []DhcpProfile +} + +func (s *DhcpProfileListResult) GetType__() bindings.BindingType { + return DhcpProfileListResultBindingType() +} + +func (s *DhcpProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DhcpRelayProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + ServerAddresses []string +} + +func (s *DhcpRelayProfile) GetType__() bindings.BindingType { + return DhcpRelayProfileBindingType() +} + +func (s *DhcpRelayProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpRelayProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DhcpRelayProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Dhcp relay profile list results + Results []DhcpRelayProfile +} + +func (s *DhcpRelayProfileListResult) GetType__() bindings.BindingType { + return DhcpRelayProfileListResultBindingType() +} + +func (s *DhcpRelayProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpRelayProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DhcpRelayService struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // dhcp relay profile referenced by the dhcp relay service + DhcpRelayProfileId *string +} + +func (s *DhcpRelayService) GetType__() bindings.BindingType { + return DhcpRelayServiceBindingType() +} + +func (s *DhcpRelayService) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpRelayService._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DhcpRelayServiceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Dhcp relay service list results + Results []DhcpRelayService +} + +func (s *DhcpRelayServiceListResult) GetType__() bindings.BindingType { + return DhcpRelayServiceListResultBindingType() +} + +func (s *DhcpRelayServiceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpRelayServiceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DhcpServerStatus struct { + // uuid of active transport node + ActiveNode *string + // Error message, if available + ErrorMessage *string + // Possible values are: + // + // * DhcpServerStatus#DhcpServerStatus_SERVICE_STATUS_UP + // * DhcpServerStatus#DhcpServerStatus_SERVICE_STATUS_DOWN + // * DhcpServerStatus#DhcpServerStatus_SERVICE_STATUS_ERROR + // * DhcpServerStatus#DhcpServerStatus_SERVICE_STATUS_NO_STANDBY + // + // UP means the dhcp service is working fine on both active transport-node and stand-by transport-node (if have), hence fail-over can work at this time if there is failure happens on one of the transport-node; DOWN means the dhcp service is down on both active transport-node and stand-by node (if have), hence the dhcp-service will not repsonse any dhcp request; Error means error happens on transport-node(s) or no status is reported from transport-node(s). The dhcp service may be working (or not working); NO_STANDBY means dhcp service is working in one of the transport node while not in the other transport-node (if have). Hence if the dhcp service in the working transport-node is down, fail-over will not happen and the dhcp service will go down. + ServiceStatus *string + // uuid of stand_by transport node. null if non-HA mode + StandByNode *string +} + +const DhcpServerStatus_SERVICE_STATUS_UP = "UP" +const DhcpServerStatus_SERVICE_STATUS_DOWN = "DOWN" +const DhcpServerStatus_SERVICE_STATUS_ERROR = "ERROR" +const DhcpServerStatus_SERVICE_STATUS_NO_STANDBY = "NO_STANDBY" + +func (s *DhcpServerStatus) GetType__() bindings.BindingType { + return DhcpServerStatusBindingType() +} + +func (s *DhcpServerStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpServerStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// DHCP static binding to define a static ip allocation. +type DhcpStaticBinding struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Gateway ip address of the allocation. format: ip + GatewayIp *string + // Lease time, in seconds, [60-(2^32-1)]. Default is 86400. format: int64 + LeaseTime *int64 + Options *DhcpOptions + // The host name to be assigned to the host. format: hostname + HostName *string + // The ip address to be assigned to the host. format: ip + IpAddress *string + // The MAC address of the host. format: mac-address + MacAddress *string +} + +func (s *DhcpStaticBinding) GetType__() bindings.BindingType { + return DhcpStaticBindingBindingType() +} + +func (s *DhcpStaticBinding) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpStaticBinding._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A paginated list of DHCP static bindings. +type DhcpStaticBindingListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // A paginated list of DHCP static bindings. + Results []DhcpStaticBinding +} + +func (s *DhcpStaticBindingListResult) GetType__() bindings.BindingType { + return DhcpStaticBindingListResultBindingType() +} + +func (s *DhcpStaticBindingListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpStaticBindingListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DhcpStatistics struct { + // The total number of DHCP ACK packets format: int64 + Acks *int64 + // The total number of DHCP DECLINE packets format: int64 + Declines *int64 + // dhcp server uuid + DhcpServerId *string + // The total number of DHCP DISCOVER packets format: int64 + Discovers *int64 + // The total number of DHCP errors format: int64 + Errors *int64 + // The total number of DHCP INFORM packets format: int64 + Informs *int64 + // The DHCP ip pool usage statistics + IpPoolStats []DhcpIpPoolUsage + // The total number of DHCP NACK packets format: int64 + Nacks *int64 + // The total number of DHCP OFFER packets format: int64 + Offers *int64 + // The total number of DHCP RELEASE packets format: int64 + Releases *int64 + // The total number of DHCP REQUEST packets format: int64 + Requests *int64 + // timestamp of the statistics format: int64 + Timestamp *int64 +} + +func (s *DhcpStatistics) GetType__() bindings.BindingType { + return DhcpStatisticsBindingType() +} + +func (s *DhcpStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Base type of IPv6 ip-allocation extended by ip-pool and static-binding. +type DhcpV6InfoBase struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Primary and secondary DNS server address to assign host. They can be overridden by ip-pool or static-binding level property. format: ipv6 + DnsNameservers []string + // Host name or prefix to be assigned to host. It can be overridden by ip-pool or static-binding level property. + DomainNames []string + // Lease time, in seconds. format: int64 + LeaseTime *int64 + // Preferred time, in seconds. If this value is not provided, the value of lease_time\*0.8 will be used. format: int64 + PreferredTime *int64 + // SNTP server ips. format: ipv6 + SntpServers []string +} + +func (s *DhcpV6InfoBase) GetType__() bindings.BindingType { + return DhcpV6InfoBaseBindingType() +} + +func (s *DhcpV6InfoBase) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpV6InfoBase._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// DHCP IPv6 ip pool to define dynamic ip allocation ranges. The DhcpV6IpPool would only provide stateless DHCP (domain search list, DNS servers, SNTP servers) to client if both the ranges and excluded_ranges are not specified. +type DhcpV6IpPool struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Primary and secondary DNS server address to assign host. They can be overridden by ip-pool or static-binding level property. format: ipv6 + DnsNameservers []string + // Host name or prefix to be assigned to host. It can be overridden by ip-pool or static-binding level property. + DomainNames []string + // Lease time, in seconds. format: int64 + LeaseTime *int64 + // Preferred time, in seconds. If this value is not provided, the value of lease_time\*0.8 will be used. format: int64 + PreferredTime *int64 + // SNTP server ips. format: ipv6 + SntpServers []string + // Excluded addresses to define dynamic ip allocation ranges. + ExcludedRanges []IpPoolRange + // Ip address ranges to define dynamic ip allocation ranges. + Ranges []IpPoolRange +} + +func (s *DhcpV6IpPool) GetType__() bindings.BindingType { + return DhcpV6IpPoolBindingType() +} + +func (s *DhcpV6IpPool) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpV6IpPool._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A paginated list of DHCP IPv6 ip pools. +type DhcpV6IpPoolListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // A paginated list of DHCP IPv6 ip pools. + Results []DhcpV6IpPool +} + +func (s *DhcpV6IpPoolListResult) GetType__() bindings.BindingType { + return DhcpV6IpPoolListResultBindingType() +} + +func (s *DhcpV6IpPoolListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpV6IpPoolListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// DHCP IPv6 static binding to define a static ip allocation. +type DhcpV6StaticBinding struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Primary and secondary DNS server address to assign host. They can be overridden by ip-pool or static-binding level property. format: ipv6 + DnsNameservers []string + // Host name or prefix to be assigned to host. It can be overridden by ip-pool or static-binding level property. + DomainNames []string + // Lease time, in seconds. format: int64 + LeaseTime *int64 + // Preferred time, in seconds. If this value is not provided, the value of lease_time\*0.8 will be used. format: int64 + PreferredTime *int64 + // SNTP server ips. format: ipv6 + SntpServers []string + // When not specified, no ip address will be assigned to client host. format: ipv6 + IpAddresses []string + // The MAC address of the host. Either client-duid or mac-address, but not both. format: mac-address + MacAddress *string +} + +func (s *DhcpV6StaticBinding) GetType__() bindings.BindingType { + return DhcpV6StaticBindingBindingType() +} + +func (s *DhcpV6StaticBinding) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpV6StaticBinding._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A paginated list of DHCP IPv6 static bindings. +type DhcpV6StaticBindingListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // A paginated list of DHCP IPv6 static bindings. + Results []DhcpV6StaticBinding +} + +func (s *DhcpV6StaticBindingListResult) GetType__() bindings.BindingType { + return DhcpV6StaticBindingListResultBindingType() +} + +func (s *DhcpV6StaticBindingListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DhcpV6StaticBindingListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type Dhcpv6Header struct { + // Possible values are: + // + // * Dhcpv6Header#Dhcpv6Header_MSG_TYPE_SOLICIT + // * Dhcpv6Header#Dhcpv6Header_MSG_TYPE_ADVERTISE + // * Dhcpv6Header#Dhcpv6Header_MSG_TYPE_REQUEST + // * Dhcpv6Header#Dhcpv6Header_MSG_TYPE_REPLY + // + // This is used to specify the DHCP v6 message. To request the assignment of one or more IPv6 addresses, a client first locates a DHCP server and then requests the assignment of addresses and other configuration information from the server. The client sends a Solicit message to the All_DHCP_Relay_Agents_and_Servers address to find available DHCP servers. Any server that can meet the client's requirements responds with an Advertise message. The client then chooses one of the servers and sends a Request message to the server asking for confirmed assignment of addresses and other configuration information. The server responds with a Reply message that contains the confirmed addresses and configuration. SOLICIT - A client sends a Solicit message to locate servers. ADVERTISE - A server sends and Advertise message to indicate that it is available. REQUEST - A client sends a Request message to request configuration parameters. REPLY - A server sends a Reply message containing assigned addresses and configuration parameters. + MsgType *string +} + +const Dhcpv6Header_MSG_TYPE_SOLICIT = "SOLICIT" +const Dhcpv6Header_MSG_TYPE_ADVERTISE = "ADVERTISE" +const Dhcpv6Header_MSG_TYPE_REQUEST = "REQUEST" +const Dhcpv6Header_MSG_TYPE_REPLY = "REPLY" + +func (s *Dhcpv6Header) GetType__() bindings.BindingType { + return Dhcpv6HeaderBindingType() +} + +func (s *Dhcpv6Header) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Dhcpv6Header._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Active Directory Domain +type DirectoryAdDomain struct { + // Each active directory domain has a domain naming context (NC), which contains domain-specific data. The root of this naming context is represented by a domain's distinguished name (DN) and is typically referred to as the NC head. + BaseDistinguishedName *string + // NetBIOS names can contain all alphanumeric characters except for the certain disallowed characters. Names can contain a period, but names cannot start with a period. NetBIOS is similar to DNS in that it can serve as a directory service, but more limited as it has no provisions for a name hierarchy and names are limited to 15 characters. The netbios name is case insensitive and is stored in upper case regardless of input case. + NetbiosName *string + SelectiveSyncSettings *SelectiveSyncSettings + SyncSettings *DirectoryDomainSyncSettings + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * DirectoryDomain#DirectoryDomain_RESOURCE_TYPE_DIRECTORYADDOMAIN + // + // Domain resource type comes from multiple sub-classes extending this base class. For example, DirectoryAdDomain is one accepted resource_type. If there are more sub-classes defined, they will also be accepted resource_type. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Directory domain Event Log server's information including host, name, protocol and so on. + EventLogServers []DirectoryEventLogServer + // Directory domain LDAP servers' information including host, name, port, protocol and so on. + LdapServers []DirectoryLdapServer + // Directory domain name which best describes the domain. It could be unique fqdn name or it could also be descriptive. There is no unique contraint for domain name among different domains. + Name *string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const DirectoryAdDomain__TYPE_IDENTIFIER = "DirectoryAdDomain" + +func (s *DirectoryAdDomain) GetType__() bindings.BindingType { + return DirectoryAdDomainBindingType() +} + +func (s *DirectoryAdDomain) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DirectoryAdDomain._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DirectoryAdGroup struct { + // GUID is a 128-bit value that is unique not only in the enterprise but also across the world. GUIDs are assigned to every object created by Active Directory, not just User and Group objects. + ObjectGuid *string + // A security identifier (SID) is a unique value of variable length used to identify a trustee. A SID consists of the following components - The revision level of the SID structure; A 48-bit identifier authority value that identifies the authority that issued the SID; A variable number of subauthority or relative identifier (RID) values that uniquely identify the trustee relative to the authority that issued the SID. + SecureId *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Directory group resource type comes from multiple sub-classes extending this base class. For example, DirectoryAdGroup is one accepted resource_type. If there are more sub-classes defined, they will also be accepted resource_type. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Directory group distinguished name + DistinguishedName *string + // Domain ID this directory group belongs to. + DomainId *string + // Each active directory domain has a domain naming context (NC), which contains domain-specific data. The root of this naming context is represented by a domain's distinguished name (DN) and is typically referred to as the NC head. + DomainName *string + // Domain sync node under which this directory group is located. We currently sync only from Root node and hence this attribute doesn't have a specific value set. + DomainSyncNodeId *string +} + +func (s *DirectoryAdGroup) GetType__() bindings.BindingType { + return DirectoryAdGroupBindingType() +} + +func (s *DirectoryAdGroup) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DirectoryAdGroup._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Directory Domain +type DirectoryDomain struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * DirectoryDomain#DirectoryDomain_RESOURCE_TYPE_DIRECTORYADDOMAIN + // + // Domain resource type comes from multiple sub-classes extending this base class. For example, DirectoryAdDomain is one accepted resource_type. If there are more sub-classes defined, they will also be accepted resource_type. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Directory domain Event Log server's information including host, name, protocol and so on. + EventLogServers []DirectoryEventLogServer + // Directory domain LDAP servers' information including host, name, port, protocol and so on. + LdapServers []DirectoryLdapServer + // Directory domain name which best describes the domain. It could be unique fqdn name or it could also be descriptive. There is no unique contraint for domain name among different domains. + Name *string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const DirectoryDomain__TYPE_IDENTIFIER = "DirectoryDomain" +const DirectoryDomain_RESOURCE_TYPE_DIRECTORYADDOMAIN = "DirectoryAdDomain" + +func (s *DirectoryDomain) GetType__() bindings.BindingType { + return DirectoryDomainBindingType() +} + +func (s *DirectoryDomain) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DirectoryDomain._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of Directory Domain +type DirectoryDomainListResults struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of Directory Domains + Results []*data.StructValue +} + +func (s *DirectoryDomainListResults) GetType__() bindings.BindingType { + return DirectoryDomainListResultsBindingType() +} + +func (s *DirectoryDomainListResults) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DirectoryDomainListResults._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Size of Directory Domain +type DirectoryDomainSize struct { + // Number of groups format: int32 + GroupCount *int64 + // Number of group members format: int32 + GroupMemberCount *int64 + // Number of users format: int32 + UserCount *int64 +} + +func (s *DirectoryDomainSize) GetType__() bindings.BindingType { + return DirectoryDomainSizeBindingType() +} + +func (s *DirectoryDomainSize) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DirectoryDomainSize._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Domain synchronization settings +type DirectoryDomainSyncSettings struct { + // Directory domain delta synchronization interval time between two delta sync in minutes. format: int64 + DeltaSyncInterval *int64 + // Directory domain full synchronization schedule using cron expression. For example, cron expression \"0 0 12 ? \* SUN \*\" means full sync is scheduled every Sunday midnight. If this object is null, it means there is no background cron job running for full sync. + FullSyncCronExpr *string + // Sync delay after Directory domain has been successfully created. if delay is -1, initial full sync will not be triggered. format: int32 + SyncDelayInSec *int64 +} + +func (s *DirectoryDomainSyncSettings) GetType__() bindings.BindingType { + return DirectoryDomainSyncSettingsBindingType() +} + +func (s *DirectoryDomainSyncSettings) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DirectoryDomainSyncSettings._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Directory domain synchronization statistics +type DirectoryDomainSyncStats struct { + // All the historical delta sync are counted in calculating the average delta sync time in milliseconds. format: int64 + AvgDeltaSyncTime *int64 + // All the historical full sync are counted in calculating the average full sync time in milliseconds. format: int64 + AvgFullSyncTime *int64 + // Possible values are: + // + // * DirectoryDomainSyncStats#DirectoryDomainSyncStats_CURRENT_STATE_IDLE + // * DirectoryDomainSyncStats#DirectoryDomainSyncStats_CURRENT_STATE_FULL_SYNC + // * DirectoryDomainSyncStats#DirectoryDomainSyncStats_CURRENT_STATE_DELTA_SYNC + // * DirectoryDomainSyncStats#DirectoryDomainSyncStats_CURRENT_STATE_SELECTIVE_FULL_SYNC + // * DirectoryDomainSyncStats#DirectoryDomainSyncStats_CURRENT_STATE_SELECTIVE_DELTA_SYNC + // + // Current running state of the directory domain in synchronization life cycle. It could be one of the following five states. SELECTIVE_FULL_SYNC and SELECTIVE_DELTA_SYNC are sync states for selective sync. + CurrentState *string + // Since what time the current state has begun. The time is expressed in millisecond epoch time. format: int64 + CurrentStateBeginTime *int64 + // number of successful historical delta sync initiated either by system or by API request. format: int64 + NumDeltaSync *int64 + // number of successful historical full sync initiated either by system or by API request. format: int64 + NumFullSync *int64 + // Directory domain previous sync ending time expressed in millisecond epoch time. format: int64 + PrevSyncEndTime *int64 + // Directory domain previous sync status error if last status was failure. + PrevSyncError *string + // Possible values are: + // + // * DirectoryDomainSyncStats#DirectoryDomainSyncStats_PREV_SYNC_STATUS_SUCCESS + // * DirectoryDomainSyncStats#DirectoryDomainSyncStats_PREV_SYNC_STATUS_FAILURE + // * DirectoryDomainSyncStats#DirectoryDomainSyncStats_PREV_SYNC_STATUS_UNKNOWN + // + // Directory domain previous sync status. It could be one of the following two states. + PrevSyncStatus *string + // Possible values are: + // + // * DirectoryDomainSyncStats#DirectoryDomainSyncStats_PREV_SYNC_TYPE_IDLE + // * DirectoryDomainSyncStats#DirectoryDomainSyncStats_PREV_SYNC_TYPE_FULL_SYNC + // * DirectoryDomainSyncStats#DirectoryDomainSyncStats_PREV_SYNC_TYPE_DELTA_SYNC + // * DirectoryDomainSyncStats#DirectoryDomainSyncStats_PREV_SYNC_TYPE_SELECTIVE_FULL_SYNC + // * DirectoryDomainSyncStats#DirectoryDomainSyncStats_PREV_SYNC_TYPE_SELECTIVE_DELTA_SYNC + // + // Directory domain previous sync type. It could be one of the following five states. Right after the directory domain is configured, this field is set to IDLE. + PrevSyncType *string +} + +const DirectoryDomainSyncStats_CURRENT_STATE_IDLE = "IDLE" +const DirectoryDomainSyncStats_CURRENT_STATE_FULL_SYNC = "FULL_SYNC" +const DirectoryDomainSyncStats_CURRENT_STATE_DELTA_SYNC = "DELTA_SYNC" +const DirectoryDomainSyncStats_CURRENT_STATE_SELECTIVE_FULL_SYNC = "SELECTIVE_FULL_SYNC" +const DirectoryDomainSyncStats_CURRENT_STATE_SELECTIVE_DELTA_SYNC = "SELECTIVE_DELTA_SYNC" +const DirectoryDomainSyncStats_PREV_SYNC_STATUS_SUCCESS = "SUCCESS" +const DirectoryDomainSyncStats_PREV_SYNC_STATUS_FAILURE = "FAILURE" +const DirectoryDomainSyncStats_PREV_SYNC_STATUS_UNKNOWN = "UNKNOWN" +const DirectoryDomainSyncStats_PREV_SYNC_TYPE_IDLE = "IDLE" +const DirectoryDomainSyncStats_PREV_SYNC_TYPE_FULL_SYNC = "FULL_SYNC" +const DirectoryDomainSyncStats_PREV_SYNC_TYPE_DELTA_SYNC = "DELTA_SYNC" +const DirectoryDomainSyncStats_PREV_SYNC_TYPE_SELECTIVE_FULL_SYNC = "SELECTIVE_FULL_SYNC" +const DirectoryDomainSyncStats_PREV_SYNC_TYPE_SELECTIVE_DELTA_SYNC = "SELECTIVE_DELTA_SYNC" + +func (s *DirectoryDomainSyncStats) GetType__() bindings.BindingType { + return DirectoryDomainSyncStatsBindingType() +} + +func (s *DirectoryDomainSyncStats) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DirectoryDomainSyncStats._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Event log server of directory domain +type DirectoryEventLogServer struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Directory domain name which best describes the domain. It could be unique fqdn name or it could also be descriptive. There is no unique contraint for domain name among different domains. + DomainName *string + // Directory Event Log server DNS host name or ip address which is reachable by NSX manager to be connected and do event fetching. format: hostname-or-ip + Host *string + // Directory event log server connection password. + Password *string + Status *DirectoryEventLogServerStatus + // Directory event log server connection user name. + Username *string +} + +func (s *DirectoryEventLogServer) GetType__() bindings.BindingType { + return DirectoryEventLogServerBindingType() +} + +func (s *DirectoryEventLogServer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DirectoryEventLogServer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Event log server connection status +type DirectoryEventLogServerStatus struct { + // Additional optional detail error message + ErrorMessage *string + // Last event record ID is an opaque integer value that shows the last successfully received event from event log server. format: int64 + LastEventRecordId *int64 + // Time of last successfully received and record event from event log server. format: int64 + LastEventTimeCreated *int64 + // Last polling time format: int64 + LastPollingTime *int64 + // Possible values are: + // + // * DirectoryEventLogServerStatus#DirectoryEventLogServerStatus_STATUS_OK + // * DirectoryEventLogServerStatus#DirectoryEventLogServerStatus_STATUS_ERROR + // + // Connection status: OK: All OK ERROR: Generic error + Status *string +} + +const DirectoryEventLogServerStatus_STATUS_OK = "OK" +const DirectoryEventLogServerStatus_STATUS_ERROR = "ERROR" + +func (s *DirectoryEventLogServerStatus) GetType__() bindings.BindingType { + return DirectoryEventLogServerStatusBindingType() +} + +func (s *DirectoryEventLogServerStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DirectoryEventLogServerStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DirectoryGroup struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Directory group resource type comes from multiple sub-classes extending this base class. For example, DirectoryAdGroup is one accepted resource_type. If there are more sub-classes defined, they will also be accepted resource_type. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Directory group distinguished name + DistinguishedName *string + // Domain ID this directory group belongs to. + DomainId *string + // Each active directory domain has a domain naming context (NC), which contains domain-specific data. The root of this naming context is represented by a domain's distinguished name (DN) and is typically referred to as the NC head. + DomainName *string + // Domain sync node under which this directory group is located. We currently sync only from Root node and hence this attribute doesn't have a specific value set. + DomainSyncNodeId *string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const DirectoryGroup__TYPE_IDENTIFIER = "DirectoryGroup" + +func (s *DirectoryGroup) GetType__() bindings.BindingType { + return DirectoryGroupBindingType() +} + +func (s *DirectoryGroup) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DirectoryGroup._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DirectoryGroupListResults struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Directory group list + Results []*data.StructValue +} + +func (s *DirectoryGroupListResults) GetType__() bindings.BindingType { + return DirectoryGroupListResultsBindingType() +} + +func (s *DirectoryGroupListResults) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DirectoryGroupListResults._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DirectoryGroupMember struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Directory group distinguished name this group member belongs to. + GroupDistinguishedName *string + // Directory group id this group member belongs to + GroupId *string + // Directory group name this group member owns + MemberGroupDistinguishedName *string + // Directory group id this group member owns + MemberGroupId *string + // Whether this member group is a directory member of the parent group speicified by group_id or a nested member group which parent group is also member group of the parent group speicified by group_id. + Nested *bool +} + +func (s *DirectoryGroupMember) GetType__() bindings.BindingType { + return DirectoryGroupMemberBindingType() +} + +func (s *DirectoryGroupMember) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DirectoryGroupMember._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DirectoryGroupMemberListResults struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Directory group member list + Results []DirectoryGroupMember +} + +func (s *DirectoryGroupMemberListResults) GetType__() bindings.BindingType { + return DirectoryGroupMemberListResultsBindingType() +} + +func (s *DirectoryGroupMemberListResults) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DirectoryGroupMemberListResults._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// LDAP server of directory domain +type DirectoryLdapServer struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Directory domain name which best describes the domain. It could be unique fqdn name or it could also be descriptive. There is no unique contraint for domain name among different domains. + DomainName *string + // Directory LDAP server DNS host name or ip address which is reachable by NSX manager to be connected and do object synchronization. format: hostname-or-ip + Host *string + // Directory LDAP server connection password. + Password *string + // Directory LDAP server connection TCP/UDP port. format: int64 + Port *int64 + // Possible values are: + // + // * DirectoryLdapServer#DirectoryLdapServer_PROTOCOL_LDAP + // * DirectoryLdapServer#DirectoryLdapServer_PROTOCOL_LDAPS + // + // Directory LDAP server connection protocol which is either LDAP or LDAPS. + Protocol *string + // Directory LDAP server certificate thumbprint used in secure LDAPS connection. + Thumbprint *string + // Directory LDAP server connection user name. + Username *string +} + +const DirectoryLdapServer_PROTOCOL_LDAP = "LDAP" +const DirectoryLdapServer_PROTOCOL_LDAPS = "LDAPS" + +func (s *DirectoryLdapServer) GetType__() bindings.BindingType { + return DirectoryLdapServerBindingType() +} + +func (s *DirectoryLdapServer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DirectoryLdapServer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of directory domain LDAP servers +type DirectoryLdapServerListResults struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of directory domain LDAP servers + Results []DirectoryLdapServer +} + +func (s *DirectoryLdapServerListResults) GetType__() bindings.BindingType { + return DirectoryLdapServerListResultsBindingType() +} + +func (s *DirectoryLdapServerListResults) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DirectoryLdapServerListResults._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Status LDAP server of directory domain +type DirectoryLdapServerStatus struct { + // Error ID of the directory LDAP server status maintained by the NSX directory service. format: int64 + ErrorId *int64 + // Error message of the directory LDAP server status maintained by the NSX directory service. + ErrorMessage *string +} + +func (s *DirectoryLdapServerStatus) GetType__() bindings.BindingType { + return DirectoryLdapServerStatusBindingType() +} + +func (s *DirectoryLdapServerStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DirectoryLdapServerStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Organization Unit +type DirectoryOrgUnit struct { + // List of children Organization Units if any. + Children []DirectoryOrgUnit + // Distinguished name of the organization unit. + DistinguishedName *string + // Organization Unit name. + Name *string +} + +func (s *DirectoryOrgUnit) GetType__() bindings.BindingType { + return DirectoryOrgUnitBindingType() +} + +func (s *DirectoryOrgUnit) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DirectoryOrgUnit._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of organization units +type DirectoryOrgUnitListResults struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of Organization Units + Results []DirectoryOrgUnit +} + +func (s *DirectoryOrgUnitListResults) GetType__() bindings.BindingType { + return DirectoryOrgUnitListResultsBindingType() +} + +func (s *DirectoryOrgUnitListResults) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DirectoryOrgUnitListResults._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DiscoveredNode struct { + // Certificate of the discovered node + Certificate *string + // Local Id of the discovered node in the Compute Manager + CmLocalId *string + // External id of the discovered node, ex. a mo-ref from VC + ExternalId *string + // Hardware Id is generated using system hardware info. It is used to retrieve fabric node of the esx. + HardwareId *string + // IP Addresses of the the discovered node. format: ip + IpAddresses []string + // Discovered Node type like Host + NodeType *string + // Id of the compute manager from where this node was discovered + OriginId *string + // Key-Value map of additional specific properties of discovered node in the Compute Manager + OriginProperties []KeyValuePair + // OS type of the discovered node + OsType *string + // OS version of the discovered node + OsVersion *string + // External id of the compute collection to which this node belongs + ParentComputeCollection *string + // The stateless property describes whether host persists its state across reboot or not. If state persists, value is set as false otherwise true. + Stateless *bool + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Specifies list of scope of discovered resource. e.g. if VHC path is associated with principal identity, who owns the discovered resource, then scope id will be VHC path and scope type will be VHC. + Scope []DiscoveredResourceScope + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const DiscoveredNode__TYPE_IDENTIFIER = "DiscoveredNode" + +func (s *DiscoveredNode) GetType__() bindings.BindingType { + return DiscoveredNodeBindingType() +} + +func (s *DiscoveredNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DiscoveredNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Network interface properties of discovered node +type DiscoveredNodeInterfaceProperties struct { + // Switch name which is connected to nic, switch can be opaque, proxyHostSwitch or virtual + ConnectedSwitch *string + // Possible values are: + // + // * DiscoveredNodeInterfaceProperties#DiscoveredNodeInterfaceProperties_CONNECTED_SWITCH_TYPE_VSS + // * DiscoveredNodeInterfaceProperties#DiscoveredNodeInterfaceProperties_CONNECTED_SWITCH_TYPE_DVS + // * DiscoveredNodeInterfaceProperties#DiscoveredNodeInterfaceProperties_CONNECTED_SWITCH_TYPE_N_VDS + // + // Type of virtual switch can be VSS, DVS or N-VDS. + ConnectedSwitchType *string + // Id of the network interface + InterfaceId *string + // Mac address of the interface format: mac-address + PhysicalAddress *string +} + +const DiscoveredNodeInterfaceProperties_CONNECTED_SWITCH_TYPE_VSS = "VSS" +const DiscoveredNodeInterfaceProperties_CONNECTED_SWITCH_TYPE_DVS = "DVS" +const DiscoveredNodeInterfaceProperties_CONNECTED_SWITCH_TYPE_N_VDS = "N-VDS" + +func (s *DiscoveredNodeInterfaceProperties) GetType__() bindings.BindingType { + return DiscoveredNodeInterfacePropertiesBindingType() +} + +func (s *DiscoveredNodeInterfaceProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DiscoveredNodeInterfaceProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Discovered Node list result +type DiscoveredNodeListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Discovered Node list results + Results []DiscoveredNode +} + +func (s *DiscoveredNodeListResult) GetType__() bindings.BindingType { + return DiscoveredNodeListResultBindingType() +} + +func (s *DiscoveredNodeListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DiscoveredNodeListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// All the network interfaces of the discovered node +type DiscoveredNodeNetworkInterfaces struct { + // Id of the discovered node + DiscoveredNodeId *string + // Network interfaces of the node + NetworkInterfaces []DiscoveredNodeInterfaceProperties +} + +func (s *DiscoveredNodeNetworkInterfaces) GetType__() bindings.BindingType { + return DiscoveredNodeNetworkInterfacesBindingType() +} + +func (s *DiscoveredNodeNetworkInterfaces) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DiscoveredNodeNetworkInterfaces._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Base class for resources that are discovered and automatically updated +type DiscoveredResource struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Specifies list of scope of discovered resource. e.g. if VHC path is associated with principal identity, who owns the discovered resource, then scope id will be VHC path and scope type will be VHC. + Scope []DiscoveredResourceScope + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const DiscoveredResource__TYPE_IDENTIFIER = "DiscoveredResource" + +func (s *DiscoveredResource) GetType__() bindings.BindingType { + return DiscoveredResourceBindingType() +} + +func (s *DiscoveredResource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DiscoveredResource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Scope of discovered resource +type DiscoveredResourceScope struct { + // Specifies the scope id of discovered resource. + ScopeId *string + // Possible values are: + // + // * DiscoveredResourceScope#DiscoveredResourceScope_SCOPE_TYPE_CLUSTER + // + // Type of the scope for the discovered resource. + ScopeType *string +} + +const DiscoveredResourceScope_SCOPE_TYPE_CLUSTER = "CONTAINER_CLUSTER" + +func (s *DiscoveredResourceScope) GetType__() bindings.BindingType { + return DiscoveredResourceScopeBindingType() +} + +func (s *DiscoveredResourceScope) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DiscoveredResourceScope._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Distributed virtual portgroup on a VC +type DistributedVirtualPortgroup struct { + // For distributed virtual portgroup, backing type is standard. For logical switch portgroup, the backing type is set to nsx. + BackingType *string + // Generated UUID of the portgroup + Key *string + // Possible values are: + // + // * DistributedVirtualPortgroup#DistributedVirtualPortgroup_OVERALL_STATUS_RED + // * DistributedVirtualPortgroup#DistributedVirtualPortgroup_OVERALL_STATUS_YELLOW + // * DistributedVirtualPortgroup#DistributedVirtualPortgroup_OVERALL_STATUS_GREEN + // * DistributedVirtualPortgroup#DistributedVirtualPortgroup_OVERALL_STATUS_GRAY + // + // This parameters reflects the managed entity status of the portgroup as reported by VC. + OverallStatus *string + // Id of the portgroup, eg. a mo-ref from VC. + CmLocalId *string + // External id of the virtual portgroup + ExternalId *string + // Portgroup type like DistributedVirtualPortgroup + OriginType *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Specifies list of scope of discovered resource. e.g. if VHC path is associated with principal identity, who owns the discovered resource, then scope id will be VHC path and scope type will be VHC. + Scope []DiscoveredResourceScope + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +const DistributedVirtualPortgroup_OVERALL_STATUS_RED = "RED" +const DistributedVirtualPortgroup_OVERALL_STATUS_YELLOW = "YELLOW" +const DistributedVirtualPortgroup_OVERALL_STATUS_GREEN = "GREEN" +const DistributedVirtualPortgroup_OVERALL_STATUS_GRAY = "GRAY" + +func (s *DistributedVirtualPortgroup) GetType__() bindings.BindingType { + return DistributedVirtualPortgroupBindingType() +} + +func (s *DistributedVirtualPortgroup) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DistributedVirtualPortgroup._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// DistributedVirtualSwitch on a VC +type DistributedVirtualSwitch struct { + // Array of discovered nodes connected to this switch. + DiscoveredNodes []DiscoveredNode + // It contains information about VMware specific multiple dynamic LACP groups. + LacpGroupConfigs []LacpGroupConfigInfo + // Key-Value map of additional properties of switch + OriginProperties []KeyValuePair + // The uniform name of uplink ports on each host. + UplinkPortNames []string + UplinkPortgroup *DistributedVirtualPortgroup + // UUID of the switch + Uuid *string + // ID of the virtual switch in compute manager + CmLocalId *string + // External id of the virtual switch + ExternalId *string + // ID of the compute manager where this virtual switch is discovered. + OriginId *string + // Switch type like VmwareDistributedVirtualSwitch + OriginType *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Specifies list of scope of discovered resource. e.g. if VHC path is associated with principal identity, who owns the discovered resource, then scope id will be VHC path and scope type will be VHC. + Scope []DiscoveredResourceScope + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +func (s *DistributedVirtualSwitch) GetType__() bindings.BindingType { + return DistributedVirtualSwitchBindingType() +} + +func (s *DistributedVirtualSwitch) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DistributedVirtualSwitch._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The response for DNS nslookup. +type DnsAnswer struct { + // The answers of the query. + Answers []DnsQueryAnswer + // Authotitative answers of the query. This is a deprecated property, please use 'answers' instead. + AuthoritativeAnswers []DnsQueryAnswer + // Dns server ip address and port, format is \"ip address#port\". + DnsServer *string + // ID of the edge node that performed the query. + EdgeNodeId *string + // Non-authotitative answers of the query. This is a deprecated property, please use 'answers' instead. + NonAuthoritativeAnswers []DnsQueryAnswer + // It can be NXDOMAIN or error message which is not consisted of authoritative_answer or non_authoritative_answer. + RawAnswer *string + // The source ip used in this lookup. format: ipv4 + SourceIp *string +} + +func (s *DnsAnswer) GetType__() bindings.BindingType { + return DnsAnswerBindingType() +} + +func (s *DnsAnswer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DnsAnswer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The array of the failed DNS queries with entry count and timestamp on active and standby transport node. +type DnsFailedQueries struct { + // The array of failed DNS queries on active and standby transport node. If there is no standby node, the failed queries on standby node will not be present. + PerNodeFailedQueries []PerNodeDnsFailedQueries + // Timestamp of the request, in YYYY-MM-DD HH:MM:SS.zzz format. + Timestamp *string +} + +func (s *DnsFailedQueries) GetType__() bindings.BindingType { + return DnsFailedQueriesBindingType() +} + +func (s *DnsFailedQueries) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DnsFailedQueries._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The summary of the failed DNS query. The query result represents a full query chain from client VM to dns forwarder, and upstream server if no forwarder cache was hit. +type DnsFailedQuery struct { + // The address be queried, can be a FQDN or an ip address. + Address *string + // The client host ip address from which the query was issued. + ClientIp *string + // The detailed error message of the failed query, if any. + ErrorMessage *string + // The type of the query failure, e.g. NXDOMAIN, etc. + ErrorType *string + // The DNS forwarder ip address to which the query was first received. + ForwarderIp *string + // The record type be queried, e.g. A, CNAME, SOA, etc. + RecordType *string + // The source ip address that is used to forward a query to an upstream server. + SourceIp *string + // The time the query took before it got a failed answer, in ms. format: int64 + TimeSpent *int64 + // Timestamp of the request, in YYYY-MM-DD HH:MM:SS.zzz format. + Timestamp *string + // The upstream server ip address to which the query was forwarded. If the query could not be serviced from the DNS forwarder cache, this property will contain the IP address of the DNS server that serviced the request. If the request was serviced from the cache, this property will be absent. + UpstreamServerIp *string +} + +func (s *DnsFailedQuery) GetType__() bindings.BindingType { + return DnsFailedQueryBindingType() +} + +func (s *DnsFailedQuery) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DnsFailedQuery._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DnsForwarder struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // One DNS answer cache entry will consume ~120 bytes. Hence 1 KB cache size can cache ~8 DNS answer entries, and the default 1024 KB cache size can hold ~8k DNS answer entries. format: int32 + CacheSize *int64 + // The conditional zone forwarders. During matching a zone forwarder, the DNS forwarder will use the conditional fowarder with the longest domain name that matches the query. + ConditionalForwarders []ConditionalForwarderZone + DefaultForwarder *ForwarderZone + // Flag to enable/disable the forwarder + Enabled *bool + // The ip address the DNS forwarder listens on. It can be an ip address already owned by the logical-router uplink port or router-link, or a loopback port ip address. But it can not be a downlink port address. User needs to ensure the address is reachable via router or NAT from both client VMs and upstream servers. User will need to create Firewall rules if needed to allow such traffic on a Tier-1 or Tier-0. format: ipv4 + ListenerIp *string + // Possible values are: + // + // * DnsForwarder#DnsForwarder_LOG_LEVEL_DEBUG + // * DnsForwarder#DnsForwarder_LOG_LEVEL_INFO + // * DnsForwarder#DnsForwarder_LOG_LEVEL_WARNING + // * DnsForwarder#DnsForwarder_LOG_LEVEL_ERROR + // * DnsForwarder#DnsForwarder_LOG_LEVEL_FATAL + // + // Log level of the DNS forwarder + LogLevel *string + // Specify the LogicalRouter where the DnsForwarder runs. The HA mode of the hosting LogicalRouter must be Active/Standby. + LogicalRouterId *string +} + +const DnsForwarder_LOG_LEVEL_DEBUG = "DEBUG" +const DnsForwarder_LOG_LEVEL_INFO = "INFO" +const DnsForwarder_LOG_LEVEL_WARNING = "WARNING" +const DnsForwarder_LOG_LEVEL_ERROR = "ERROR" +const DnsForwarder_LOG_LEVEL_FATAL = "FATAL" + +func (s *DnsForwarder) GetType__() bindings.BindingType { + return DnsForwarderBindingType() +} + +func (s *DnsForwarder) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DnsForwarder._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DnsForwarderListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paginated list of DNS forwarders + Results []DnsForwarder +} + +func (s *DnsForwarderListResult) GetType__() bindings.BindingType { + return DnsForwarderListResultBindingType() +} + +func (s *DnsForwarderListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DnsForwarderListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The current statistics counters of the DNS forwarder including cache usages and query numbers per forwarders. +type DnsForwarderStatistics struct { + // The statistics of conditional forwarders + ConditionalForwarderStatistics []PerForwarderStatistics + // The configured cache size, in kb format: int64 + ConfiguredCacheSize *int64 + DefaultForwarderStatistics *PerForwarderStatistics + // Error message, if available + ErrorMessage *string + // The totocal number of queries answered from local cache format: int64 + QueriesAnsweredLocally *int64 + // The total number of forwarded dns queries format: int64 + QueriesForwarded *int64 + // Time stamp of the current statistics, in ms format: int64 + Timestamp *int64 + // The total number of received dns queries format: int64 + TotalQueries *int64 + // The statistics of used cache + UsedCacheStatistics []PerNodeUsedCacheStatistics +} + +func (s *DnsForwarderStatistics) GetType__() bindings.BindingType { + return DnsForwarderStatisticsBindingType() +} + +func (s *DnsForwarderStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DnsForwarderStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The current runtime status of the DNS forwarder including the hosting transport nodes and forwarder service status. +type DnsForwarderStatus struct { + // Uuid of active transport node + ActiveNode *string + // Extra message, if available + ExtraMessage *string + // Uuid of stand_by transport node. null if non-HA mode + StandbyNode *string + // Possible values are: + // + // * DnsForwarderStatus#DnsForwarderStatus_STATUS_UP + // * DnsForwarderStatus#DnsForwarderStatus_STATUS_DOWN + // * DnsForwarderStatus#DnsForwarderStatus_STATUS_ERROR + // * DnsForwarderStatus#DnsForwarderStatus_STATUS_NO_BACKUP + // + // UP means the DNS forwarder is working correctly on the active transport node and the stand-by transport node (if present). Failover will occur if either node goes down. DOWN means the DNS forwarder is down on both active transport node and standby node (if present). The DNS forwarder does not function in this situation. Error means there is some error on one or both transport node, or no status was reported from one or both transport nodes. The dns forwarder may be working (or not working). NO_BACKUP means dns forwarder is working in only one transport node, either because it is down on the standby node, or no standby is configured. An forwarder outage will occur if the active node goes down. + Status *string + // Time stamp of the current status, in ms format: int64 + Timestamp *int64 +} + +const DnsForwarderStatus_STATUS_UP = "UP" +const DnsForwarderStatus_STATUS_DOWN = "DOWN" +const DnsForwarderStatus_STATUS_ERROR = "ERROR" +const DnsForwarderStatus_STATUS_NO_BACKUP = "NO_BACKUP" + +func (s *DnsForwarderStatus) GetType__() bindings.BindingType { + return DnsForwarderStatusBindingType() +} + +func (s *DnsForwarderStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DnsForwarderStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DnsHeader struct { + // This is used to define what is being asked or responded. format: hostname-or-ip + Address *string + // Possible values are: + // + // * DnsHeader#DnsHeader_ADDRESS_TYPE_V4 + // * DnsHeader#DnsHeader_ADDRESS_TYPE_V6 + // + // This is used to specify the type of the address. V4 - The address provided is an IPv4 domain name/IP address, the Type in query or response will be A V6 - The address provided is an IPv6 domain name/IP address, the Type in query or response will be AAAA + AddressType *string + // Possible values are: + // + // * DnsHeader#DnsHeader_MESSAGE_TYPE_QUERY + // * DnsHeader#DnsHeader_MESSAGE_TYPE_RESPONSE + // + // Specifies the message type whether it is a query or a response. + MessageType *string +} + +const DnsHeader_ADDRESS_TYPE_V4 = "V4" +const DnsHeader_ADDRESS_TYPE_V6 = "V6" +const DnsHeader_MESSAGE_TYPE_QUERY = "QUERY" +const DnsHeader_MESSAGE_TYPE_RESPONSE = "RESPONSE" + +func (s *DnsHeader) GetType__() bindings.BindingType { + return DnsHeaderBindingType() +} + +func (s *DnsHeader) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DnsHeader._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Answer of nslookup +type DnsQueryAnswer struct { + // Can be resolved ip address. + Address *string + // Matched name of the given address. + Name *string + // Unparsed answer string from raw_answer. + RawString *string +} + +func (s *DnsQueryAnswer) GetType__() bindings.BindingType { + return DnsQueryAnswerBindingType() +} + +func (s *DnsQueryAnswer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DnsQueryAnswer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Firewall to use TTL config to manage firewall cache to expire snooped FQDN entries from DNS response. +type DnsTtlConfig struct { + // Possible values are: + // + // * DnsTtlConfig#DnsTtlConfig_DNS_TTL_TYPE_USE_TTL + // * DnsTtlConfig#DnsTtlConfig_DNS_TTL_TYPE_AUTO + // * DnsTtlConfig#DnsTtlConfig_DNS_TTL_TYPE_NEVER_EXPIRE + // + // TTL type to decide how to manage ttl. + DnsTtlType *string + // The number of seconds that snooped DNS responses are retained in the cache. Used only when dns_ttl_type is USE_TTL. format: int64 + Ttl *int64 +} + +const DnsTtlConfig_DNS_TTL_TYPE_USE_TTL = "USE_TTL" +const DnsTtlConfig_DNS_TTL_TYPE_AUTO = "AUTO" +const DnsTtlConfig_DNS_TTL_TYPE_NEVER_EXPIRE = "NEVER_EXPIRE" + +func (s *DnsTtlConfig) GetType__() bindings.BindingType { + return DnsTtlConfigBindingType() +} + +func (s *DnsTtlConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DnsTtlConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents configuration of a Donut +type DonutConfiguration struct { + // Expression to retrieve count to be shown on Donut. + Count *string + // If true, displays the count of entities in the donut + DisplayCount *bool + Label *Label + // Hyperlink of the specified UI page that provides details. + Navigation *string + // Sections + Sections []DonutSection + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_TIMERANGEDROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_SPACERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LEGENDWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration, CustomFilterWidgetConfiguration, TimeRangeDropdownFilterWidgetConfiguration, SpacerWidgetConfiguration, LegendWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If the condition is met then the widget will be displayed to UI. If no condition is provided, then the widget will be displayed unconditionally. + Condition *string + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + FeatureSet *FeatureSet + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. This field is deprecated instead use 'filters' property. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + // A List of filter applied to this widget configuration. This will be used to identify the filters applied to this widget. + Filters []string + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + Legend *Legend + // List of plotting configuration for a given widget. Widget plotting configurations which are common across all the widgets types should be define here. + PlotConfigs []WidgetPlotConfiguration + // Represents the vertical span of the widget / container. 1 Row span is equal to 20px. format: int32 + Rowspan *int64 + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // If the value of this field is set to true then card header will be displayed otherwise only card will be displayed without header. + ShowHeader *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const DonutConfiguration__TYPE_IDENTIFIER = "DonutConfiguration" + +func (s *DonutConfiguration) GetType__() bindings.BindingType { + return DonutConfigurationBindingType() +} + +func (s *DonutConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DonutConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents an entity or portion to be plotted on a donut or stats chart. +type DonutPart struct { + // If the condition is met then the part will be displayed. Examples of expression syntax are provided under 'example_request' section of 'CreateWidgetConfiguration' API. + Condition *string + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + // A numerical value that represents the portion or entity of the donut or stats chart. + Field *string + // If true, legend will be shown only if the data for the part is available. This is applicable only if legends are specified in widget configuration. + HideEmptyLegend *bool + Label *Label + // Hyperlink of the specified UI page that provides details. If drilldown_id is provided, then navigation cannot be used. + Navigation *string + // Additional rendering or conditional evaluation of the field values to be performed, if any. + RenderConfiguration []RenderConfiguration + // Multi-line text to be shown on tooltip while hovering over the portion. + Tooltip []Tooltip +} + +func (s *DonutPart) GetType__() bindings.BindingType { + return DonutPartBindingType() +} + +func (s *DonutPart) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DonutPart._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents high level logical grouping of portions or segments of a donut / stats chart. +type DonutSection struct { + // Array of portions or parts of the donut or stats chart. + Parts []DonutPart + // Field of the root of the api result set for forming parts. + RowListField *string + // If true, the section will be appled as template for forming parts. Only one part will be formed from each element of 'row_list_field'. + Template *bool +} + +func (s *DonutSection) GetType__() bindings.BindingType { + return DonutSectionBindingType() +} + +func (s *DonutSection) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DonutSection._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Dropdown Filter plotting configuration. +type DropdownFilterPlotConfiguration struct { + // Allow maximize capability for this widget + AllowMaximize *bool + // If the condition is met then the given chart config is applied to the widget configuration. + Condition *string + // Allow search on drop down filter. + AllowSearch *bool +} + +func (s *DropdownFilterPlotConfiguration) GetType__() bindings.BindingType { + return DropdownFilterPlotConfigurationBindingType() +} + +func (s *DropdownFilterPlotConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DropdownFilterPlotConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents configuration for dropdown filter widget. +type DropdownFilterWidgetConfiguration struct { + // Expression to specify default value of filter. + DefaultValue *string + DropdownFilterPlotConfig *DropdownFilterPlotConfiguration + DropdownItem *DropdownItem + // Placeholder message to be displayed in dropdown filter. + PlaceholderMsg *string + // If the condition is met then the static filter will be added. If no condition is provided, then the static filters will be applied unconditionally. + StaticFilterCondition *string + // Additional static items to be added in dropdown filter. Example can be 'ALL'. + StaticFilters []StaticFilter + // Alias to be used when emitting filter value. + Alias *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_TIMERANGEDROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_SPACERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LEGENDWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration, CustomFilterWidgetConfiguration, TimeRangeDropdownFilterWidgetConfiguration, SpacerWidgetConfiguration, LegendWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If the condition is met then the widget will be displayed to UI. If no condition is provided, then the widget will be displayed unconditionally. + Condition *string + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + FeatureSet *FeatureSet + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. This field is deprecated instead use 'filters' property. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + // A List of filter applied to this widget configuration. This will be used to identify the filters applied to this widget. + Filters []string + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + Legend *Legend + // List of plotting configuration for a given widget. Widget plotting configurations which are common across all the widgets types should be define here. + PlotConfigs []WidgetPlotConfiguration + // Represents the vertical span of the widget / container. 1 Row span is equal to 20px. format: int32 + Rowspan *int64 + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // If the value of this field is set to true then card header will be displayed otherwise only card will be displayed without header. + ShowHeader *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} + +func (s *DropdownFilterWidgetConfiguration) GetType__() bindings.BindingType { + return DropdownFilterWidgetConfigurationBindingType() +} + +func (s *DropdownFilterWidgetConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DropdownFilterWidgetConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Dropdown item definition +type DropdownItem struct { + // An additional key-value pair for item to be display in dropdown. + AdditionalValue *data.StructValue + // expression to extract display name to be shown in the drop down. + DisplayName *string + // An expression that represents the items of the dropdown filter. + Field *string + // Property value is shown in the drop down input box for a filter. If the value is not provided 'display_name' property value is used. + ShortDisplayName *string + // Value of filter inside dropdown filter. + Value *string +} + +func (s *DropdownItem) GetType__() bindings.BindingType { + return DropdownItemBindingType() +} + +func (s *DropdownItem) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DropdownItem._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Dscp value is ignored in case of 'TRUSTED' DscpMode. +type Dscp struct { + // Possible values are: + // + // * Dscp#Dscp_MODE_TRUSTED + // * Dscp#Dscp_MODE_UNTRUSTED + // + // Trust settings + Mode *string + // Internal Forwarding Priority format: int32 + Priority *int64 +} + +const Dscp_MODE_TRUSTED = "TRUSTED" +const Dscp_MODE_UNTRUSTED = "UNTRUSTED" + +func (s *Dscp) GetType__() bindings.BindingType { + return DscpBindingType() +} + +func (s *Dscp) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Dscp._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Duplicate address binding information +type DuplicateAddressBindingEntry struct { + Binding *PacketAddressClassifier + // Timestamp at which the binding was discovered via snooping or manually specified by the user format: int64 + BindingTimestamp *int64 + // Possible values are: + // + // * DuplicateAddressBindingEntry#DuplicateAddressBindingEntry_SOURCE_INVALID + // * DuplicateAddressBindingEntry#DuplicateAddressBindingEntry_SOURCE_UNKNOWN + // * DuplicateAddressBindingEntry#DuplicateAddressBindingEntry_SOURCE_USER_DEFINED + // * DuplicateAddressBindingEntry#DuplicateAddressBindingEntry_SOURCE_ARP_SNOOPING + // * DuplicateAddressBindingEntry#DuplicateAddressBindingEntry_SOURCE_DHCP_SNOOPING + // * DuplicateAddressBindingEntry#DuplicateAddressBindingEntry_SOURCE_VM_TOOLS + // * DuplicateAddressBindingEntry#DuplicateAddressBindingEntry_SOURCE_ND_SNOOPING + // * DuplicateAddressBindingEntry#DuplicateAddressBindingEntry_SOURCE_DHCPV6_SNOOPING + // * DuplicateAddressBindingEntry#DuplicateAddressBindingEntry_SOURCE_VM_TOOLS_V6 + // + // Source from which the address binding entry was obtained + Source *string + // Provides the ID of the port on which the same address bidning exists + ConflictingPort *string +} + +const DuplicateAddressBindingEntry_SOURCE_INVALID = "INVALID" +const DuplicateAddressBindingEntry_SOURCE_UNKNOWN = "UNKNOWN" +const DuplicateAddressBindingEntry_SOURCE_USER_DEFINED = "USER_DEFINED" +const DuplicateAddressBindingEntry_SOURCE_ARP_SNOOPING = "ARP_SNOOPING" +const DuplicateAddressBindingEntry_SOURCE_DHCP_SNOOPING = "DHCP_SNOOPING" +const DuplicateAddressBindingEntry_SOURCE_VM_TOOLS = "VM_TOOLS" +const DuplicateAddressBindingEntry_SOURCE_ND_SNOOPING = "ND_SNOOPING" +const DuplicateAddressBindingEntry_SOURCE_DHCPV6_SNOOPING = "DHCPV6_SNOOPING" +const DuplicateAddressBindingEntry_SOURCE_VM_TOOLS_V6 = "VM_TOOLS_V6" + +func (s *DuplicateAddressBindingEntry) GetType__() bindings.BindingType { + return DuplicateAddressBindingEntryBindingType() +} + +func (s *DuplicateAddressBindingEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DuplicateAddressBindingEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Duplicate IP detection and control +type DuplicateIPDetection struct { + // Indicates whether duplicate IP detection should be enabled + DuplicateIpDetectionEnabled *bool +} + +func (s *DuplicateIPDetection) GetType__() bindings.BindingType { + return DuplicateIPDetectionBindingType() +} + +func (s *DuplicateIPDetection) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DuplicateIPDetection._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type DynamicContentFilters struct { + // These filter values will be set by the remote node like the NSX Intelligence Platform for instance. We would not need to know or act on these dynamic content filters, except for passing them on as request parameters along with the support bundle collection API. + DynamicContentFilters []string +} + +func (s *DynamicContentFilters) GetType__() bindings.BindingType { + return DynamicContentFiltersBindingType() +} + +func (s *DynamicContentFilters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for DynamicContentFilters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Indicate the status of End User License Agreement acceptance +type EULAAcceptance struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Acceptance status of End User License Agreement + Acceptance *bool +} + +func (s *EULAAcceptance) GetType__() bindings.BindingType { + return EULAAcceptanceBindingType() +} + +func (s *EULAAcceptance) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EULAAcceptance._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// End User License Agreement content +type EULAContent struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Content of End User License Agreement + Content *string +} + +func (s *EULAContent) GetType__() bindings.BindingType { + return EULAContentBindingType() +} + +func (s *EULAContent) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EULAContent._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type EdgeCluster struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Set of allocation rules and respected action for auto placement of logical router, DHCP and MDProxy on edge cluster members. + AllocationRules []AllocationRule + // Edge cluster profile bindings + ClusterProfileBindings []ClusterProfileTypeIdEntry + // Possible values are: + // + // * EdgeCluster#EdgeCluster_DEPLOYMENT_TYPE_VIRTUAL_MACHINE + // * EdgeCluster#EdgeCluster_DEPLOYMENT_TYPE_PHYSICAL_MACHINE + // * EdgeCluster#EdgeCluster_DEPLOYMENT_TYPE_UNKNOWN + // + // This field is a readonly field which shows the deployment_type of members. It returns UNKNOWN if there are no members, and returns VIRTUAL_MACHINE| PHYSICAL_MACHINE if all edge members are VIRTUAL_MACHINE|PHYSICAL_MACHINE. It returns HYBRID if the cluster contains edge members of both types VIRTUAL_MACHINE and PHYSICAL_MACHINE. + DeploymentType *string + // Flag should be only use in federation for inter site l2 and l3 forwarding. Before enabling this flag, all the edge cluster members must have remote tunnel endpoint configured. TIER0/TIER1 logical routers managed by GM must be associated with edge cluster which has inter-site forwarding enabled. + EnableInterSiteForwarding *bool + // Possible values are: + // + // * EdgeCluster#EdgeCluster_MEMBER_NODE_TYPE_EDGE_NODE + // * EdgeCluster#EdgeCluster_MEMBER_NODE_TYPE_PUBLIC_CLOUD_GATEWAY_NODE + // * EdgeCluster#EdgeCluster_MEMBER_NODE_TYPE_UNKNOWN + // + // Edge cluster is homogenous collection of transport nodes. Hence all transport nodes of the cluster must be of same type. This readonly field shows the type of transport nodes. + MemberNodeType *string + // EdgeCluster only supports homogeneous members. These member should be backed by either EdgeNode or PublicCloudGatewayNode. TransportNode type of these nodes should be the same. DeploymentType (VIRTUAL_MACHINE|PHYSICAL_MACHINE) of these EdgeNodes is recommended to be the same. EdgeCluster supports members of different deployment types. + Members []EdgeClusterMember + // List of remote tunnel endpoint ipaddress configured on edge cluster for each transport node. + NodeRtepIps []NodeRtepIpsConfig +} + +const EdgeCluster_DEPLOYMENT_TYPE_VIRTUAL_MACHINE = "VIRTUAL_MACHINE" +const EdgeCluster_DEPLOYMENT_TYPE_PHYSICAL_MACHINE = "PHYSICAL_MACHINE" +const EdgeCluster_DEPLOYMENT_TYPE_UNKNOWN = "UNKNOWN" +const EdgeCluster_MEMBER_NODE_TYPE_EDGE_NODE = "EDGE_NODE" +const EdgeCluster_MEMBER_NODE_TYPE_PUBLIC_CLOUD_GATEWAY_NODE = "PUBLIC_CLOUD_GATEWAY_NODE" +const EdgeCluster_MEMBER_NODE_TYPE_UNKNOWN = "UNKNOWN" + +func (s *EdgeCluster) GetType__() bindings.BindingType { + return EdgeClusterBindingType() +} + +func (s *EdgeCluster) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeCluster._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Allocation details of cluster and its members. Contains information of the edge nodes present in cluster, active and standby services of each node, utilization details of configured sub-pools. These allocation details can be monitored by customers to trigger migration of certain service contexts to different edge nodes, to balance the utilization of edge node resources. +type EdgeClusterAllocationStatus struct { + // Display name of the edge cluster + DisplayName *string + // System allotted UUID of edge cluster. + Id *string + // Represents the number of edge nodes in the cluster. format: int32 + MemberCount *int64 + // Allocation details of edge nodes present in the cluster. + Members []EdgeMemberAllocationStatus +} + +func (s *EdgeClusterAllocationStatus) GetType__() bindings.BindingType { + return EdgeClusterAllocationStatusBindingType() +} + +func (s *EdgeClusterAllocationStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeClusterAllocationStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type EdgeClusterInterSiteStatus struct { + // Id of the edge cluster whose status is being reported. + EdgeClusterId *string + // Name of the edge cluster whose status is being reported. + EdgeClusterName *string + // Timestamp when the edge cluster inter-site status was last updated. format: int64 + LastUpdateTimestamp *int64 + // Per edge node inter-site status. + MemberStatus []EdgeClusterMemberInterSiteStatus + // Possible values are: + // + // * EdgeClusterInterSiteStatus#EdgeClusterInterSiteStatus_OVERALL_STATUS_UP + // * EdgeClusterInterSiteStatus#EdgeClusterInterSiteStatus_OVERALL_STATUS_DOWN + // * EdgeClusterInterSiteStatus#EdgeClusterInterSiteStatus_OVERALL_STATUS_DEGRADED + // * EdgeClusterInterSiteStatus#EdgeClusterInterSiteStatus_OVERALL_STATUS_UNKNOWN + // * EdgeClusterInterSiteStatus#EdgeClusterInterSiteStatus_OVERALL_STATUS_CONFIGURED + // + // Overall status of all edge nodes IBGP status in the edge cluster. + OverallStatus *string +} + +const EdgeClusterInterSiteStatus_OVERALL_STATUS_UP = "UP" +const EdgeClusterInterSiteStatus_OVERALL_STATUS_DOWN = "DOWN" +const EdgeClusterInterSiteStatus_OVERALL_STATUS_DEGRADED = "DEGRADED" +const EdgeClusterInterSiteStatus_OVERALL_STATUS_UNKNOWN = "UNKNOWN" +const EdgeClusterInterSiteStatus_OVERALL_STATUS_CONFIGURED = "CONFIGURED" + +func (s *EdgeClusterInterSiteStatus) GetType__() bindings.BindingType { + return EdgeClusterInterSiteStatusBindingType() +} + +func (s *EdgeClusterInterSiteStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeClusterInterSiteStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type EdgeClusterListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Edge cluster list results + Results []EdgeCluster +} + +func (s *EdgeClusterListResult) GetType__() bindings.BindingType { + return EdgeClusterListResultBindingType() +} + +func (s *EdgeClusterListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeClusterListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type EdgeClusterMember struct { + // description of edge cluster member + Description *string + // display name of edge cluster member + DisplayName *string + // System generated index for cluster member format: int32 + MemberIndex *int64 + // Identifier of the transport node backed by an Edge node + TransportNodeId *string +} + +func (s *EdgeClusterMember) GetType__() bindings.BindingType { + return EdgeClusterMemberBindingType() +} + +func (s *EdgeClusterMember) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeClusterMember._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type EdgeClusterMemberAllocationPool struct { + // Possible values are: + // + // * EdgeClusterMemberAllocationPool#EdgeClusterMemberAllocationPool_ALLOCATION_POOL_TYPE_LOADBALANCERALLOCATIONPOOL + // + // Types of logical router allocation pool based on services + AllocationPoolType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const EdgeClusterMemberAllocationPool__TYPE_IDENTIFIER = "EdgeClusterMemberAllocationPool" +const EdgeClusterMemberAllocationPool_ALLOCATION_POOL_TYPE_LOADBALANCERALLOCATIONPOOL = "LoadBalancerAllocationPool" + +func (s *EdgeClusterMemberAllocationPool) GetType__() bindings.BindingType { + return EdgeClusterMemberAllocationPoolBindingType() +} + +func (s *EdgeClusterMemberAllocationPool) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeClusterMemberAllocationPool._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type EdgeClusterMemberAllocationProfile struct { + AllocationPool *data.StructValue + // Possible values are: + // + // * EdgeClusterMemberAllocationProfile#EdgeClusterMemberAllocationProfile_ALLOCATION_TYPE_MANUAL + // * EdgeClusterMemberAllocationProfile#EdgeClusterMemberAllocationProfile_ALLOCATION_TYPE_AUTO + // + // Allocation type is used to specify the mode used to allocate the LR. This is populated only for TIER1 logical router and for TIER0 this will be null. + AllocationType *string + // Flag to enable the auto-relocation of standby service router running on edge cluster and node associated with the logical router. Only dynamically allocated tier1 logical routers are considered for the relocation. + EnableStandbyRelocation *bool +} + +const EdgeClusterMemberAllocationProfile_ALLOCATION_TYPE_MANUAL = "MANUAL" +const EdgeClusterMemberAllocationProfile_ALLOCATION_TYPE_AUTO = "AUTO" + +func (s *EdgeClusterMemberAllocationProfile) GetType__() bindings.BindingType { + return EdgeClusterMemberAllocationProfileBindingType() +} + +func (s *EdgeClusterMemberAllocationProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeClusterMemberAllocationProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type EdgeClusterMemberInterSiteStatus struct { + // Total number of current established inter-site IBGP sessions. format: int64 + EstablishedBgpSessions *int64 + // Inter-site BGP neighbor status. + NeighborStatus []BgpNeighborStatusLiteDto + // Possible values are: + // + // * EdgeClusterMemberInterSiteStatus#EdgeClusterMemberInterSiteStatus_STATUS_UP + // * EdgeClusterMemberInterSiteStatus#EdgeClusterMemberInterSiteStatus_STATUS_DOWN + // * EdgeClusterMemberInterSiteStatus#EdgeClusterMemberInterSiteStatus_STATUS_DEGRADED + // * EdgeClusterMemberInterSiteStatus#EdgeClusterMemberInterSiteStatus_STATUS_UNKNOWN + // + // Edge node IBGP status + Status *string + // Total number of inter-site IBGP sessions. format: int64 + TotalBgpSessions *int64 + TransportNode *ResourceReference +} + +const EdgeClusterMemberInterSiteStatus_STATUS_UP = "UP" +const EdgeClusterMemberInterSiteStatus_STATUS_DOWN = "DOWN" +const EdgeClusterMemberInterSiteStatus_STATUS_DEGRADED = "DEGRADED" +const EdgeClusterMemberInterSiteStatus_STATUS_UNKNOWN = "UNKNOWN" + +func (s *EdgeClusterMemberInterSiteStatus) GetType__() bindings.BindingType { + return EdgeClusterMemberInterSiteStatusBindingType() +} + +func (s *EdgeClusterMemberInterSiteStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeClusterMemberInterSiteStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type EdgeClusterMemberStatus struct { + // Possible values are: + // + // * EdgeClusterMemberStatus#EdgeClusterMemberStatus_STATUS_UP + // * EdgeClusterMemberStatus#EdgeClusterMemberStatus_STATUS_DOWN + // * EdgeClusterMemberStatus#EdgeClusterMemberStatus_STATUS_ADMIN_DOWN + // * EdgeClusterMemberStatus#EdgeClusterMemberStatus_STATUS_PARTIALLY_DISCONNECTED + // * EdgeClusterMemberStatus#EdgeClusterMemberStatus_STATUS_UNKNOWN + // + // Status of an edge node + Status *string + TransportNode *ResourceReference +} + +const EdgeClusterMemberStatus_STATUS_UP = "UP" +const EdgeClusterMemberStatus_STATUS_DOWN = "DOWN" +const EdgeClusterMemberStatus_STATUS_ADMIN_DOWN = "ADMIN_DOWN" +const EdgeClusterMemberStatus_STATUS_PARTIALLY_DISCONNECTED = "PARTIALLY_DISCONNECTED" +const EdgeClusterMemberStatus_STATUS_UNKNOWN = "UNKNOWN" + +func (s *EdgeClusterMemberStatus) GetType__() bindings.BindingType { + return EdgeClusterMemberStatusBindingType() +} + +func (s *EdgeClusterMemberStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeClusterMemberStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type EdgeClusterMemberTransportNode struct { + // System generated index for cluster member format: int32 + MemberIndex *int64 + // Identifier of the transport node backed by an Edge node + TransportNodeId *string +} + +func (s *EdgeClusterMemberTransportNode) GetType__() bindings.BindingType { + return EdgeClusterMemberTransportNodeBindingType() +} + +func (s *EdgeClusterMemberTransportNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeClusterMemberTransportNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This holds the state of Edge Cluster. If there are errors in realizing EC outside of MP, it gives details of the components and specific errors. +type EdgeClusterState struct { + // Array of configuration state of various sub systems + Details []ConfigurationStateElement + // Error code format: int64 + FailureCode *int64 + // Error message in case of failure + FailureMessage *string + // Possible values are: + // + // * EdgeClusterState#EdgeClusterState_STATE_PENDING + // * EdgeClusterState#EdgeClusterState_STATE_IN_PROGRESS + // * EdgeClusterState#EdgeClusterState_STATE_SUCCESS + // * EdgeClusterState#EdgeClusterState_STATE_FAILED + // * EdgeClusterState#EdgeClusterState_STATE_PARTIAL_SUCCESS + // * EdgeClusterState#EdgeClusterState_STATE_ORPHANED + // * EdgeClusterState#EdgeClusterState_STATE_UNKNOWN + // * EdgeClusterState#EdgeClusterState_STATE_ERROR + // * EdgeClusterState#EdgeClusterState_STATE_IN_SYNC + // * EdgeClusterState#EdgeClusterState_STATE_NOT_AVAILABLE + // * EdgeClusterState#EdgeClusterState_STATE_VM_DEPLOYMENT_QUEUED + // * EdgeClusterState#EdgeClusterState_STATE_VM_DEPLOYMENT_IN_PROGRESS + // * EdgeClusterState#EdgeClusterState_STATE_VM_DEPLOYMENT_FAILED + // * EdgeClusterState#EdgeClusterState_STATE_VM_POWER_ON_IN_PROGRESS + // * EdgeClusterState#EdgeClusterState_STATE_VM_POWER_ON_FAILED + // * EdgeClusterState#EdgeClusterState_STATE_REGISTRATION_PENDING + // * EdgeClusterState#EdgeClusterState_STATE_NODE_NOT_READY + // * EdgeClusterState#EdgeClusterState_STATE_NODE_READY + // * EdgeClusterState#EdgeClusterState_STATE_VM_POWER_OFF_IN_PROGRESS + // * EdgeClusterState#EdgeClusterState_STATE_VM_POWER_OFF_FAILED + // * EdgeClusterState#EdgeClusterState_STATE_VM_UNDEPLOY_IN_PROGRESS + // * EdgeClusterState#EdgeClusterState_STATE_VM_UNDEPLOY_FAILED + // * EdgeClusterState#EdgeClusterState_STATE_VM_UNDEPLOY_SUCCESSFUL + // * EdgeClusterState#EdgeClusterState_STATE_EDGE_CONFIG_ERROR + // * EdgeClusterState#EdgeClusterState_STATE_VM_DEPLOYMENT_RESTARTED + // * EdgeClusterState#EdgeClusterState_STATE_REGISTRATION_FAILED + // * EdgeClusterState#EdgeClusterState_STATE_TRANSPORT_NODE_SYNC_PENDING + // * EdgeClusterState#EdgeClusterState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING + // * EdgeClusterState#EdgeClusterState_STATE_EDGE_HARDWARE_NOT_SUPPORTED + // * EdgeClusterState#EdgeClusterState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED + // * EdgeClusterState#EdgeClusterState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER + // * EdgeClusterState#EdgeClusterState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED + // * EdgeClusterState#EdgeClusterState_STATE_NO_PNIC_PREPARED_IN_EDGE + // * EdgeClusterState#EdgeClusterState_STATE_APPLIANCE_INTERNAL_ERROR + // * EdgeClusterState#EdgeClusterState_STATE_VTEP_DHCP_NOT_SUPPORTED + // * EdgeClusterState#EdgeClusterState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE + // * EdgeClusterState#EdgeClusterState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED + // * EdgeClusterState#EdgeClusterState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND + // * EdgeClusterState#EdgeClusterState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED + // * EdgeClusterState#EdgeClusterState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY + // * EdgeClusterState#EdgeClusterState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM + // * EdgeClusterState#EdgeClusterState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM + // * EdgeClusterState#EdgeClusterState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM + // * EdgeClusterState#EdgeClusterState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE + // * EdgeClusterState#EdgeClusterState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE + // * EdgeClusterState#EdgeClusterState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED + // * EdgeClusterState#EdgeClusterState_STATE_NO_PNIC_SPECIFIED_IN_TN + // * EdgeClusterState#EdgeClusterState_STATE_INVALID_PNIC_DEVICE_NAME + // * EdgeClusterState#EdgeClusterState_STATE_TRANSPORT_NODE_READY + // * EdgeClusterState#EdgeClusterState_STATE_VM_NETWORK_EDIT_PENDING + // * EdgeClusterState#EdgeClusterState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY + // * EdgeClusterState#EdgeClusterState_STATE_MPA_DISCONNECTED + // * EdgeClusterState#EdgeClusterState_STATE_VM_RENAME_PENDING + // * EdgeClusterState#EdgeClusterState_STATE_VM_CONFIG_EDIT_PENDING + // * EdgeClusterState#EdgeClusterState_STATE_VM_NETWORK_EDIT_FAILED + // * EdgeClusterState#EdgeClusterState_STATE_VM_RENAME_FAILED + // * EdgeClusterState#EdgeClusterState_STATE_VM_CONFIG_EDIT_FAILED + // * EdgeClusterState#EdgeClusterState_STATE_VM_CONFIG_DISCREPANCY + // * EdgeClusterState#EdgeClusterState_STATE_VM_NODE_REFRESH_FAILED + // * EdgeClusterState#EdgeClusterState_STATE_VM_PLACEMENT_REFRESH_FAILED + // * EdgeClusterState#EdgeClusterState_STATE_REGISTRATION_TIMEDOUT + // * EdgeClusterState#EdgeClusterState_STATE_REPLACE_FAILED + // * EdgeClusterState#EdgeClusterState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED + // * EdgeClusterState#EdgeClusterState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING + // * EdgeClusterState#EdgeClusterState_STATE_DELETE_VM_IN_REDEPLOY_FAILED + // * EdgeClusterState#EdgeClusterState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED + // * EdgeClusterState#EdgeClusterState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE + // * EdgeClusterState#EdgeClusterState_STATE_VM_RESOURCE_RESERVATION_FAILED + // * EdgeClusterState#EdgeClusterState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER + // * EdgeClusterState#EdgeClusterState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING + // * EdgeClusterState#EdgeClusterState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE + // * EdgeClusterState#EdgeClusterState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE + // * EdgeClusterState#EdgeClusterState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE + // * EdgeClusterState#EdgeClusterState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE + // * EdgeClusterState#EdgeClusterState_STATE_COMPUTE_MANAGER_NOT_FOUND + // * EdgeClusterState#EdgeClusterState_STATE_DELETE_IN_PROGRESS + // + // Gives details of state of desired configuration. Additional enums with more details on progress/success/error states are sent for edge node. The success states are NODE_READY and TRANSPORT_NODE_READY, pending states are {VM_DEPLOYMENT_QUEUED, VM_DEPLOYMENT_IN_PROGRESS, REGISTRATION_PENDING} and other values indicate failures. \"in_sync\" state indicates that the desired configuration has been received by the host to which it applies, but is not yet in effect. When the configuration is actually in effect, the state will change to \"success\". Please note, failed state is deprecated. + State *string + // Request identifier of the API which modified the entity. + PendingChangeList []string +} + +const EdgeClusterState_STATE_PENDING = "pending" +const EdgeClusterState_STATE_IN_PROGRESS = "in_progress" +const EdgeClusterState_STATE_SUCCESS = "success" +const EdgeClusterState_STATE_FAILED = "failed" +const EdgeClusterState_STATE_PARTIAL_SUCCESS = "partial_success" +const EdgeClusterState_STATE_ORPHANED = "orphaned" +const EdgeClusterState_STATE_UNKNOWN = "unknown" +const EdgeClusterState_STATE_ERROR = "error" +const EdgeClusterState_STATE_IN_SYNC = "in_sync" +const EdgeClusterState_STATE_NOT_AVAILABLE = "NOT_AVAILABLE" +const EdgeClusterState_STATE_VM_DEPLOYMENT_QUEUED = "VM_DEPLOYMENT_QUEUED" +const EdgeClusterState_STATE_VM_DEPLOYMENT_IN_PROGRESS = "VM_DEPLOYMENT_IN_PROGRESS" +const EdgeClusterState_STATE_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const EdgeClusterState_STATE_VM_POWER_ON_IN_PROGRESS = "VM_POWER_ON_IN_PROGRESS" +const EdgeClusterState_STATE_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const EdgeClusterState_STATE_REGISTRATION_PENDING = "REGISTRATION_PENDING" +const EdgeClusterState_STATE_NODE_NOT_READY = "NODE_NOT_READY" +const EdgeClusterState_STATE_NODE_READY = "NODE_READY" +const EdgeClusterState_STATE_VM_POWER_OFF_IN_PROGRESS = "VM_POWER_OFF_IN_PROGRESS" +const EdgeClusterState_STATE_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const EdgeClusterState_STATE_VM_UNDEPLOY_IN_PROGRESS = "VM_UNDEPLOY_IN_PROGRESS" +const EdgeClusterState_STATE_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const EdgeClusterState_STATE_VM_UNDEPLOY_SUCCESSFUL = "VM_UNDEPLOY_SUCCESSFUL" +const EdgeClusterState_STATE_EDGE_CONFIG_ERROR = "EDGE_CONFIG_ERROR" +const EdgeClusterState_STATE_VM_DEPLOYMENT_RESTARTED = "VM_DEPLOYMENT_RESTARTED" +const EdgeClusterState_STATE_REGISTRATION_FAILED = "REGISTRATION_FAILED" +const EdgeClusterState_STATE_TRANSPORT_NODE_SYNC_PENDING = "TRANSPORT_NODE_SYNC_PENDING" +const EdgeClusterState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING = "TRANSPORT_NODE_CONFIGURATION_MISSING" +const EdgeClusterState_STATE_EDGE_HARDWARE_NOT_SUPPORTED = "EDGE_HARDWARE_NOT_SUPPORTED" +const EdgeClusterState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED = "MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED" +const EdgeClusterState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER = "TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER" +const EdgeClusterState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED = "TZ_ENDPOINTS_NOT_SPECIFIED" +const EdgeClusterState_STATE_NO_PNIC_PREPARED_IN_EDGE = "NO_PNIC_PREPARED_IN_EDGE" +const EdgeClusterState_STATE_APPLIANCE_INTERNAL_ERROR = "APPLIANCE_INTERNAL_ERROR" +const EdgeClusterState_STATE_VTEP_DHCP_NOT_SUPPORTED = "VTEP_DHCP_NOT_SUPPORTED" +const EdgeClusterState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE = "UNSUPPORTED_HOST_SWITCH_PROFILE" +const EdgeClusterState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED = "UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED" +const EdgeClusterState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND = "HOSTSWITCH_PROFILE_NOT_FOUND" +const EdgeClusterState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED = "LLDP_SEND_ENABLED_NOT_SUPPORTED" +const EdgeClusterState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY = "UNSUPPORTED_NAMED_TEAMING_POLICY" +const EdgeClusterState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM = "LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM" +const EdgeClusterState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM = "LACP_NOT_SUPPORTED_FOR_EDGE_VM" +const EdgeClusterState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM = "STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM" +const EdgeClusterState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE = "MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE" +const EdgeClusterState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE = "UNSUPPORTED_LACP_LB_ALGO_FOR_NODE" +const EdgeClusterState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED = "EDGE_NODE_VERSION_NOT_SUPPORTED" +const EdgeClusterState_STATE_NO_PNIC_SPECIFIED_IN_TN = "NO_PNIC_SPECIFIED_IN_TN" +const EdgeClusterState_STATE_INVALID_PNIC_DEVICE_NAME = "INVALID_PNIC_DEVICE_NAME" +const EdgeClusterState_STATE_TRANSPORT_NODE_READY = "TRANSPORT_NODE_READY" +const EdgeClusterState_STATE_VM_NETWORK_EDIT_PENDING = "VM_NETWORK_EDIT_PENDING" +const EdgeClusterState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY = "UNSUPPORTED_DEFAULT_TEAMING_POLICY" +const EdgeClusterState_STATE_MPA_DISCONNECTED = "MPA_DISCONNECTED" +const EdgeClusterState_STATE_VM_RENAME_PENDING = "VM_RENAME_PENDING" +const EdgeClusterState_STATE_VM_CONFIG_EDIT_PENDING = "VM_CONFIG_EDIT_PENDING" +const EdgeClusterState_STATE_VM_NETWORK_EDIT_FAILED = "VM_NETWORK_EDIT_FAILED" +const EdgeClusterState_STATE_VM_RENAME_FAILED = "VM_RENAME_FAILED" +const EdgeClusterState_STATE_VM_CONFIG_EDIT_FAILED = "VM_CONFIG_EDIT_FAILED" +const EdgeClusterState_STATE_VM_CONFIG_DISCREPANCY = "VM_CONFIG_DISCREPANCY" +const EdgeClusterState_STATE_VM_NODE_REFRESH_FAILED = "VM_NODE_REFRESH_FAILED" +const EdgeClusterState_STATE_VM_PLACEMENT_REFRESH_FAILED = "VM_PLACEMENT_REFRESH_FAILED" +const EdgeClusterState_STATE_REGISTRATION_TIMEDOUT = "REGISTRATION_TIMEDOUT" +const EdgeClusterState_STATE_REPLACE_FAILED = "REPLACE_FAILED" +const EdgeClusterState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED = "UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED" +const EdgeClusterState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING = "LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING" +const EdgeClusterState_STATE_DELETE_VM_IN_REDEPLOY_FAILED = "DELETE_VM_IN_REDEPLOY_FAILED" +const EdgeClusterState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED = "DEPLOY_VM_IN_REDEPLOY_FAILED" +const EdgeClusterState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE = "INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE" +const EdgeClusterState_STATE_VM_RESOURCE_RESERVATION_FAILED = "VM_RESOURCE_RESERVATION_FAILED" +const EdgeClusterState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER = "DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER" +const EdgeClusterState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING = "DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING" +const EdgeClusterState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE = "EDGE_NODE_SETTINGS_MISMATCH_RESOLVE" +const EdgeClusterState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE = "EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE" +const EdgeClusterState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE = "EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE" +const EdgeClusterState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE = "EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE" +const EdgeClusterState_STATE_COMPUTE_MANAGER_NOT_FOUND = "COMPUTE_MANAGER_NOT_FOUND" +const EdgeClusterState_STATE_DELETE_IN_PROGRESS = "DELETE_IN_PROGRESS" + +func (s *EdgeClusterState) GetType__() bindings.BindingType { + return EdgeClusterStateBindingType() +} + +func (s *EdgeClusterState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeClusterState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type EdgeClusterStatus struct { + // Id of the edge cluster whose status is being reported + EdgeClusterId *string + // Possible values are: + // + // * EdgeClusterStatus#EdgeClusterStatus_EDGE_CLUSTER_STATUS_UP + // * EdgeClusterStatus#EdgeClusterStatus_EDGE_CLUSTER_STATUS_DOWN + // * EdgeClusterStatus#EdgeClusterStatus_EDGE_CLUSTER_STATUS_DEGRADED + // * EdgeClusterStatus#EdgeClusterStatus_EDGE_CLUSTER_STATUS_UNKNOWN + // + // Status of an edge node + EdgeClusterStatus *string + // Timestamp when the cluster status was last updated format: int64 + LastUpdateTimestamp *int64 + // Per Edge Node Status + MemberStatus []EdgeClusterMemberStatus +} + +const EdgeClusterStatus_EDGE_CLUSTER_STATUS_UP = "UP" +const EdgeClusterStatus_EDGE_CLUSTER_STATUS_DOWN = "DOWN" +const EdgeClusterStatus_EDGE_CLUSTER_STATUS_DEGRADED = "DEGRADED" +const EdgeClusterStatus_EDGE_CLUSTER_STATUS_UNKNOWN = "UNKNOWN" + +func (s *EdgeClusterStatus) GetType__() bindings.BindingType { + return EdgeClusterStatusBindingType() +} + +func (s *EdgeClusterStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeClusterStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This contains fields that captures state of Trackable entities. Edge and VPN state entities extend this object. +type EdgeConfigurationState struct { + // Array of configuration state of various sub systems + Details []ConfigurationStateElement + // Error code format: int64 + FailureCode *int64 + // Error message in case of failure + FailureMessage *string + // Possible values are: + // + // * EdgeConfigurationState#EdgeConfigurationState_STATE_PENDING + // * EdgeConfigurationState#EdgeConfigurationState_STATE_IN_PROGRESS + // * EdgeConfigurationState#EdgeConfigurationState_STATE_SUCCESS + // * EdgeConfigurationState#EdgeConfigurationState_STATE_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_PARTIAL_SUCCESS + // * EdgeConfigurationState#EdgeConfigurationState_STATE_ORPHANED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_UNKNOWN + // * EdgeConfigurationState#EdgeConfigurationState_STATE_ERROR + // * EdgeConfigurationState#EdgeConfigurationState_STATE_IN_SYNC + // * EdgeConfigurationState#EdgeConfigurationState_STATE_NOT_AVAILABLE + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_DEPLOYMENT_QUEUED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_DEPLOYMENT_IN_PROGRESS + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_DEPLOYMENT_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_POWER_ON_IN_PROGRESS + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_POWER_ON_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_REGISTRATION_PENDING + // * EdgeConfigurationState#EdgeConfigurationState_STATE_NODE_NOT_READY + // * EdgeConfigurationState#EdgeConfigurationState_STATE_NODE_READY + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_POWER_OFF_IN_PROGRESS + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_POWER_OFF_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_UNDEPLOY_IN_PROGRESS + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_UNDEPLOY_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_UNDEPLOY_SUCCESSFUL + // * EdgeConfigurationState#EdgeConfigurationState_STATE_EDGE_CONFIG_ERROR + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_DEPLOYMENT_RESTARTED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_REGISTRATION_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_TRANSPORT_NODE_SYNC_PENDING + // * EdgeConfigurationState#EdgeConfigurationState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING + // * EdgeConfigurationState#EdgeConfigurationState_STATE_EDGE_HARDWARE_NOT_SUPPORTED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER + // * EdgeConfigurationState#EdgeConfigurationState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_NO_PNIC_PREPARED_IN_EDGE + // * EdgeConfigurationState#EdgeConfigurationState_STATE_APPLIANCE_INTERNAL_ERROR + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VTEP_DHCP_NOT_SUPPORTED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE + // * EdgeConfigurationState#EdgeConfigurationState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND + // * EdgeConfigurationState#EdgeConfigurationState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY + // * EdgeConfigurationState#EdgeConfigurationState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM + // * EdgeConfigurationState#EdgeConfigurationState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM + // * EdgeConfigurationState#EdgeConfigurationState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM + // * EdgeConfigurationState#EdgeConfigurationState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE + // * EdgeConfigurationState#EdgeConfigurationState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE + // * EdgeConfigurationState#EdgeConfigurationState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_NO_PNIC_SPECIFIED_IN_TN + // * EdgeConfigurationState#EdgeConfigurationState_STATE_INVALID_PNIC_DEVICE_NAME + // * EdgeConfigurationState#EdgeConfigurationState_STATE_TRANSPORT_NODE_READY + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_NETWORK_EDIT_PENDING + // * EdgeConfigurationState#EdgeConfigurationState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY + // * EdgeConfigurationState#EdgeConfigurationState_STATE_MPA_DISCONNECTED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_RENAME_PENDING + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_CONFIG_EDIT_PENDING + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_NETWORK_EDIT_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_RENAME_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_CONFIG_EDIT_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_CONFIG_DISCREPANCY + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_NODE_REFRESH_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_PLACEMENT_REFRESH_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_REGISTRATION_TIMEDOUT + // * EdgeConfigurationState#EdgeConfigurationState_STATE_REPLACE_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING + // * EdgeConfigurationState#EdgeConfigurationState_STATE_DELETE_VM_IN_REDEPLOY_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE + // * EdgeConfigurationState#EdgeConfigurationState_STATE_VM_RESOURCE_RESERVATION_FAILED + // * EdgeConfigurationState#EdgeConfigurationState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER + // * EdgeConfigurationState#EdgeConfigurationState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING + // * EdgeConfigurationState#EdgeConfigurationState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE + // * EdgeConfigurationState#EdgeConfigurationState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE + // * EdgeConfigurationState#EdgeConfigurationState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE + // * EdgeConfigurationState#EdgeConfigurationState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE + // * EdgeConfigurationState#EdgeConfigurationState_STATE_COMPUTE_MANAGER_NOT_FOUND + // * EdgeConfigurationState#EdgeConfigurationState_STATE_DELETE_IN_PROGRESS + // + // Gives details of state of desired configuration. Additional enums with more details on progress/success/error states are sent for edge node. The success states are NODE_READY and TRANSPORT_NODE_READY, pending states are {VM_DEPLOYMENT_QUEUED, VM_DEPLOYMENT_IN_PROGRESS, REGISTRATION_PENDING} and other values indicate failures. \"in_sync\" state indicates that the desired configuration has been received by the host to which it applies, but is not yet in effect. When the configuration is actually in effect, the state will change to \"success\". Please note, failed state is deprecated. + State *string + // Request identifier of the API which modified the entity. + PendingChangeList []string +} + +const EdgeConfigurationState_STATE_PENDING = "pending" +const EdgeConfigurationState_STATE_IN_PROGRESS = "in_progress" +const EdgeConfigurationState_STATE_SUCCESS = "success" +const EdgeConfigurationState_STATE_FAILED = "failed" +const EdgeConfigurationState_STATE_PARTIAL_SUCCESS = "partial_success" +const EdgeConfigurationState_STATE_ORPHANED = "orphaned" +const EdgeConfigurationState_STATE_UNKNOWN = "unknown" +const EdgeConfigurationState_STATE_ERROR = "error" +const EdgeConfigurationState_STATE_IN_SYNC = "in_sync" +const EdgeConfigurationState_STATE_NOT_AVAILABLE = "NOT_AVAILABLE" +const EdgeConfigurationState_STATE_VM_DEPLOYMENT_QUEUED = "VM_DEPLOYMENT_QUEUED" +const EdgeConfigurationState_STATE_VM_DEPLOYMENT_IN_PROGRESS = "VM_DEPLOYMENT_IN_PROGRESS" +const EdgeConfigurationState_STATE_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const EdgeConfigurationState_STATE_VM_POWER_ON_IN_PROGRESS = "VM_POWER_ON_IN_PROGRESS" +const EdgeConfigurationState_STATE_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const EdgeConfigurationState_STATE_REGISTRATION_PENDING = "REGISTRATION_PENDING" +const EdgeConfigurationState_STATE_NODE_NOT_READY = "NODE_NOT_READY" +const EdgeConfigurationState_STATE_NODE_READY = "NODE_READY" +const EdgeConfigurationState_STATE_VM_POWER_OFF_IN_PROGRESS = "VM_POWER_OFF_IN_PROGRESS" +const EdgeConfigurationState_STATE_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const EdgeConfigurationState_STATE_VM_UNDEPLOY_IN_PROGRESS = "VM_UNDEPLOY_IN_PROGRESS" +const EdgeConfigurationState_STATE_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const EdgeConfigurationState_STATE_VM_UNDEPLOY_SUCCESSFUL = "VM_UNDEPLOY_SUCCESSFUL" +const EdgeConfigurationState_STATE_EDGE_CONFIG_ERROR = "EDGE_CONFIG_ERROR" +const EdgeConfigurationState_STATE_VM_DEPLOYMENT_RESTARTED = "VM_DEPLOYMENT_RESTARTED" +const EdgeConfigurationState_STATE_REGISTRATION_FAILED = "REGISTRATION_FAILED" +const EdgeConfigurationState_STATE_TRANSPORT_NODE_SYNC_PENDING = "TRANSPORT_NODE_SYNC_PENDING" +const EdgeConfigurationState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING = "TRANSPORT_NODE_CONFIGURATION_MISSING" +const EdgeConfigurationState_STATE_EDGE_HARDWARE_NOT_SUPPORTED = "EDGE_HARDWARE_NOT_SUPPORTED" +const EdgeConfigurationState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED = "MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED" +const EdgeConfigurationState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER = "TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER" +const EdgeConfigurationState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED = "TZ_ENDPOINTS_NOT_SPECIFIED" +const EdgeConfigurationState_STATE_NO_PNIC_PREPARED_IN_EDGE = "NO_PNIC_PREPARED_IN_EDGE" +const EdgeConfigurationState_STATE_APPLIANCE_INTERNAL_ERROR = "APPLIANCE_INTERNAL_ERROR" +const EdgeConfigurationState_STATE_VTEP_DHCP_NOT_SUPPORTED = "VTEP_DHCP_NOT_SUPPORTED" +const EdgeConfigurationState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE = "UNSUPPORTED_HOST_SWITCH_PROFILE" +const EdgeConfigurationState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED = "UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED" +const EdgeConfigurationState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND = "HOSTSWITCH_PROFILE_NOT_FOUND" +const EdgeConfigurationState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED = "LLDP_SEND_ENABLED_NOT_SUPPORTED" +const EdgeConfigurationState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY = "UNSUPPORTED_NAMED_TEAMING_POLICY" +const EdgeConfigurationState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM = "LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM" +const EdgeConfigurationState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM = "LACP_NOT_SUPPORTED_FOR_EDGE_VM" +const EdgeConfigurationState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM = "STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM" +const EdgeConfigurationState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE = "MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE" +const EdgeConfigurationState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE = "UNSUPPORTED_LACP_LB_ALGO_FOR_NODE" +const EdgeConfigurationState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED = "EDGE_NODE_VERSION_NOT_SUPPORTED" +const EdgeConfigurationState_STATE_NO_PNIC_SPECIFIED_IN_TN = "NO_PNIC_SPECIFIED_IN_TN" +const EdgeConfigurationState_STATE_INVALID_PNIC_DEVICE_NAME = "INVALID_PNIC_DEVICE_NAME" +const EdgeConfigurationState_STATE_TRANSPORT_NODE_READY = "TRANSPORT_NODE_READY" +const EdgeConfigurationState_STATE_VM_NETWORK_EDIT_PENDING = "VM_NETWORK_EDIT_PENDING" +const EdgeConfigurationState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY = "UNSUPPORTED_DEFAULT_TEAMING_POLICY" +const EdgeConfigurationState_STATE_MPA_DISCONNECTED = "MPA_DISCONNECTED" +const EdgeConfigurationState_STATE_VM_RENAME_PENDING = "VM_RENAME_PENDING" +const EdgeConfigurationState_STATE_VM_CONFIG_EDIT_PENDING = "VM_CONFIG_EDIT_PENDING" +const EdgeConfigurationState_STATE_VM_NETWORK_EDIT_FAILED = "VM_NETWORK_EDIT_FAILED" +const EdgeConfigurationState_STATE_VM_RENAME_FAILED = "VM_RENAME_FAILED" +const EdgeConfigurationState_STATE_VM_CONFIG_EDIT_FAILED = "VM_CONFIG_EDIT_FAILED" +const EdgeConfigurationState_STATE_VM_CONFIG_DISCREPANCY = "VM_CONFIG_DISCREPANCY" +const EdgeConfigurationState_STATE_VM_NODE_REFRESH_FAILED = "VM_NODE_REFRESH_FAILED" +const EdgeConfigurationState_STATE_VM_PLACEMENT_REFRESH_FAILED = "VM_PLACEMENT_REFRESH_FAILED" +const EdgeConfigurationState_STATE_REGISTRATION_TIMEDOUT = "REGISTRATION_TIMEDOUT" +const EdgeConfigurationState_STATE_REPLACE_FAILED = "REPLACE_FAILED" +const EdgeConfigurationState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED = "UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED" +const EdgeConfigurationState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING = "LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING" +const EdgeConfigurationState_STATE_DELETE_VM_IN_REDEPLOY_FAILED = "DELETE_VM_IN_REDEPLOY_FAILED" +const EdgeConfigurationState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED = "DEPLOY_VM_IN_REDEPLOY_FAILED" +const EdgeConfigurationState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE = "INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE" +const EdgeConfigurationState_STATE_VM_RESOURCE_RESERVATION_FAILED = "VM_RESOURCE_RESERVATION_FAILED" +const EdgeConfigurationState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER = "DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER" +const EdgeConfigurationState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING = "DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING" +const EdgeConfigurationState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE = "EDGE_NODE_SETTINGS_MISMATCH_RESOLVE" +const EdgeConfigurationState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE = "EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE" +const EdgeConfigurationState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE = "EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE" +const EdgeConfigurationState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE = "EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE" +const EdgeConfigurationState_STATE_COMPUTE_MANAGER_NOT_FOUND = "COMPUTE_MANAGER_NOT_FOUND" +const EdgeConfigurationState_STATE_DELETE_IN_PROGRESS = "DELETE_IN_PROGRESS" + +func (s *EdgeConfigurationState) GetType__() bindings.BindingType { + return EdgeConfigurationStateBindingType() +} + +func (s *EdgeConfigurationState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeConfigurationState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Profile for BFD HA cluster setting +type EdgeHighAvailabilityProfile struct { + // BFD allowed hops format: int64 + BfdAllowedHops *int64 + // Number of times a packet is missed before BFD declares the neighbor down. format: int64 + BfdDeclareDeadMultiple *int64 + // the time interval (in millisec) between probe packets for heartbeat purpose format: int64 + BfdProbeInterval *int64 + StandbyRelocationConfig *StandbyRelocationConfig + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * ClusterProfile#ClusterProfile_RESOURCE_TYPE_EDGEHIGHAVAILABILITYPROFILE + // * ClusterProfile#ClusterProfile_RESOURCE_TYPE_BRIDGEHIGHAVAILABILITYCLUSTERPROFILE + // + // Supported cluster profiles. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const EdgeHighAvailabilityProfile__TYPE_IDENTIFIER = "EdgeHighAvailabilityProfile" + +func (s *EdgeHighAvailabilityProfile) GetType__() bindings.BindingType { + return EdgeHighAvailabilityProfileBindingType() +} + +func (s *EdgeHighAvailabilityProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeHighAvailabilityProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type EdgeMemberAllocationStatus struct { + // List of services allocated on the edge node. + AllocatedServices []AllocatedService + // Allocation details of pools defined on the edge node. + AllocationPools []AllocationPool + // System generated index for transport node backed by edge node. format: int32 + MemberIndex *int64 + // Display name of edge cluster member. Defaults to ID if not set. + NodeDisplayName *string + // System allotted UUID of edge node. + NodeId *string +} + +func (s *EdgeMemberAllocationStatus) GetType__() bindings.BindingType { + return EdgeMemberAllocationStatusBindingType() +} + +func (s *EdgeMemberAllocationStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeMemberAllocationStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type EdgeNode struct { + // List of logical router ids to which this edge node is allocated. + AllocationList []string + DeploymentConfig *EdgeNodeDeploymentConfig + // Possible values are: + // + // * EdgeNode#EdgeNode_DEPLOYMENT_TYPE_VIRTUAL_MACHINE + // * EdgeNode#EdgeNode_DEPLOYMENT_TYPE_PHYSICAL_MACHINE + // * EdgeNode#EdgeNode_DEPLOYMENT_TYPE_UNKNOWN + // + // Supported edge deployment type. + DeploymentType *string + NodeSettings *EdgeNodeSettings + // This field is deprecated. TransportNode field 'description' must be used instead. For EdgeNode and PublicCloudGatewayNode, this field is ignored if specified in request payload. + Description *string + // Discovered IP Addresses of the fabric node, version 4 or 6 format: ip + DiscoveredIpAddresses []string + // This field is deprecated. TransportNode field 'display_name' must be used instead. For HostNode, this field defaults to ID if not set. For EdgeNode and PublicCloudGatewayNode, this field is ignored if specified in request payload. + DisplayName *string + // ID of the Node maintained on the Node and used to recognize the Node + ExternalId *string + // Fully qualified domain name of the fabric node + Fqdn *string + // Unique identifier of this resource. + Id *string + // IP Addresses of the Node, version 4 or 6. This property is mandatory for all nodes except for automatic deployment of edge virtual machine node. For automatic deployment, the ip address from management_port_subnets property will be considered. format: ip + IpAddresses []string + // Fabric node type, for example 'HostNode', 'EdgeNode' or 'PublicCloudGatewayNode' + ResourceType string + // This field is deprecated. TransportNode field 'tags' must be used instead. For EdgeNode and PublicCloudGatewayNode, this field is ignored if specified in request payload. + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const EdgeNode__TYPE_IDENTIFIER = "EdgeNode" +const EdgeNode_DEPLOYMENT_TYPE_VIRTUAL_MACHINE = "VIRTUAL_MACHINE" +const EdgeNode_DEPLOYMENT_TYPE_PHYSICAL_MACHINE = "PHYSICAL_MACHINE" +const EdgeNode_DEPLOYMENT_TYPE_UNKNOWN = "UNKNOWN" + +func (s *EdgeNode) GetType__() bindings.BindingType { + return EdgeNodeBindingType() +} + +func (s *EdgeNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type EdgeNodeDeploymentConfig struct { + // Possible values are: + // + // * EdgeNodeDeploymentConfig#EdgeNodeDeploymentConfig_FORM_FACTOR_SMALL + // * EdgeNodeDeploymentConfig#EdgeNodeDeploymentConfig_FORM_FACTOR_MEDIUM + // * EdgeNodeDeploymentConfig#EdgeNodeDeploymentConfig_FORM_FACTOR_LARGE + // * EdgeNodeDeploymentConfig#EdgeNodeDeploymentConfig_FORM_FACTOR_XLARGE + // + // Supported edge form factor. + FormFactor *string + NodeUserSettings *NodeUserSettings + VmDeploymentConfig *data.StructValue +} + +const EdgeNodeDeploymentConfig_FORM_FACTOR_SMALL = "SMALL" +const EdgeNodeDeploymentConfig_FORM_FACTOR_MEDIUM = "MEDIUM" +const EdgeNodeDeploymentConfig_FORM_FACTOR_LARGE = "LARGE" +const EdgeNodeDeploymentConfig_FORM_FACTOR_XLARGE = "XLARGE" + +func (s *EdgeNodeDeploymentConfig) GetType__() bindings.BindingType { + return EdgeNodeDeploymentConfigBindingType() +} + +func (s *EdgeNodeDeploymentConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeNodeDeploymentConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The settings are used during deployment and consequent update of an edge, unless indicated otherwise. These settings are editable for manually deployed edge nodes as well. If using DHCP, you must leave the following fields unset: search_domains, management_port_subnets, dns_servers and default_gateway_addresses. EdgeNodeSettings reports current values configured on the edge node. If the settings lag with actual state on the edge, these may be refreshed at NSX Manager using API POST api/v1/transport-nodes /<transport-node-id>?action=refresh_node_configuration&resource_type= EdgeNode +type EdgeNodeSettings struct { + // Array of additional specific properties for advanced or cloud- specific deployments in key-value format. + AdvancedConfiguration []KeyValuePair + // Allowing root SSH logins is not recommended for security reasons. Edit of this property is not supported when updating transport node. Use the CLI to change this property. + AllowSshRootLogin *bool + // List of DNS servers. format: ip + DnsServers []string + // Enabling SSH service is not recommended for security reasons. + EnableSsh *bool + // Host name or FQDN for edge node. + Hostname *string + // List of NTP servers. format: hostname-or-ipv4 + NtpServers []string + // List of domain names that are used to complete unqualified host names. + SearchDomains []string + // List of Syslog server configuration. + SyslogServers []SyslogConfiguration +} + +func (s *EdgeNodeSettings) GetType__() bindings.BindingType { + return EdgeNodeSettingsBindingType() +} + +func (s *EdgeNodeSettings) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeNodeSettings._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Datapath memory pool usage value. +type EdgeTransportNodeDatapathMemoryPoolUsage struct { + // Description of the memory pool. + Description *string + // Name of the datapath memory pool as available on edge node CLI. + Name *string + // Percentage of memory pool in use. + Usage *float64 +} + +func (s *EdgeTransportNodeDatapathMemoryPoolUsage) GetType__() bindings.BindingType { + return EdgeTransportNodeDatapathMemoryPoolUsageBindingType() +} + +func (s *EdgeTransportNodeDatapathMemoryPoolUsage) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeTransportNodeDatapathMemoryPoolUsage._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Detailed view of the datapath memory usage. Details out the heap and per memory pool point in time usage. +type EdgeTransportNodeDatapathMemoryUsage struct { + // Percentage of heap memory in use. + DatapathHeapUsage *float64 + DatapathMemPoolsUsage []EdgeTransportNodeDatapathMemoryPoolUsage + // Highest percentage usage value among datapath memory pools. + HighestDatapathMemPoolUsage *float64 + HighestDatapathMemPoolUsageNames []string +} + +func (s *EdgeTransportNodeDatapathMemoryUsage) GetType__() bindings.BindingType { + return EdgeTransportNodeDatapathMemoryUsageBindingType() +} + +func (s *EdgeTransportNodeDatapathMemoryUsage) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeTransportNodeDatapathMemoryUsage._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Point in time usage of system, datapath, swap and cache memory in edge node. +type EdgeTransportNodeMemoryUsage struct { + // Percentage of RAM on the system that can be flushed out to disk. + CacheUsage *float64 + DatapathMemUsageDetails *EdgeTransportNodeDatapathMemoryUsage + // Percentage of memory in use by datapath processes which includes RES and hugepage memory. + DatapathTotalUsage *float64 + // Percentage of swap disk in use. + SwapUsage *float64 + // Percentage of RAM in use on edge node. + SystemMemUsage *float64 +} + +func (s *EdgeTransportNodeMemoryUsage) GetType__() bindings.BindingType { + return EdgeTransportNodeMemoryUsageBindingType() +} + +func (s *EdgeTransportNodeMemoryUsage) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeTransportNodeMemoryUsage._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Status of edge upgrade +type EdgeUpgradeStatus struct { + // This field indicates whether we can perform upgrade rollback. + CanRollback *bool + // Can the upgrade of the remaining units in this component be skipped + CanSkip *bool + // Component type for the upgrade status + ComponentType *string + CurrentVersionNodeSummary *NodeSummaryList + // Details about the upgrade status + Details *string + // Number of nodes of the type and at the component version format: int32 + NodeCountAtTargetVersion *int64 + // Indicator of upgrade progress in percentage + PercentComplete *float64 + PreUpgradeStatus *UpgradeChecksExecutionStatus + // Possible values are: + // + // * EdgeUpgradeStatus#EdgeUpgradeStatus_STATUS_SUCCESS + // * EdgeUpgradeStatus#EdgeUpgradeStatus_STATUS_FAILED + // * EdgeUpgradeStatus#EdgeUpgradeStatus_STATUS_IN_PROGRESS + // * EdgeUpgradeStatus#EdgeUpgradeStatus_STATUS_NOT_STARTED + // * EdgeUpgradeStatus#EdgeUpgradeStatus_STATUS_PAUSING + // * EdgeUpgradeStatus#EdgeUpgradeStatus_STATUS_PAUSED + // + // Upgrade status of component + Status *string + // Target component version + TargetComponentVersion *string +} + +const EdgeUpgradeStatus_STATUS_SUCCESS = "SUCCESS" +const EdgeUpgradeStatus_STATUS_FAILED = "FAILED" +const EdgeUpgradeStatus_STATUS_IN_PROGRESS = "IN_PROGRESS" +const EdgeUpgradeStatus_STATUS_NOT_STARTED = "NOT_STARTED" +const EdgeUpgradeStatus_STATUS_PAUSING = "PAUSING" +const EdgeUpgradeStatus_STATUS_PAUSED = "PAUSED" + +func (s *EdgeUpgradeStatus) GetType__() bindings.BindingType { + return EdgeUpgradeStatusBindingType() +} + +func (s *EdgeUpgradeStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EdgeUpgradeStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type EffectiveIPAddressMemberListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged Collection of effective ip addresses for the given NSGroup format: address-or-block-or-range + Results []string +} + +func (s *EffectiveIPAddressMemberListResult) GetType__() bindings.BindingType { + return EffectiveIPAddressMemberListResultBindingType() +} + +func (s *EffectiveIPAddressMemberListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EffectiveIPAddressMemberListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of effective ip address along with site id +type EffectiveIPInfo struct { + EffectiveIps []string + // Id of the site to which the effective IPs belong to + SiteId *string +} + +func (s *EffectiveIPInfo) GetType__() bindings.BindingType { + return EffectiveIPInfoBindingType() +} + +func (s *EffectiveIPInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EffectiveIPInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type EffectiveMemberResourceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged Collection of resources which are the effective members of an NSGroup. + Results []ResourceReference +} + +func (s *EffectiveMemberResourceListResult) GetType__() bindings.BindingType { + return EffectiveMemberResourceListResultBindingType() +} + +func (s *EffectiveMemberResourceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EffectiveMemberResourceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type EffectiveMemberTypeListResult struct { + // Count of the member types in the results array format: int64 + ResultCount *int64 + // Possible values are: + // + // * EffectiveMemberTypeListResult#EffectiveMemberTypeListResult_RESULTS_NSGROUP + // * EffectiveMemberTypeListResult#EffectiveMemberTypeListResult_RESULTS_IPSET + // * EffectiveMemberTypeListResult#EffectiveMemberTypeListResult_RESULTS_MACSET + // * EffectiveMemberTypeListResult#EffectiveMemberTypeListResult_RESULTS_LOGICALSWITCH + // * EffectiveMemberTypeListResult#EffectiveMemberTypeListResult_RESULTS_LOGICALPORT + // * EffectiveMemberTypeListResult#EffectiveMemberTypeListResult_RESULTS_VIRTUALMACHINE + // * EffectiveMemberTypeListResult#EffectiveMemberTypeListResult_RESULTS_DIRECTORYGROUP + // * EffectiveMemberTypeListResult#EffectiveMemberTypeListResult_RESULTS_VIRTUALNETWORKINTERFACE + // * EffectiveMemberTypeListResult#EffectiveMemberTypeListResult_RESULTS_TRANSPORTNODE + // * EffectiveMemberTypeListResult#EffectiveMemberTypeListResult_RESULTS_CLOUDNATIVESERVICEINSTANCE + // * EffectiveMemberTypeListResult#EffectiveMemberTypeListResult_RESULTS_PHYSICALSERVER + // * EffectiveMemberTypeListResult#EffectiveMemberTypeListResult_RESULTS_LOGICALROUTER + // * EffectiveMemberTypeListResult#EffectiveMemberTypeListResult_RESULTS_LOGICALROUTERPORT + // + // Collection of member types for the given NSGroup + Results []string +} + +const EffectiveMemberTypeListResult_RESULTS_NSGROUP = "NSGroup" +const EffectiveMemberTypeListResult_RESULTS_IPSET = "IPSet" +const EffectiveMemberTypeListResult_RESULTS_MACSET = "MACSet" +const EffectiveMemberTypeListResult_RESULTS_LOGICALSWITCH = "LogicalSwitch" +const EffectiveMemberTypeListResult_RESULTS_LOGICALPORT = "LogicalPort" +const EffectiveMemberTypeListResult_RESULTS_VIRTUALMACHINE = "VirtualMachine" +const EffectiveMemberTypeListResult_RESULTS_DIRECTORYGROUP = "DirectoryGroup" +const EffectiveMemberTypeListResult_RESULTS_VIRTUALNETWORKINTERFACE = "VirtualNetworkInterface" +const EffectiveMemberTypeListResult_RESULTS_TRANSPORTNODE = "TransportNode" +const EffectiveMemberTypeListResult_RESULTS_CLOUDNATIVESERVICEINSTANCE = "CloudNativeServiceInstance" +const EffectiveMemberTypeListResult_RESULTS_PHYSICALSERVER = "PhysicalServer" +const EffectiveMemberTypeListResult_RESULTS_LOGICALROUTER = "LogicalRouter" +const EffectiveMemberTypeListResult_RESULTS_LOGICALROUTERPORT = "LogicalRouterPort" + +func (s *EffectiveMemberTypeListResult) GetType__() bindings.BindingType { + return EffectiveMemberTypeListResultBindingType() +} + +func (s *EffectiveMemberTypeListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EffectiveMemberTypeListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type EffectiveProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged Collection of profiles which are applied to an Entity + Results []NSXProfileReference +} + +func (s *EffectiveProfileListResult) GetType__() bindings.BindingType { + return EffectiveProfileListResultBindingType() +} + +func (s *EffectiveProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EffectiveProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A shaper that specifies egress rate properties in Mb/s +type EgressRateShaper struct { + // Average bandwidth in Mb/s format: int32 + AverageBandwidthMbps *int64 + // Burst size in bytes format: int32 + BurstSizeBytes *int64 + // Peak bandwidth in Mb/s format: int32 + PeakBandwidthMbps *int64 + Enabled *bool + // Possible values are: + // + // * QosBaseRateShaper#QosBaseRateShaper_RESOURCE_TYPE_INGRESSRATESHAPER + // * QosBaseRateShaper#QosBaseRateShaper_RESOURCE_TYPE_INGRESSBROADCASTRATESHAPER + // * QosBaseRateShaper#QosBaseRateShaper_RESOURCE_TYPE_EGRESSRATESHAPER + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const EgressRateShaper__TYPE_IDENTIFIER = "EgressRateShaper" + +func (s *EgressRateShaper) GetType__() bindings.BindingType { + return EgressRateShaperBindingType() +} + +func (s *EgressRateShaper) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EgressRateShaper._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Base class for resources that are embedded in other resources +type EmbeddedResource struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + Owner *OwnerResourceLink + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Identifier of the resource + Id *string + // The type of this resource. + ResourceType *string +} + +func (s *EmbeddedResource) GetType__() bindings.BindingType { + return EmbeddedResourceBindingType() +} + +func (s *EmbeddedResource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EmbeddedResource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// An Endpoint object is part of HostSwitch configuration in TransportNode +type Endpoint struct { + // Gateway IP format: ip + DefaultGateway *string + // Name of the virtual tunnel endpoint + DeviceName *string + // Depending upon the EndpointIpConfig used in HostSwitch, IP could be allocated either from DHCP (default) or from Static IP Pool. format: ip + Ip *string + // Unique label for this Endpoint format: int32 + Label *int64 + // MAC address format: mac-address + Mac *string + // Subnet mask format: ip + SubnetMask *string +} + +func (s *Endpoint) GetType__() bindings.BindingType { + return EndpointBindingType() +} + +func (s *Endpoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Endpoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Error information +type ErrorInfo struct { + // Error code of the error. format: int32 + ErrorCode *int64 + // Error message + ErrorMessage *string + // Timestamp when the error occurred format: int64 + Timestamp *int64 +} + +func (s *ErrorInfo) GetType__() bindings.BindingType { + return ErrorInfoBindingType() +} + +func (s *ErrorInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ErrorInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Metadata related to a given error_id +type ErrorResolverInfo struct { + // The error id for which metadata information is needed format: int64 + ErrorId *int64 + // Indicates whether there is a resolver associated with the error or not + ResolverPresent *bool + UserMetadata *ErrorResolverUserMetadata +} + +func (s *ErrorResolverInfo) GetType__() bindings.BindingType { + return ErrorResolverInfoBindingType() +} + +func (s *ErrorResolverInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ErrorResolverInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Collection of all registered ErrorResolverInfo +type ErrorResolverInfoList struct { + // ErrorResolverInfo list + Results []ErrorResolverInfo +} + +func (s *ErrorResolverInfoList) GetType__() bindings.BindingType { + return ErrorResolverInfoListBindingType() +} + +func (s *ErrorResolverInfoList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ErrorResolverInfoList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Error along with its metadata +type ErrorResolverMetadata struct { + // The entity/node UUID where the error has occurred. + EntityId *string + // The error id as reported by the entity where the error occurred. format: int64 + ErrorId *int64 + SystemMetadata *ErrorResolverSystemMetadata + UserMetadata *ErrorResolverUserMetadata +} + +func (s *ErrorResolverMetadata) GetType__() bindings.BindingType { + return ErrorResolverMetadataBindingType() +} + +func (s *ErrorResolverMetadata) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ErrorResolverMetadata._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of errors with their metadata +type ErrorResolverMetadataList struct { + // List of errors with their corresponding metadata. + Errors []ErrorResolverMetadata +} + +func (s *ErrorResolverMetadataList) GetType__() bindings.BindingType { + return ErrorResolverMetadataListBindingType() +} + +func (s *ErrorResolverMetadataList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ErrorResolverMetadataList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Metadata fetched from an external system like Syslog or LogInsight. +type ErrorResolverSystemMetadata struct { + // The value fetched from another system + Value *string +} + +func (s *ErrorResolverSystemMetadata) GetType__() bindings.BindingType { + return ErrorResolverSystemMetadataBindingType() +} + +func (s *ErrorResolverSystemMetadata) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ErrorResolverSystemMetadata._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Corresponds to one property entered by the user +type ErrorResolverUserInputData struct { + // Possible values are: + // + // * ErrorResolverUserInputData#ErrorResolverUserInputData_DATA_TYPE_TEXT + // * ErrorResolverUserInputData#ErrorResolverUserInputData_DATA_TYPE_NUMBER + // * ErrorResolverUserInputData#ErrorResolverUserInputData_DATA_TYPE_PASSWORD + // + // The datatype of the given property. Useful for data validation + DataType *string + // Name of the property supplied by the user + PropertyName *string + // The value associated with the above property + PropertyValue *string +} + +const ErrorResolverUserInputData_DATA_TYPE_TEXT = "TEXT" +const ErrorResolverUserInputData_DATA_TYPE_NUMBER = "NUMBER" +const ErrorResolverUserInputData_DATA_TYPE_PASSWORD = "PASSWORD" + +func (s *ErrorResolverUserInputData) GetType__() bindings.BindingType { + return ErrorResolverUserInputDataBindingType() +} + +func (s *ErrorResolverUserInputData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ErrorResolverUserInputData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// User supplied metadata needed for resolving errors +type ErrorResolverUserMetadata struct { + // List of user supplied input data. + UserInputList []ErrorResolverUserInputData +} + +func (s *ErrorResolverUserMetadata) GetType__() bindings.BindingType { + return ErrorResolverUserMetadataBindingType() +} + +func (s *ErrorResolverUserMetadata) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ErrorResolverUserMetadata._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// ESX global opaque configuration +type EsxGlobalOpaqueConfig struct { + // A list of global opaque configuration for ESX hosts. + OpaqueConfig []KeyValuePair + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_SWITCHINGGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_ROUTINGGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_OPERATIONCOLLECTORGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FIREWALLGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_ESXGLOBALOPAQUECONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_SECURITYGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FIPSGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FEDERATIONGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_IDSGLOBALCONFIG + // + // Valid Global configuration types + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const EsxGlobalOpaqueConfig__TYPE_IDENTIFIER = "EsxGlobalOpaqueConfig" + +func (s *EsxGlobalOpaqueConfig) GetType__() bindings.BindingType { + return EsxGlobalOpaqueConfigBindingType() +} + +func (s *EsxGlobalOpaqueConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EsxGlobalOpaqueConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// An NSService element that represents an ethertype protocol +type EtherTypeNSService struct { + // Type of the encapsulated protocol format: int64 + EtherType *int64 + // Possible values are: + // + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_ETHERTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_IPPROTOCOLNSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_IGMPTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_ICMPTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_ALGTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_L4PORTSETNSSERVICE + // + // The specific type of NSServiceElement + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const EtherTypeNSService__TYPE_IDENTIFIER = "EtherTypeNSService" + +func (s *EtherTypeNSService) GetType__() bindings.BindingType { + return EtherTypeNSServiceBindingType() +} + +func (s *EtherTypeNSService) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EtherTypeNSService._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type EthernetHeader struct { + // The destination MAC address of form: \"^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$\". For example: 00:00:00:00:00:00. + DstMac *string + // This field defaults to IPv4. format: int64 + EthType *int64 + // The source MAC address of form: \"^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$\". For example: 00:00:00:00:00:00. + SrcMac *string +} + +func (s *EthernetHeader) GetType__() bindings.BindingType { + return EthernetHeaderBindingType() +} + +func (s *EthernetHeader) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EthernetHeader._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type EventListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of events defined + Results []MonitoringEvent +} + +func (s *EventListResult) GetType__() bindings.BindingType { + return EventListResultBindingType() +} + +func (s *EventListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for EventListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of entities where Distributed Firewall will not be enforced. Exclusion List can contain NSGroup(s) or LogicalPort(s) or LogicalSwitch(es) to exclude Distributed Firewall enforcement. +type ExcludeList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Total number of members present in Exclude List. format: int64 + MemberCount *int64 + // List of members in Exclusion List + Members []ResourceReference +} + +func (s *ExcludeList) GetType__() bindings.BindingType { + return ExcludeListBindingType() +} + +func (s *ExcludeList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ExcludeList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Extended Solution Config would contain Vendor specific information required for NXGI partner Service VM. +type ExtendedSolutionConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // List of attributes specific to a partner which needs to be passed to host. + Attributes []Attribute + // The service to which the solution config belongs. + ServiceId *string +} + +func (s *ExtendedSolutionConfig) GetType__() bindings.BindingType { + return ExtendedSolutionConfigBindingType() +} + +func (s *ExtendedSolutionConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ExtendedSolutionConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Extra config is intended for supporting vendor specific configuration on the data path, it can be set as key value string pairs on either logical switch or logical port. If it was set on logical switch, it will be inherited automatically by logical ports in it. Also logical port setting will override logical switch setting if specific key was dual set on both logical switch and logical port. +type ExtraConfig struct { + ConfigPair *UnboundedKeyValuePair +} + +func (s *ExtraConfig) GetType__() bindings.BindingType { + return ExtraConfigBindingType() +} + +func (s *ExtraConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ExtraConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Profile for extra configs in host switch +type ExtraConfigHostSwitchProfile struct { + // list of extra configs + ExtraConfigs []ExtraConfig + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * BaseHostSwitchProfile#BaseHostSwitchProfile_RESOURCE_TYPE_UPLINKHOSTSWITCHPROFILE + // * BaseHostSwitchProfile#BaseHostSwitchProfile_RESOURCE_TYPE_LLDPHOSTSWITCHPROFILE + // * BaseHostSwitchProfile#BaseHostSwitchProfile_RESOURCE_TYPE_NIOCPROFILE + // * BaseHostSwitchProfile#BaseHostSwitchProfile_RESOURCE_TYPE_EXTRACONFIGHOSTSWITCHPROFILE + // + // Supported HostSwitch profiles. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + RequiredCapabilities []string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ExtraConfigHostSwitchProfile__TYPE_IDENTIFIER = "ExtraConfigHostSwitchProfile" + +func (s *ExtraConfigHostSwitchProfile) GetType__() bindings.BindingType { + return ExtraConfigHostSwitchProfileBindingType() +} + +func (s *ExtraConfigHostSwitchProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ExtraConfigHostSwitchProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FailedNodeSupportBundleResult struct { + // Error code + ErrorCode *string + // Error message + ErrorMessage *string + // Display name of node + NodeDisplayName *string + // UUID of node + NodeId *string +} + +func (s *FailedNodeSupportBundleResult) GetType__() bindings.BindingType { + return FailedNodeSupportBundleResultBindingType() +} + +func (s *FailedNodeSupportBundleResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FailedNodeSupportBundleResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Failure Domain is engineered to be isolated from failures in other failure domains, and to provide inexpensive, low-latency network connectivity to other failure domains in the same region. We support failure domain only on edge transport node. Like you can consider one rack as one failure domain and place active-standby contexts like logical router, DHCP and MDProxy in two different failure domains (racks). So failure of a single rack (FD) does not impact any services and other rack (FD) will continue to handle traffic. Initially system creates one default failure domain. For any edge transport node, if failure domains is not given, it will be mapped to default system generated failure domain. You can't update preferred_active_edge_services flag for system generated default failure domain. It will be unset which means that failure domain can be used for both active and standby allocation. +type FailureDomain struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Set preference for edge transport node failure domain which will be considered while doing auto placement of logical router, DHCP and MDProxy on edge node. true: For preemptive failover mode, active edge cluster member allocation preferes this failure domain. false: For preemptive failover mode, standby edge cluster member allocation preferes this failure domain. Default will be unset. It means no explicit preference. + PreferredActiveEdgeServices *bool +} + +func (s *FailureDomain) GetType__() bindings.BindingType { + return FailureDomainBindingType() +} + +func (s *FailureDomain) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FailureDomain._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// It will have list of failure domains which also includes system generated failure domain. +type FailureDomainListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Array of all failure domains including system generated default failure domain + Results []FailureDomain +} + +func (s *FailureDomainListResult) GetType__() bindings.BindingType { + return FailureDomainListResultBindingType() +} + +func (s *FailureDomainListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FailureDomainListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Feature Permission +type FeaturePermission struct { + // Feature Id + Feature *string + // Feature Description + FeatureDescription *string + // Feature Name + FeatureName *string + // Is execute recommended + IsExecuteRecommended *bool + // Is internal + IsInternal *bool + // Possible values are: + // + // * FeaturePermission#FeaturePermission_PERMISSION_CRUD + // * FeaturePermission#FeaturePermission_PERMISSION_READ + // * FeaturePermission#FeaturePermission_PERMISSION_EXECUTE + // * FeaturePermission#FeaturePermission_PERMISSION_NONE + // + // Permission + Permission *string +} + +const FeaturePermission_PERMISSION_CRUD = "crud" +const FeaturePermission_PERMISSION_READ = "read" +const FeaturePermission_PERMISSION_EXECUTE = "execute" +const FeaturePermission_PERMISSION_NONE = "none" + +func (s *FeaturePermission) GetType__() bindings.BindingType { + return FeaturePermissionBindingType() +} + +func (s *FeaturePermission) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FeaturePermission._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FeaturePermissionArray struct { + // Array of FeaturePermission + FeaturePermissions []FeaturePermission +} + +func (s *FeaturePermissionArray) GetType__() bindings.BindingType { + return FeaturePermissionArrayBindingType() +} + +func (s *FeaturePermissionArray) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FeaturePermissionArray._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FeaturePermissionListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List results + Results []FeaturePermission +} + +func (s *FeaturePermissionListResult) GetType__() bindings.BindingType { + return FeaturePermissionListResultBindingType() +} + +func (s *FeaturePermissionListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FeaturePermissionListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents list of features required to view the widget. +type FeatureSet struct { + // List of features required for to view widget. + FeatureList []string + // Flag for specifying if permission to all features is required If set to false, then if there is permission for any of the feature from feature list, widget will be available. + RequireAllPermissions *bool +} + +func (s *FeatureSet) GetType__() bindings.BindingType { + return FeatureSetBindingType() +} + +func (s *FeatureSet) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FeatureSet._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// feature usage result item +type FeatureUsage struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Capacity Usage List + CapacityUsage []CapacityUsage + // name of the feature + Feature *string +} + +func (s *FeatureUsage) GetType__() bindings.BindingType { + return FeatureUsageBindingType() +} + +func (s *FeatureUsage) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FeatureUsage._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FeatureUsageCsvRecord struct { + // count of number of concurrent users format: int64 + CcuUsageCount *int64 + // Number of CPU cores used by this feature format: int64 + CoreUsageCount *int64 + // count of number of cpu sockets used by this feature format: int64 + CpuUsageCount *int64 + // name of the feature + Feature *string + // count of number of vcpus of public cloud VMs format: int64 + VcpuUsageCount *int64 + // count of number of vms used by this feature format: int64 + VmUsageCount *int64 +} + +func (s *FeatureUsageCsvRecord) GetType__() bindings.BindingType { + return FeatureUsageCsvRecordBindingType() +} + +func (s *FeatureUsageCsvRecord) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FeatureUsageCsvRecord._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// list of feature usage items +type FeatureUsageList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Feature Usage List + FeatureUsageInfo []FeatureUsage +} + +func (s *FeatureUsageList) GetType__() bindings.BindingType { + return FeatureUsageListBindingType() +} + +func (s *FeatureUsageList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FeatureUsageList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FeatureUsageListInCsvFormat struct { + // File name set by HTTP server if API returns CSV result as a file. + FileName *string + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + Results []FeatureUsageCsvRecord +} + +func (s *FeatureUsageListInCsvFormat) GetType__() bindings.BindingType { + return FeatureUsageListInCsvFormatBindingType() +} + +func (s *FeatureUsageListInCsvFormat) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FeatureUsageListInCsvFormat._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Federation configuration. +type FederationConfiguration struct { + // Epoch format: int64 + Epoch *int64 + // Federation id + Id *string + // Sites + Sites []FederationSite +} + +func (s *FederationConfiguration) GetType__() bindings.BindingType { + return FederationConfigurationBindingType() +} + +func (s *FederationConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FederationConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Site information. +type FederationSite struct { + // Possible values are: + // + // * FederationSite#FederationSite_ACTIVE_GM_ACTIVE + // * FederationSite#FederationSite_ACTIVE_GM_STANDBY + // * FederationSite#FederationSite_ACTIVE_GM_NONE + // * FederationSite#FederationSite_ACTIVE_GM_INVALID + // + // Does site have active GM + ActiveGm *string + // Aph services in the site + AphList []AphInfo + // Hash of the trustManagerCert + CertHash *string + // Cluster id + ClusterId *string + // Site config version format: int64 + ConfigVersion *int64 + // Id of the site + Id *string + // Is site federated + IsFederated *bool + // Is site local + IsLocal *bool + // Name of the site + Name *string + // Possible values are: + // + // * FederationSite#FederationSite_NODE_TYPE_GM + // * FederationSite#FederationSite_NODE_TYPE_LM + // * FederationSite#FederationSite_NODE_TYPE_GM_AND_LM + // + // Type of node + NodeType *string + // Version of the site + SiteVersion *string + // Split brain + SplitBrain *bool + // System id format: int64 + SystemId *int64 + // Cert string from trust manager + TrustManagerCert *string + // Vip ip + VipIp *string +} + +const FederationSite_ACTIVE_GM_ACTIVE = "ACTIVE" +const FederationSite_ACTIVE_GM_STANDBY = "STANDBY" +const FederationSite_ACTIVE_GM_NONE = "NONE" +const FederationSite_ACTIVE_GM_INVALID = "INVALID" +const FederationSite_NODE_TYPE_GM = "GM" +const FederationSite_NODE_TYPE_LM = "LM" +const FederationSite_NODE_TYPE_GM_AND_LM = "GM_AND_LM" + +func (s *FederationSite) GetType__() bindings.BindingType { + return FederationSiteBindingType() +} + +func (s *FederationSite) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FederationSite._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FederationSiteMigrationState struct { + // Key-value pair of federation site-id and its migration-state i.e. 'ENABLED' or 'DISABLED'. + SiteMigrationState []KeyValuePair +} + +func (s *FederationSiteMigrationState) GetType__() bindings.BindingType { + return FederationSiteMigrationStateBindingType() +} + +func (s *FederationSiteMigrationState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FederationSiteMigrationState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FederationStatus struct { + // Status of synchronization between active and standby sites. + ActiveStandbySyncStatuses []ActiveStandbySyncStatus + // Site connection status + RemoteConnections []SiteStatus +} + +func (s *FederationStatus) GetType__() bindings.BindingType { + return FederationStatusBindingType() +} + +func (s *FederationStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FederationStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Provide details of validation/errors occurred during collection ,translation and apply phase in MP to Policy promotion. +type FeedBack struct { + // Error array list + ErrorList []FeedBackErrorMessage + // Manager resource display name + MpDisplayName *string + // Manager resource id + MpId *string + // Manager resource type + Type_ *string +} + +func (s *FeedBack) GetType__() bindings.BindingType { + return FeedBackBindingType() +} + +func (s *FeedBack) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FeedBack._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Provide details of error_id and error description for errors occurred during collection ,translation and apply phase in MP to Policy promotion. +type FeedBackErrorMessage struct { + // Error description due to which promotion is not successful. + ErrorDesc *string + // Error Id due to which promotion is not successful. + ErrorId *string +} + +func (s *FeedBackErrorMessage) GetType__() bindings.BindingType { + return FeedBackErrorMessageBindingType() +} + +func (s *FeedBackErrorMessage) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FeedBackErrorMessage._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FeedBackListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Feedback object list results. + Results []FeedBack +} + +func (s *FeedBackListResult) GetType__() bindings.BindingType { + return FeedBackListResultBindingType() +} + +func (s *FeedBackListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FeedBackListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FieldsFilterData struct { + IpInfo *IpInfo + TransportInfo *TransportInfo + // Possible values are: + // + // * LiveTraceFilterData#LiveTraceFilterData_RESOURCE_TYPE_FIELDSFILTERDATA + // * LiveTraceFilterData#LiveTraceFilterData_RESOURCE_TYPE_PLAINFILTERDATA + // + // Filter type + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const FieldsFilterData__TYPE_IDENTIFIER = "FieldsFilterData" + +func (s *FieldsFilterData) GetType__() bindings.BindingType { + return FieldsFilterDataBindingType() +} + +func (s *FieldsFilterData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FieldsFilterData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FieldsPacketData struct { + ArpHeader *ArpHeader + EthHeader *EthernetHeader + IpHeader *Ipv4Header + Ipv6Header *Ipv6Header + // Up to 1000 bytes of payload may be supplied (with a base64-encoded length of 1336 bytes.) Additional bytes of traceflow metadata will be appended to the payload. The payload contains any data the user wants to put after the transport header. + Payload *string + TransportHeader *TransportProtocolHeader + // If the requested frame_size is too small (given the payload and traceflow metadata requirement of 16 bytes), the traceflow request will fail with an appropriate message. The frame will be zero padded to the requested size. format: int64 + FrameSize *int64 + // Possible values are: + // + // * PacketData#PacketData_RESOURCE_TYPE_BINARYPACKETDATA + // * PacketData#PacketData_RESOURCE_TYPE_FIELDSPACKETDATA + // + // Packet configuration + ResourceType string + // A flag, when set true, indicates that the traceflow packet is of L3 routing. + Routed *bool + // Possible values are: + // + // * PacketData#PacketData_TRANSPORT_TYPE_BROADCAST + // * PacketData#PacketData_TRANSPORT_TYPE_UNICAST + // * PacketData#PacketData_TRANSPORT_TYPE_MULTICAST + // * PacketData#PacketData_TRANSPORT_TYPE_UNKNOWN + // + // This type takes effect only for IP packet. + TransportType *string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const FieldsPacketData__TYPE_IDENTIFIER = "FieldsPacketData" + +func (s *FieldsPacketData) GetType__() bindings.BindingType { + return FieldsPacketDataBindingType() +} + +func (s *FieldsPacketData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FieldsPacketData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// File properties +type FileProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // File creation time in epoch milliseconds format: int64 + CreatedEpochMs *int64 + // File modification time in epoch milliseconds format: int64 + ModifiedEpochMs *int64 + // File name + Name *string + // Size of the file in bytes format: int64 + Size *int64 +} + +func (s *FileProperties) GetType__() bindings.BindingType { + return FilePropertiesBindingType() +} + +func (s *FileProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FileProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// File properties query results +type FilePropertiesListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // File property results + Results []FileProperties +} + +func (s *FilePropertiesListResult) GetType__() bindings.BindingType { + return FilePropertiesListResultBindingType() +} + +func (s *FilePropertiesListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FilePropertiesListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// File thumbprint +type FileThumbprint struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // File name + Name *string + // File's SHA1 thumbprint + Sha1 *string + // File's SHA256 thumbprint + Sha256 *string +} + +func (s *FileThumbprint) GetType__() bindings.BindingType { + return FileThumbprintBindingType() +} + +func (s *FileThumbprint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FileThumbprint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Remote server authentication details +type FileTransferAuthenticationScheme struct { + // Password to authenticate with + Password *string + // Possible values are: + // + // * FileTransferAuthenticationScheme#FileTransferAuthenticationScheme_SCHEME_NAME_PASSWORD + // + // Authentication scheme name + SchemeName *string + // User name to authenticate with + Username *string +} + +const FileTransferAuthenticationScheme_SCHEME_NAME_PASSWORD = "PASSWORD" + +func (s *FileTransferAuthenticationScheme) GetType__() bindings.BindingType { + return FileTransferAuthenticationSchemeBindingType() +} + +func (s *FileTransferAuthenticationScheme) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FileTransferAuthenticationScheme._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Protocol to transfer backup file to remote server +type FileTransferProtocol struct { + AuthenticationScheme *FileTransferAuthenticationScheme + // Possible values are: + // + // * FileTransferProtocol#FileTransferProtocol_PROTOCOL_NAME_SFTP + // + // Protocol name + ProtocolName *string + // The expected SSH fingerprint of the server. If the server's fingerprint does not match this fingerprint, the connection will be terminated. Only ECDSA fingerprints hashed with SHA256 are supported. To obtain the host's ssh fingerprint, you should connect via some method other than SSH to obtain this information. You can use one of these commands to view the key's fingerprint: 1. ssh-keygen -l -E sha256 -f ssh_host_ecdsa_key.pub 2. awk '{print $2}' ssh_host_ecdsa_key.pub | base64 -d | sha256sum -b | sed 's/ .\*$//' | xxd -r -p | base64 | sed 's/.//44g' | awk '{print \"SHA256:\"$1}' + SshFingerprint *string +} + +const FileTransferProtocol_PROTOCOL_NAME_SFTP = "sftp" + +func (s *FileTransferProtocol) GetType__() bindings.BindingType { + return FileTransferProtocolBindingType() +} + +func (s *FileTransferProtocol) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FileTransferProtocol._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type Filter struct { + // The name of the filter. + Name *string + // The value of the filter. + Value *string +} + +func (s *Filter) GetType__() bindings.BindingType { + return FilterBindingType() +} + +func (s *Filter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Filter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Filter request parameters +type FilterRequest struct { + // Set this flag to true to make filtering case-sensitive. + CaseSensitive *bool + // Comma seperated fields to be filtered on + FieldNames *string + // Filter value + Value *string +} + +func (s *FilterRequest) GetType__() bindings.BindingType { + return FilterRequestBindingType() +} + +func (s *FilterRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FilterRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents configuration for filter widget. This is abstract representation of filter widget. +type FilterWidgetConfiguration struct { + // Alias to be used when emitting filter value. + Alias *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_TIMERANGEDROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_SPACERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LEGENDWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration, CustomFilterWidgetConfiguration, TimeRangeDropdownFilterWidgetConfiguration, SpacerWidgetConfiguration, LegendWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If the condition is met then the widget will be displayed to UI. If no condition is provided, then the widget will be displayed unconditionally. + Condition *string + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + FeatureSet *FeatureSet + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. This field is deprecated instead use 'filters' property. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + // A List of filter applied to this widget configuration. This will be used to identify the filters applied to this widget. + Filters []string + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + Legend *Legend + // List of plotting configuration for a given widget. Widget plotting configurations which are common across all the widgets types should be define here. + PlotConfigs []WidgetPlotConfiguration + // Represents the vertical span of the widget / container. 1 Row span is equal to 20px. format: int32 + Rowspan *int64 + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // If the value of this field is set to true then card header will be displayed otherwise only card will be displayed without header. + ShowHeader *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const FilterWidgetConfiguration__TYPE_IDENTIFIER = "FilterWidgetConfiguration" + +func (s *FilterWidgetConfiguration) GetType__() bindings.BindingType { + return FilterWidgetConfigurationBindingType() +} + +func (s *FilterWidgetConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FilterWidgetConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Policy api will overwrite the fipsGlobalConfig set using MP api. Always use https://<policyIp>/policy/api/v1/infra/global-config to update fips configuration. +type FipsGlobalConfig struct { + // When this flag is set to true FIPS mode will be set on ssl encryptions of load balancer feature. + LbFipsEnabled *bool + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_SWITCHINGGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_ROUTINGGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_OPERATIONCOLLECTORGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FIREWALLGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_ESXGLOBALOPAQUECONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_SECURITYGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FIPSGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FEDERATIONGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_IDSGLOBALCONFIG + // + // Valid Global configuration types + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const FipsGlobalConfig__TYPE_IDENTIFIER = "FipsGlobalConfig" + +func (s *FipsGlobalConfig) GetType__() bindings.BindingType { + return FipsGlobalConfigBindingType() +} + +func (s *FipsGlobalConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FipsGlobalConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FireWallServiceAssociationListResult struct { + // Firewall rule list result with pagination support. + Results []FirewallRule + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Possible values are: + // + // * ServiceAssociationListResult#ServiceAssociationListResult_SERVICE_TYPE_FIREWALLSERVICEASSOCIATIONLISTRESULT + // * ServiceAssociationListResult#ServiceAssociationListResult_SERVICE_TYPE_IPFIXSERVICEASSOCIATIONLISTRESULT + ServiceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const FireWallServiceAssociationListResult__TYPE_IDENTIFIER = "FireWallServiceAssociationListResult" + +func (s *FireWallServiceAssociationListResult) GetType__() bindings.BindingType { + return FireWallServiceAssociationListResultBindingType() +} + +func (s *FireWallServiceAssociationListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FireWallServiceAssociationListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A profile holding CPU and memory threshold configuration. +type FirewallCpuMemThresholdsProfile struct { + // CPU utilization threshold percentage to monitor and report for distributed firewall. format: int64 + CpuThresholdPercentage *int64 + // Heap memory threshold percentage to monitor and report for distributed firewall. format: int64 + MemThresholdPercentage *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLSESSIONTIMERPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLCPUMEMTHRESHOLDSPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLFLOODPROTECTIONPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLDNSPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_GENERALSECURITYSETTINGSPROFILE + // + // Resource type to use as profile type + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const FirewallCpuMemThresholdsProfile__TYPE_IDENTIFIER = "FirewallCpuMemThresholdsProfile" + +func (s *FirewallCpuMemThresholdsProfile) GetType__() bindings.BindingType { + return FirewallCpuMemThresholdsProfileBindingType() +} + +func (s *FirewallCpuMemThresholdsProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallCpuMemThresholdsProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A profile holding DNS configuration which allows firewall to use DNS response packets and manage firewall cache. e.g. TTL used to expire snooped entries from cache. +type FirewallDnsProfile struct { + DnsTtlConfig *DnsTtlConfig + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLSESSIONTIMERPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLCPUMEMTHRESHOLDSPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLFLOODPROTECTIONPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLDNSPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_GENERALSECURITYSETTINGSPROFILE + // + // Resource type to use as profile type + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const FirewallDnsProfile__TYPE_IDENTIFIER = "FirewallDnsProfile" + +func (s *FirewallDnsProfile) GetType__() bindings.BindingType { + return FirewallDnsProfileBindingType() +} + +func (s *FirewallDnsProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallDnsProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A profile holding protection configuration for SYN flood, UDP flood, ICMP flood and other flood attack. +type FirewallFloodProtectionProfile struct { + // The flag to indicate RST spoofing is enabled or not. This option does not apply to EDGE components. This can be enabled only if syncache is enabled. + EnableRstSpoofing *bool + // The flag to indicate syncache is enabled or not. This option does not apply to EDGE components. + EnableSyncache *bool + // The maximum limit of active icmp connections. If this property is omitted, or set to null, then there is no limit on active icmp connections for those components if it's applied to ESX components (such as segment, segment port, virtual machine, etc); on the other side, if it's applied to EDGE components (such as, gateway), it will be set to default limit (10,000) on the specific components. format: int64 + IcmpActiveFlowLimit *int64 + // The maximum limit of active NAT connections. This limit only apply to EDGE components (such as, gateway). If this property is omitted, or set to null, then there is no limit on the specific component. Meanwhile there is an implicit limit which depends on the underlying hardware resource. format: int64 + NatActiveConnLimit *int64 + // The maximum limit of other active connections besides udp, icmp and half open tcp connections. If this property is omitted, or set to null, then there is no limit on other active connections besides udp, icmp and tcp half open connections for those components if it's applied to ESX components (such as segment, segment port, virtual machine, etc); on the other side, if it's applied to EDGE components (such as, gateway), it will be set to default limit (10,000) on the specific components. format: int64 + OtherActiveConnLimit *int64 + // The maximum limit of tcp half open connections. If this property is omitted, or set to null, then there is no limit on active tcp half open connections for those components if it's applied to ESX components (such as segment, segment port, virtual machine, etc); on the other side, if it's applied to EDGE components (such as, gateway), it will be set to default limit (1,000,000) on the specific components. format: int64 + TcpHalfOpenConnLimit *int64 + // The maximum limit of active udp connections. If this property is omitted, or set to null, then there is no limit on active udp connections for those components if it's applied to ESX components (such as segment, segment port, virtual machine, etc); on the other side, if it's applied to EDGE components (such as, gateway), it will be set to default limit (100,000) on the specific component. format: int64 + UdpActiveFlowLimit *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLSESSIONTIMERPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLCPUMEMTHRESHOLDSPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLFLOODPROTECTIONPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLDNSPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_GENERALSECURITYSETTINGSPROFILE + // + // Resource type to use as profile type + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const FirewallFloodProtectionProfile__TYPE_IDENTIFIER = "FirewallFloodProtectionProfile" + +func (s *FirewallFloodProtectionProfile) GetType__() bindings.BindingType { + return FirewallFloodProtectionProfileBindingType() +} + +func (s *FirewallFloodProtectionProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallFloodProtectionProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// NSX global configs for Distributed Firewall +type FirewallGlobalConfig struct { + // When this flag is set to true, global address set is enabled in Distributed Firewall. + GlobalAddrsetModeEnabled *bool + // This property is deprecated. The fast path mode is always enabled in Distributed Firewall. + GlobalFastpathModeEnabled *bool + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_SWITCHINGGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_ROUTINGGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_OPERATIONCOLLECTORGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FIREWALLGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_ESXGLOBALOPAQUECONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_SECURITYGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FIPSGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FEDERATIONGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_IDSGLOBALCONFIG + // + // Valid Global configuration types + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const FirewallGlobalConfig__TYPE_IDENTIFIER = "FirewallGlobalConfig" + +func (s *FirewallGlobalConfig) GetType__() bindings.BindingType { + return FirewallGlobalConfigBindingType() +} + +func (s *FirewallGlobalConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallGlobalConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FirewallProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of firewall profiles. + Results []*data.StructValue +} + +func (s *FirewallProfileListResult) GetType__() bindings.BindingType { + return FirewallProfileListResultBindingType() +} + +func (s *FirewallProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FirewallRule struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + Owner *OwnerResourceLink + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Identifier of the resource + Id *string + // The type of this resource. + ResourceType *string + // Possible values are: + // + // * FirewallRule#FirewallRule_ACTION_ALLOW + // * FirewallRule#FirewallRule_ACTION_DROP + // * FirewallRule#FirewallRule_ACTION_REJECT + // * FirewallRule#FirewallRule_ACTION_REDIRECT + // * FirewallRule#FirewallRule_ACTION_DO_NOT_REDIRECT + // * FirewallRule#FirewallRule_ACTION_DETECT + // * FirewallRule#FirewallRule_ACTION_ALLOW_CONTINUE + // * FirewallRule#FirewallRule_ACTION_DETECT_PREVENT + // + // Action enforced on the packets which matches the distributed service rule. Currently DS Layer supports below actions. ALLOW - Forward any packet when a rule with this action gets a match (Used by Firewall). DROP - Drop any packet when a rule with this action gets a match. Packets won't go further(Used by Firewall). REJECT - Terminate TCP connection by sending TCP reset for a packet when a rule with this action gets a match (Used by Firewall). REDIRECT - Redirect any packet to a partner appliance when a rule with this action gets a match (Used by Service Insertion). DO_NOT_REDIRECT - Do not redirect any packet to a partner appliance when a rule with this action gets a match (Used by Service Insertion). DETECT - Detect IDS Signatures. ALLOW_CONTINUE - Allows rules to jump from this rule. Action on matching rules in the destination category will decide next step. Application is default destination until new categories are supported to jump to. DETECT_PREVENT - Detect and Prevent IDS Signatures. + Action *string + // List of object where rule will be enforced. The section level field overrides this one. Null will be treated as any. + AppliedTos []ResourceReference + // List of the destinations. Null will be treated as any. + Destinations []ResourceReference + // Negation of the destination. + DestinationsExcluded *bool + // Possible values are: + // + // * FirewallRule#FirewallRule_DIRECTION_IN + // * FirewallRule#FirewallRule_DIRECTION_OUT + // * FirewallRule#FirewallRule_DIRECTION_IN_OUT + // + // Rule direction in case of stateless distributed service rules. This will only considered if section level parameter is set to stateless. Default to IN_OUT if not specified. + Direction *string + // Flag to disable rule. Disabled will only be persisted but never provisioned/realized. + Disabled *bool + // Possible values are: + // + // * FirewallRule#FirewallRule_IP_PROTOCOL_IPV4 + // * FirewallRule#FirewallRule_IP_PROTOCOL_IPV6 + // * FirewallRule#FirewallRule_IP_PROTOCOL_IPV4_IPV6 + // + // Type of IP packet that should be matched while enforcing the rule. + IpProtocol *string + // Flag to indicate whether rule is default. + IsDefault *bool + // Flag to enable packet logging. Default is disabled. + Logged *bool + // User notes specific to the rule. + Notes *string + // Priority of the rule. format: int64 + Priority *int64 + // User level field which will be printed in CLI and packet logs. + RuleTag *string + // List of sources. Null will be treated as any. + Sources []ResourceReference + // Negation of the source. + SourcesExcluded *bool + // NS Profile object which accepts attributes and sub-attributes of various network services (ex. L7 AppId, domain name, encryption algorithm) as key value pairs. + ContextProfiles []ResourceReference + // List of NSGroups that have end point attributes like AD Groups(SID), process name, process hash etc. For Flash release, only NSGroups containing AD Groups are supported. + ExtendedSources []ResourceReference + // Section Id of the section to which this rule belongs to. + SectionId *string + // List of the services. Null will be treated as any. + Services []FirewallService +} + +const FirewallRule_ACTION_ALLOW = "ALLOW" +const FirewallRule_ACTION_DROP = "DROP" +const FirewallRule_ACTION_REJECT = "REJECT" +const FirewallRule_ACTION_REDIRECT = "REDIRECT" +const FirewallRule_ACTION_DO_NOT_REDIRECT = "DO_NOT_REDIRECT" +const FirewallRule_ACTION_DETECT = "DETECT" +const FirewallRule_ACTION_ALLOW_CONTINUE = "ALLOW_CONTINUE" +const FirewallRule_ACTION_DETECT_PREVENT = "DETECT_PREVENT" +const FirewallRule_DIRECTION_IN = "IN" +const FirewallRule_DIRECTION_OUT = "OUT" +const FirewallRule_DIRECTION_IN_OUT = "IN_OUT" +const FirewallRule_IP_PROTOCOL_IPV4 = "IPV4" +const FirewallRule_IP_PROTOCOL_IPV6 = "IPV6" +const FirewallRule_IP_PROTOCOL_IPV4_IPV6 = "IPV4_IPV6" + +func (s *FirewallRule) GetType__() bindings.BindingType { + return FirewallRuleBindingType() +} + +func (s *FirewallRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FirewallRuleList struct { + // List of firewall rules in the section. Only homogenous rules are supported. + Rules []FirewallRule +} + +func (s *FirewallRuleList) GetType__() bindings.BindingType { + return FirewallRuleListBindingType() +} + +func (s *FirewallRuleList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallRuleList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FirewallRuleListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Firewall rule list result with pagination support. + Results []FirewallRule +} + +func (s *FirewallRuleListResult) GetType__() bindings.BindingType { + return FirewallRuleListResultBindingType() +} + +func (s *FirewallRuleListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallRuleListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FirewallSection struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // List of objects where the rules in this section will be enforced. This will take precedence over rule level appliedTo. + AppliedTos []ResourceReference + // It is a boolean flag which reflects whether a distributed service section is default section or not. Each Layer 3 and Layer 2 section will have at least and at most one default section. + IsDefault *bool + // Number of rules in this section. format: int64 + RuleCount *int64 + // Possible values are: + // + // * FirewallSection#FirewallSection_SECTION_TYPE_LAYER2 + // * FirewallSection#FirewallSection_SECTION_TYPE_LAYER3 + // * FirewallSection#FirewallSection_SECTION_TYPE_L3REDIRECT + // * FirewallSection#FirewallSection_SECTION_TYPE_IDS + // + // Type of the rules which a section can contain. Only homogeneous sections are supported. + SectionType *string + // Stateful or Stateless nature of distributed service section is enforced on all rules inside the section. Layer3 sections can be stateful or stateless. Layer2 sections can only be stateless. + Stateful *bool + // This flag indicates whether it is an auto-plumbed section that is associated to a LogicalRouter. Auto-plumbed sections are system owned and cannot be updated via the API. + Autoplumbed *bool + // Category from policy framework. + Category *string + // Comments for section lock/unlock. + Comments *string + // This attribute represents enforcement point of firewall section. For example, firewall section enforced on logical port with attachment type bridge endpoint will have 'BRIDGEENDPOINT' value, firewall section enforced on logical router will have 'LOGICALROUTER' value and rest have 'VIF' value. + EnforcedOn *string + FirewallSchedule *ResourceReference + // ID of the user who last modified the lock for the section. + LockModifiedBy *string + // Section locked/unlocked time in epoch milliseconds. format: int64 + LockModifiedTime *int64 + // Section is locked/unlocked. + Locked *bool + // Priority of current section with respect to other sections. In case the field is empty, the list section api should be used to get section priority. format: int64 + Priority *int64 + // If TCP strict is enabled on a section and a packet matches rule in it, the following check will be performed. If the packet does not belong to an existing session, the kernel will check to see if the SYN flag of the packet is set. If it is not, then it will drop the packet. + TcpStrict *bool +} + +const FirewallSection_SECTION_TYPE_LAYER2 = "LAYER2" +const FirewallSection_SECTION_TYPE_LAYER3 = "LAYER3" +const FirewallSection_SECTION_TYPE_L3REDIRECT = "L3REDIRECT" +const FirewallSection_SECTION_TYPE_IDS = "IDS" + +func (s *FirewallSection) GetType__() bindings.BindingType { + return FirewallSectionBindingType() +} + +func (s *FirewallSection) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallSection._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FirewallSectionListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of the firewall sections. The list has to be homogenous. + Results []FirewallSection +} + +func (s *FirewallSectionListResult) GetType__() bindings.BindingType { + return FirewallSectionListResultBindingType() +} + +func (s *FirewallSectionListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallSectionListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FirewallSectionLock struct { + // Comments for section lock/unlock. + Comments *string + // Revision of the section. format: int64 + SectionRevision *int64 +} + +func (s *FirewallSectionLock) GetType__() bindings.BindingType { + return FirewallSectionLockBindingType() +} + +func (s *FirewallSectionLock) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallSectionLock._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FirewallSectionRuleList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // List of objects where the rules in this section will be enforced. This will take precedence over rule level appliedTo. + AppliedTos []ResourceReference + // It is a boolean flag which reflects whether a distributed service section is default section or not. Each Layer 3 and Layer 2 section will have at least and at most one default section. + IsDefault *bool + // Number of rules in this section. format: int64 + RuleCount *int64 + // Possible values are: + // + // * FirewallSectionRuleList#FirewallSectionRuleList_SECTION_TYPE_LAYER2 + // * FirewallSectionRuleList#FirewallSectionRuleList_SECTION_TYPE_LAYER3 + // * FirewallSectionRuleList#FirewallSectionRuleList_SECTION_TYPE_L3REDIRECT + // * FirewallSectionRuleList#FirewallSectionRuleList_SECTION_TYPE_IDS + // + // Type of the rules which a section can contain. Only homogeneous sections are supported. + SectionType *string + // Stateful or Stateless nature of distributed service section is enforced on all rules inside the section. Layer3 sections can be stateful or stateless. Layer2 sections can only be stateless. + Stateful *bool + // This flag indicates whether it is an auto-plumbed section that is associated to a LogicalRouter. Auto-plumbed sections are system owned and cannot be updated via the API. + Autoplumbed *bool + // Category from policy framework. + Category *string + // Comments for section lock/unlock. + Comments *string + // This attribute represents enforcement point of firewall section. For example, firewall section enforced on logical port with attachment type bridge endpoint will have 'BRIDGEENDPOINT' value, firewall section enforced on logical router will have 'LOGICALROUTER' value and rest have 'VIF' value. + EnforcedOn *string + FirewallSchedule *ResourceReference + // ID of the user who last modified the lock for the section. + LockModifiedBy *string + // Section locked/unlocked time in epoch milliseconds. format: int64 + LockModifiedTime *int64 + // Section is locked/unlocked. + Locked *bool + // Priority of current section with respect to other sections. In case the field is empty, the list section api should be used to get section priority. format: int64 + Priority *int64 + // If TCP strict is enabled on a section and a packet matches rule in it, the following check will be performed. If the packet does not belong to an existing session, the kernel will check to see if the SYN flag of the packet is set. If it is not, then it will drop the packet. + TcpStrict *bool + // List of firewall rules in the section. Only homogenous rules are supported. + Rules []FirewallRule +} + +const FirewallSectionRuleList_SECTION_TYPE_LAYER2 = "LAYER2" +const FirewallSectionRuleList_SECTION_TYPE_LAYER3 = "LAYER3" +const FirewallSectionRuleList_SECTION_TYPE_L3REDIRECT = "L3REDIRECT" +const FirewallSectionRuleList_SECTION_TYPE_IDS = "IDS" + +func (s *FirewallSectionRuleList) GetType__() bindings.BindingType { + return FirewallSectionRuleListBindingType() +} + +func (s *FirewallSectionRuleList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallSectionRuleList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FirewallSectionState struct { + // Array of configuration state of various sub systems + Details []ConfigurationStateElement + // Error code format: int64 + FailureCode *int64 + // Error message in case of failure + FailureMessage *string + // Possible values are: + // + // * FirewallSectionState#FirewallSectionState_STATE_PENDING + // * FirewallSectionState#FirewallSectionState_STATE_IN_PROGRESS + // * FirewallSectionState#FirewallSectionState_STATE_SUCCESS + // * FirewallSectionState#FirewallSectionState_STATE_FAILED + // * FirewallSectionState#FirewallSectionState_STATE_PARTIAL_SUCCESS + // * FirewallSectionState#FirewallSectionState_STATE_ORPHANED + // * FirewallSectionState#FirewallSectionState_STATE_UNKNOWN + // * FirewallSectionState#FirewallSectionState_STATE_ERROR + // * FirewallSectionState#FirewallSectionState_STATE_IN_SYNC + // * FirewallSectionState#FirewallSectionState_STATE_NOT_AVAILABLE + // * FirewallSectionState#FirewallSectionState_STATE_VM_DEPLOYMENT_QUEUED + // * FirewallSectionState#FirewallSectionState_STATE_VM_DEPLOYMENT_IN_PROGRESS + // * FirewallSectionState#FirewallSectionState_STATE_VM_DEPLOYMENT_FAILED + // * FirewallSectionState#FirewallSectionState_STATE_VM_POWER_ON_IN_PROGRESS + // * FirewallSectionState#FirewallSectionState_STATE_VM_POWER_ON_FAILED + // * FirewallSectionState#FirewallSectionState_STATE_REGISTRATION_PENDING + // * FirewallSectionState#FirewallSectionState_STATE_NODE_NOT_READY + // * FirewallSectionState#FirewallSectionState_STATE_NODE_READY + // * FirewallSectionState#FirewallSectionState_STATE_VM_POWER_OFF_IN_PROGRESS + // * FirewallSectionState#FirewallSectionState_STATE_VM_POWER_OFF_FAILED + // * FirewallSectionState#FirewallSectionState_STATE_VM_UNDEPLOY_IN_PROGRESS + // * FirewallSectionState#FirewallSectionState_STATE_VM_UNDEPLOY_FAILED + // * FirewallSectionState#FirewallSectionState_STATE_VM_UNDEPLOY_SUCCESSFUL + // * FirewallSectionState#FirewallSectionState_STATE_EDGE_CONFIG_ERROR + // * FirewallSectionState#FirewallSectionState_STATE_VM_DEPLOYMENT_RESTARTED + // * FirewallSectionState#FirewallSectionState_STATE_REGISTRATION_FAILED + // * FirewallSectionState#FirewallSectionState_STATE_TRANSPORT_NODE_SYNC_PENDING + // * FirewallSectionState#FirewallSectionState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING + // * FirewallSectionState#FirewallSectionState_STATE_EDGE_HARDWARE_NOT_SUPPORTED + // * FirewallSectionState#FirewallSectionState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED + // * FirewallSectionState#FirewallSectionState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER + // * FirewallSectionState#FirewallSectionState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED + // * FirewallSectionState#FirewallSectionState_STATE_NO_PNIC_PREPARED_IN_EDGE + // * FirewallSectionState#FirewallSectionState_STATE_APPLIANCE_INTERNAL_ERROR + // * FirewallSectionState#FirewallSectionState_STATE_VTEP_DHCP_NOT_SUPPORTED + // * FirewallSectionState#FirewallSectionState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE + // * FirewallSectionState#FirewallSectionState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED + // * FirewallSectionState#FirewallSectionState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND + // * FirewallSectionState#FirewallSectionState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED + // * FirewallSectionState#FirewallSectionState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY + // * FirewallSectionState#FirewallSectionState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM + // * FirewallSectionState#FirewallSectionState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM + // * FirewallSectionState#FirewallSectionState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM + // * FirewallSectionState#FirewallSectionState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE + // * FirewallSectionState#FirewallSectionState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE + // * FirewallSectionState#FirewallSectionState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED + // * FirewallSectionState#FirewallSectionState_STATE_NO_PNIC_SPECIFIED_IN_TN + // * FirewallSectionState#FirewallSectionState_STATE_INVALID_PNIC_DEVICE_NAME + // * FirewallSectionState#FirewallSectionState_STATE_TRANSPORT_NODE_READY + // * FirewallSectionState#FirewallSectionState_STATE_VM_NETWORK_EDIT_PENDING + // * FirewallSectionState#FirewallSectionState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY + // * FirewallSectionState#FirewallSectionState_STATE_MPA_DISCONNECTED + // * FirewallSectionState#FirewallSectionState_STATE_VM_RENAME_PENDING + // * FirewallSectionState#FirewallSectionState_STATE_VM_CONFIG_EDIT_PENDING + // * FirewallSectionState#FirewallSectionState_STATE_VM_NETWORK_EDIT_FAILED + // * FirewallSectionState#FirewallSectionState_STATE_VM_RENAME_FAILED + // * FirewallSectionState#FirewallSectionState_STATE_VM_CONFIG_EDIT_FAILED + // * FirewallSectionState#FirewallSectionState_STATE_VM_CONFIG_DISCREPANCY + // * FirewallSectionState#FirewallSectionState_STATE_VM_NODE_REFRESH_FAILED + // * FirewallSectionState#FirewallSectionState_STATE_VM_PLACEMENT_REFRESH_FAILED + // * FirewallSectionState#FirewallSectionState_STATE_REGISTRATION_TIMEDOUT + // * FirewallSectionState#FirewallSectionState_STATE_REPLACE_FAILED + // * FirewallSectionState#FirewallSectionState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED + // * FirewallSectionState#FirewallSectionState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING + // * FirewallSectionState#FirewallSectionState_STATE_DELETE_VM_IN_REDEPLOY_FAILED + // * FirewallSectionState#FirewallSectionState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED + // * FirewallSectionState#FirewallSectionState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE + // * FirewallSectionState#FirewallSectionState_STATE_VM_RESOURCE_RESERVATION_FAILED + // * FirewallSectionState#FirewallSectionState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER + // * FirewallSectionState#FirewallSectionState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING + // * FirewallSectionState#FirewallSectionState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE + // * FirewallSectionState#FirewallSectionState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE + // * FirewallSectionState#FirewallSectionState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE + // * FirewallSectionState#FirewallSectionState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE + // * FirewallSectionState#FirewallSectionState_STATE_COMPUTE_MANAGER_NOT_FOUND + // * FirewallSectionState#FirewallSectionState_STATE_DELETE_IN_PROGRESS + // + // Gives details of state of desired configuration. Additional enums with more details on progress/success/error states are sent for edge node. The success states are NODE_READY and TRANSPORT_NODE_READY, pending states are {VM_DEPLOYMENT_QUEUED, VM_DEPLOYMENT_IN_PROGRESS, REGISTRATION_PENDING} and other values indicate failures. \"in_sync\" state indicates that the desired configuration has been received by the host to which it applies, but is not yet in effect. When the configuration is actually in effect, the state will change to \"success\". Please note, failed state is deprecated. + State *string + // This attribute represents revision number of section's desired state. format: int64 + RevisionDesired *int64 + // Pending changes to be realized. + PendingChangeList []PendingChange +} + +const FirewallSectionState_STATE_PENDING = "pending" +const FirewallSectionState_STATE_IN_PROGRESS = "in_progress" +const FirewallSectionState_STATE_SUCCESS = "success" +const FirewallSectionState_STATE_FAILED = "failed" +const FirewallSectionState_STATE_PARTIAL_SUCCESS = "partial_success" +const FirewallSectionState_STATE_ORPHANED = "orphaned" +const FirewallSectionState_STATE_UNKNOWN = "unknown" +const FirewallSectionState_STATE_ERROR = "error" +const FirewallSectionState_STATE_IN_SYNC = "in_sync" +const FirewallSectionState_STATE_NOT_AVAILABLE = "NOT_AVAILABLE" +const FirewallSectionState_STATE_VM_DEPLOYMENT_QUEUED = "VM_DEPLOYMENT_QUEUED" +const FirewallSectionState_STATE_VM_DEPLOYMENT_IN_PROGRESS = "VM_DEPLOYMENT_IN_PROGRESS" +const FirewallSectionState_STATE_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const FirewallSectionState_STATE_VM_POWER_ON_IN_PROGRESS = "VM_POWER_ON_IN_PROGRESS" +const FirewallSectionState_STATE_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const FirewallSectionState_STATE_REGISTRATION_PENDING = "REGISTRATION_PENDING" +const FirewallSectionState_STATE_NODE_NOT_READY = "NODE_NOT_READY" +const FirewallSectionState_STATE_NODE_READY = "NODE_READY" +const FirewallSectionState_STATE_VM_POWER_OFF_IN_PROGRESS = "VM_POWER_OFF_IN_PROGRESS" +const FirewallSectionState_STATE_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const FirewallSectionState_STATE_VM_UNDEPLOY_IN_PROGRESS = "VM_UNDEPLOY_IN_PROGRESS" +const FirewallSectionState_STATE_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const FirewallSectionState_STATE_VM_UNDEPLOY_SUCCESSFUL = "VM_UNDEPLOY_SUCCESSFUL" +const FirewallSectionState_STATE_EDGE_CONFIG_ERROR = "EDGE_CONFIG_ERROR" +const FirewallSectionState_STATE_VM_DEPLOYMENT_RESTARTED = "VM_DEPLOYMENT_RESTARTED" +const FirewallSectionState_STATE_REGISTRATION_FAILED = "REGISTRATION_FAILED" +const FirewallSectionState_STATE_TRANSPORT_NODE_SYNC_PENDING = "TRANSPORT_NODE_SYNC_PENDING" +const FirewallSectionState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING = "TRANSPORT_NODE_CONFIGURATION_MISSING" +const FirewallSectionState_STATE_EDGE_HARDWARE_NOT_SUPPORTED = "EDGE_HARDWARE_NOT_SUPPORTED" +const FirewallSectionState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED = "MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED" +const FirewallSectionState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER = "TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER" +const FirewallSectionState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED = "TZ_ENDPOINTS_NOT_SPECIFIED" +const FirewallSectionState_STATE_NO_PNIC_PREPARED_IN_EDGE = "NO_PNIC_PREPARED_IN_EDGE" +const FirewallSectionState_STATE_APPLIANCE_INTERNAL_ERROR = "APPLIANCE_INTERNAL_ERROR" +const FirewallSectionState_STATE_VTEP_DHCP_NOT_SUPPORTED = "VTEP_DHCP_NOT_SUPPORTED" +const FirewallSectionState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE = "UNSUPPORTED_HOST_SWITCH_PROFILE" +const FirewallSectionState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED = "UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED" +const FirewallSectionState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND = "HOSTSWITCH_PROFILE_NOT_FOUND" +const FirewallSectionState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED = "LLDP_SEND_ENABLED_NOT_SUPPORTED" +const FirewallSectionState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY = "UNSUPPORTED_NAMED_TEAMING_POLICY" +const FirewallSectionState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM = "LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM" +const FirewallSectionState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM = "LACP_NOT_SUPPORTED_FOR_EDGE_VM" +const FirewallSectionState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM = "STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM" +const FirewallSectionState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE = "MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE" +const FirewallSectionState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE = "UNSUPPORTED_LACP_LB_ALGO_FOR_NODE" +const FirewallSectionState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED = "EDGE_NODE_VERSION_NOT_SUPPORTED" +const FirewallSectionState_STATE_NO_PNIC_SPECIFIED_IN_TN = "NO_PNIC_SPECIFIED_IN_TN" +const FirewallSectionState_STATE_INVALID_PNIC_DEVICE_NAME = "INVALID_PNIC_DEVICE_NAME" +const FirewallSectionState_STATE_TRANSPORT_NODE_READY = "TRANSPORT_NODE_READY" +const FirewallSectionState_STATE_VM_NETWORK_EDIT_PENDING = "VM_NETWORK_EDIT_PENDING" +const FirewallSectionState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY = "UNSUPPORTED_DEFAULT_TEAMING_POLICY" +const FirewallSectionState_STATE_MPA_DISCONNECTED = "MPA_DISCONNECTED" +const FirewallSectionState_STATE_VM_RENAME_PENDING = "VM_RENAME_PENDING" +const FirewallSectionState_STATE_VM_CONFIG_EDIT_PENDING = "VM_CONFIG_EDIT_PENDING" +const FirewallSectionState_STATE_VM_NETWORK_EDIT_FAILED = "VM_NETWORK_EDIT_FAILED" +const FirewallSectionState_STATE_VM_RENAME_FAILED = "VM_RENAME_FAILED" +const FirewallSectionState_STATE_VM_CONFIG_EDIT_FAILED = "VM_CONFIG_EDIT_FAILED" +const FirewallSectionState_STATE_VM_CONFIG_DISCREPANCY = "VM_CONFIG_DISCREPANCY" +const FirewallSectionState_STATE_VM_NODE_REFRESH_FAILED = "VM_NODE_REFRESH_FAILED" +const FirewallSectionState_STATE_VM_PLACEMENT_REFRESH_FAILED = "VM_PLACEMENT_REFRESH_FAILED" +const FirewallSectionState_STATE_REGISTRATION_TIMEDOUT = "REGISTRATION_TIMEDOUT" +const FirewallSectionState_STATE_REPLACE_FAILED = "REPLACE_FAILED" +const FirewallSectionState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED = "UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED" +const FirewallSectionState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING = "LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING" +const FirewallSectionState_STATE_DELETE_VM_IN_REDEPLOY_FAILED = "DELETE_VM_IN_REDEPLOY_FAILED" +const FirewallSectionState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED = "DEPLOY_VM_IN_REDEPLOY_FAILED" +const FirewallSectionState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE = "INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE" +const FirewallSectionState_STATE_VM_RESOURCE_RESERVATION_FAILED = "VM_RESOURCE_RESERVATION_FAILED" +const FirewallSectionState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER = "DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER" +const FirewallSectionState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING = "DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING" +const FirewallSectionState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE = "EDGE_NODE_SETTINGS_MISMATCH_RESOLVE" +const FirewallSectionState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE = "EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE" +const FirewallSectionState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE = "EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE" +const FirewallSectionState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE = "EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE" +const FirewallSectionState_STATE_COMPUTE_MANAGER_NOT_FOUND = "COMPUTE_MANAGER_NOT_FOUND" +const FirewallSectionState_STATE_DELETE_IN_PROGRESS = "DELETE_IN_PROGRESS" + +func (s *FirewallSectionState) GetType__() bindings.BindingType { + return FirewallSectionStateBindingType() +} + +func (s *FirewallSectionState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallSectionState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FirewallSectionsSummary struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Total number of rules in the section. format: int64 + RuleCount *int64 + // Total number of sections for the section type. format: int64 + SectionCount *int64 + // Possible values are: + // + // * FirewallSectionsSummary#FirewallSectionsSummary_SECTION_TYPE_L2DFW + // * FirewallSectionsSummary#FirewallSectionsSummary_SECTION_TYPE_L3DFW + // * FirewallSectionsSummary#FirewallSectionsSummary_SECTION_TYPE_L3BRIDGEPORTFW + // * FirewallSectionsSummary#FirewallSectionsSummary_SECTION_TYPE_L3LOGICALROUTERFW + // + // Type of rules which a section can contain. + SectionType *string +} + +const FirewallSectionsSummary_SECTION_TYPE_L2DFW = "L2DFW" +const FirewallSectionsSummary_SECTION_TYPE_L3DFW = "L3DFW" +const FirewallSectionsSummary_SECTION_TYPE_L3BRIDGEPORTFW = "L3BRIDGEPORTFW" +const FirewallSectionsSummary_SECTION_TYPE_L3LOGICALROUTERFW = "L3LOGICALROUTERFW" + +func (s *FirewallSectionsSummary) GetType__() bindings.BindingType { + return FirewallSectionsSummaryBindingType() +} + +func (s *FirewallSectionsSummary) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallSectionsSummary._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FirewallSectionsSummaryList struct { + // Timestamp of the last computation, in epoch milliseconds. format: int64 + LastComputeTime *int64 + // List of firewall sections summary. + SectionsSummary []FirewallSectionsSummary +} + +func (s *FirewallSectionsSummaryList) GetType__() bindings.BindingType { + return FirewallSectionsSummaryListBindingType() +} + +func (s *FirewallSectionsSummaryList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallSectionsSummaryList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FirewallService struct { + // Will be set to false if the referenced NSX resource has been deleted. + IsValid *bool + // Display name of the NSX resource. + TargetDisplayName *string + // Identifier of the NSX resource. + TargetId *string + // Type of the NSX resource. + TargetType *string + Service *data.StructValue +} + +func (s *FirewallService) GetType__() bindings.BindingType { + return FirewallServiceBindingType() +} + +func (s *FirewallService) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallService._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A profile holding TCP, UDP and ICMP session timeout configuration. +type FirewallSessionTimerProfile struct { + // The timeout value for the connection after an ICMP error came back in response to an ICMP packet. The default value for Edges (i.e, Gateway, or Logical Router) may be different than Distributed Firewall hosts. format: int64 + IcmpErrorReply *int64 + // The timeout value of connection in seconds after the first packet. This will be the initial timeout for the new ICMP flow. The default value for Edges (i.e, Gateway, or Logical Router) may be different than Distributed Firewall hosts. format: int64 + IcmpFirstPacket *int64 + // The timeout value of connection in seconds after one endpoint sends an RST. The default value for Edges (i.e, Gateway, or Logical Router) may be different than Distributed Firewall hosts. format: int64 + TcpClosed *int64 + // The timeout value of connection in seconds after the first FIN has been sent. The default value for Edges (i.e, Gateway, or Logical Router) may be different than Distributed Firewall hosts. format: int64 + TcpClosing *int64 + // The timeout value of connection in seconds once the connection has become fully established. The default value for Edges (i.e, Gateway, or Logical Router) may be different than Distributed Firewall hosts. format: int64 + TcpEstablished *int64 + // The timeout value of connection in seconds after both FINs have been exchanged and connection is closed. The default value for Edges (i.e, Gateway, or Logical Router) may be different than Distributed Firewall hosts. format: int64 + TcpFinwait *int64 + // The timeout value of connection in seconds after the first packet has been sent. The default value for Edges (i.e, Gateway, or Logical Router) may be different than Distributed Firewall hosts. format: int64 + TcpFirstPacket *int64 + // The timeout value of connection in seconds after a second packet has been transferred. The default value for Edges (i.e, Gateway, or Logical Router) may be different than Distributed Firewall hosts. format: int64 + TcpOpening *int64 + // The timeout value of connection in seconds after the first packet. This will be the initial timeout for the new UDP flow. The default value for Edges (i.e, Gateway, or Logical Router) may be different than Distributed Firewall hosts. format: int64 + UdpFirstPacket *int64 + // The timeout value of connection in seconds if both hosts have sent packets. The default value for Edges (i.e, Gateway, or Logical Router) may be different than Distributed Firewall hosts. format: int64 + UdpMultiple *int64 + // The timeout value of connection in seconds if the source host sends more than one packet but the destination host has never sent one back. The default value for Edges (i.e, Gateway, or Logical Router) may be different than Distributed Firewall hosts. format: int64 + UdpSingle *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLSESSIONTIMERPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLCPUMEMTHRESHOLDSPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLFLOODPROTECTIONPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLDNSPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_GENERALSECURITYSETTINGSPROFILE + // + // Resource type to use as profile type + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const FirewallSessionTimerProfile__TYPE_IDENTIFIER = "FirewallSessionTimerProfile" + +func (s *FirewallSessionTimerProfile) GetType__() bindings.BindingType { + return FirewallSessionTimerProfileBindingType() +} + +func (s *FirewallSessionTimerProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallSessionTimerProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FirewallStats struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Aggregated number of bytes processed by the rule. format: int64 + ByteCount *int64 + // Aggregated number of hits received by the rule. format: int64 + HitCount *int64 + // Aggregated number of L7 Profile Accepted counters received by the rule. format: int64 + L7AcceptCount *int64 + // Aggregated number of L7 Profile Rejected counters received by the rule. format: int64 + L7RejectCount *int64 + // Aggregated number of L7 Profile Rejected with Response counters received by the rule. format: int64 + L7RejectWithResponseCount *int64 + // Maximum value of popularity index of all firewall rules of the type. This is aggregated statistic which are computed with lower frequency compared to individual generic rule statistics. It may have a computation delay up to 15 minutes in response to this API. format: int64 + MaxPopularityIndex *int64 + // Maximum value of sessions count of all firewall rules of the type. This is aggregated statistic which are computed with lower frequency compared to generic rule statistics. It may have a computation delay up to 15 minutes in response to this API. format: int64 + MaxSessionCount *int64 + // Aggregated number of packets processed by the rule. format: int64 + PacketCount *int64 + // This is calculated by sessions count divided by age of the rule. format: int64 + PopularityIndex *int64 + // Rule Identifier of the Firewall rule. This is a globally unique number. + RuleId *string + // Aggregated number of sessions processed by the rule. format: int64 + SessionCount *int64 + // Aggregated number of sessions processed by the all firewall rules. This is aggregated statistic which are computed with lower frequency compared to individual generic rule statistics. It may have a computation delay up to 15 minutes in response to this API. format: int64 + TotalSessionCount *int64 +} + +func (s *FirewallStats) GetType__() bindings.BindingType { + return FirewallStatsBindingType() +} + +func (s *FirewallStats) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallStats._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FirewallStatsList struct { + // Total count for firewall rule statistics in results set format: int64 + ResultCount *int64 + // List of rule statistics + Results []FirewallStats + // Corresponding firewall section identifier for list of rule statistics + SectionId *string +} + +func (s *FirewallStatsList) GetType__() bindings.BindingType { + return FirewallStatsListBindingType() +} + +func (s *FirewallStatsList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallStatsList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Firewall Status Response +type FirewallStatus struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * FirewallStatus#FirewallStatus_CONTEXT_TRANSPORT_NODES + // * FirewallStatus#FirewallStatus_CONTEXT_LOGICAL_ROUTERS + // * FirewallStatus#FirewallStatus_CONTEXT_BRIDGE_PORTS + // + // Types of firewall contexts. + Context *string + // Possible values are: + // + // * FirewallStatus#FirewallStatus_GLOBAL_STATUS_DISABLED + // * FirewallStatus#FirewallStatus_GLOBAL_STATUS_ENABLED + // + // Firewall status for a fabric entity or in global context where firewall is supported. + GlobalStatus *string + // List of firewall status on various target logical resources. This will override the global status of corresponding firewall context (e.g it will override the gloabal status of logical_routers). + TargetStatuses []TargetResourceStatus +} + +const FirewallStatus_CONTEXT_TRANSPORT_NODES = "transport_nodes" +const FirewallStatus_CONTEXT_LOGICAL_ROUTERS = "logical_routers" +const FirewallStatus_CONTEXT_BRIDGE_PORTS = "bridge_ports" +const FirewallStatus_GLOBAL_STATUS_DISABLED = "DISABLED" +const FirewallStatus_GLOBAL_STATUS_ENABLED = "ENABLED" + +func (s *FirewallStatus) GetType__() bindings.BindingType { + return FirewallStatusBindingType() +} + +func (s *FirewallStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of firewall statuses for a context or all context +type FirewallStatusListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + Results []FirewallStatus +} + +func (s *FirewallStatusListResult) GetType__() bindings.BindingType { + return FirewallStatusListResultBindingType() +} + +func (s *FirewallStatusListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirewallStatusListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FirstnSampling struct { + // Number of packets to be sampled format: int64 + MatchNumber *int64 + // Possible values are: + // + // * SamplingArgument#SamplingArgument_SAMPLING_TYPE_FIRSTNSAMPLING + // * SamplingArgument#SamplingArgument_SAMPLING_TYPE_PACKETNUMBERSAMPLING + // * SamplingArgument#SamplingArgument_SAMPLING_TYPE_INTERVALSAMPLING + // + // Sampling type + SamplingType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const FirstnSampling__TYPE_IDENTIFIER = "FirstNSampling" + +func (s *FirstnSampling) GetType__() bindings.BindingType { + return FirstnSamplingBindingType() +} + +func (s *FirstnSampling) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FirstnSampling._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Footer of a widget that provides additional information or allows an action such as clickable url for navigation. An example usage of footer is provided under 'example_request' section of 'CreateWidgetConfiguration' API. +type Footer struct { + // Action to be performed at the footer of a widget. An action at the footer can be simple text description or a hyperlink to a UI page. Action allows a clickable url for navigation. An example usage of footer action is provided under 'example_request' section of 'CreateWidgetConfiguration' API. + Actions []FooterAction + // If the condition is met then the footer will be applied. Examples of expression syntax are provided under 'example_request' section of 'CreateWidgetConfiguration' API. + Condition *string +} + +func (s *Footer) GetType__() bindings.BindingType { + return FooterBindingType() +} + +func (s *Footer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Footer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Action specified at the footer of a widget to provide additional information or to provide a clickable url for navigation. An example usage of footer action is provided under the 'example_request' section of 'CreateWidgetConfiguration' API. +type FooterAction struct { + // If true, the footer will appear in the underlying container that holds the widget. + DockToContainerFooter *bool + Label *Label + // Hyperlink to the UI page that provides details of action. + Url *string +} + +func (s *FooterAction) GetType__() bindings.BindingType { + return FooterActionBindingType() +} + +func (s *FooterAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FooterAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ForwarderZone struct { + // The source ip used by the fowarder of the zone. If no source ip specified, the ip address of listener of the DNS forwarder will be used. format: ipv4 + SourceIp *string + // Ip address of the upstream DNS servers the DNS forwarder accesses. format: ipv4 + UpstreamServers []string +} + +func (s *ForwarderZone) GetType__() bindings.BindingType { + return ForwarderZoneBindingType() +} + +func (s *ForwarderZone) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ForwarderZone._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type FullSyncStatus struct { + // Time at which the full sync was completed. + CompletedAt *string + // Snapshot version targeted by full sync. + SnapshotVersion *string + // Possible values are: + // + // * FullSyncStatus#FullSyncStatus_STATUS_UNAVAILABLE + // * FullSyncStatus#FullSyncStatus_STATUS_ERROR + // * FullSyncStatus#FullSyncStatus_STATUS_ONGOING + // * FullSyncStatus#FullSyncStatus_STATUS_COMPLETE + // * FullSyncStatus#FullSyncStatus_STATUS_NOT_STARTED + // + // Status of full sync. + Status *string + // Identifier for the full sync. + SyncId *string + // Possible values are: + // + // * FullSyncStatus#FullSyncStatus_SYNC_TYPE_UNAVAILABLE + // * FullSyncStatus#FullSyncStatus_SYNC_TYPE_STANDARD + // * FullSyncStatus#FullSyncStatus_SYNC_TYPE_FORCED + // + // Type of full sync. + SyncType *string +} + +const FullSyncStatus_STATUS_UNAVAILABLE = "UNAVAILABLE" +const FullSyncStatus_STATUS_ERROR = "ERROR" +const FullSyncStatus_STATUS_ONGOING = "ONGOING" +const FullSyncStatus_STATUS_COMPLETE = "COMPLETE" +const FullSyncStatus_STATUS_NOT_STARTED = "NOT_STARTED" +const FullSyncStatus_SYNC_TYPE_UNAVAILABLE = "UNAVAILABLE" +const FullSyncStatus_SYNC_TYPE_STANDARD = "STANDARD" +const FullSyncStatus_SYNC_TYPE_FORCED = "FORCED" + +func (s *FullSyncStatus) GetType__() bindings.BindingType { + return FullSyncStatusBindingType() +} + +func (s *FullSyncStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for FullSyncStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A profile holding general security settings. +type GeneralSecuritySettingsProfile struct { + // The flag to indicate double flow check is enabled or not. This option applies only to EDGE components. + EnableDoubleFlow *bool + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLSESSIONTIMERPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLCPUMEMTHRESHOLDSPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLFLOODPROTECTIONPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_FIREWALLDNSPROFILE + // * BaseFirewallProfile#BaseFirewallProfile_RESOURCE_TYPE_GENERALSECURITYSETTINGSPROFILE + // + // Resource type to use as profile type + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const GeneralSecuritySettingsProfile__TYPE_IDENTIFIER = "GeneralSecuritySettingsProfile" + +func (s *GeneralSecuritySettingsProfile) GetType__() bindings.BindingType { + return GeneralSecuritySettingsProfileBindingType() +} + +func (s *GeneralSecuritySettingsProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GeneralSecuritySettingsProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Define DHCP options other than option 121. +type GenericDhcpOption struct { + // Code of the dhcp option. format: int64 + Code *int64 + // Value of the option. + Values []string +} + +func (s *GenericDhcpOption) GetType__() bindings.BindingType { + return GenericDhcpOptionBindingType() +} + +func (s *GenericDhcpOption) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GenericDhcpOption._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// GI Specific service profile +type GiServiceProfile struct { + // The service to which the service profile belongs. + ServiceId *string + // ID of the vendor template, created by partner while registering the service. + VendorTemplateId *string + // Different VMs in data center can have Different protection levels as specified by administrator in the policy. The identifier for the policy with which the partner appliance identifies this policy. This identifier will be passed to the partner appliance at runtime to specify which protection level is applicable for the VM being protected. + VendorTemplateKey *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Service Profile type, for example 'GiServiceProfile', 'ServiceInsertionServiceProfile' + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const GiServiceProfile__TYPE_IDENTIFIER = "GiServiceProfile" + +func (s *GiServiceProfile) GetType__() bindings.BindingType { + return GiServiceProfileBindingType() +} + +func (s *GiServiceProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GiServiceProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The GlobalConfigs is the base class for global configurations for different types in a NSX domain. +type GlobalConfigs struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_SWITCHINGGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_ROUTINGGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_OPERATIONCOLLECTORGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FIREWALLGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_ESXGLOBALOPAQUECONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_SECURITYGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FIPSGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FEDERATIONGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_IDSGLOBALCONFIG + // + // Valid Global configuration types + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const GlobalConfigs__TYPE_IDENTIFIER = "GlobalConfigs" +const GlobalConfigs_RESOURCE_TYPE_SWITCHINGGLOBALCONFIG = "SwitchingGlobalConfig" +const GlobalConfigs_RESOURCE_TYPE_ROUTINGGLOBALCONFIG = "RoutingGlobalConfig" +const GlobalConfigs_RESOURCE_TYPE_OPERATIONCOLLECTORGLOBALCONFIG = "OperationCollectorGlobalConfig" +const GlobalConfigs_RESOURCE_TYPE_FIREWALLGLOBALCONFIG = "FirewallGlobalConfig" +const GlobalConfigs_RESOURCE_TYPE_ESXGLOBALOPAQUECONFIG = "EsxGlobalOpaqueConfig" +const GlobalConfigs_RESOURCE_TYPE_SECURITYGLOBALCONFIG = "SecurityGlobalConfig" +const GlobalConfigs_RESOURCE_TYPE_FIPSGLOBALCONFIG = "FipsGlobalConfig" +const GlobalConfigs_RESOURCE_TYPE_FEDERATIONGLOBALCONFIG = "FederationGlobalConfig" +const GlobalConfigs_RESOURCE_TYPE_IDSGLOBALCONFIG = "IdsGlobalConfig" + +func (s *GlobalConfigs) GetType__() bindings.BindingType { + return GlobalConfigsBindingType() +} + +func (s *GlobalConfigs) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GlobalConfigs._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A list of global configurations grouped by their types +type GlobalConfigsListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Domain specific global configuration. + Results []*data.StructValue +} + +func (s *GlobalConfigsListResult) GetType__() bindings.BindingType { + return GlobalConfigsListResultBindingType() +} + +func (s *GlobalConfigsListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GlobalConfigsListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Overall restore process status +type GlobalRestoreStatus struct { + // A description of the restore status + Description *string + // Possible values are: + // + // * GlobalRestoreStatus#GlobalRestoreStatus_VALUE_INITIAL + // * GlobalRestoreStatus#GlobalRestoreStatus_VALUE_SUCCESS + // * GlobalRestoreStatus#GlobalRestoreStatus_VALUE_FAILED + // * GlobalRestoreStatus#GlobalRestoreStatus_VALUE_RUNNING + // * GlobalRestoreStatus#GlobalRestoreStatus_VALUE_SUSPENDED_BY_USER + // * GlobalRestoreStatus#GlobalRestoreStatus_VALUE_SUSPENDED_FOR_USER_ACTION + // * GlobalRestoreStatus#GlobalRestoreStatus_VALUE_SUSPENDED + // * GlobalRestoreStatus#GlobalRestoreStatus_VALUE_ABORTED + // + // Global rolled-up restore status value + Value *string +} + +const GlobalRestoreStatus_VALUE_INITIAL = "INITIAL" +const GlobalRestoreStatus_VALUE_SUCCESS = "SUCCESS" +const GlobalRestoreStatus_VALUE_FAILED = "FAILED" +const GlobalRestoreStatus_VALUE_RUNNING = "RUNNING" +const GlobalRestoreStatus_VALUE_SUSPENDED_BY_USER = "SUSPENDED_BY_USER" +const GlobalRestoreStatus_VALUE_SUSPENDED_FOR_USER_ACTION = "SUSPENDED_FOR_USER_ACTION" +const GlobalRestoreStatus_VALUE_SUSPENDED = "SUSPENDED" +const GlobalRestoreStatus_VALUE_ABORTED = "ABORTED" + +func (s *GlobalRestoreStatus) GetType__() bindings.BindingType { + return GlobalRestoreStatusBindingType() +} + +func (s *GlobalRestoreStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GlobalRestoreStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// BGP Graceful Restart configuration parameters +type GracefulRestartConfig struct { + // Possible values are: + // + // * GracefulRestartConfig#GracefulRestartConfig_GRACEFUL_RESTART_MODE_DISABLE + // * GracefulRestartConfig#GracefulRestartConfig_GRACEFUL_RESTART_MODE_HELPER_ONLY + // * GracefulRestartConfig#GracefulRestartConfig_GRACEFUL_RESTART_MODE_GR_AND_HELPER + // + // BGP Graceful Restart mode + GracefulRestartMode *string + GracefulRestartTimer *GracefulRestartTimer +} + +const GracefulRestartConfig_GRACEFUL_RESTART_MODE_DISABLE = "DISABLE" +const GracefulRestartConfig_GRACEFUL_RESTART_MODE_HELPER_ONLY = "HELPER_ONLY" +const GracefulRestartConfig_GRACEFUL_RESTART_MODE_GR_AND_HELPER = "GR_AND_HELPER" + +func (s *GracefulRestartConfig) GetType__() bindings.BindingType { + return GracefulRestartConfigBindingType() +} + +func (s *GracefulRestartConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GracefulRestartConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// BGP Graceful Restart timers configuration +type GracefulRestartTimer struct { + // Maximum time BGP speaker will take for the BGP session to be re-established after a restart. Ranges from 1 sec to 3600 sec. This can be used to speed up routing convergence by its peer in case that the BGP speaker does not come back after a restart. If the session does not get re-established within the \"Restart Time\" that the Restarting Speaker advertised previously, the Receiving Speaker will delete all the stale routes from that peer. format: int64 + RestartTimer *int64 + // Maximum time before stale routes are removed from the RIB when the local BGP process restarts. Ranges from 1 sec to 3600 sec. format: int64 + StaleTimer *int64 +} + +func (s *GracefulRestartTimer) GetType__() bindings.BindingType { + return GracefulRestartTimerBindingType() +} + +func (s *GracefulRestartTimer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GracefulRestartTimer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents configuration of a graph widget +type GraphConfiguration struct { + Axes *Axes + // If true, value of a point is shown as label on X axis. If false, value of point is not shown as label on X axis. false can be useful in situations where there are too many points and showing the X value as label can clutter the X axis. + DisplayxValue *bool + // Graphs + Graphs []GraphDefinition + // An array of graphs colors which will be applied to each graph seperately. if number of provided colors are smaller than number of graph in the widget then colors are applied in circular manner. + GraphsColors []string + // List of line chart plotting configuration. This plotting configuration will be applicable for the LINE_GRAPH only. + LineChartPlotConfigs []LineChartPlotConfiguration + // Hyperlink of the specified UI page that provides details. + Navigation *string + // Possible values are: + // + // * GraphConfiguration#GraphConfiguration_SUB_TYPE_LINE_GRAPH + // * GraphConfiguration#GraphConfiguration_SUB_TYPE_BAR_GRAPH + // * GraphConfiguration#GraphConfiguration_SUB_TYPE_STACKED_BAR_GRAPH + // + // Describes the the type of graph. LINE_GRAPH shows a line graph chart BAR_GRAPH shows a simple bar graph chart STACKED_BAR_GRAPH shows a stacked bar graph chart + SubType *string + // Possible values are: + // + // * GraphConfiguration#GraphConfiguration_XVALUE_TYPE_STRING + // * GraphConfiguration#GraphConfiguration_XVALUE_TYPE_NUMBER + // * GraphConfiguration#GraphConfiguration_XVALUE_TYPE_DATE + // * GraphConfiguration#GraphConfiguration_XVALUE_TYPE_MILLISECOND + // * GraphConfiguration#GraphConfiguration_XVALUE_TYPE_SECOND + // + // x value type. + XValueType *string + // Possible values are: + // + // * GraphConfiguration#GraphConfiguration_YVALUE_TYPE_INTEGER + // * GraphConfiguration#GraphConfiguration_YVALUE_TYPE_DOUBLE + // + // y value type. + YValueType *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_TIMERANGEDROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_SPACERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LEGENDWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration, CustomFilterWidgetConfiguration, TimeRangeDropdownFilterWidgetConfiguration, SpacerWidgetConfiguration, LegendWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If the condition is met then the widget will be displayed to UI. If no condition is provided, then the widget will be displayed unconditionally. + Condition *string + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + FeatureSet *FeatureSet + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. This field is deprecated instead use 'filters' property. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + // A List of filter applied to this widget configuration. This will be used to identify the filters applied to this widget. + Filters []string + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + Legend *Legend + // List of plotting configuration for a given widget. Widget plotting configurations which are common across all the widgets types should be define here. + PlotConfigs []WidgetPlotConfiguration + // Represents the vertical span of the widget / container. 1 Row span is equal to 20px. format: int32 + Rowspan *int64 + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // If the value of this field is set to true then card header will be displayed otherwise only card will be displayed without header. + ShowHeader *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const GraphConfiguration__TYPE_IDENTIFIER = "GraphConfiguration" +const GraphConfiguration_SUB_TYPE_LINE_GRAPH = "LINE_GRAPH" +const GraphConfiguration_SUB_TYPE_BAR_GRAPH = "BAR_GRAPH" +const GraphConfiguration_SUB_TYPE_STACKED_BAR_GRAPH = "STACKED_BAR_GRAPH" +const GraphConfiguration_XVALUE_TYPE_STRING = "string" +const GraphConfiguration_XVALUE_TYPE_NUMBER = "number" +const GraphConfiguration_XVALUE_TYPE_DATE = "date" +const GraphConfiguration_XVALUE_TYPE_MILLISECOND = "millisecond" +const GraphConfiguration_XVALUE_TYPE_SECOND = "second" +const GraphConfiguration_YVALUE_TYPE_INTEGER = "integer" +const GraphConfiguration_YVALUE_TYPE_DOUBLE = "double" + +func (s *GraphConfiguration) GetType__() bindings.BindingType { + return GraphConfigurationBindingType() +} + +func (s *GraphConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GraphConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Defines a graph +type GraphDefinition struct { + // Identifier of graph. It can be used to differentiate multiple graph series present in GraphWidgetConfiguration. + Id *string + Label *Label + PointDefinition *PointDefinition + // Additional rendering or conditional evaluation of the field values to be performed, if any. + RenderConfiguration []RenderConfiguration + // An expression that represents the series of the graph + RowListField *string +} + +func (s *GraphDefinition) GetType__() bindings.BindingType { + return GraphDefinitionBindingType() +} + +func (s *GraphDefinition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GraphDefinition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents configuration of a Grid or Table widget. +type GridConfiguration struct { + // Array of columns of a Grid widget + Columns []ColumnItem + // Number of records per page. page_size will be effective only when the urls provided in the datasource support paging. format: int32 + PageSize *int64 + // Rows of grid or table are formed from the list of objects returned by a row list field. + RowListFields []RowListField + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_TIMERANGEDROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_SPACERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LEGENDWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration, CustomFilterWidgetConfiguration, TimeRangeDropdownFilterWidgetConfiguration, SpacerWidgetConfiguration, LegendWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If the condition is met then the widget will be displayed to UI. If no condition is provided, then the widget will be displayed unconditionally. + Condition *string + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + FeatureSet *FeatureSet + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. This field is deprecated instead use 'filters' property. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + // A List of filter applied to this widget configuration. This will be used to identify the filters applied to this widget. + Filters []string + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + Legend *Legend + // List of plotting configuration for a given widget. Widget plotting configurations which are common across all the widgets types should be define here. + PlotConfigs []WidgetPlotConfiguration + // Represents the vertical span of the widget / container. 1 Row span is equal to 20px. format: int32 + Rowspan *int64 + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // If the value of this field is set to true then card header will be displayed otherwise only card will be displayed without header. + ShowHeader *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const GridConfiguration__TYPE_IDENTIFIER = "GridConfiguration" + +func (s *GridConfiguration) GetType__() bindings.BindingType { + return GridConfigurationBindingType() +} + +func (s *GridConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GridConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Detailed feedback requests from the migration tool where user input is required. +type GroupedMigrationFeedbackRequest struct { + // List of acceptable actions for this feedback request. + AcceptedActions []string + // Data type of the items listed in acceptable values list. + AcceptedValueType *string + // List of acceptable values for this feedback request. + AcceptedValues []string + // Identify a feedback request type across objects. This can be used to group together objects with similar feedback request and resolve them in one go. + Hash *string + // Detailed feedback request with options. + Message *string + // Indicates if multiple values can be selected as response from the list of acceptable value. + MultiValue *bool + // Collection of feedback requests of a given type + Objects []SummaryMigrationFeedbackRequest + // Indicates if a valid response already exist for all feedback requests in this group. + Resolved *bool + // Functional sub-area that this query falls into. + SubVertical *string + // The suggested action to resolve this feedback request. + SuggestedAction *string + // The suggested value to resolve this feedback request. + SuggestedValue *string + // Functional area that this query falls into. + Vertical *string +} + +func (s *GroupedMigrationFeedbackRequest) GetType__() bindings.BindingType { + return GroupedMigrationFeedbackRequestBindingType() +} + +func (s *GroupedMigrationFeedbackRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GroupedMigrationFeedbackRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Groups of detailed feedback requests from the migration tool where user input is required. +type GroupedMigrationFeedbackRequestListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged Collection of groups of feedback requests + Results []GroupedMigrationFeedbackRequest +} + +func (s *GroupedMigrationFeedbackRequestListResult) GetType__() bindings.BindingType { + return GroupedMigrationFeedbackRequestListResultBindingType() +} + +func (s *GroupedMigrationFeedbackRequestListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GroupedMigrationFeedbackRequestListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Guest virtual machine details include OS name and computer name of guest VM. +type GuestInfo struct { + // Computer name of guest virtual machine, which is set inside guest OS. Currently this is supported for guests on ESXi that have VMware Tools installed. + ComputerName *string + // OS name of guest virtual machine. Currently this is supported for guests on ESXi that have VMware Tools installed. + OsName *string +} + +func (s *GuestInfo) GetType__() bindings.BindingType { + return GuestInfoBindingType() +} + +func (s *GuestInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for GuestInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type HaVipConfig struct { + // Flag to enable this ha vip config. + Enabled *bool + // Array of IP address subnets which will be used as floating IP addresses. | Note - this configuration is applicable only for Active-Standby LogicalRouter. | For Active-Active LogicalRouter this configuration will be rejected. + HaVipSubnets []VIPSubnet + // Identifiers of logical router uplink ports which are to be paired to provide | redundancy. Floating IP will be owned by one of these uplink ports (depending upon | which node is Active). + RedundantUplinkPortIds []string +} + +func (s *HaVipConfig) GetType__() bindings.BindingType { + return HaVipConfigBindingType() +} + +func (s *HaVipConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HaVipConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Header of a widget that provides additional information. This will be shown at the container level. It includes details as label value pairs. +type Header struct { + // If the condition is met then the header will be applied. Examples of expression syntax are provided under 'example_request' section of 'CreateWidgetConfiguration' API. + Condition *string + // Possible values are: + // + // * Header#Header_CONTENT_ALIGNMENT_LEFT + // * Header#Header_CONTENT_ALIGNMENT_RIGHT + // + // Alignment of header labels. + ContentAlignment *string + // An array of widgets which will appear inside the container header Instead of 'sub_headers' property use this property. + SubHeaderWidgets []WidgetItem + // An array of label-value properties. This field is deprecated instead used 'sub_header_widgets' property to define header widgets. + SubHeaders []PropertyItem +} + +const Header_CONTENT_ALIGNMENT_LEFT = "LEFT" +const Header_CONTENT_ALIGNMENT_RIGHT = "RIGHT" + +func (s *Header) GetType__() bindings.BindingType { + return HeaderBindingType() +} + +func (s *Header) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Header._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Result of health check. +type HealthCheckResult struct { + // List of health check results on specific transport node. + ResultsPerTransportNode []HealthCheckResultPerTransportNode + // Timestamp of check result updated. format: int64 + UpdatedTime *int64 + // Possible values are: + // + // * HealthCheckResult#HealthCheckResult_VLAN_MTU_STATUS_TRUNKED + // * HealthCheckResult#HealthCheckResult_VLAN_MTU_STATUS_UNTRUNKED + // * HealthCheckResult#HealthCheckResult_VLAN_MTU_STATUS_UNKNOWN + // + // Overall status of VLAN-MTU health check result. + VlanMtuStatus *string +} + +const HealthCheckResult_VLAN_MTU_STATUS_TRUNKED = "TRUNKED" +const HealthCheckResult_VLAN_MTU_STATUS_UNTRUNKED = "UNTRUNKED" +const HealthCheckResult_VLAN_MTU_STATUS_UNKNOWN = "UNKNOWN" + +func (s *HealthCheckResult) GetType__() bindings.BindingType { + return HealthCheckResultBindingType() +} + +func (s *HealthCheckResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HealthCheckResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Health check result on specific host switch of specific transport node. +type HealthCheckResultOnHostSwitch struct { + // Name of the host switch. + HostSwitchName *string + // List of health check results per uplink on current host switch of specific transport node. + ResultsPerUplink []HealthCheckResultPerUplink + // Timestamp of check result updated. format: int64 + UpdatedTime *int64 + // Possible values are: + // + // * HealthCheckResultOnHostSwitch#HealthCheckResultOnHostSwitch_VLAN_MTU_STATUS_TRUNKED + // * HealthCheckResultOnHostSwitch#HealthCheckResultOnHostSwitch_VLAN_MTU_STATUS_UNTRUNKED + // * HealthCheckResultOnHostSwitch#HealthCheckResultOnHostSwitch_VLAN_MTU_STATUS_UNKNOWN + // + // Status of VLAN-MTU health check result on host switch. + VlanMtuStatus *string +} + +const HealthCheckResultOnHostSwitch_VLAN_MTU_STATUS_TRUNKED = "TRUNKED" +const HealthCheckResultOnHostSwitch_VLAN_MTU_STATUS_UNTRUNKED = "UNTRUNKED" +const HealthCheckResultOnHostSwitch_VLAN_MTU_STATUS_UNKNOWN = "UNKNOWN" + +func (s *HealthCheckResultOnHostSwitch) GetType__() bindings.BindingType { + return HealthCheckResultOnHostSwitchBindingType() +} + +func (s *HealthCheckResultOnHostSwitch) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HealthCheckResultOnHostSwitch._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Health check result on specific transport node +type HealthCheckResultPerTransportNode struct { + ResultOnHostSwitch *HealthCheckResultOnHostSwitch + // ID of the Transport Node. + TransportNodeId *string +} + +func (s *HealthCheckResultPerTransportNode) GetType__() bindings.BindingType { + return HealthCheckResultPerTransportNodeBindingType() +} + +func (s *HealthCheckResultPerTransportNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HealthCheckResultPerTransportNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Health check result for specific uplink. +type HealthCheckResultPerUplink struct { + // List of VLAN ID ranges which are allowed by VLAN settings but may be disallowed by MTU settings. + MtuDisallowed []HealthCheckVlanRange + // Name of the uplink. + UplinkName *string + // List of VLAN ID ranges which are allowed by VLAN and MTU settings. + VlanAndMtuAllowed []HealthCheckVlanRange + // List of VLAN ID ranges which may be disallowed by VLAN settings. + VlanDisallowed []HealthCheckVlanRange +} + +func (s *HealthCheckResultPerUplink) GetType__() bindings.BindingType { + return HealthCheckResultPerUplinkBindingType() +} + +func (s *HealthCheckResultPerUplink) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HealthCheckResultPerUplink._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// HealthCheckSpecVlan is used for specifying VLAN ID ranges for healthcheck. +type HealthCheckSpecVlans struct { + // VLAN ID ranges + VlanRanges []HealthCheckVlanRange +} + +func (s *HealthCheckSpecVlans) GetType__() bindings.BindingType { + return HealthCheckSpecVlansBindingType() +} + +func (s *HealthCheckSpecVlans) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HealthCheckSpecVlans._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// VLAN ID range +type HealthCheckVlanRange struct { + // Virtual Local Area Network Identifier format: int64 + End *int64 + // Virtual Local Area Network Identifier format: int64 + Start *int64 +} + +func (s *HealthCheckVlanRange) GetType__() bindings.BindingType { + return HealthCheckVlanRangeBindingType() +} + +func (s *HealthCheckVlanRange) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HealthCheckVlanRange._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type HeatMapTransportNodesAggregateStatus struct { + // Number of transport nodes that are degraded format: int32 + DegradedCount *int64 + // Number of transport nodes that are down format: int32 + DownCount *int64 + // Number of transport nodes with unknown status format: int32 + UnknownCount *int64 + // Number of transport nodes that are up format: int32 + UpCount *int64 +} + +func (s *HeatMapTransportNodesAggregateStatus) GetType__() bindings.BindingType { + return HeatMapTransportNodesAggregateStatusBindingType() +} + +func (s *HeatMapTransportNodesAggregateStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HeatMapTransportNodesAggregateStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type HeatMapTransportZoneStatus struct { + // Number of transport nodes that are degraded format: int32 + DegradedCount *int64 + // Number of transport nodes that are down format: int32 + DownCount *int64 + // Number of transport nodes with unknown status format: int32 + UnknownCount *int64 + // Number of transport nodes that are up format: int32 + UpCount *int64 +} + +func (s *HeatMapTransportZoneStatus) GetType__() bindings.BindingType { + return HeatMapTransportZoneStatusBindingType() +} + +func (s *HeatMapTransportZoneStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HeatMapTransportZoneStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The traffic_name specifies the infrastructure traffic type and it must be one of the following system-defined types: FAULT_TOLERANCE is traffic for failover and recovery. HBR is traffic for Host based replication. ISCSI is traffic for Internet Small Computer System Interface. MANAGEMENT is traffic for host management. NFS is traffic related to file transfer in network file system. VDP is traffic for vSphere data protection. VIRTUAL_MACHINE is traffic generated by virtual machines. VMOTION is traffic for computing resource migration. VSAN is traffic generated by virtual storage area network. The dynamic_res_pool_name provides a name for the resource pool. It can be any arbitrary string. Either traffic_name or dynamic_res_pool_name must be set. If both are specified or omitted, an error will be returned. +type HostInfraTrafficType struct { + // Dynamic resource pool traffic name + DynamicResPoolName *string + // Possible values are: + // + // * HostInfraTrafficType#HostInfraTrafficType_TRAFFIC_NAME_FAULT_TOLERANCE + // * HostInfraTrafficType#HostInfraTrafficType_TRAFFIC_NAME_HBR + // * HostInfraTrafficType#HostInfraTrafficType_TRAFFIC_NAME_ISCSI + // * HostInfraTrafficType#HostInfraTrafficType_TRAFFIC_NAME_MANAGEMENT + // * HostInfraTrafficType#HostInfraTrafficType_TRAFFIC_NAME_NFS + // * HostInfraTrafficType#HostInfraTrafficType_TRAFFIC_NAME_VDP + // * HostInfraTrafficType#HostInfraTrafficType_TRAFFIC_NAME_VIRTUAL_MACHINE + // * HostInfraTrafficType#HostInfraTrafficType_TRAFFIC_NAME_VMOTION + // * HostInfraTrafficType#HostInfraTrafficType_TRAFFIC_NAME_VSAN + // + // Traffic types + TrafficName *string +} + +const HostInfraTrafficType_TRAFFIC_NAME_FAULT_TOLERANCE = "FAULT_TOLERANCE" +const HostInfraTrafficType_TRAFFIC_NAME_HBR = "HBR" +const HostInfraTrafficType_TRAFFIC_NAME_ISCSI = "ISCSI" +const HostInfraTrafficType_TRAFFIC_NAME_MANAGEMENT = "MANAGEMENT" +const HostInfraTrafficType_TRAFFIC_NAME_NFS = "NFS" +const HostInfraTrafficType_TRAFFIC_NAME_VDP = "VDP" +const HostInfraTrafficType_TRAFFIC_NAME_VIRTUAL_MACHINE = "VIRTUAL_MACHINE" +const HostInfraTrafficType_TRAFFIC_NAME_VMOTION = "VMOTION" +const HostInfraTrafficType_TRAFFIC_NAME_VSAN = "VSAN" + +func (s *HostInfraTrafficType) GetType__() bindings.BindingType { + return HostInfraTrafficTypeBindingType() +} + +func (s *HostInfraTrafficType) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HostInfraTrafficType._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Host node +type HostNode struct { + // Id of the compute collection to which discovered node belongs. + ComputeCollectionId *string + // Id of discovered node which was converted to create this node + DiscoveredNodeId *string + HostCredential *HostNodeLoginCredential + // Possible values are: + // + // * HostNode#HostNode_MAINTENANCE_MODE_STATE_OFF + // * HostNode#HostNode_MAINTENANCE_MODE_STATE_ENTERING + // * HostNode#HostNode_MAINTENANCE_MODE_STATE_ON + // + // Indicates host node's maintenance mode state. The state is ENTERING when a task to put the host in maintenance-mode is in progress. + MaintenanceModeState *string + // The id of the vCenter server managing the ESXi type HostNode + ManagedByServer *string + // Possible values are: + // + // * HostNode#HostNode_OS_TYPE_ESXI + // * HostNode#HostNode_OS_TYPE_RHELKVM + // * HostNode#HostNode_OS_TYPE_RHELSERVER + // * HostNode#HostNode_OS_TYPE_WINDOWSSERVER + // * HostNode#HostNode_OS_TYPE_RHELCONTAINER + // * HostNode#HostNode_OS_TYPE_UBUNTUKVM + // * HostNode#HostNode_OS_TYPE_UBUNTUSERVER + // * HostNode#HostNode_OS_TYPE_HYPERV + // * HostNode#HostNode_OS_TYPE_CENTOSKVM + // * HostNode#HostNode_OS_TYPE_CENTOSSERVER + // * HostNode#HostNode_OS_TYPE_CENTOSCONTAINER + // * HostNode#HostNode_OS_TYPE_SLESKVM + // * HostNode#HostNode_OS_TYPE_SLESSERVER + // * HostNode#HostNode_OS_TYPE_OELSERVER + // + // Hypervisor type, for example ESXi or RHEL KVM + OsType *string + // Version of the hypervisor operating system + OsVersion *string + // Specify an installation folder to install the NSX kernel modules for Windows Server. By default, it is C:\\Program Files\\VMware\\NSX\\. + WindowsInstallLocation *string + // This field is deprecated. TransportNode field 'description' must be used instead. For EdgeNode and PublicCloudGatewayNode, this field is ignored if specified in request payload. + Description *string + // Discovered IP Addresses of the fabric node, version 4 or 6 format: ip + DiscoveredIpAddresses []string + // This field is deprecated. TransportNode field 'display_name' must be used instead. For HostNode, this field defaults to ID if not set. For EdgeNode and PublicCloudGatewayNode, this field is ignored if specified in request payload. + DisplayName *string + // ID of the Node maintained on the Node and used to recognize the Node + ExternalId *string + // Fully qualified domain name of the fabric node + Fqdn *string + // Unique identifier of this resource. + Id *string + // IP Addresses of the Node, version 4 or 6. This property is mandatory for all nodes except for automatic deployment of edge virtual machine node. For automatic deployment, the ip address from management_port_subnets property will be considered. format: ip + IpAddresses []string + // Fabric node type, for example 'HostNode', 'EdgeNode' or 'PublicCloudGatewayNode' + ResourceType string + // This field is deprecated. TransportNode field 'tags' must be used instead. For EdgeNode and PublicCloudGatewayNode, this field is ignored if specified in request payload. + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const HostNode__TYPE_IDENTIFIER = "HostNode" +const HostNode_MAINTENANCE_MODE_STATE_OFF = "OFF" +const HostNode_MAINTENANCE_MODE_STATE_ENTERING = "ENTERING" +const HostNode_MAINTENANCE_MODE_STATE_ON = "ON" +const HostNode_OS_TYPE_ESXI = "ESXI" +const HostNode_OS_TYPE_RHELKVM = "RHELKVM" +const HostNode_OS_TYPE_RHELSERVER = "RHELSERVER" +const HostNode_OS_TYPE_WINDOWSSERVER = "WINDOWSSERVER" +const HostNode_OS_TYPE_RHELCONTAINER = "RHELCONTAINER" +const HostNode_OS_TYPE_UBUNTUKVM = "UBUNTUKVM" +const HostNode_OS_TYPE_UBUNTUSERVER = "UBUNTUSERVER" +const HostNode_OS_TYPE_HYPERV = "HYPERV" +const HostNode_OS_TYPE_CENTOSKVM = "CENTOSKVM" +const HostNode_OS_TYPE_CENTOSSERVER = "CENTOSSERVER" +const HostNode_OS_TYPE_CENTOSCONTAINER = "CENTOSCONTAINER" +const HostNode_OS_TYPE_SLESKVM = "SLESKVM" +const HostNode_OS_TYPE_SLESSERVER = "SLESSERVER" +const HostNode_OS_TYPE_OELSERVER = "OELSERVER" + +func (s *HostNode) GetType__() bindings.BindingType { + return HostNodeBindingType() +} + +func (s *HostNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HostNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The credentials to login into the host node +type HostNodeLoginCredential struct { + // The authentication password of the host node + Password *string + // For ESXi hosts, the thumbprint of the ESXi management service. For KVM hosts, the SSH key fingerprint. If thumbprint is not provided then connection to host may not be established and API call will fail. + Thumbprint *string + // The username of the account on the host node + Username *string +} + +func (s *HostNodeLoginCredential) GetType__() bindings.BindingType { + return HostNodeLoginCredentialBindingType() +} + +func (s *HostNodeLoginCredential) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HostNodeLoginCredential._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Host Node Status +type HostNodeStatus struct { + // Possible values are: + // + // * HostNodeStatus#HostNodeStatus_CONFIG_STATUS_PENDING + // * HostNodeStatus#HostNodeStatus_CONFIG_STATUS_IN_PROGRESS + // * HostNodeStatus#HostNodeStatus_CONFIG_STATUS_SUCCESS + // * HostNodeStatus#HostNodeStatus_CONFIG_STATUS_FAILED + // * HostNodeStatus#HostNodeStatus_CONFIG_STATUS_PARTIAL_SUCCESS + // * HostNodeStatus#HostNodeStatus_CONFIG_STATUS_ORPHANED + // * HostNodeStatus#HostNodeStatus_CONFIG_STATUS_UNKNOWN + // * HostNodeStatus#HostNodeStatus_CONFIG_STATUS_ERROR + // + // Gives details of state of desired configuration. This property is available only if Tranport Node exists for the host. Following are the supported values pending - Transport Node configuration status is pending in_progress - Transport Node configuration status is in progress success - Transport Node configuration status is successful failed - Transport Node configuration status is failed partial_success - Transport Node configuration status is partial success orphaned - Transport Node configuration status is orphaned unknown - Transport Node configuration status is unknown error - Error occured during Transport Node configuration + ConfigStatus *string + // Possible values are: + // + // * HostNodeStatus#HostNodeStatus_DEPLOYMENT_STATUS_INSTALL_IN_PROGRESS + // * HostNodeStatus#HostNodeStatus_DEPLOYMENT_STATUS_INSTALL_FAILED + // * HostNodeStatus#HostNodeStatus_DEPLOYMENT_STATUS_INSTALL_SUCCESSFUL + // * HostNodeStatus#HostNodeStatus_DEPLOYMENT_STATUS_UNINSTALL_IN_PROGRESS + // * HostNodeStatus#HostNodeStatus_DEPLOYMENT_STATUS_UNINSTALL_FAILED + // * HostNodeStatus#HostNodeStatus_DEPLOYMENT_STATUS_UNINSTALL_SUCCESSFUL + // * HostNodeStatus#HostNodeStatus_DEPLOYMENT_STATUS_UNINSTALL_SCHEDULED + // * HostNodeStatus#HostNodeStatus_DEPLOYMENT_STATUS_UPGRADE_IN_PROGRESS + // * HostNodeStatus#HostNodeStatus_DEPLOYMENT_STATUS_UPGRADE_FAILED + // * HostNodeStatus#HostNodeStatus_DEPLOYMENT_STATUS_DEPLOYMENT_QUEUED + // * HostNodeStatus#HostNodeStatus_DEPLOYMENT_STATUS_DEPLOYMENT_IN_PROGRESS + // * HostNodeStatus#HostNodeStatus_DEPLOYMENT_STATUS_DEPLOYMENT_FAILED + // * HostNodeStatus#HostNodeStatus_DEPLOYMENT_STATUS_DEPLOYMENT_SUCCESSFUL + // * HostNodeStatus#HostNodeStatus_DEPLOYMENT_STATUS_UNDEPLOYMENT_QUEUED + // * HostNodeStatus#HostNodeStatus_DEPLOYMENT_STATUS_UNDEPLOYMENT_IN_PROGRESS + // * HostNodeStatus#HostNodeStatus_DEPLOYMENT_STATUS_UNDEPLOYMENT_FAILED + // * HostNodeStatus#HostNodeStatus_DEPLOYMENT_STATUS_UNDEPLOYMENT_SUCCESSFUL + // * HostNodeStatus#HostNodeStatus_DEPLOYMENT_STATUS_UPGRADE_QUEUED + // * HostNodeStatus#HostNodeStatus_DEPLOYMENT_STATUS_HOST_DISCONNECTED + // * HostNodeStatus#HostNodeStatus_DEPLOYMENT_STATUS_POWERED_OFF + // + // This specifies the current nsx install status for host node. Following are the supported values INSTALL_IN_PROGRESS - NSX installation is in progress on the host INSTALL_FAILED - NSX installation failed on the host INSTALL_SUCCESSFUL - NSX installation successful on the host UNINSTALL_IN_PROGRESS - NSX uninstallation in progress on the host UNINSTALL_FAILED - NSX uninstallation failed on the host UNINSTALL_SUCCESSFUL - NSX uninstallation successful on the host UNINSTALL_SCHEDULED - NSX uninstallation is scheduled on the host UPGRADE_IN_PROGRESS - NSX upgrade is in progress on the host UPGRADE_FAILED - NSX upgrade failed on the host DEPLOYMENT_QUEUED - Deployment is queued on the DEPLOYMENT_IN_PROGRESS - Deployment is in progress DEPLOYMENT_FAILED - Deployment is failed DEPLOYMENT_SUCCESSFUL - Deployment is successful UNDEPLOYMENT_QUEUED - Undeployment is queued UNDEPLOYMENT_IN_PROGRESS - Undeployment is in progress UNDEPLOYMENT_FAILED - Undeployment failed UNDEPLOYMENT_SUCCESSFUL - Undeployment is successful UPGRADE_QUEUED - Upgrade is queued HOST_DISCONNECTED - Host is disconnected POWERED_OFF - Host is powered off + DeploymentStatus *string + // Unique Id of the host node + NodeId *string +} + +const HostNodeStatus_CONFIG_STATUS_PENDING = "pending" +const HostNodeStatus_CONFIG_STATUS_IN_PROGRESS = "in_progress" +const HostNodeStatus_CONFIG_STATUS_SUCCESS = "success" +const HostNodeStatus_CONFIG_STATUS_FAILED = "failed" +const HostNodeStatus_CONFIG_STATUS_PARTIAL_SUCCESS = "partial_success" +const HostNodeStatus_CONFIG_STATUS_ORPHANED = "orphaned" +const HostNodeStatus_CONFIG_STATUS_UNKNOWN = "unknown" +const HostNodeStatus_CONFIG_STATUS_ERROR = "error" +const HostNodeStatus_DEPLOYMENT_STATUS_INSTALL_IN_PROGRESS = "INSTALL_IN_PROGRESS" +const HostNodeStatus_DEPLOYMENT_STATUS_INSTALL_FAILED = "INSTALL_FAILED" +const HostNodeStatus_DEPLOYMENT_STATUS_INSTALL_SUCCESSFUL = "INSTALL_SUCCESSFUL" +const HostNodeStatus_DEPLOYMENT_STATUS_UNINSTALL_IN_PROGRESS = "UNINSTALL_IN_PROGRESS" +const HostNodeStatus_DEPLOYMENT_STATUS_UNINSTALL_FAILED = "UNINSTALL_FAILED" +const HostNodeStatus_DEPLOYMENT_STATUS_UNINSTALL_SUCCESSFUL = "UNINSTALL_SUCCESSFUL" +const HostNodeStatus_DEPLOYMENT_STATUS_UNINSTALL_SCHEDULED = "UNINSTALL_SCHEDULED" +const HostNodeStatus_DEPLOYMENT_STATUS_UPGRADE_IN_PROGRESS = "UPGRADE_IN_PROGRESS" +const HostNodeStatus_DEPLOYMENT_STATUS_UPGRADE_FAILED = "UPGRADE_FAILED" +const HostNodeStatus_DEPLOYMENT_STATUS_DEPLOYMENT_QUEUED = "DEPLOYMENT_QUEUED" +const HostNodeStatus_DEPLOYMENT_STATUS_DEPLOYMENT_IN_PROGRESS = "DEPLOYMENT_IN_PROGRESS" +const HostNodeStatus_DEPLOYMENT_STATUS_DEPLOYMENT_FAILED = "DEPLOYMENT_FAILED" +const HostNodeStatus_DEPLOYMENT_STATUS_DEPLOYMENT_SUCCESSFUL = "DEPLOYMENT_SUCCESSFUL" +const HostNodeStatus_DEPLOYMENT_STATUS_UNDEPLOYMENT_QUEUED = "UNDEPLOYMENT_QUEUED" +const HostNodeStatus_DEPLOYMENT_STATUS_UNDEPLOYMENT_IN_PROGRESS = "UNDEPLOYMENT_IN_PROGRESS" +const HostNodeStatus_DEPLOYMENT_STATUS_UNDEPLOYMENT_FAILED = "UNDEPLOYMENT_FAILED" +const HostNodeStatus_DEPLOYMENT_STATUS_UNDEPLOYMENT_SUCCESSFUL = "UNDEPLOYMENT_SUCCESSFUL" +const HostNodeStatus_DEPLOYMENT_STATUS_UPGRADE_QUEUED = "UPGRADE_QUEUED" +const HostNodeStatus_DEPLOYMENT_STATUS_HOST_DISCONNECTED = "HOST_DISCONNECTED" +const HostNodeStatus_DEPLOYMENT_STATUS_POWERED_OFF = "POWERED_OFF" + +func (s *HostNodeStatus) GetType__() bindings.BindingType { + return HostNodeStatusBindingType() +} + +func (s *HostNodeStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HostNodeStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// HostNodeStatus queries result +type HostNodeStatusListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // HostNodeStatus Results + Results []HostNodeStatus +} + +func (s *HostNodeStatusListResult) GetType__() bindings.BindingType { + return HostNodeStatusListResultBindingType() +} + +func (s *HostNodeStatusListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HostNodeStatusListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Information of host switch participating in transport zone +type HostSwitchInfo struct { + // Unique ID of a host switch + HostSwitchId *string + // Possible values are: + // + // * HostSwitchInfo#HostSwitchInfo_HOST_SWITCH_MODE_STANDARD + // * HostSwitchInfo#HostSwitchInfo_HOST_SWITCH_MODE_ENS + // * HostSwitchInfo#HostSwitchInfo_HOST_SWITCH_MODE_ENS_INTERRUPT + // + // Mode of host switch + HostSwitchMode *string + // Name of a host switch + HostSwitchName *string + // Possible values are: + // + // * HostSwitchInfo#HostSwitchInfo_HOST_SWITCH_TYPE_NVDS + // * HostSwitchInfo#HostSwitchInfo_HOST_SWITCH_TYPE_VDS + // + // Type of a host switch + HostSwitchType *string +} + +const HostSwitchInfo_HOST_SWITCH_MODE_STANDARD = "STANDARD" +const HostSwitchInfo_HOST_SWITCH_MODE_ENS = "ENS" +const HostSwitchInfo_HOST_SWITCH_MODE_ENS_INTERRUPT = "ENS_INTERRUPT" +const HostSwitchInfo_HOST_SWITCH_TYPE_NVDS = "NVDS" +const HostSwitchInfo_HOST_SWITCH_TYPE_VDS = "VDS" + +func (s *HostSwitchInfo) GetType__() bindings.BindingType { + return HostSwitchInfoBindingType() +} + +func (s *HostSwitchInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HostSwitchInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type HostSwitchProfileTypeIdEntry struct { + // Possible values are: + // + // * HostSwitchProfileTypeIdEntry#HostSwitchProfileTypeIdEntry_KEY_UPLINKHOSTSWITCHPROFILE + // * HostSwitchProfileTypeIdEntry#HostSwitchProfileTypeIdEntry_KEY_LLDPHOSTSWITCHPROFILE + // * HostSwitchProfileTypeIdEntry#HostSwitchProfileTypeIdEntry_KEY_NIOCPROFILE + // * HostSwitchProfileTypeIdEntry#HostSwitchProfileTypeIdEntry_KEY_EXTRACONFIGHOSTSWITCHPROFILE + // + // Supported HostSwitch profiles. + Key *string + // key value + Value *string +} + +const HostSwitchProfileTypeIdEntry_KEY_UPLINKHOSTSWITCHPROFILE = "UplinkHostSwitchProfile" +const HostSwitchProfileTypeIdEntry_KEY_LLDPHOSTSWITCHPROFILE = "LldpHostSwitchProfile" +const HostSwitchProfileTypeIdEntry_KEY_NIOCPROFILE = "NiocProfile" +const HostSwitchProfileTypeIdEntry_KEY_EXTRACONFIGHOSTSWITCHPROFILE = "ExtraConfigHostSwitchProfile" + +func (s *HostSwitchProfileTypeIdEntry) GetType__() bindings.BindingType { + return HostSwitchProfileTypeIdEntryBindingType() +} + +func (s *HostSwitchProfileTypeIdEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HostSwitchProfileTypeIdEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// HostSwitch Profile queries result +type HostSwitchProfilesListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // HostSwitch Profile Results + Results []*data.StructValue +} + +func (s *HostSwitchProfilesListResult) GetType__() bindings.BindingType { + return HostSwitchProfilesListResultBindingType() +} + +func (s *HostSwitchProfilesListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HostSwitchProfilesListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The HostSwitchSpec is the base class for standard and preconfigured host switch specifications. +type HostSwitchSpec struct { + // Possible values are: + // + // * HostSwitchSpec#HostSwitchSpec_RESOURCE_TYPE_STANDARDHOSTSWITCHSPEC + // * HostSwitchSpec#HostSwitchSpec_RESOURCE_TYPE_PRECONFIGUREDHOSTSWITCHSPEC + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const HostSwitchSpec__TYPE_IDENTIFIER = "HostSwitchSpec" +const HostSwitchSpec_RESOURCE_TYPE_STANDARDHOSTSWITCHSPEC = "StandardHostSwitchSpec" +const HostSwitchSpec_RESOURCE_TYPE_PRECONFIGUREDHOSTSWITCHSPEC = "PreconfiguredHostSwitchSpec" + +func (s *HostSwitchSpec) GetType__() bindings.BindingType { + return HostSwitchSpecBindingType() +} + +func (s *HostSwitchSpec) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HostSwitchSpec._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Host Switch State +type HostSwitchState struct { + // List of virtual tunnel endpoints which are configured on this switch + Endpoints []Endpoint + // External ID of the HostSwitch + HostSwitchId *string + // The name must be unique among all host switches specified in a given Transport Node. + HostSwitchName *string + // Possible values are: + // + // * HostSwitchState#HostSwitchState_HOST_SWITCH_TYPE_NVDS + // * HostSwitchState#HostSwitchState_HOST_SWITCH_TYPE_VDS + // + // VDS represents VMware vSphere Distributed Switch from vSphere that is used as HostSwitch through TransportNode or TransportNodeProfile configuration. When VDS is used as a HostSwitch, Hosts have to be added to VDS from vSphere and VDS instance is created on Hosts. To configure NSX on such hosts, you can use this VDS as a HostSwitch from NSX manager. vCenter has the ownership of MTU, LAG, NIOC and LLDP configuration of such VDS backed HostSwitch. Remaining configuration (e.g. UplinkHostswitchProfile) will be managed by NSX. NVDS represents NSX Virtual Switch which is NSX native HostSwitch. All configurations of NVDS will be managed by NSX. + HostSwitchType *string + // List of Ids of TransportZones this HostSwitch belongs to + TransportZoneIds []string +} + +const HostSwitchState_HOST_SWITCH_TYPE_NVDS = "NVDS" +const HostSwitchState_HOST_SWITCH_TYPE_VDS = "VDS" + +func (s *HostSwitchState) GetType__() bindings.BindingType { + return HostSwitchStateBindingType() +} + +func (s *HostSwitchState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HostSwitchState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Status of host upgrade +type HostUpgradeStatus struct { + // This field indicates whether we can perform upgrade rollback. + CanRollback *bool + // Can the upgrade of the remaining units in this component be skipped + CanSkip *bool + // Component type for the upgrade status + ComponentType *string + CurrentVersionNodeSummary *NodeSummaryList + // Details about the upgrade status + Details *string + // Number of nodes of the type and at the component version format: int32 + NodeCountAtTargetVersion *int64 + // Indicator of upgrade progress in percentage + PercentComplete *float64 + PreUpgradeStatus *UpgradeChecksExecutionStatus + // Possible values are: + // + // * HostUpgradeStatus#HostUpgradeStatus_STATUS_SUCCESS + // * HostUpgradeStatus#HostUpgradeStatus_STATUS_FAILED + // * HostUpgradeStatus#HostUpgradeStatus_STATUS_IN_PROGRESS + // * HostUpgradeStatus#HostUpgradeStatus_STATUS_NOT_STARTED + // * HostUpgradeStatus#HostUpgradeStatus_STATUS_PAUSING + // * HostUpgradeStatus#HostUpgradeStatus_STATUS_PAUSED + // + // Upgrade status of component + Status *string + // Target component version + TargetComponentVersion *string +} + +const HostUpgradeStatus_STATUS_SUCCESS = "SUCCESS" +const HostUpgradeStatus_STATUS_FAILED = "FAILED" +const HostUpgradeStatus_STATUS_IN_PROGRESS = "IN_PROGRESS" +const HostUpgradeStatus_STATUS_NOT_STARTED = "NOT_STARTED" +const HostUpgradeStatus_STATUS_PAUSING = "PAUSING" +const HostUpgradeStatus_STATUS_PAUSED = "PAUSED" + +func (s *HostUpgradeStatus) GetType__() bindings.BindingType { + return HostUpgradeStatusBindingType() +} + +func (s *HostUpgradeStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HostUpgradeStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type HostedEntityInfo struct { + // The type of entity hosted could be MP, CCP, VMC App etc. + EntityType *string + // Unique identifier of entity + EntityUuid *string +} + +func (s *HostedEntityInfo) GetType__() bindings.BindingType { + return HostedEntityInfoBindingType() +} + +func (s *HostedEntityInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HostedEntityInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type HttpProtocol struct { + AuthenticationScheme *BasicAuthenticationScheme + // Possible values are: + // + // * Protocol#Protocol_NAME_HTTP + // * Protocol#Protocol_NAME_HTTPS + // * Protocol#Protocol_NAME_SCP + // * Protocol#Protocol_NAME_SFTP + // + // Protocol name + Name string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const HttpProtocol__TYPE_IDENTIFIER = "HttpProtocol" + +func (s *HttpProtocol) GetType__() bindings.BindingType { + return HttpProtocolBindingType() +} + +func (s *HttpProtocol) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HttpProtocol._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// HTTP Service properties +type HttpServiceProperties struct { + // Identifies whether basic authentication is enabled or disabled in API calls. + BasicAuthenticationEnabled *bool + Certificate *Certificate + // Cipher suites used to secure contents of connection + CipherSuites []CipherSuite + // The maximum number of concurrent API requests that will be serviced for a given authenticated client. If the number of API requests being processed exceeds this limit, new API requests will be refused and a 503 Service Unavailable response will be returned to the client. To disable API concurrency limiting, set this value to 0. format: int64 + ClientApiConcurrencyLimit *int64 + // The maximum number of API requests that will be serviced per second for a given authenticated client. If more API requests are received than can be serviced, a 429 Too Many Requests HTTP response will be returned. To disable API rate limiting, set this value to 0. format: int64 + ClientApiRateLimit *int64 + // NSX connection timeout, set to 0 to configure no timeout format: int64 + ConnectionTimeout *int64 + // Identifies whether cookie-based authentication is enabled or disabled in API calls. When cookie-based authentication is disabled, new sessions cannot be created via /api/session/create. + CookieBasedAuthenticationEnabled *bool + // The maximum number of concurrent API requests that will be serviced. If the number of API requests being processed exceeds this limit, new API requests will be refused and a 503 Service Unavailable response will be returned to the client. To disable API concurrency limiting, set this value to 0. format: int64 + GlobalApiConcurrencyLimit *int64 + // Possible values are: + // + // * HttpServiceProperties#HttpServiceProperties_LOGGING_LEVEL_OFF + // * HttpServiceProperties#HttpServiceProperties_LOGGING_LEVEL_FATAL + // * HttpServiceProperties#HttpServiceProperties_LOGGING_LEVEL_ERROR + // * HttpServiceProperties#HttpServiceProperties_LOGGING_LEVEL_WARN + // * HttpServiceProperties#HttpServiceProperties_LOGGING_LEVEL_INFO + // * HttpServiceProperties#HttpServiceProperties_LOGGING_LEVEL_DEBUG + // * HttpServiceProperties#HttpServiceProperties_LOGGING_LEVEL_TRACE + // + // Service logging level + LoggingLevel *string + // TLS protocol versions + ProtocolVersions []ProtocolVersion + // Host name or IP address to use for redirect location headers, or empty string to derive from current request + RedirectHost *string + // NSX session inactivity timeout, set to 0 to configure no timeout format: int64 + SessionTimeout *int64 +} + +const HttpServiceProperties_LOGGING_LEVEL_OFF = "OFF" +const HttpServiceProperties_LOGGING_LEVEL_FATAL = "FATAL" +const HttpServiceProperties_LOGGING_LEVEL_ERROR = "ERROR" +const HttpServiceProperties_LOGGING_LEVEL_WARN = "WARN" +const HttpServiceProperties_LOGGING_LEVEL_INFO = "INFO" +const HttpServiceProperties_LOGGING_LEVEL_DEBUG = "DEBUG" +const HttpServiceProperties_LOGGING_LEVEL_TRACE = "TRACE" + +func (s *HttpServiceProperties) GetType__() bindings.BindingType { + return HttpServicePropertiesBindingType() +} + +func (s *HttpServiceProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HttpServiceProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type HttpsProtocol struct { + AuthenticationScheme *BasicAuthenticationScheme + // SSL thumbprint of server + Sha256Thumbprint *string + // Possible values are: + // + // * Protocol#Protocol_NAME_HTTP + // * Protocol#Protocol_NAME_HTTPS + // * Protocol#Protocol_NAME_SCP + // * Protocol#Protocol_NAME_SFTP + // + // Protocol name + Name string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const HttpsProtocol__TYPE_IDENTIFIER = "HttpsProtocol" + +func (s *HttpsProtocol) GetType__() bindings.BindingType { + return HttpsProtocolBindingType() +} + +func (s *HttpsProtocol) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for HttpsProtocol._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A NSService that represents IPv4 or IPv6 ICMP protocol +type ICMPTypeNSService struct { + // ICMP message code format: int64 + IcmpCode *int64 + // ICMP message type format: int64 + IcmpType *int64 + // Possible values are: + // + // * ICMPTypeNSService#ICMPTypeNSService_PROTOCOL_ICMPV4 + // * ICMPTypeNSService#ICMPTypeNSService_PROTOCOL_ICMPV6 + // + // ICMP protocol type + Protocol *string + // Possible values are: + // + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_ETHERTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_IPPROTOCOLNSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_IGMPTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_ICMPTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_ALGTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_L4PORTSETNSSERVICE + // + // The specific type of NSServiceElement + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ICMPTypeNSService__TYPE_IDENTIFIER = "ICMPTypeNSService" +const ICMPTypeNSService_PROTOCOL_ICMPV4 = "ICMPv4" +const ICMPTypeNSService_PROTOCOL_ICMPV6 = "ICMPv6" + +func (s *ICMPTypeNSService) GetType__() bindings.BindingType { + return ICMPTypeNSServiceBindingType() +} + +func (s *ICMPTypeNSService) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ICMPTypeNSService._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Filtering parameters to get only a subset of intrusion events. +type IDSEventDataRequest struct { + // An array of filter conditions. + Filters []FilterRequest +} + +func (s *IDSEventDataRequest) GetType__() bindings.BindingType { + return IDSEventDataRequestBindingType() +} + +func (s *IDSEventDataRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IDSEventDataRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Intrusions that are detected, grouped by signature. It contains the signature id, severity, name, the number of intrusions of that type and the first occurence. +type IDSEventsBySignature struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Number of times this particular signature was detected. format: int64 + Count *int64 + // First occurence of the intrusion, in epoch milliseconds. format: int64 + FirstOccurence *int64 + // Flag indicating an ongoing intrusion. + IsOngoing *bool + // IDSEvent resource type. + ResourceType *string + // Severity of the threat covered by the signature, can be Critical, High, Medium, or Low. + Severity *string + // Signature ID pertaining to the detected intrusion. format: int64 + SignatureId *int64 + // Name of the signature pertaining to the detected intrusion. + SignatureName *string +} + +func (s *IDSEventsBySignature) GetType__() bindings.BindingType { + return IDSEventsBySignatureBindingType() +} + +func (s *IDSEventsBySignature) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IDSEventsBySignature._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of all intrusions that are detected grouped by signature, it contains minimal details about the intrusions. +type IDSEventsBySignatureResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of all intrusions detected, grouped by signature. The details include signature id, name, severity, timestamp, and total number of attempts per signature. + Results []IDSEventsBySignature +} + +func (s *IDSEventsBySignatureResult) GetType__() bindings.BindingType { + return IDSEventsBySignatureResultBindingType() +} + +func (s *IDSEventsBySignatureResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IDSEventsBySignatureResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Intrusion event with all the event and signature details, each event contains the signature id, name, severity, first and recent occurence, users and VMs affected and other signature metadata. +type IDSEventsSummary struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Count of VMs on which a particular signature was detected. format: int64 + AffectedVmCount *int64 + // First occurence of the intrusion, in epoch milliseconds. format: int64 + FirstOccurence *int64 + // IDS event flow data specific to each IDS event. The data includes source ip, source port, destination ip, destination port, and protocol. + IdsflowDetails *data.StructValue + // Flag indicating an ongoing intrusion. + IsOngoing *bool + // Indicates if the rule id is valid or not. + IsRuleValid *bool + // Latest occurence of the intrusion, in epoch milliseconds. format: int64 + LatestOccurence *int64 + // IDSEvent resource type. + ResourceType *string + // The IDS Rule id that detected this particular intrusion. format: int64 + RuleId *int64 + // Signature ID pertaining to the detected intrusion. format: int64 + SignatureId *int64 + // Metadata about the detected signature including name, id, severity, product affected, protocol etc. + SignatureMetadata *data.StructValue + // Number of times this particular signature was detected. format: int64 + TotalCount *int64 + // List of users logged into VMs on which a particular signature was detected. + UserDetails *data.StructValue + // List of VMs on which a particular signature was detected with the count. + VmDetails *data.StructValue +} + +func (s *IDSEventsSummary) GetType__() bindings.BindingType { + return IDSEventsSummaryBindingType() +} + +func (s *IDSEventsSummary) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IDSEventsSummary._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// An entity that holds the list of IDS signatures which need to be detected. The profiles can be custom created or built in. +type IDSProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // List of IDS signatures ids which need to be detected. + Signatures []string +} + +func (s *IDSProfile) GetType__() bindings.BindingType { + return IDSProfileBindingType() +} + +func (s *IDSProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IDSProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type IDSSignatureDetail struct { + // Packet analysis action + Action *string + // Product affected by the signature. + AffectedProduct *string + // Target of the attack tracked in the signature. + AttackTarget *string + // VMware defined signature category. + Category []string + // Class type of the signature. + ClassType *string + // CVE of the signature. + Cves []string + // Represents the cvss value of a Signature. The value is derived from cvssv3 or cvssv2 score. If cvssv3 exists, then this is the cvssv3 score, else it is the cvssv2 score. + Cvss *string + // Signature CVSSV2 score. + Cvssv2 *string + // Signature CVSSV3 score. + Cvssv3 *string + // Source-destination direction. + Direction *string + // Signature enabled. + Enabled *bool + // Flow established from server, from client etc. + Flow *string + // Family of the malware tracked in the signature. + MalwareFamily *string + // Name of the signature. + Name *string + // Performance impact of the signature. + PerformanceImpact *string + // Signature policy. + Policy []string + // Protocol used in the packet analysis. + Protocol *string + // IDSSignatureDetail resource type. + ResourceType *string + // VMware defined signature severity. + Severity *string + // Unique ID of the signature rule. format: int64 + SignatureId *int64 + // The revision of the signature format: int64 + SignatureRevision *int64 + // Signature vendor set severity of the signature rule. + SignatureSeverity *string + // Vendor assigned classification tag. + Tag []string + // Signature type. + Type_ []string + // List of mitre attack URLs pertaining to signature. + Urls []string +} + +func (s *IDSSignatureDetail) GetType__() bindings.BindingType { + return IDSSignatureDetailBindingType() +} + +func (s *IDSSignatureDetail) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IDSSignatureDetail._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of all intrusions that are detected grouped by signature with their summary. +type IDSSummaryListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged collection of the detected intrusions. + Results []IDSEventsSummary +} + +func (s *IDSSummaryListResult) GetType__() bindings.BindingType { + return IDSSummaryListResultBindingType() +} + +func (s *IDSSummaryListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IDSSummaryListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A NSService that represents IGMP protocol +type IGMPTypeNSService struct { + // Possible values are: + // + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_ETHERTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_IPPROTOCOLNSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_IGMPTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_ICMPTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_ALGTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_L4PORTSETNSSERVICE + // + // The specific type of NSServiceElement + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IGMPTypeNSService__TYPE_IDENTIFIER = "IGMPTypeNSService" + +func (s *IGMPTypeNSService) GetType__() bindings.BindingType { + return IGMPTypeNSServiceBindingType() +} + +func (s *IGMPTypeNSService) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IGMPTypeNSService._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// IP Address +type IPAddressElement struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // IPElement can be a single IP address, IP address range or a Subnet. Its type can be of IPv4 or IPv6. Supported list of formats are \"192.168.1.1\", \"192.168.1.1-192.168.1.100\", \"192.168.0.0/24\", \"fe80::250:56ff:fe83:318c\", \"fe80::250:56ff:fe83:3181-fe80::250:56ff:fe83:318c\", \"fe80::250:56ff:fe83:318c/64\" format: address-or-block-or-range + IpAddress *string +} + +func (s *IPAddressElement) GetType__() bindings.BindingType { + return IPAddressElementBindingType() +} + +func (s *IPAddressElement) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPAddressElement._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Collection of IP address elements +type IPAddressElementListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // IP address element list + Results []IPAddressElement +} + +func (s *IPAddressElementListResult) GetType__() bindings.BindingType { + return IPAddressElementListResultBindingType() +} + +func (s *IPAddressElementListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPAddressElementListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type IPAddresses struct { + // The IP addresses in the form of IP Address, IP Range, CIDR, used as source IPs or destination IPs of filters. format: address-or-block-or-range + IpAddresses []string +} + +func (s *IPAddresses) GetType__() bindings.BindingType { + return IPAddressesBindingType() +} + +func (s *IPAddresses) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPAddresses._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type IPInfo struct { + // IPv4 Addresses format: ipv4 + IpAddresses []string + // Subnet Prefix Length format: int64 + PrefixLength *int64 +} + +func (s *IPInfo) GetType__() bindings.BindingType { + return IPInfoBindingType() +} + +func (s *IPInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type IPMirrorDestination struct { + // The destination IPs of the mirror packet will be sent to. format: ip + DestinationIps []string + // Possible values are: + // + // * IPMirrorDestination#IPMirrorDestination_ENCAPSULATION_TYPE_GRE + // * IPMirrorDestination#IPMirrorDestination_ENCAPSULATION_TYPE_ERSPAN_TWO + // * IPMirrorDestination#IPMirrorDestination_ENCAPSULATION_TYPE_ERSPAN_THREE + // + // You can choose GRE, ERSPAN II or ERSPAN III. + EncapsulationType *string + // Used by physical switch for the mirror traffic forwarding. Must be provided and only effective when encapsulation type is ERSPAN type II or type III. format: int32 + ErspanId *int64 + // User-configurable 32-bit key only for GRE format: int32 + GreKey *int64 + // Possible values are: + // + // * MirrorDestination#MirrorDestination_RESOURCE_TYPE_LOGICALPORTMIRRORDESTINATION + // * MirrorDestination#MirrorDestination_RESOURCE_TYPE_PNICMIRRORDESTINATION + // * MirrorDestination#MirrorDestination_RESOURCE_TYPE_IPMIRRORDESTINATION + // + // Resource types of mirror destination + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IPMirrorDestination__TYPE_IDENTIFIER = "IPMirrorDestination" +const IPMirrorDestination_ENCAPSULATION_TYPE_GRE = "GRE" +const IPMirrorDestination_ENCAPSULATION_TYPE_ERSPAN_TWO = "ERSPAN_TWO" +const IPMirrorDestination_ENCAPSULATION_TYPE_ERSPAN_THREE = "ERSPAN_THREE" + +func (s *IPMirrorDestination) GetType__() bindings.BindingType { + return IPMirrorDestinationBindingType() +} + +func (s *IPMirrorDestination) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPMirrorDestination._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type IPPrefixList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Logical router id + LogicalRouterId *string + // Ordered list of PrefixConfig + Prefixes []PrefixConfig +} + +func (s *IPPrefixList) GetType__() bindings.BindingType { + return IPPrefixListBindingType() +} + +func (s *IPPrefixList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPPrefixList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type IPPrefixListListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paginated list of IPPrefixLists + Results []IPPrefixList +} + +func (s *IPPrefixListListResult) GetType__() bindings.BindingType { + return IPPrefixListListResultBindingType() +} + +func (s *IPPrefixListListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPPrefixListListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// An NSService element that represents an IP protocol +type IPProtocolNSService struct { + // The IP protocol number format: int64 + ProtocolNumber *int64 + // Possible values are: + // + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_ETHERTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_IPPROTOCOLNSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_IGMPTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_ICMPTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_ALGTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_L4PORTSETNSSERVICE + // + // The specific type of NSServiceElement + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IPProtocolNSService__TYPE_IDENTIFIER = "IPProtocolNSService" + +func (s *IPProtocolNSService) GetType__() bindings.BindingType { + return IPProtocolNSServiceBindingType() +} + +func (s *IPProtocolNSService) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPProtocolNSService._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Dead peer detection (DPD) is a method that allows detection of unreachable internet key excahnge (IKE) peers. Any changes affects all IPSec VPN sessions consuming this profile. +type IPSecVPNDPDProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // When the DPD probe mode is periodic, this interval is the number of seconds between DPD messages. When the DPD probe mode is on-demand, this interval is the number of seconds during which traffic is not received from the peer before DPD retry messages are sent if there is IPSec traffic to send. For PERIODIC Mode: Minimum: 3 Maximum: 360 Default: 60 For ON_DEMAND Mode: Minimum: 1 Maximum: 10 Default: 3 format: int64 + DpdProbeInterval *int64 + // Possible values are: + // + // * IPSecVPNDPDProfile#IPSecVPNDPDProfile_DPD_PROBE_MODE_PERIODIC + // * IPSecVPNDPDProfile#IPSecVPNDPDProfile_DPD_PROBE_MODE_ON_DEMAND + // + // DPD probe mode is used to query the liveliness of the peer. Two modes are possible - PERIODIC - is used to query the liveliness of the peer at regular intervals (dpd_probe_interval). It does not take into consideration traffic coming from the peer. The benefit of this mode over the on-demand mode is earlier detection of dead peers. However, use of periodic DPD incurs extra overhead. When communicating to large numbers of peers, please consider using on-demand DPD instead. ON_DEMAND - is used to query the liveliness of the peer by instructing the local endpoint to send DPD message to a peer if there is traffic to send to the peer AND the peer was idle for dpd_probe_interval seconds (i.e. there was no traffic from the peer for dpd_probe_interval seconds) + DpdProbeMode *string + // If true, enable dead peer detection. + Enabled *bool + // Maximum number of DPD messages retry attempts. This value is applicable for both dpd probe modes, periodic and on-demand. format: int64 + RetryCount *int64 +} + +const IPSecVPNDPDProfile_DPD_PROBE_MODE_PERIODIC = "PERIODIC" +const IPSecVPNDPDProfile_DPD_PROBE_MODE_ON_DEMAND = "ON_DEMAND" + +func (s *IPSecVPNDPDProfile) GetType__() bindings.BindingType { + return IPSecVPNDPDProfileBindingType() +} + +func (s *IPSecVPNDPDProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNDPDProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List all the dead peer detection (DPD) profiles. +type IPSecVPNDPDProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // IPSec DPD Profile list results + Results []IPSecVPNDPDProfile +} + +func (s *IPSecVPNDPDProfileListResult) GetType__() bindings.BindingType { + return IPSecVPNDPDProfileListResultBindingType() +} + +func (s *IPSecVPNDPDProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNDPDProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// IKE Profile is a reusable profile that captures IKE phase one negotiation parameters. Any changes affects all IPSec VPN sessions consuming this profile. +type IPSecVPNIKEProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * IPSecVPNIKEProfile#IPSecVPNIKEProfile_DH_GROUPS_GROUP2 + // * IPSecVPNIKEProfile#IPSecVPNIKEProfile_DH_GROUPS_GROUP5 + // * IPSecVPNIKEProfile#IPSecVPNIKEProfile_DH_GROUPS_GROUP14 + // * IPSecVPNIKEProfile#IPSecVPNIKEProfile_DH_GROUPS_GROUP15 + // * IPSecVPNIKEProfile#IPSecVPNIKEProfile_DH_GROUPS_GROUP16 + // * IPSecVPNIKEProfile#IPSecVPNIKEProfile_DH_GROUPS_GROUP19 + // * IPSecVPNIKEProfile#IPSecVPNIKEProfile_DH_GROUPS_GROUP20 + // * IPSecVPNIKEProfile#IPSecVPNIKEProfile_DH_GROUPS_GROUP21 + // + // Diffie-Hellman group to be used if PFS is enabled. Default is GROUP14. + DhGroups []string + // Possible values are: + // + // * IPSecVPNIKEProfile#IPSecVPNIKEProfile_DIGEST_ALGORITHMS_SHA1 + // * IPSecVPNIKEProfile#IPSecVPNIKEProfile_DIGEST_ALGORITHMS_SHA2_256 + // * IPSecVPNIKEProfile#IPSecVPNIKEProfile_DIGEST_ALGORITHMS_SHA2_384 + // * IPSecVPNIKEProfile#IPSecVPNIKEProfile_DIGEST_ALGORITHMS_SHA2_512 + // + // Algorithm to be used for message digest during Internet Key Exchange(IKE) negotiation. Default is SHA2_256. + DigestAlgorithms []string + // Possible values are: + // + // * IPSecVPNIKEProfile#IPSecVPNIKEProfile_ENCRYPTION_ALGORITHMS_128 + // * IPSecVPNIKEProfile#IPSecVPNIKEProfile_ENCRYPTION_ALGORITHMS_256 + // * IPSecVPNIKEProfile#IPSecVPNIKEProfile_ENCRYPTION_ALGORITHMS_GCM_128 + // * IPSecVPNIKEProfile#IPSecVPNIKEProfile_ENCRYPTION_ALGORITHMS_GCM_192 + // * IPSecVPNIKEProfile#IPSecVPNIKEProfile_ENCRYPTION_ALGORITHMS_GCM_256 + // + // Encryption algorithm is used during Internet Key Exchange(IKE) negotiation. Default is AES_128. + EncryptionAlgorithms []string + // Possible values are: + // + // * IPSecVPNIKEProfile#IPSecVPNIKEProfile_IKE_VERSION_V1 + // * IPSecVPNIKEProfile#IPSecVPNIKEProfile_IKE_VERSION_V2 + // * IPSecVPNIKEProfile#IPSecVPNIKEProfile_IKE_VERSION_FLEX + // + // IKE protocol version to be used. IKE-Flex will initiate IKE-V2 and responds to both IKE-V1 and IKE-V2. + IkeVersion *string + // Life time for security association. Default is 86400 seconds (1 day). format: int64 + SaLifeTime *int64 +} + +const IPSecVPNIKEProfile_DH_GROUPS_GROUP2 = "GROUP2" +const IPSecVPNIKEProfile_DH_GROUPS_GROUP5 = "GROUP5" +const IPSecVPNIKEProfile_DH_GROUPS_GROUP14 = "GROUP14" +const IPSecVPNIKEProfile_DH_GROUPS_GROUP15 = "GROUP15" +const IPSecVPNIKEProfile_DH_GROUPS_GROUP16 = "GROUP16" +const IPSecVPNIKEProfile_DH_GROUPS_GROUP19 = "GROUP19" +const IPSecVPNIKEProfile_DH_GROUPS_GROUP20 = "GROUP20" +const IPSecVPNIKEProfile_DH_GROUPS_GROUP21 = "GROUP21" +const IPSecVPNIKEProfile_DIGEST_ALGORITHMS_SHA1 = "SHA1" +const IPSecVPNIKEProfile_DIGEST_ALGORITHMS_SHA2_256 = "SHA2_256" +const IPSecVPNIKEProfile_DIGEST_ALGORITHMS_SHA2_384 = "SHA2_384" +const IPSecVPNIKEProfile_DIGEST_ALGORITHMS_SHA2_512 = "SHA2_512" +const IPSecVPNIKEProfile_ENCRYPTION_ALGORITHMS_128 = "AES_128" +const IPSecVPNIKEProfile_ENCRYPTION_ALGORITHMS_256 = "AES_256" +const IPSecVPNIKEProfile_ENCRYPTION_ALGORITHMS_GCM_128 = "AES_GCM_128" +const IPSecVPNIKEProfile_ENCRYPTION_ALGORITHMS_GCM_192 = "AES_GCM_192" +const IPSecVPNIKEProfile_ENCRYPTION_ALGORITHMS_GCM_256 = "AES_GCM_256" +const IPSecVPNIKEProfile_IKE_VERSION_V1 = "IKE_V1" +const IPSecVPNIKEProfile_IKE_VERSION_V2 = "IKE_V2" +const IPSecVPNIKEProfile_IKE_VERSION_FLEX = "IKE_FLEX" + +func (s *IPSecVPNIKEProfile) GetType__() bindings.BindingType { + return IPSecVPNIKEProfileBindingType() +} + +func (s *IPSecVPNIKEProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNIKEProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List all the IKE profiles. +type IPSecVPNIKEProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // IKE Profile list results + Results []IPSecVPNIKEProfile +} + +func (s *IPSecVPNIKEProfileListResult) GetType__() bindings.BindingType { + return IPSecVPNIKEProfileListResultBindingType() +} + +func (s *IPSecVPNIKEProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNIKEProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Summarized view of all IPSec VPN sessions for a specified service. +type IPSecVPNIKEServiceSummary struct { + AggregateTrafficCounters *IPSecVPNTrafficCounters + // Timestamp when the data was last updated. format: int64 + LastUpdateTimestamp *int64 + SessionSummary *IPsecVPNIKESessionSummary + // Traffic summary per session. + TrafficSummaryPerSession []IPSecVPNSessionTrafficSummary + // VPN service display name. + DisplayName *string + // UUID for a vpn service. + IpsecVpnServiceId *string + // Logical router identifier associated with vpn service. + LogicalRouterId *string +} + +func (s *IPSecVPNIKEServiceSummary) GetType__() bindings.BindingType { + return IPSecVPNIKEServiceSummaryBindingType() +} + +func (s *IPSecVPNIKEServiceSummary) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNIKEServiceSummary._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Status for IPSec VPN IKE session UP, DOWN, NEGOTIATING and fail reason if IKE session is down. +type IPSecVPNIKESessionStatus struct { + // Reason for failure. + FailReason *string + // Possible values are: + // + // * IPSecVPNIKESessionStatus#IPSecVPNIKESessionStatus_IKE_SESSION_STATE_UP + // * IPSecVPNIKESessionStatus#IPSecVPNIKESessionStatus_IKE_SESSION_STATE_DOWN + // * IPSecVPNIKESessionStatus#IPSecVPNIKESessionStatus_IKE_SESSION_STATE_NEGOTIATING + // + // IKE session service status UP, DOWN and NEGOTIATING. + IkeSessionState *string + // Transport Node identifier where session is present. + TransportNodeId *string +} + +const IPSecVPNIKESessionStatus_IKE_SESSION_STATE_UP = "UP" +const IPSecVPNIKESessionStatus_IKE_SESSION_STATE_DOWN = "DOWN" +const IPSecVPNIKESessionStatus_IKE_SESSION_STATE_NEGOTIATING = "NEGOTIATING" + +func (s *IPSecVPNIKESessionStatus) GetType__() bindings.BindingType { + return IPSecVPNIKESessionStatusBindingType() +} + +func (s *IPSecVPNIKESessionStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNIKESessionStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Traffic statistics for IPSec VPN IKE session. Note - Not supported in this release. +type IPSecVPNIKETrafficStatistics struct { + // Number of bytes in. format: int64 + BytesIn *int64 + // Number of bytes out. format: int64 + BytesOut *int64 + // Fail count. format: int64 + FailCount *int64 + // Number of packets in. format: int64 + PacketsIn *int64 + // Number of packets out. format: int64 + PacketsOut *int64 +} + +func (s *IPSecVPNIKETrafficStatistics) GetType__() bindings.BindingType { + return IPSecVPNIKETrafficStatisticsBindingType() +} + +func (s *IPSecVPNIKETrafficStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNIKETrafficStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Local endpoint represents a logical router on which tunnel needs to be terminated. +type IPSecVPNLocalEndpoint struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Site certificate identifier. + CertificateId *string + IpsecVpnServiceId *ResourceReference + // IPV4 Address for local endpoint. format: ipv4 + LocalAddress *string + // Local identifier. + LocalId *string + // Certificate authority (CA) identifier list to verify peer certificates. + TrustCaIds []string + // Certificate revocation list (CRL) identifier list of peer certificates. + TrustCrlIds []string +} + +func (s *IPSecVPNLocalEndpoint) GetType__() bindings.BindingType { + return IPSecVPNLocalEndpointBindingType() +} + +func (s *IPSecVPNLocalEndpoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNLocalEndpoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List all the local endpoints. +type IPSecVPNLocalEndpointListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // IPSec local endpoint list results + Results []IPSecVPNLocalEndpoint +} + +func (s *IPSecVPNLocalEndpointListResult) GetType__() bindings.BindingType { + return IPSecVPNLocalEndpointListResultBindingType() +} + +func (s *IPSecVPNLocalEndpointListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNLocalEndpointListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// IPSec VPN Peer Endpoint covers configuration to be applied locally to establish a session with remote endpoint on peer site. +type IPSecVPNPeerEndpoint struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * IPSecVPNPeerEndpoint#IPSecVPNPeerEndpoint_AUTHENTICATION_MODE_PSK + // * IPSecVPNPeerEndpoint#IPSecVPNPeerEndpoint_AUTHENTICATION_MODE_CERTIFICATE + // + // Authentication mode used for the peer authentication. For PSK (Pre Shared Key) authentication mode, 'psk' property is mandatory and for the CERTIFICATE authentication mode, 'peer_id' property is mandatory. + AuthenticationMode *string + // Possible values are: + // + // * IPSecVPNPeerEndpoint#IPSecVPNPeerEndpoint_CONNECTION_INITIATION_MODE_INITIATOR + // * IPSecVPNPeerEndpoint#IPSecVPNPeerEndpoint_CONNECTION_INITIATION_MODE_RESPOND_ONLY + // * IPSecVPNPeerEndpoint#IPSecVPNPeerEndpoint_CONNECTION_INITIATION_MODE_ON_DEMAND + // + // Connection initiation mode used by local endpoint to establish ike connection with peer endpoint. INITIATOR - In this mode local endpoint initiates tunnel setup and will also respond to incoming tunnel setup requests from peer gateway. RESPOND_ONLY - In this mode, local endpoint shall only respond to incoming tunnel setup requests. It shall not initiate the tunnel setup. ON_DEMAND - In this mode local endpoint will initiate tunnel creation once first packet matching the policy rule is received and will also respond to incoming initiation request. + ConnectionInitiationMode *string + // Dead peer detection (DPD) profile id. Default will be set according to system default policy. + DpdProfileId *string + // IKE profile id to be used. Default will be set according to system default policy. + IkeProfileId *string + // Tunnel profile id to be used. By default it will point to system default profile. + IpsecTunnelProfileId *string + // IPV4 address of peer endpoint on remote site. + PeerAddress *string + // Peer identifier. + PeerId *string + // IPSec Pre-shared key. Maximum length of this field is 128 characters. + Psk *string +} + +const IPSecVPNPeerEndpoint_AUTHENTICATION_MODE_PSK = "PSK" +const IPSecVPNPeerEndpoint_AUTHENTICATION_MODE_CERTIFICATE = "CERTIFICATE" +const IPSecVPNPeerEndpoint_CONNECTION_INITIATION_MODE_INITIATOR = "INITIATOR" +const IPSecVPNPeerEndpoint_CONNECTION_INITIATION_MODE_RESPOND_ONLY = "RESPOND_ONLY" +const IPSecVPNPeerEndpoint_CONNECTION_INITIATION_MODE_ON_DEMAND = "ON_DEMAND" + +func (s *IPSecVPNPeerEndpoint) GetType__() bindings.BindingType { + return IPSecVPNPeerEndpointBindingType() +} + +func (s *IPSecVPNPeerEndpoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNPeerEndpoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List all the peer endpoints. +type IPSecVPNPeerEndpointListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // IPSec Peer endpoint list results + Results []IPSecVPNPeerEndpoint +} + +func (s *IPSecVPNPeerEndpointListResult) GetType__() bindings.BindingType { + return IPSecVPNPeerEndpointListResultBindingType() +} + +func (s *IPSecVPNPeerEndpointListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNPeerEndpointListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// For policy-based IPsec VPNs, a security policy specifies as its action the VPN tunnel to be used for transit traffic that meets the policy's match criteria. +type IPSecVPNPolicyRule struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + Owner *OwnerResourceLink + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique policy id. + Id *string + // The type of this resource. + ResourceType *string + // Possible values are: + // + // * IPSecVPNPolicyRule#IPSecVPNPolicyRule_ACTION_PROTECT + // * IPSecVPNPolicyRule#IPSecVPNPolicyRule_ACTION_BYPASS + // + // PROTECT - Protect rules are defined per policy based IPSec VPN session. BYPASS - Bypass rules are defined per IPSec VPN service and affects all policy based IPSec VPN sessions. Bypass rules are prioritized over protect rules. + Action *string + // List of peer subnets. + Destinations []IPSecVPNPolicySubnet + // A flag to enable/disable the policy rule. + Enabled *bool + // A flag to enable/disable the logging for the policy rule. + Logged *bool + // List of local subnets. + Sources []IPSecVPNPolicySubnet +} + +const IPSecVPNPolicyRule_ACTION_PROTECT = "PROTECT" +const IPSecVPNPolicyRule_ACTION_BYPASS = "BYPASS" + +func (s *IPSecVPNPolicyRule) GetType__() bindings.BindingType { + return IPSecVPNPolicyRuleBindingType() +} + +func (s *IPSecVPNPolicyRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNPolicyRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Used to specify the local/peer subnets in IPSec VPN Policy rule. +type IPSecVPNPolicySubnet struct { + // Subnet used in policy rule. format: ipv4-cidr-block + Subnet *string +} + +func (s *IPSecVPNPolicySubnet) GetType__() bindings.BindingType { + return IPSecVPNPolicySubnetBindingType() +} + +func (s *IPSecVPNPolicySubnet) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNPolicySubnet._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// IPSec VPN policy traffic statistics +type IPSecVPNPolicyTrafficStatistics struct { + AggregateTrafficCounters *IPSecVPNTrafficCounters + // Policy Identifier. + PolicyId *string + // Tunnel port identifier. + TunnelPortId *string + // Tunnel statistics. + TunnelStatistics []IPSecVPNTunnelTrafficStatistics +} + +func (s *IPSecVPNPolicyTrafficStatistics) GetType__() bindings.BindingType { + return IPSecVPNPolicyTrafficStatisticsBindingType() +} + +func (s *IPSecVPNPolicyTrafficStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNPolicyTrafficStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Create and manage IPSec VPN service for given logical router. +type IPSecVPNService struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Bypass policy rules are configured using VPN service. Bypass rules always have higher priority over protect rules and they affect all policy based vpn sessions associated with the IPSec VPN service. Protect rules are defined per policy based vpn session. + BypassRules []IPSecVPNPolicyRule + // If true, enable VPN services for given logical router. + Enabled *bool + // Possible values are: + // + // * IPSecVPNService#IPSecVPNService_IKE_LOG_LEVEL_DEBUG + // * IPSecVPNService#IPSecVPNService_IKE_LOG_LEVEL_INFO + // * IPSecVPNService#IPSecVPNService_IKE_LOG_LEVEL_WARN + // * IPSecVPNService#IPSecVPNService_IKE_LOG_LEVEL_ERROR + // * IPSecVPNService#IPSecVPNService_IKE_LOG_LEVEL_EMERGENCY + // + // Log level for internet key exchange (IKE). + IkeLogLevel *string + // Enable/disable IPSec HA state sync. IPSec HA state sync can be disabled in case there are performance issues with the state sync messages. Default is to enable HA Sync. + IpsecHaSync *bool + // Logical router id. + LogicalRouterId *string +} + +const IPSecVPNService_IKE_LOG_LEVEL_DEBUG = "DEBUG" +const IPSecVPNService_IKE_LOG_LEVEL_INFO = "INFO" +const IPSecVPNService_IKE_LOG_LEVEL_WARN = "WARN" +const IPSecVPNService_IKE_LOG_LEVEL_ERROR = "ERROR" +const IPSecVPNService_IKE_LOG_LEVEL_EMERGENCY = "EMERGENCY" + +func (s *IPSecVPNService) GetType__() bindings.BindingType { + return IPSecVPNServiceBindingType() +} + +func (s *IPSecVPNService) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNService._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List all the IPSec VPN services. +type IPSecVPNServiceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // IPSec VPN serivce list result + Results []IPSecVPNService +} + +func (s *IPSecVPNServiceListResult) GetType__() bindings.BindingType { + return IPSecVPNServiceListResultBindingType() +} + +func (s *IPSecVPNServiceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNServiceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// VPN session defines connection between local and peer endpoint. Untill VPN session is defined configuration is not realized. +type IPSecVPNSession struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * IPSecVPNSession#IPSecVPNSession_RESOURCE_TYPE_POLICYBASEDIPSECVPNSESSION + // * IPSecVPNSession#IPSecVPNSession_RESOURCE_TYPE_ROUTEBASEDIPSECVPNSESSION + // + // A Policy Based VPN requires to define protect rules that match local and peer subnets. IPSec security associations is negotiated for each pair of local and peer subnet. A Route Based VPN is more flexible, more powerful and recommended over policy based VPN. IP Tunnel port is created and all traffic routed via tunnel port is protected. Routes can be configured statically or can be learned through BGP. A route based VPN is must for establishing redundant VPN session to remote site. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Enable/Disable IPSec VPN session. + Enabled *bool + // Identifier of VPN Service linked with local endpoint. + IpsecVpnServiceId *string + // Local endpoint identifier. + LocalEndpointId *string + // Peer endpoint identifier. + PeerEndpointId *string + TcpMssClamping *TcpMssClamping +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IPSecVPNSession__TYPE_IDENTIFIER = "IPSecVPNSession" +const IPSecVPNSession_RESOURCE_TYPE_POLICYBASEDIPSECVPNSESSION = "PolicyBasedIPSecVPNSession" +const IPSecVPNSession_RESOURCE_TYPE_ROUTEBASEDIPSECVPNSESSION = "RouteBasedIPSecVPNSession" + +func (s *IPSecVPNSession) GetType__() bindings.BindingType { + return IPSecVPNSessionBindingType() +} + +func (s *IPSecVPNSession) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNSession._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List all the IPSec VPN sessions. +type IPSecVPNSessionListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // IPSec VPN sessions list result + Results []*data.StructValue +} + +func (s *IPSecVPNSessionListResult) GetType__() bindings.BindingType { + return IPSecVPNSessionListResultBindingType() +} + +func (s *IPSecVPNSessionListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNSessionListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This holds the state of IPSec VPN Session. If there are errors in realizing session outside of MP, it gives details of the components and specific errors. +type IPSecVPNSessionState struct { + // Array of configuration state of various sub systems + Details []ConfigurationStateElement + // Error code format: int64 + FailureCode *int64 + // Error message in case of failure + FailureMessage *string + // Possible values are: + // + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_PENDING + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_IN_PROGRESS + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_SUCCESS + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_FAILED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_PARTIAL_SUCCESS + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_ORPHANED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_UNKNOWN + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_ERROR + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_IN_SYNC + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_NOT_AVAILABLE + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_VM_DEPLOYMENT_QUEUED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_VM_DEPLOYMENT_IN_PROGRESS + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_VM_DEPLOYMENT_FAILED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_VM_POWER_ON_IN_PROGRESS + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_VM_POWER_ON_FAILED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_REGISTRATION_PENDING + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_NODE_NOT_READY + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_NODE_READY + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_VM_POWER_OFF_IN_PROGRESS + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_VM_POWER_OFF_FAILED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_VM_UNDEPLOY_IN_PROGRESS + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_VM_UNDEPLOY_FAILED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_VM_UNDEPLOY_SUCCESSFUL + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_EDGE_CONFIG_ERROR + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_VM_DEPLOYMENT_RESTARTED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_REGISTRATION_FAILED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_TRANSPORT_NODE_SYNC_PENDING + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_EDGE_HARDWARE_NOT_SUPPORTED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_NO_PNIC_PREPARED_IN_EDGE + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_APPLIANCE_INTERNAL_ERROR + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_VTEP_DHCP_NOT_SUPPORTED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_NO_PNIC_SPECIFIED_IN_TN + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_INVALID_PNIC_DEVICE_NAME + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_TRANSPORT_NODE_READY + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_VM_NETWORK_EDIT_PENDING + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_MPA_DISCONNECTED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_VM_RENAME_PENDING + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_VM_CONFIG_EDIT_PENDING + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_VM_NETWORK_EDIT_FAILED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_VM_RENAME_FAILED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_VM_CONFIG_EDIT_FAILED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_VM_CONFIG_DISCREPANCY + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_VM_NODE_REFRESH_FAILED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_VM_PLACEMENT_REFRESH_FAILED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_REGISTRATION_TIMEDOUT + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_REPLACE_FAILED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_DELETE_VM_IN_REDEPLOY_FAILED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_VM_RESOURCE_RESERVATION_FAILED + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_COMPUTE_MANAGER_NOT_FOUND + // * IPSecVPNSessionState#IPSecVPNSessionState_STATE_DELETE_IN_PROGRESS + // + // Gives details of state of desired configuration. Additional enums with more details on progress/success/error states are sent for edge node. The success states are NODE_READY and TRANSPORT_NODE_READY, pending states are {VM_DEPLOYMENT_QUEUED, VM_DEPLOYMENT_IN_PROGRESS, REGISTRATION_PENDING} and other values indicate failures. \"in_sync\" state indicates that the desired configuration has been received by the host to which it applies, but is not yet in effect. When the configuration is actually in effect, the state will change to \"success\". Please note, failed state is deprecated. + State *string + // Request identifier of the API which modified the entity. + PendingChangeList []string +} + +const IPSecVPNSessionState_STATE_PENDING = "pending" +const IPSecVPNSessionState_STATE_IN_PROGRESS = "in_progress" +const IPSecVPNSessionState_STATE_SUCCESS = "success" +const IPSecVPNSessionState_STATE_FAILED = "failed" +const IPSecVPNSessionState_STATE_PARTIAL_SUCCESS = "partial_success" +const IPSecVPNSessionState_STATE_ORPHANED = "orphaned" +const IPSecVPNSessionState_STATE_UNKNOWN = "unknown" +const IPSecVPNSessionState_STATE_ERROR = "error" +const IPSecVPNSessionState_STATE_IN_SYNC = "in_sync" +const IPSecVPNSessionState_STATE_NOT_AVAILABLE = "NOT_AVAILABLE" +const IPSecVPNSessionState_STATE_VM_DEPLOYMENT_QUEUED = "VM_DEPLOYMENT_QUEUED" +const IPSecVPNSessionState_STATE_VM_DEPLOYMENT_IN_PROGRESS = "VM_DEPLOYMENT_IN_PROGRESS" +const IPSecVPNSessionState_STATE_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const IPSecVPNSessionState_STATE_VM_POWER_ON_IN_PROGRESS = "VM_POWER_ON_IN_PROGRESS" +const IPSecVPNSessionState_STATE_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const IPSecVPNSessionState_STATE_REGISTRATION_PENDING = "REGISTRATION_PENDING" +const IPSecVPNSessionState_STATE_NODE_NOT_READY = "NODE_NOT_READY" +const IPSecVPNSessionState_STATE_NODE_READY = "NODE_READY" +const IPSecVPNSessionState_STATE_VM_POWER_OFF_IN_PROGRESS = "VM_POWER_OFF_IN_PROGRESS" +const IPSecVPNSessionState_STATE_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const IPSecVPNSessionState_STATE_VM_UNDEPLOY_IN_PROGRESS = "VM_UNDEPLOY_IN_PROGRESS" +const IPSecVPNSessionState_STATE_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const IPSecVPNSessionState_STATE_VM_UNDEPLOY_SUCCESSFUL = "VM_UNDEPLOY_SUCCESSFUL" +const IPSecVPNSessionState_STATE_EDGE_CONFIG_ERROR = "EDGE_CONFIG_ERROR" +const IPSecVPNSessionState_STATE_VM_DEPLOYMENT_RESTARTED = "VM_DEPLOYMENT_RESTARTED" +const IPSecVPNSessionState_STATE_REGISTRATION_FAILED = "REGISTRATION_FAILED" +const IPSecVPNSessionState_STATE_TRANSPORT_NODE_SYNC_PENDING = "TRANSPORT_NODE_SYNC_PENDING" +const IPSecVPNSessionState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING = "TRANSPORT_NODE_CONFIGURATION_MISSING" +const IPSecVPNSessionState_STATE_EDGE_HARDWARE_NOT_SUPPORTED = "EDGE_HARDWARE_NOT_SUPPORTED" +const IPSecVPNSessionState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED = "MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED" +const IPSecVPNSessionState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER = "TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER" +const IPSecVPNSessionState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED = "TZ_ENDPOINTS_NOT_SPECIFIED" +const IPSecVPNSessionState_STATE_NO_PNIC_PREPARED_IN_EDGE = "NO_PNIC_PREPARED_IN_EDGE" +const IPSecVPNSessionState_STATE_APPLIANCE_INTERNAL_ERROR = "APPLIANCE_INTERNAL_ERROR" +const IPSecVPNSessionState_STATE_VTEP_DHCP_NOT_SUPPORTED = "VTEP_DHCP_NOT_SUPPORTED" +const IPSecVPNSessionState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE = "UNSUPPORTED_HOST_SWITCH_PROFILE" +const IPSecVPNSessionState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED = "UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED" +const IPSecVPNSessionState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND = "HOSTSWITCH_PROFILE_NOT_FOUND" +const IPSecVPNSessionState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED = "LLDP_SEND_ENABLED_NOT_SUPPORTED" +const IPSecVPNSessionState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY = "UNSUPPORTED_NAMED_TEAMING_POLICY" +const IPSecVPNSessionState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM = "LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM" +const IPSecVPNSessionState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM = "LACP_NOT_SUPPORTED_FOR_EDGE_VM" +const IPSecVPNSessionState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM = "STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM" +const IPSecVPNSessionState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE = "MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE" +const IPSecVPNSessionState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE = "UNSUPPORTED_LACP_LB_ALGO_FOR_NODE" +const IPSecVPNSessionState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED = "EDGE_NODE_VERSION_NOT_SUPPORTED" +const IPSecVPNSessionState_STATE_NO_PNIC_SPECIFIED_IN_TN = "NO_PNIC_SPECIFIED_IN_TN" +const IPSecVPNSessionState_STATE_INVALID_PNIC_DEVICE_NAME = "INVALID_PNIC_DEVICE_NAME" +const IPSecVPNSessionState_STATE_TRANSPORT_NODE_READY = "TRANSPORT_NODE_READY" +const IPSecVPNSessionState_STATE_VM_NETWORK_EDIT_PENDING = "VM_NETWORK_EDIT_PENDING" +const IPSecVPNSessionState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY = "UNSUPPORTED_DEFAULT_TEAMING_POLICY" +const IPSecVPNSessionState_STATE_MPA_DISCONNECTED = "MPA_DISCONNECTED" +const IPSecVPNSessionState_STATE_VM_RENAME_PENDING = "VM_RENAME_PENDING" +const IPSecVPNSessionState_STATE_VM_CONFIG_EDIT_PENDING = "VM_CONFIG_EDIT_PENDING" +const IPSecVPNSessionState_STATE_VM_NETWORK_EDIT_FAILED = "VM_NETWORK_EDIT_FAILED" +const IPSecVPNSessionState_STATE_VM_RENAME_FAILED = "VM_RENAME_FAILED" +const IPSecVPNSessionState_STATE_VM_CONFIG_EDIT_FAILED = "VM_CONFIG_EDIT_FAILED" +const IPSecVPNSessionState_STATE_VM_CONFIG_DISCREPANCY = "VM_CONFIG_DISCREPANCY" +const IPSecVPNSessionState_STATE_VM_NODE_REFRESH_FAILED = "VM_NODE_REFRESH_FAILED" +const IPSecVPNSessionState_STATE_VM_PLACEMENT_REFRESH_FAILED = "VM_PLACEMENT_REFRESH_FAILED" +const IPSecVPNSessionState_STATE_REGISTRATION_TIMEDOUT = "REGISTRATION_TIMEDOUT" +const IPSecVPNSessionState_STATE_REPLACE_FAILED = "REPLACE_FAILED" +const IPSecVPNSessionState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED = "UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED" +const IPSecVPNSessionState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING = "LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING" +const IPSecVPNSessionState_STATE_DELETE_VM_IN_REDEPLOY_FAILED = "DELETE_VM_IN_REDEPLOY_FAILED" +const IPSecVPNSessionState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED = "DEPLOY_VM_IN_REDEPLOY_FAILED" +const IPSecVPNSessionState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE = "INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE" +const IPSecVPNSessionState_STATE_VM_RESOURCE_RESERVATION_FAILED = "VM_RESOURCE_RESERVATION_FAILED" +const IPSecVPNSessionState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER = "DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER" +const IPSecVPNSessionState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING = "DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING" +const IPSecVPNSessionState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE = "EDGE_NODE_SETTINGS_MISMATCH_RESOLVE" +const IPSecVPNSessionState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE = "EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE" +const IPSecVPNSessionState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE = "EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE" +const IPSecVPNSessionState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE = "EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE" +const IPSecVPNSessionState_STATE_COMPUTE_MANAGER_NOT_FOUND = "COMPUTE_MANAGER_NOT_FOUND" +const IPSecVPNSessionState_STATE_DELETE_IN_PROGRESS = "DELETE_IN_PROGRESS" + +func (s *IPSecVPNSessionState) GetType__() bindings.BindingType { + return IPSecVPNSessionStateBindingType() +} + +func (s *IPSecVPNSessionState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNSessionState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Session statistics gives aggregated statistics of all policies for all the tunnels. +type IPSecVPNSessionStatistics struct { + AggregateTrafficCounters *IPSecVPNTrafficCounters + // Display name of vpn session. + DisplayName *string + IkeStatus *IPSecVPNIKESessionStatus + IkeTrafficStatistics *IPSecVPNIKETrafficStatistics + // UUID of vpn session. + IpsecVpnSessionId *string + // Timestamp when the data was last updated. format: int64 + LastUpdateTimestamp *int64 + // Partial statistics if true specifies that the statistics are only from active node. + PartialStats *bool + // Gives aggregate traffic statistics across all ipsec tunnels and individual tunnel statistics. + PolicyStatistics []IPSecVPNPolicyTrafficStatistics +} + +func (s *IPSecVPNSessionStatistics) GetType__() bindings.BindingType { + return IPSecVPNSessionStatisticsBindingType() +} + +func (s *IPSecVPNSessionStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNSessionStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// IKE session traffic summary provides IKE session status and aggregate of traffic across all tunnel. +type IPSecVPNSessionStatus struct { + AggregateTrafficCounters *IPSecVPNTrafficCounters + // Display name of vpn session. + DisplayName *string + // Number of failed tunnels. format: int64 + FailedTunnels *int64 + IkeStatus *IPSecVPNIKESessionStatus + // UUID of vpn session. + IpsecVpnSessionId *string + // Timestamp when the data was last updated. format: int64 + LastUpdateTimestamp *int64 + // Number of negotiated tunnels. format: int64 + NegotiatedTunnels *int64 + // Possible values are: + // + // * IPSecVPNSessionStatus#IPSecVPNSessionStatus_SESSION_STATUS_UP + // * IPSecVPNSessionStatus#IPSecVPNSessionStatus_SESSION_STATUS_DOWN + // * IPSecVPNSessionStatus#IPSecVPNSessionStatus_SESSION_STATUS_DEGRADED + // + // Gives session status consolidated using IKE status and tunnel status. It can be UP, DOWN, DEGRADED. If IKE and all tunnels are UP status will be UP, if all down it will be DOWN, otherwise it will be DEGRADED. + SessionStatus *string + // Total number of tunnels. format: int64 + TotalTunnels *int64 +} + +const IPSecVPNSessionStatus_SESSION_STATUS_UP = "UP" +const IPSecVPNSessionStatus_SESSION_STATUS_DOWN = "DOWN" +const IPSecVPNSessionStatus_SESSION_STATUS_DEGRADED = "DEGRADED" + +func (s *IPSecVPNSessionStatus) GetType__() bindings.BindingType { + return IPSecVPNSessionStatusBindingType() +} + +func (s *IPSecVPNSessionStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNSessionStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Summarized view of all selected IPSec VPN sessions. +type IPSecVPNSessionSummary struct { + AggregateTrafficCounters *IPSecVPNTrafficCounters + // Timestamp when the data was last updated. format: int64 + LastUpdateTimestamp *int64 + SessionSummary *IPsecVPNIKESessionSummary + // Traffic summary per session. + TrafficSummaryPerSession []IPSecVPNSessionTrafficSummary +} + +func (s *IPSecVPNSessionSummary) GetType__() bindings.BindingType { + return IPSecVPNSessionSummaryBindingType() +} + +func (s *IPSecVPNSessionSummary) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNSessionSummary._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// IPSec VPN session traffic summary. +type IPSecVPNSessionTrafficSummary struct { + IpsecVpnSession *ResourceReference + TrafficCounters *IPSecVPNTrafficCounters +} + +func (s *IPSecVPNSessionTrafficSummary) GetType__() bindings.BindingType { + return IPSecVPNSessionTrafficSummaryBindingType() +} + +func (s *IPSecVPNSessionTrafficSummary) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNSessionTrafficSummary._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Traffic counters for IPSec VPN session. +type IPSecVPNTrafficCounters struct { + // Total number of bytes recevied. format: int64 + BytesIn *int64 + // Total number of bytes sent. format: int64 + BytesOut *int64 + // Total number of incoming packets dropped on inbound security association. format: int64 + DroppedPacketsIn *int64 + // Total number of outgoing packets dropped on outbound security association. format: int64 + DroppedPacketsOut *int64 + // Total number of packets received. format: int64 + PacketsIn *int64 + // Total number of packets sent. format: int64 + PacketsOut *int64 +} + +func (s *IPSecVPNTrafficCounters) GetType__() bindings.BindingType { + return IPSecVPNTrafficCountersBindingType() +} + +func (s *IPSecVPNTrafficCounters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNTrafficCounters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Provides IPSec VPN session status. +type IPSecVPNTransportStatus struct { + Status *IPSecVPNSessionStatus + // Possible values are: + // + // * L2VPNTransportTunnelStatus#L2VPNTransportTunnelStatus_RESOURCE_TYPE_IPSECVPNTRANSPORTSTATUS + // + // Resource types of L2VPN Transport tunnels + ResourceType string + TunnelId *ResourceReference +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IPSecVPNTransportStatus__TYPE_IDENTIFIER = "IPSecVPNTransportStatus" + +func (s *IPSecVPNTransportStatus) GetType__() bindings.BindingType { + return IPSecVPNTransportStatusBindingType() +} + +func (s *IPSecVPNTransportStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNTransportStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// IPSec VPN tunnel profile is a reusable profile that captures phase two negotiation parameters and tunnel properties. Any changes affects all IPSec VPN sessions consuming this profile. +type IPSecVPNTunnelProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_DF_POLICY_COPY + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_DF_POLICY_CLEAR + // + // Defragmentation policy helps to handle defragmentation bit present in the inner packet. COPY copies the defragmentation bit from the inner IP packet into the outer packet. CLEAR ignores the defragmentation bit present in the inner packet. + DfPolicy *string + // Possible values are: + // + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_DH_GROUPS_GROUP2 + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_DH_GROUPS_GROUP5 + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_DH_GROUPS_GROUP14 + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_DH_GROUPS_GROUP15 + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_DH_GROUPS_GROUP16 + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_DH_GROUPS_GROUP19 + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_DH_GROUPS_GROUP20 + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_DH_GROUPS_GROUP21 + // + // Diffie-Hellman group to be used if PFS is enabled. Default is GROUP14. + DhGroups []string + // Possible values are: + // + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_DIGEST_ALGORITHMS_SHA1 + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_DIGEST_ALGORITHMS_SHA2_256 + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_DIGEST_ALGORITHMS_SHA2_384 + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_DIGEST_ALGORITHMS_SHA2_512 + // + // Algorithm to be used for message digest. Default digest algorithm is implicitly covered by default encryption algorithm \"AES_GCM_128\". + DigestAlgorithms []string + // If true, perfect forward secrecy (PFS) is enabled. + EnablePerfectForwardSecrecy *bool + // Possible values are: + // + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_ENCAPSULATION_MODE_MODE + // + // Encapsulation Mode to be used for encryption of packet. Tunnel mode protects internal routing information by encrypting IP header of original packet. + EncapsulationMode *string + // Possible values are: + // + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_ENCRYPTION_ALGORITHMS_AES_128 + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_ENCRYPTION_ALGORITHMS_AES_256 + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_ENCRYPTION_ALGORITHMS_AES_GCM_128 + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_ENCRYPTION_ALGORITHMS_AES_GCM_192 + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_ENCRYPTION_ALGORITHMS_AES_GCM_256 + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_ENCRYPTION_ALGORITHMS_NO_ENCRYPTION_AUTH_AES_GMAC_128 + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_ENCRYPTION_ALGORITHMS_NO_ENCRYPTION_AUTH_AES_GMAC_192 + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_ENCRYPTION_ALGORITHMS_NO_ENCRYPTION_AUTH_AES_GMAC_256 + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_ENCRYPTION_ALGORITHMS_NO_ENCRYPTION + // + // Encryption algorithm to encrypt/decrypt the messages exchanged between IPSec VPN initiator and responder during tunnel negotiation. Default is AES_GCM_128. + EncryptionAlgorithms []string + // SA life time specifies the expiry time of security association. Default is 3600 seconds. format: int64 + SaLifeTime *int64 + // Possible values are: + // + // * IPSecVPNTunnelProfile#IPSecVPNTunnelProfile_TRANSFORM_PROTOCOL_ESP + // + // IPSec transform specifies IPSec security protocol. + TransformProtocol *string +} + +const IPSecVPNTunnelProfile_DF_POLICY_COPY = "COPY" +const IPSecVPNTunnelProfile_DF_POLICY_CLEAR = "CLEAR" +const IPSecVPNTunnelProfile_DH_GROUPS_GROUP2 = "GROUP2" +const IPSecVPNTunnelProfile_DH_GROUPS_GROUP5 = "GROUP5" +const IPSecVPNTunnelProfile_DH_GROUPS_GROUP14 = "GROUP14" +const IPSecVPNTunnelProfile_DH_GROUPS_GROUP15 = "GROUP15" +const IPSecVPNTunnelProfile_DH_GROUPS_GROUP16 = "GROUP16" +const IPSecVPNTunnelProfile_DH_GROUPS_GROUP19 = "GROUP19" +const IPSecVPNTunnelProfile_DH_GROUPS_GROUP20 = "GROUP20" +const IPSecVPNTunnelProfile_DH_GROUPS_GROUP21 = "GROUP21" +const IPSecVPNTunnelProfile_DIGEST_ALGORITHMS_SHA1 = "SHA1" +const IPSecVPNTunnelProfile_DIGEST_ALGORITHMS_SHA2_256 = "SHA2_256" +const IPSecVPNTunnelProfile_DIGEST_ALGORITHMS_SHA2_384 = "SHA2_384" +const IPSecVPNTunnelProfile_DIGEST_ALGORITHMS_SHA2_512 = "SHA2_512" +const IPSecVPNTunnelProfile_ENCAPSULATION_MODE_MODE = "TUNNEL_MODE" +const IPSecVPNTunnelProfile_ENCRYPTION_ALGORITHMS_AES_128 = "AES_128" +const IPSecVPNTunnelProfile_ENCRYPTION_ALGORITHMS_AES_256 = "AES_256" +const IPSecVPNTunnelProfile_ENCRYPTION_ALGORITHMS_AES_GCM_128 = "AES_GCM_128" +const IPSecVPNTunnelProfile_ENCRYPTION_ALGORITHMS_AES_GCM_192 = "AES_GCM_192" +const IPSecVPNTunnelProfile_ENCRYPTION_ALGORITHMS_AES_GCM_256 = "AES_GCM_256" +const IPSecVPNTunnelProfile_ENCRYPTION_ALGORITHMS_NO_ENCRYPTION_AUTH_AES_GMAC_128 = "NO_ENCRYPTION_AUTH_AES_GMAC_128" +const IPSecVPNTunnelProfile_ENCRYPTION_ALGORITHMS_NO_ENCRYPTION_AUTH_AES_GMAC_192 = "NO_ENCRYPTION_AUTH_AES_GMAC_192" +const IPSecVPNTunnelProfile_ENCRYPTION_ALGORITHMS_NO_ENCRYPTION_AUTH_AES_GMAC_256 = "NO_ENCRYPTION_AUTH_AES_GMAC_256" +const IPSecVPNTunnelProfile_ENCRYPTION_ALGORITHMS_NO_ENCRYPTION = "NO_ENCRYPTION" +const IPSecVPNTunnelProfile_TRANSFORM_PROTOCOL_ESP = "ESP" + +func (s *IPSecVPNTunnelProfile) GetType__() bindings.BindingType { + return IPSecVPNTunnelProfileBindingType() +} + +func (s *IPSecVPNTunnelProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNTunnelProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List all the tunnel profiles. +type IPSecVPNTunnelProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // IPSec Tunnel Profile list results + Results []IPSecVPNTunnelProfile +} + +func (s *IPSecVPNTunnelProfileListResult) GetType__() bindings.BindingType { + return IPSecVPNTunnelProfileListResultBindingType() +} + +func (s *IPSecVPNTunnelProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNTunnelProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// IPSec VPN tunnel traffic statistics. +type IPSecVPNTunnelTrafficStatistics struct { + // Total number of incoming bytes on inbound Security association (SA). format: int64 + BytesIn *int64 + // Total number of outgoing bytes on outbound Security association (SA). format: int64 + BytesOut *int64 + // Total number of packets dropped due to decryption failures. format: int64 + DecryptionFailures *int64 + // Total number of incoming packets dropped on inbound security association. format: int64 + DroppedPacketsIn *int64 + // Total number of outgoing packets dropped on outbound security association. format: int64 + DroppedPacketsOut *int64 + // Total number of packets dropped because of failure in encryption. format: int64 + EncryptionFailures *int64 + // Total number of packets dropped due to integrity failures. format: int64 + IntegrityFailures *int64 + // Local subnet to which a tunnel belongs. + LocalSubnet *string + // Number of packets dropped because of no matching policy is available. format: int64 + NomatchingPolicyErrors *int64 + // Total number of incoming packets on inbound Security association (SA). format: int64 + PacketsIn *int64 + // Total number of outgoing packets on outbound Security association (SA). format: int64 + PacketsOut *int64 + // Total number of incoming packets dropped on inbound Security association (SA)(misc). format: int64 + PacketsReceiveOtherError *int64 + // Total number of packets dropped while sending for any reason. format: int64 + PacketsSentOtherError *int64 + // Peer subnet to which a tunnel belongs. + PeerSubnet *string + // Policy UUID of IPSec Tunnel. + PolicyId *string + // Total number of packets dropped due to replay check on that Security association (SA). format: int64 + ReplayErrors *int64 + // Totoal number of security association (SA) mismatch errors on incoming packets. format: int64 + SaMismatchErrorsIn *int64 + // Totoal number of security association (SA) mismatch errors on outgoing packets. format: int64 + SaMismatchErrorsOut *int64 + // Total number of packets dropped while sending due to overflow in sequence number. format: int64 + SeqNumberOverflowError *int64 + // Gives the detailed reason about the tunnel when it is down. If tunnel is UP tunnel down reason will be empty. + TunnelDownReason *string + // Possible values are: + // + // * IPSecVPNTunnelTrafficStatistics#IPSecVPNTunnelTrafficStatistics_TUNNEL_STATUS_UP + // * IPSecVPNTunnelTrafficStatistics#IPSecVPNTunnelTrafficStatistics_TUNNEL_STATUS_DOWN + // * IPSecVPNTunnelTrafficStatistics#IPSecVPNTunnelTrafficStatistics_TUNNEL_STATUS_NEGOTIATING + // + // Specifies the status of tunnel. If all the SA (Security association) are negotiated then tunnels status will be UP. If negotiation fails for the SAs status will be DOWN, if SAs are in negotiating phase tunnels status will be NEGOTIATING. + TunnelStatus *string +} + +const IPSecVPNTunnelTrafficStatistics_TUNNEL_STATUS_UP = "UP" +const IPSecVPNTunnelTrafficStatistics_TUNNEL_STATUS_DOWN = "DOWN" +const IPSecVPNTunnelTrafficStatistics_TUNNEL_STATUS_NEGOTIATING = "NEGOTIATING" + +func (s *IPSecVPNTunnelTrafficStatistics) GetType__() bindings.BindingType { + return IPSecVPNTunnelTrafficStatisticsBindingType() +} + +func (s *IPSecVPNTunnelTrafficStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSecVPNTunnelTrafficStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// IPSet is used to group individual IP addresses, range of IP addresses or subnets. An IPSet is a homogeneous group of IP addresses, either of type IPv4 or of type IPv6. IPSets can be used as source or destination in firewall rules. These can also be used as members of NSGroups. +type IPSet struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // IP addresses format: address-or-block-or-range + IpAddresses []string +} + +func (s *IPSet) GetType__() bindings.BindingType { + return IPSetBindingType() +} + +func (s *IPSet) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSet._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Paged collection of IPSets +type IPSetListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // IPSet list results + Results []IPSet +} + +func (s *IPSetListResult) GetType__() bindings.BindingType { + return IPSetListResultBindingType() +} + +func (s *IPSetListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSetListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type IPSubnet struct { + // All IP addresses, some of which may be automatically configured. When updating this field, the payload may contain only the IP addresses that should be changed, or may contain the IP addresses to change as well as the automatically assigned addresses. Currently, only one updatable address and one system-maintained address are supported. Currently, the system-maintained address supported is Extended Unique Identifier(EUI)-64 address. EUI-64 address is generated by the system only when user configured ip-subnet has prefix length less than or equal to 64. format: ip + IpAddresses []string + // Subnet Prefix Length format: int64 + PrefixLength *int64 +} + +func (s *IPSubnet) GetType__() bindings.BindingType { + return IPSubnetBindingType() +} + +func (s *IPSubnet) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPSubnet._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// IPSec VPN session status summary, gives total, failed, degraded and established IPSec VPN sessions. +type IPsecVPNIKESessionSummary struct { + // Number of degraded sessions. format: int64 + DegradedSessions *int64 + // Number of established sessions. format: int64 + EstablishedSessions *int64 + // Number of failed sessions. format: int64 + FailedSessions *int64 + // Total sessions configured. format: int64 + TotalSessions *int64 +} + +func (s *IPsecVPNIKESessionSummary) GetType__() bindings.BindingType { + return IPsecVPNIKESessionSummaryBindingType() +} + +func (s *IPsecVPNIKESessionSummary) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPsecVPNIKESessionSummary._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// IPv4 address properties +type IPv4AddressProperties struct { + // Interface IPv4 address + IpAddress *string + // Interface netmask + Netmask *string +} + +func (s *IPv4AddressProperties) GetType__() bindings.BindingType { + return IPv4AddressPropertiesBindingType() +} + +func (s *IPv4AddressProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPv4AddressProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// DHCP server to support IPv4 DHCP service. Properties defined at DHCP server level can be overridden by ip-pool or static-binding level properties. +type IPv4DhcpServer struct { + // DHCP server ip in CIDR format. format: ipv4-cidr-block + DhcpServerIp *string + // Primary and secondary DNS server address to assign host. They can be overridden by ip-pool or static-binding level property. format: ipv4 + DnsNameservers []string + // Host name or prefix to be assigned to host. It can be overridden by ip-pool or static-binding level property. format: hostname + DomainName *string + // Gateway ip to be assigned to host. It can be overridden by ip-pool or static-binding level property. format: ipv4 + GatewayIp *string + // Enable or disable monitoring of DHCP ip-pools usage. When enabled, system events are generated when pool usage exceeds the configured thresholds. System events can be viewed in REST API /api/v2/hpm/alarms + MonitorIppoolUsage *bool + Options *DhcpOptions +} + +func (s *IPv4DhcpServer) GetType__() bindings.BindingType { + return IPv4DhcpServerBindingType() +} + +func (s *IPv4DhcpServer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPv4DhcpServer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// IPv6 DAD status +type IPv6DADStatus struct { + // IP address on the port for which DAD status is reported. format: ip + IpAddress *string + // Possible values are: + // + // * IPv6DADStatus#IPv6DADStatus_STATUS_DUPLICATED + // * IPv6DADStatus#IPv6DADStatus_STATUS_TENTATIVE + // * IPv6DADStatus#IPv6DADStatus_STATUS_ASSIGNED + // * IPv6DADStatus#IPv6DADStatus_STATUS_NOT_APPLICABLE + // * IPv6DADStatus#IPv6DADStatus_STATUS_UNKNOWN + // + // DAD status for IP address on the port. + Status *string + // Array of transport node id on which DAD status is reported for given IP address. + TransportNode []ResourceReference +} + +const IPv6DADStatus_STATUS_DUPLICATED = "DUPLICATED" +const IPv6DADStatus_STATUS_TENTATIVE = "TENTATIVE" +const IPv6DADStatus_STATUS_ASSIGNED = "ASSIGNED" +const IPv6DADStatus_STATUS_NOT_APPLICABLE = "NOT_APPLICABLE" +const IPv6DADStatus_STATUS_UNKNOWN = "UNKNOWN" + +func (s *IPv6DADStatus) GetType__() bindings.BindingType { + return IPv6DADStatusBindingType() +} + +func (s *IPv6DADStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPv6DADStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// DHCP server to support IPv6 DHCP service. Properties defined at DHCP server level can be overridden by ip-pool or static-binding level properties. +type IPv6DhcpServer struct { + // DHCP server ip in CIDR format. format: ipv6-cidr-block + DhcpServerIp *string + // Primary and secondary DNS server address to assign host. They can be overridden by ip-pool or static-binding level property. format: ipv6 + DnsNameservers []string + // Host name or prefix to be assigned to host. It can be overridden by ip-pool or static-binding level property. + DomainNames []string + // DHCP server id. + ServerId *string + // SNTP server ips. format: ipv6 + SntpServers []string +} + +func (s *IPv6DhcpServer) GetType__() bindings.BindingType { + return IPv6DhcpServerBindingType() +} + +func (s *IPv6DhcpServer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPv6DhcpServer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type IPv6Profiles struct { + // Identifier of Duplicate Address Detection profile. DAD profile has various configurations related to duplicate address detection. If no profile is associated manually to the router, then the system defined default DAD profile will be automatically applied. + DadProfileId *string + // Identifier of Neighbor Discovery Router Advertisement profile. NDRA profile has various configurations required for router advertisement. If no profile is associated manually to the router, then the system defined default NDRA profile will be automatically applied. + NdraProfileId *string +} + +func (s *IPv6Profiles) GetType__() bindings.BindingType { + return IPv6ProfilesBindingType() +} + +func (s *IPv6Profiles) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IPv6Profiles._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type IcmpEchoRequestHeader struct { + // ICMP id format: int64 + Id *int64 + // ICMP sequence number format: int64 + Sequence *int64 +} + +func (s *IcmpEchoRequestHeader) GetType__() bindings.BindingType { + return IcmpEchoRequestHeaderBindingType() +} + +func (s *IcmpEchoRequestHeader) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IcmpEchoRequestHeader._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Icon to be applied at dashboard for widgets and UI elements. +type Icon struct { + // Icon color applied to icon in hex format. + Color *string + // Possible values are: + // + // * Icon#Icon_PLACEMENT_PRE + // * Icon#Icon_PLACEMENT_POST + // + // If specified as PRE, the icon appears before the UI element. If set as POST, the icon appears after the UI element. + Placement *string + // Icon size in unit applied to icon.A unit can be specified by the 'size_unit' property. + Size *float64 + // Possible values are: + // + // * Icon#Icon_SIZE_UNIT_PX + // * Icon#Icon_SIZE_UNIT_REM + // * Icon#Icon_SIZE_UNIT_PC + // + // Icon size unit applied to icon along with size. if 'size' property value is provided and no value is provided for this property then default value for this proerty is set to 'px'. + SizeUnit *string + // Multi-line text to be shown on tooltip while hovering over the icon. + Tooltip []Tooltip + // Icon will be rendered based on its type. For example, if ERROR is chosen, then icon representing error will be rendered. or else custom svg icon name can be given. + Type_ *string +} + +const Icon_PLACEMENT_PRE = "PRE" +const Icon_PLACEMENT_POST = "POST" +const Icon_SIZE_UNIT_PX = "px" +const Icon_SIZE_UNIT_REM = "rem" +const Icon_SIZE_UNIT_PC = "pc" + +func (s *Icon) GetType__() bindings.BindingType { + return IconBindingType() +} + +func (s *Icon) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Icon._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Status of the Identity Firewall enabled Compute collection. +type IdfwComputeCollectionCondition struct { + // Possible values are: + // + // * IdfwComputeCollectionCondition#IdfwComputeCollectionCondition_STATUS_UNKNOWN + // * IdfwComputeCollectionCondition#IdfwComputeCollectionCondition_STATUS_UP + // * IdfwComputeCollectionCondition#IdfwComputeCollectionCondition_STATUS_DOWN + // * IdfwComputeCollectionCondition#IdfwComputeCollectionCondition_STATUS_DFW_DISABLED + // * IdfwComputeCollectionCondition#IdfwComputeCollectionCondition_STATUS_IDFW_ENABLED + // * IdfwComputeCollectionCondition#IdfwComputeCollectionCondition_STATUS_IDFW_DISABLED + // + // IDFW enabled Compute collection status. + Status *string + // Status of the Compute collection. + StatusDetail *string +} + +const IdfwComputeCollectionCondition_STATUS_UNKNOWN = "UNKNOWN" +const IdfwComputeCollectionCondition_STATUS_UP = "UP" +const IdfwComputeCollectionCondition_STATUS_DOWN = "DOWN" +const IdfwComputeCollectionCondition_STATUS_DFW_DISABLED = "DFW_DISABLED" +const IdfwComputeCollectionCondition_STATUS_IDFW_ENABLED = "IDFW_ENABLED" +const IdfwComputeCollectionCondition_STATUS_IDFW_DISABLED = "IDFW_DISABLED" + +func (s *IdfwComputeCollectionCondition) GetType__() bindings.BindingType { + return IdfwComputeCollectionConditionBindingType() +} + +func (s *IdfwComputeCollectionCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdfwComputeCollectionCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of compute collection ids and status connected to VC. +type IdfwComputeCollectionListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Array of IDFW compute collection Ids and status connected to VC. + Results []IdfwComputeCollectionStatus +} + +func (s *IdfwComputeCollectionListResult) GetType__() bindings.BindingType { + return IdfwComputeCollectionListResultBindingType() +} + +func (s *IdfwComputeCollectionListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdfwComputeCollectionListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// compute collection ID and status connected to VC. +type IdfwComputeCollectionStatus struct { + // IDFW compute collection ID connected to VC. + ComputeCollectionId *string + // IDFW enabled compute collection status. + ComputeCollectionStatus []IdfwComputeCollectionCondition +} + +func (s *IdfwComputeCollectionStatus) GetType__() bindings.BindingType { + return IdfwComputeCollectionStatusBindingType() +} + +func (s *IdfwComputeCollectionStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdfwComputeCollectionStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Identity Firewall NSGorup to user mapping to link DirGroup to user session data. +type IdfwDirGroupUserSessionMapping struct { + // Directory Group ID. + DirGroupId *string + // User ID. + UserId *string +} + +func (s *IdfwDirGroupUserSessionMapping) GetType__() bindings.BindingType { + return IdfwDirGroupUserSessionMappingBindingType() +} + +func (s *IdfwDirGroupUserSessionMapping) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdfwDirGroupUserSessionMapping._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Compute collection enabled for Identity Firewall where login events will be collected. +type IdfwEnabledComputeCollection struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Compute collection ID. + ComputeCollectionId *string + // Compute collection name. + ComputeCollectionName *string + // Compute collection enabled status (true=Enabled / false=Disabled). + Enabled *bool +} + +func (s *IdfwEnabledComputeCollection) GetType__() bindings.BindingType { + return IdfwEnabledComputeCollectionBindingType() +} + +func (s *IdfwEnabledComputeCollection) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdfwEnabledComputeCollection._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of compute collections enabled for IDFW where login events will be collected. +type IdfwEnabledComputeCollectionListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Array of IDFW Enabled Compute Collections. + Results []IdfwEnabledComputeCollection +} + +func (s *IdfwEnabledComputeCollectionListResult) GetType__() bindings.BindingType { + return IdfwEnabledComputeCollectionListResultBindingType() +} + +func (s *IdfwEnabledComputeCollectionListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdfwEnabledComputeCollectionListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Identity Firewall master switch setting. This setting enables or disables Identity Firewall feature across the system. It affects compute collections, hypervisor and virtual machines. This operation is expensive and also has big impact and implication on system perforamce. +type IdfwMasterSwitchSetting struct { + // IDFW master switch (true=Enabled / false=Disabled). + IdfwMasterSwitchEnabled *bool +} + +func (s *IdfwMasterSwitchSetting) GetType__() bindings.BindingType { + return IdfwMasterSwitchSettingBindingType() +} + +func (s *IdfwMasterSwitchSetting) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdfwMasterSwitchSetting._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Identity Firewall user login/session data for a single NSGroup. +type IdfwNsgroupVmDetailListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // NSGroup ID + NsGroupId *string + // List of user login/session data for a single VM + Results []IdfwVmDetail +} + +func (s *IdfwNsgroupVmDetailListResult) GetType__() bindings.BindingType { + return IdfwNsgroupVmDetailListResultBindingType() +} + +func (s *IdfwNsgroupVmDetailListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdfwNsgroupVmDetailListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Identity Firewall standalone hosts switch setting. This setting enables or disables Identity Firewall feature on all standalone hosts. +type IdfwStandaloneHostsSwitchSetting struct { + // IDFW standalone hosts switch (true=Enabled / false=Disabled). + StandaloneHostsEnabled *bool +} + +func (s *IdfwStandaloneHostsSwitchSetting) GetType__() bindings.BindingType { + return IdfwStandaloneHostsSwitchSettingBindingType() +} + +func (s *IdfwStandaloneHostsSwitchSetting) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdfwStandaloneHostsSwitchSetting._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Identity Firewall statistics data. +type IdfwSystemStats struct { + // Number of concurrent logged on users (across VDI & RDSH). Multiple logins by the same user is counted as 1. format: int32 + NumConcurrentUsers *int64 + // Number of active user sessions/logins in IDFW enabled compute collections (including both UP and DOWN hosts). N sessions/logins by the same user is counted as n. format: int32 + NumUserSessions *int64 +} + +func (s *IdfwSystemStats) GetType__() bindings.BindingType { + return IdfwSystemStatsBindingType() +} + +func (s *IdfwSystemStats) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdfwSystemStats._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Status of the Identity Firewall Compute Collection's transport node. +type IdfwTransportNodeCondition struct { + // Possible values are: + // + // * IdfwTransportNodeCondition#IdfwTransportNodeCondition_STATUS_UNKNOWN + // * IdfwTransportNodeCondition#IdfwTransportNodeCondition_STATUS_UP + // * IdfwTransportNodeCondition#IdfwTransportNodeCondition_STATUS_DOWN + // * IdfwTransportNodeCondition#IdfwTransportNodeCondition_STATUS_NOT_PREPARED + // * IdfwTransportNodeCondition#IdfwTransportNodeCondition_STATUS_IDFW_COMPONENT_NOT_INSTALLED + // * IdfwTransportNodeCondition#IdfwTransportNodeCondition_STATUS_DFW_DISABLED + // * IdfwTransportNodeCondition#IdfwTransportNodeCondition_STATUS_IDFW_DISABLED + // + // Transport node status for IDFW compute collection. + Status *string + // IDFW Compute collection's transport node condition. + StatusDetail *string +} + +const IdfwTransportNodeCondition_STATUS_UNKNOWN = "UNKNOWN" +const IdfwTransportNodeCondition_STATUS_UP = "UP" +const IdfwTransportNodeCondition_STATUS_DOWN = "DOWN" +const IdfwTransportNodeCondition_STATUS_NOT_PREPARED = "NOT_PREPARED" +const IdfwTransportNodeCondition_STATUS_IDFW_COMPONENT_NOT_INSTALLED = "IDFW_COMPONENT_NOT_INSTALLED" +const IdfwTransportNodeCondition_STATUS_DFW_DISABLED = "DFW_DISABLED" +const IdfwTransportNodeCondition_STATUS_IDFW_DISABLED = "IDFW_DISABLED" + +func (s *IdfwTransportNodeCondition) GetType__() bindings.BindingType { + return IdfwTransportNodeConditionBindingType() +} + +func (s *IdfwTransportNodeCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdfwTransportNodeCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// ID and status of the Identity Firewall enabled Compute collection's transport node. +type IdfwTransportNodeStatus struct { + // TransportNode ID of the Identity Firewall enabled Compute collection's transport node. + TransportNodeId *string + // Status of the IDFW transport node. + TransportNodeStatus []IdfwTransportNodeCondition +} + +func (s *IdfwTransportNodeStatus) GetType__() bindings.BindingType { + return IdfwTransportNodeStatusBindingType() +} + +func (s *IdfwTransportNodeStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdfwTransportNodeStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Status of the Identity Firewall enabled Compute collection transport nodes. +type IdfwTransportNodeStatusListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of transport node ids and status for idfw enabled Compute collection. + Results []IdfwTransportNodeStatus +} + +func (s *IdfwTransportNodeStatusListResult) GetType__() bindings.BindingType { + return IdfwTransportNodeStatusListResultBindingType() +} + +func (s *IdfwTransportNodeStatusListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdfwTransportNodeStatusListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Identity Firewall user session data on a client machine (typically a VM). Multiple entries for the same user can be returned if the user logins to multiple sessions on the same VM. +type IdfwUserSessionData struct { + // AD Domain of user. + DomainName *string + // Identifier of user session data. + Id *string + // Login time. format: int64 + LoginTime *int64 + // Logout time if applicable. An active user session has no logout time. Non-active user session is stored (up to last 5 most recent entries) per VM and per user. format: int64 + LogoutTime *int64 + // Possible values are: + // + // * IdfwUserSessionData#IdfwUserSessionData_SESSION_SOURCE_GI + // * IdfwUserSessionData#IdfwUserSessionData_SESSION_SOURCE_ELS + // * IdfwUserSessionData#IdfwUserSessionData_SESSION_SOURCE_LI + // + // User session source can be one of: - GI (Guest Introspection) - ELS (AD Event log server) - LI (Log Insight) + SessionSource *string + // AD user ID (may not exist). + UserId *string + // AD user name. + UserName *string + // User session ID. This also indicates whether this is VDI / RDSH. format: int32 + UserSessionId *int64 + // Virtual machine (external ID or BIOS UUID) where login/logout events occurred. + VmExtId *string +} + +const IdfwUserSessionData_SESSION_SOURCE_GI = "GI" +const IdfwUserSessionData_SESSION_SOURCE_ELS = "ELS" +const IdfwUserSessionData_SESSION_SOURCE_LI = "LI" + +func (s *IdfwUserSessionData) GetType__() bindings.BindingType { + return IdfwUserSessionDataBindingType() +} + +func (s *IdfwUserSessionData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdfwUserSessionData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Identity Firewall user session data list and Directory Group to user mappings. +type IdfwUserSessionDataAndMappings struct { + // Active user session data list + ActiveUserSessions []IdfwUserSessionData + // Archived user session data list + ArchivedUserSessions []IdfwUserSessionData + // Directory Group to user session data mappings + DirGroupToUserSessionDataMappings []IdfwDirGroupUserSessionMapping +} + +func (s *IdfwUserSessionDataAndMappings) GetType__() bindings.BindingType { + return IdfwUserSessionDataAndMappingsBindingType() +} + +func (s *IdfwUserSessionDataAndMappings) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdfwUserSessionDataAndMappings._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Identity Firewall user login/session data for a single user. +type IdfwUserStats struct { + // List of active (still logged in) user login/sessions data (no limit) + ActiveSessions []IdfwUserSessionData + // Optional list of up to 5 most recent archived (previously logged in) user login/session data. + ArchivedSessions []IdfwUserSessionData + // AD user Identifier (String ID) + UserId *string +} + +func (s *IdfwUserStats) GetType__() bindings.BindingType { + return IdfwUserStatsBindingType() +} + +func (s *IdfwUserStats) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdfwUserStats._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Status of the Identity Firewall compute collection's VM. +type IdfwVirtualMachineCondition struct { + // Possible values are: + // + // * IdfwVirtualMachineCondition#IdfwVirtualMachineCondition_STATUS_UNKNOWN + // * IdfwVirtualMachineCondition#IdfwVirtualMachineCondition_STATUS_UP + // * IdfwVirtualMachineCondition#IdfwVirtualMachineCondition_STATUS_DOWN + // * IdfwVirtualMachineCondition#IdfwVirtualMachineCondition_STATUS_VM_TOOLS_NOT_INSTALLED + // * IdfwVirtualMachineCondition#IdfwVirtualMachineCondition_STATUS_IDFW_NOT_SUPPORTED + // * IdfwVirtualMachineCondition#IdfwVirtualMachineCondition_STATUS_DFW_DISABLED + // * IdfwVirtualMachineCondition#IdfwVirtualMachineCondition_STATUS_IDFW_DISABLED + // + // VM IDFW Status. + Status *string + // IDFW compute collection's VM condition. + StatusDetail *string +} + +const IdfwVirtualMachineCondition_STATUS_UNKNOWN = "UNKNOWN" +const IdfwVirtualMachineCondition_STATUS_UP = "UP" +const IdfwVirtualMachineCondition_STATUS_DOWN = "DOWN" +const IdfwVirtualMachineCondition_STATUS_VM_TOOLS_NOT_INSTALLED = "VM_TOOLS_NOT_INSTALLED" +const IdfwVirtualMachineCondition_STATUS_IDFW_NOT_SUPPORTED = "IDFW_NOT_SUPPORTED" +const IdfwVirtualMachineCondition_STATUS_DFW_DISABLED = "DFW_DISABLED" +const IdfwVirtualMachineCondition_STATUS_IDFW_DISABLED = "IDFW_DISABLED" + +func (s *IdfwVirtualMachineCondition) GetType__() bindings.BindingType { + return IdfwVirtualMachineConditionBindingType() +} + +func (s *IdfwVirtualMachineCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdfwVirtualMachineCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// ID and status of the VM on Identity Firewall compute collection. +type IdfwVirtualMachineStatus struct { + // VM ID of the VM on Identity Firewall compute collection. + VmId *string + // Status of the Identity Firewall compute collection's Virtual Machine. + VmStatus []IdfwVirtualMachineCondition +} + +func (s *IdfwVirtualMachineStatus) GetType__() bindings.BindingType { + return IdfwVirtualMachineStatusBindingType() +} + +func (s *IdfwVirtualMachineStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdfwVirtualMachineStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// VM ID and status of the Identity Firewall Compute collection. +type IdfwVirtualMachineStatusListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of VM's on Identity Firewall Compute collection. + Results []IdfwVirtualMachineStatus +} + +func (s *IdfwVirtualMachineStatusListResult) GetType__() bindings.BindingType { + return IdfwVirtualMachineStatusListResultBindingType() +} + +func (s *IdfwVirtualMachineStatusListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdfwVirtualMachineStatusListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Identity Firewall user login/session data for a single VM +type IdfwVmDetail struct { + LastLoginUserSession *ResourceReference + // List of user session data. + UserSessions []IdfwUserSessionData + // Virtual machine (external ID or BIOS UUID) where login/logout event occurred. + VmExtId *string + // List of client machine IP addresses. + VmIpAddresses []string +} + +func (s *IdfwVmDetail) GetType__() bindings.BindingType { + return IdfwVmDetailBindingType() +} + +func (s *IdfwVmDetail) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdfwVmDetail._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Identity Firewall user login/session data for a single VM. +type IdfwVmStats struct { + // List of active (still logged in) user login/sessions data (no limit) + ActiveSessions []IdfwUserSessionData + // Optional list of up to 5 most recent archived (previously logged in) user login/session data. + ArchivedSessions []IdfwUserSessionData + // Virtual machine (external ID or BIOS UUID) where login/logout event occurred. + VmExtId *string +} + +func (s *IdfwVmStats) GetType__() bindings.BindingType { + return IdfwVmStatsBindingType() +} + +func (s *IdfwVmStats) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdfwVmStats._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// IDS event flow data specific to each IDS event. The data includes source ip, source port, destination ip, destination port, protocol, rule id, profile id, and the action. +type IdsEventFlowData struct { + // Possible values are: + // + // * IdsEventFlowData#IdsEventFlowData_ACTION_TYPE_ALERT + // * IdsEventFlowData#IdsEventFlowData_ACTION_TYPE_DROP + // * IdsEventFlowData#IdsEventFlowData_ACTION_TYPE_REJECT + // * IdsEventFlowData#IdsEventFlowData_ACTION_TYPE_INVALID + // + // The action pertaining to the detected intrusion. Possible values are ALERT, DROP, REJECT, and INVALID. ALERT - If there is a signature match on the packet, it is allowed to pass but a notification is sent to the user notifying an intrusion was detected. DROP - On a signature match, the packet is silently dropped. An alert is sent to the user that an intrusion was detected. REJECT - On a signature match, the packet is dropped and TCP RST or ICMP error messages (for non-TCP pkts) are sent to the endpoints. An alert is sent to the user that an intrusion was detected. INVALID - If the action doesn't belong to any of the above mentioned categories, it is marked as INVALID. + ActionType *string + // Bytes sent to client. format: int64 + BytesToclient *int64 + // Bytes sent to server. format: int64 + BytesToserver *int64 + // IP address of the VM that initiated the communication. + ClientIp *string + // IP address of the destination VM on the intrusion flow. + DestinationIp *string + // Port on the destination VM where the traffic was sent to. format: int64 + DestinationPort *int64 + // IP address of VM on the host where IDS engine is running. + LocalVmIp *string + // The IDS profile id that is associated with the IDS rule pertaining to the intrusion event detected. + ProfileId *string + // Traffic protocol pertaining to the detected intrusion, could be TCP/UDP etc. + Protocol *string + // The IDS Rule id pertaining to the detected intrusion. format: int64 + RuleId *int64 + // IP address of the source VM on the intrusion flow. + SourceIp *string + // Source port through which traffic was initiated that caused the intrusion to be detected. format: int64 + SourcePort *int64 +} + +const IdsEventFlowData_ACTION_TYPE_ALERT = "ALERT" +const IdsEventFlowData_ACTION_TYPE_DROP = "DROP" +const IdsEventFlowData_ACTION_TYPE_REJECT = "REJECT" +const IdsEventFlowData_ACTION_TYPE_INVALID = "INVALID" + +func (s *IdsEventFlowData) GetType__() bindings.BindingType { + return IdsEventFlowDataBindingType() +} + +func (s *IdsEventFlowData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdsEventFlowData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// NSX global configs for Distributed Intrusion Services +type IdsGlobalConfig struct { + // When this flag is set to true, IDS events would be sent to syslog. + GlobalIdseventsToSyslogEnabled *bool + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_SWITCHINGGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_ROUTINGGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_OPERATIONCOLLECTORGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FIREWALLGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_ESXGLOBALOPAQUECONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_SECURITYGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FIPSGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FEDERATIONGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_IDSGLOBALCONFIG + // + // Valid Global configuration types + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IdsGlobalConfig__TYPE_IDENTIFIER = "IdsGlobalConfig" + +func (s *IdsGlobalConfig) GetType__() bindings.BindingType { + return IdsGlobalConfigBindingType() +} + +func (s *IdsGlobalConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdsGlobalConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of all affected users pertaining to a specific signature. +type IdsUserList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of all affected users specific to a particular signature. + Results []string +} + +func (s *IdsUserList) GetType__() bindings.BindingType { + return IdsUserListBindingType() +} + +func (s *IdsUserList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdsUserList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of Users logged into VMs where intrusions of a given signature were detected. +type IdsUserStats struct { + // Number of unique users logged into VMs on which a particular signature was detected. format: int64 + Count *int64 + // List of users logged into VMs on which a particular signature was detected. + UserList []string +} + +func (s *IdsUserStats) GetType__() bindings.BindingType { + return IdsUserStatsBindingType() +} + +func (s *IdsUserStats) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdsUserStats._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of all affected VMs pertaining to a specific signature. +type IdsVmList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of all affected VMs specific to a particular signature. + Results []string +} + +func (s *IdsVmList) GetType__() bindings.BindingType { + return IdsVmListBindingType() +} + +func (s *IdsVmList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdsVmList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of VMs on which a particular signature was detected with the count. +type IdsVmStats struct { + // Number of unique VMs on which a particular signature was detected. format: int64 + Count *int64 + // List of VM names on which intrusions of that particular signature type were detected. + VmList []string +} + +func (s *IdsVmStats) GetType__() bindings.BindingType { + return IdsVmStatsBindingType() +} + +func (s *IdsVmStats) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IdsVmStats._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A list of fields to include in query results +type IncludedFieldsParameters struct { + // Note - this parameter currently only works when used with the search APIs /policy/api/v1/search/query and /policy/api/v1/search/dsl. It is ignored for other list APIs. + IncludedFields *string +} + +func (s *IncludedFieldsParameters) GetType__() bindings.BindingType { + return IncludedFieldsParametersBindingType() +} + +func (s *IncludedFieldsParameters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IncludedFieldsParameters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A shaper that specifies ingress rate properties in kb/s +type IngressBroadcastRateShaper struct { + // Average bandwidth in kb/s format: int32 + AverageBandwidthKbps *int64 + // Burst size in bytes format: int32 + BurstSizeBytes *int64 + // Peak bandwidth in kb/s format: int32 + PeakBandwidthKbps *int64 + Enabled *bool + // Possible values are: + // + // * QosBaseRateShaper#QosBaseRateShaper_RESOURCE_TYPE_INGRESSRATESHAPER + // * QosBaseRateShaper#QosBaseRateShaper_RESOURCE_TYPE_INGRESSBROADCASTRATESHAPER + // * QosBaseRateShaper#QosBaseRateShaper_RESOURCE_TYPE_EGRESSRATESHAPER + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IngressBroadcastRateShaper__TYPE_IDENTIFIER = "IngressBroadcastRateShaper" + +func (s *IngressBroadcastRateShaper) GetType__() bindings.BindingType { + return IngressBroadcastRateShaperBindingType() +} + +func (s *IngressBroadcastRateShaper) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IngressBroadcastRateShaper._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A shaper that specifies ingress rate properties in Mb/s +type IngressRateShaper struct { + // Average bandwidth in Mb/s format: int32 + AverageBandwidthMbps *int64 + // Burst size in bytes format: int32 + BurstSizeBytes *int64 + // Peak bandwidth in Mb/s format: int32 + PeakBandwidthMbps *int64 + Enabled *bool + // Possible values are: + // + // * QosBaseRateShaper#QosBaseRateShaper_RESOURCE_TYPE_INGRESSRATESHAPER + // * QosBaseRateShaper#QosBaseRateShaper_RESOURCE_TYPE_INGRESSBROADCASTRATESHAPER + // * QosBaseRateShaper#QosBaseRateShaper_RESOURCE_TYPE_EGRESSRATESHAPER + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IngressRateShaper__TYPE_IDENTIFIER = "IngressRateShaper" + +func (s *IngressRateShaper) GetType__() bindings.BindingType { + return IngressRateShaperBindingType() +} + +func (s *IngressRateShaper) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IngressRateShaper._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type InitiateClusterRestoreRequest struct { + // IP address or FQDN of the node from which the backup was taken format: hostname-or-ip + IpAddress *string + // Unique id of the backed-up configuration from which the appliance will be restored + NodeId *string + // Timestamp of the backed-up configuration from which the appliance will be restored format: int64 + Timestamp *int64 +} + +func (s *InitiateClusterRestoreRequest) GetType__() bindings.BindingType { + return InitiateClusterRestoreRequestBindingType() +} + +func (s *InitiateClusterRestoreRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InitiateClusterRestoreRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// install-upgrade service properties +type InstallUpgradeServiceProperties struct { + // True if service enabled; otherwise, false + Enabled *bool + // IP of manager on which install-upgrade is enabled + EnabledOn *string +} + +func (s *InstallUpgradeServiceProperties) GetType__() bindings.BindingType { + return InstallUpgradeServicePropertiesBindingType() +} + +func (s *InstallUpgradeServiceProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InstallUpgradeServiceProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The Instance Deployment Config contains settings that is applied during install time. +type InstanceDeploymentConfig struct { + // Resource Pool or Compute Id. + ComputeId *string + // Context Id or VCenter Id. + ContextId *string + // The service VM will be deployed on the specified host in the specified server within the cluster if host_id is specified. Note: You must ensure that storage and specified networks are accessible by this host. + HostId *string + // Storage Id. + StorageId *string + // List of NIC information for VMs + VmNicInfos []VmNicInfo +} + +func (s *InstanceDeploymentConfig) GetType__() bindings.BindingType { + return InstanceDeploymentConfigBindingType() +} + +func (s *InstanceDeploymentConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InstanceDeploymentConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// An InstanceEndpoint belongs to one ServiceInstance and represents a redirection target for a Rule. For Example - It can be an L3 Destination. Service Attachments is required for a InstanceEndpoint of type LOGICAL, and deployed_to if its a VIRTUAL InstanceEndpoint. +type InstanceEndpoint struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * InstanceEndpoint#InstanceEndpoint_ENDPOINT_TYPE_LOGICAL + // * InstanceEndpoint#InstanceEndpoint_ENDPOINT_TYPE_VIRTUAL + // + // LOGICAL - It must be created with a ServiceAttachment and identifies a destination connected to the Service Port of the ServiceAttachment, through the ServiceAttachment's Logical Switch. VIRTUAL - It represents a L3 destination the router can route to but does not provide any further information about its location in the network. Virtual InstanceEndpoints are used for redirection targets that are not connected to Service Ports, such as the next-hop routers on the Edge uplinks. + EndpointType *string + // Link Ids are mandatory for VIRTUAL Instance Endpoint. Even though VIRTUAL, the Instance Endpoint should be connected/accessible through an NSX object. The link id is this NSX object id. Example - For North-South Service Insertion, this is the LogicalRouter Id through which the targetIp/L3 destination accessible. + LinkIds []ResourceReference + // Id(s) of the Service Attachment where this enndpoint is connected to. Service Attachment is mandatory for LOGICAL Instance Endpoint. + ServiceAttachments []ResourceReference + // The Service instancee with which the instance endpoint is associated. + ServiceInstanceId *string + // Target IPs on an interface of the Service Instance. + TargetIps []IPInfo +} + +const InstanceEndpoint_ENDPOINT_TYPE_LOGICAL = "LOGICAL" +const InstanceEndpoint_ENDPOINT_TYPE_VIRTUAL = "VIRTUAL" + +func (s *InstanceEndpoint) GetType__() bindings.BindingType { + return InstanceEndpointBindingType() +} + +func (s *InstanceEndpoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InstanceEndpoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of instance endpoints. +type InstanceEndpointListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of instance endpoints. + Results []InstanceEndpoint +} + +func (s *InstanceEndpointListResult) GetType__() bindings.BindingType { + return InstanceEndpointListResultBindingType() +} + +func (s *InstanceEndpointListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InstanceEndpointListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A Service Runtime is the runtime entity associated with ever Service-VM deployed. +type InstanceRuntime struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Resource Pool or cluster Id. + ComputeCollectionId *string + // Possible values are: + // + // * InstanceRuntime#InstanceRuntime_DEPLOYMENT_STATUS_DEPLOYMENT_IN_PROGRESS + // * InstanceRuntime#InstanceRuntime_DEPLOYMENT_STATUS_DEPLOYMENT_FAILED + // * InstanceRuntime#InstanceRuntime_DEPLOYMENT_STATUS_DEPLOYMENT_SUCCESSFUL + // * InstanceRuntime#InstanceRuntime_DEPLOYMENT_STATUS_UPGRADE_IN_PROGRESS + // * InstanceRuntime#InstanceRuntime_DEPLOYMENT_STATUS_UPGRADE_FAILED + // * InstanceRuntime#InstanceRuntime_DEPLOYMENT_STATUS_UNDEPLOYMENT_IN_PROGRESS + // * InstanceRuntime#InstanceRuntime_DEPLOYMENT_STATUS_UNDEPLOYMENT_FAILED + // * InstanceRuntime#InstanceRuntime_DEPLOYMENT_STATUS_UNDEPLOYMENT_SUCCESSFUL + // * InstanceRuntime#InstanceRuntime_DEPLOYMENT_STATUS_UNKNOWN + // + // Service-Instance Runtime deployment status of the Service-VM. It shows the latest status during the process of deployment, redeploy, upgrade, and un-deployment of VM. + DeploymentStatus *string + // Error message for the Service Instance Runtime if any. + ErrorMessage *string + // Possible values are: + // + // * InstanceRuntime#InstanceRuntime_MAINTENANCE_MODE_OFF + // * InstanceRuntime#InstanceRuntime_MAINTENANCE_MODE_ENTERING + // * InstanceRuntime#InstanceRuntime_MAINTENANCE_MODE_ON + // * InstanceRuntime#InstanceRuntime_MAINTENANCE_MODE_EXITING + // + // The maintenance mode indicates whether the corresponding service VM is in maintenance mode. The service VM will not be used to service new requests if it is in maintenance mode. + MaintenanceMode *string + // Possible values are: + // + // * InstanceRuntime#InstanceRuntime_RUNTIME_HEALTH_STATUS_BY_PARTNER_HEALTHY + // * InstanceRuntime#InstanceRuntime_RUNTIME_HEALTH_STATUS_BY_PARTNER_STOPPED + // * InstanceRuntime#InstanceRuntime_RUNTIME_HEALTH_STATUS_BY_PARTNER_NOT_RESPONDING + // + // Service-Instance runtime health status set by partner to indicate whether the service is running properly or not. + RuntimeHealthStatusByPartner *string + // Possible values are: + // + // * InstanceRuntime#InstanceRuntime_RUNTIME_STATUS_IN_SERVICE + // * InstanceRuntime#InstanceRuntime_RUNTIME_STATUS_OUT_OF_SERVICE + // * InstanceRuntime#InstanceRuntime_RUNTIME_STATUS_NEEDS_ATTENTION + // * InstanceRuntime#InstanceRuntime_RUNTIME_STATUS_NOT_AVAILABLE + // + // Service-Instance Runtime status of the deployed Service-VM. + RuntimeStatus *string + // Id of an instantiation of a registered service. + ServiceInstanceId *string + // Service-VM/SVM id of deployed virtual-machine. + ServiceVmId *string + // Moref of the datastore in VC. + StorageId *string + // Reason provided by partner for the service being unhealthy. This could be due to various reasons such as connectivity lost as an example. + UnhealthyReason *string + VmNicInfo *VmNicInfo +} + +const InstanceRuntime_DEPLOYMENT_STATUS_DEPLOYMENT_IN_PROGRESS = "DEPLOYMENT_IN_PROGRESS" +const InstanceRuntime_DEPLOYMENT_STATUS_DEPLOYMENT_FAILED = "DEPLOYMENT_FAILED" +const InstanceRuntime_DEPLOYMENT_STATUS_DEPLOYMENT_SUCCESSFUL = "DEPLOYMENT_SUCCESSFUL" +const InstanceRuntime_DEPLOYMENT_STATUS_UPGRADE_IN_PROGRESS = "UPGRADE_IN_PROGRESS" +const InstanceRuntime_DEPLOYMENT_STATUS_UPGRADE_FAILED = "UPGRADE_FAILED" +const InstanceRuntime_DEPLOYMENT_STATUS_UNDEPLOYMENT_IN_PROGRESS = "UNDEPLOYMENT_IN_PROGRESS" +const InstanceRuntime_DEPLOYMENT_STATUS_UNDEPLOYMENT_FAILED = "UNDEPLOYMENT_FAILED" +const InstanceRuntime_DEPLOYMENT_STATUS_UNDEPLOYMENT_SUCCESSFUL = "UNDEPLOYMENT_SUCCESSFUL" +const InstanceRuntime_DEPLOYMENT_STATUS_UNKNOWN = "UNKNOWN" +const InstanceRuntime_MAINTENANCE_MODE_OFF = "OFF" +const InstanceRuntime_MAINTENANCE_MODE_ENTERING = "ENTERING" +const InstanceRuntime_MAINTENANCE_MODE_ON = "ON" +const InstanceRuntime_MAINTENANCE_MODE_EXITING = "EXITING" +const InstanceRuntime_RUNTIME_HEALTH_STATUS_BY_PARTNER_HEALTHY = "HEALTHY" +const InstanceRuntime_RUNTIME_HEALTH_STATUS_BY_PARTNER_STOPPED = "STOPPED" +const InstanceRuntime_RUNTIME_HEALTH_STATUS_BY_PARTNER_NOT_RESPONDING = "NOT_RESPONDING" +const InstanceRuntime_RUNTIME_STATUS_IN_SERVICE = "IN_SERVICE" +const InstanceRuntime_RUNTIME_STATUS_OUT_OF_SERVICE = "OUT_OF_SERVICE" +const InstanceRuntime_RUNTIME_STATUS_NEEDS_ATTENTION = "NEEDS_ATTENTION" +const InstanceRuntime_RUNTIME_STATUS_NOT_AVAILABLE = "NOT_AVAILABLE" + +func (s *InstanceRuntime) GetType__() bindings.BindingType { + return InstanceRuntimeBindingType() +} + +func (s *InstanceRuntime) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InstanceRuntime._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Result of List of InstanceRuntimes +type InstanceRuntimeListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Array of existing InstanceRuntimes in database + Results []InstanceRuntime +} + +func (s *InstanceRuntimeListResult) GetType__() bindings.BindingType { + return InstanceRuntimeListResultBindingType() +} + +func (s *InstanceRuntimeListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InstanceRuntimeListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Details of the instructions displayed during restore process +type InstructionInfo struct { + // A list of actions that are to be applied to resources + Actions []string + // A list of fields that are displayable to users in a table + Fields []string + // UUID of the instruction + Id *string + // Instruction name + Name *string +} + +func (s *InstructionInfo) GetType__() bindings.BindingType { + return InstructionInfoBindingType() +} + +func (s *InstructionInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InstructionInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This is deprecated. Please use CommonAgentEndpointInfo instead. An endpoint to connect to NSX-Intelligence broker. Either FQDN or IP address can be used in the endpoint info. +type IntelligenceBrokerEndpointInfo struct { + // The IP address or the full qualified domain name of broker. format: hostname-or-ip + Address *string + // The port number where the broker is listening to. format: int64 + Port *int64 +} + +func (s *IntelligenceBrokerEndpointInfo) GetType__() bindings.BindingType { + return IntelligenceBrokerEndpointInfoBindingType() +} + +func (s *IntelligenceBrokerEndpointInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IntelligenceBrokerEndpointInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Contains info used to configure the VM on deployment +type IntelligenceClusterNodeVMDeploymentConfig struct { + // Possible values are: + // + // * IntelligenceClusterNodeVMDeploymentConfig#IntelligenceClusterNodeVMDeploymentConfig_PLACEMENT_TYPE_INTELLIGENCEVSPHERECLUSTERNODEVMDEPLOYMENTCONFIG + // + // Specifies the config for the platform through which to deploy the VM + PlacementType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IntelligenceClusterNodeVMDeploymentConfig__TYPE_IDENTIFIER = "IntelligenceClusterNodeVMDeploymentConfig" +const IntelligenceClusterNodeVMDeploymentConfig_PLACEMENT_TYPE_INTELLIGENCEVSPHERECLUSTERNODEVMDEPLOYMENTCONFIG = "IntelligenceVsphereClusterNodeVMDeploymentConfig" + +func (s *IntelligenceClusterNodeVMDeploymentConfig) GetType__() bindings.BindingType { + return IntelligenceClusterNodeVMDeploymentConfigBindingType() +} + +func (s *IntelligenceClusterNodeVMDeploymentConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IntelligenceClusterNodeVMDeploymentConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Contains the deployment information for a NSX-Intelligence node VM. +type IntelligenceClusterNodeVMDeploymentRequest struct { + DeploymentConfig *data.StructValue + // Possible values are: + // + // * IntelligenceClusterNodeVMDeploymentRequest#IntelligenceClusterNodeVMDeploymentRequest_FORM_FACTOR_EVALUATION + // * IntelligenceClusterNodeVMDeploymentRequest#IntelligenceClusterNodeVMDeploymentRequest_FORM_FACTOR_STANDARD + // * IntelligenceClusterNodeVMDeploymentRequest#IntelligenceClusterNodeVMDeploymentRequest_FORM_FACTOR_ADVANCED + // * IntelligenceClusterNodeVMDeploymentRequest#IntelligenceClusterNodeVMDeploymentRequest_FORM_FACTOR_SMALL + // * IntelligenceClusterNodeVMDeploymentRequest#IntelligenceClusterNodeVMDeploymentRequest_FORM_FACTOR_LARGE + // * IntelligenceClusterNodeVMDeploymentRequest#IntelligenceClusterNodeVMDeploymentRequest_FORM_FACTOR_EXTRA_LARGE + // + // Specifies the desired \"size\" of the VM + FormFactor *string + UserSettings *NodeUserSettings + // ID of the VM maintained internally. Note: This is automatically generated and cannot be modified. + VmId *string +} + +const IntelligenceClusterNodeVMDeploymentRequest_FORM_FACTOR_EVALUATION = "EVALUATION" +const IntelligenceClusterNodeVMDeploymentRequest_FORM_FACTOR_STANDARD = "STANDARD" +const IntelligenceClusterNodeVMDeploymentRequest_FORM_FACTOR_ADVANCED = "ADVANCED" +const IntelligenceClusterNodeVMDeploymentRequest_FORM_FACTOR_SMALL = "SMALL" +const IntelligenceClusterNodeVMDeploymentRequest_FORM_FACTOR_LARGE = "LARGE" +const IntelligenceClusterNodeVMDeploymentRequest_FORM_FACTOR_EXTRA_LARGE = "EXTRA_LARGE" + +func (s *IntelligenceClusterNodeVMDeploymentRequest) GetType__() bindings.BindingType { + return IntelligenceClusterNodeVMDeploymentRequestBindingType() +} + +func (s *IntelligenceClusterNodeVMDeploymentRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IntelligenceClusterNodeVMDeploymentRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of IntelligenceClusterNodeVMDeploymentRequests +type IntelligenceClusterNodeVMDeploymentRequestList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Array of existing IntelligenceClusterNodeVMDeploymentRequests + Results []IntelligenceClusterNodeVMDeploymentRequest +} + +func (s *IntelligenceClusterNodeVMDeploymentRequestList) GetType__() bindings.BindingType { + return IntelligenceClusterNodeVMDeploymentRequestListBindingType() +} + +func (s *IntelligenceClusterNodeVMDeploymentRequestList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IntelligenceClusterNodeVMDeploymentRequestList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Contains up-to-date information relating to an auto-deployed VM, including its status and (potentially) an error message. +type IntelligenceClusterNodeVMDeploymentStatusReport struct { + DeploymentProgressState *ClusterNodeVMDeploymentProgressState + // In case of auto-deployment-related failure, the code for the error will be stored here. format: int64 + FailureCode *int64 + // In case of auto-deployment-related failure, an error message will be stored here. + FailureMessage *string + // Possible values are: + // + // * IntelligenceClusterNodeVMDeploymentStatusReport#IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_NOT_AVAILABLE + // * IntelligenceClusterNodeVMDeploymentStatusReport#IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_DEPLOYMENT_QUEUED + // * IntelligenceClusterNodeVMDeploymentStatusReport#IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_DEPLOYMENT_IN_PROGRESS + // * IntelligenceClusterNodeVMDeploymentStatusReport#IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_DEPLOYMENT_FAILED + // * IntelligenceClusterNodeVMDeploymentStatusReport#IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_POWER_ON_IN_PROGRESS + // * IntelligenceClusterNodeVMDeploymentStatusReport#IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_POWER_ON_FAILED + // * IntelligenceClusterNodeVMDeploymentStatusReport#IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_POWER_ON_SUCCESSFUL + // * IntelligenceClusterNodeVMDeploymentStatusReport#IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_REGISTRATION_IN_PROGRESS + // * IntelligenceClusterNodeVMDeploymentStatusReport#IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_REGISTRATION_SUCCESSFUL + // * IntelligenceClusterNodeVMDeploymentStatusReport#IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_REGISTRATION_FAILED + // * IntelligenceClusterNodeVMDeploymentStatusReport#IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_WAITING_TO_COME_ONLINE + // * IntelligenceClusterNodeVMDeploymentStatusReport#IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_ONLINE_FAILED + // * IntelligenceClusterNodeVMDeploymentStatusReport#IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_POWER_OFF_IN_PROGRESS + // * IntelligenceClusterNodeVMDeploymentStatusReport#IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_POWER_OFF_FAILED + // * IntelligenceClusterNodeVMDeploymentStatusReport#IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_WAITING_TO_UNDEPLOY_VM + // * IntelligenceClusterNodeVMDeploymentStatusReport#IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_UNDEPLOY_IN_PROGRESS + // * IntelligenceClusterNodeVMDeploymentStatusReport#IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_UNDEPLOY_FAILED + // * IntelligenceClusterNodeVMDeploymentStatusReport#IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_UNDEPLOY_SUCCESSFUL + // * IntelligenceClusterNodeVMDeploymentStatusReport#IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_UNKNOWN_STATE + // + // Status of the addition or deletion of an auto-deployed NSX-Intelligence cluster node VM. + Status *string +} + +const IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_NOT_AVAILABLE = "NOT_AVAILABLE" +const IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_DEPLOYMENT_QUEUED = "VM_DEPLOYMENT_QUEUED" +const IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_DEPLOYMENT_IN_PROGRESS = "VM_DEPLOYMENT_IN_PROGRESS" +const IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_POWER_ON_IN_PROGRESS = "VM_POWER_ON_IN_PROGRESS" +const IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_POWER_ON_SUCCESSFUL = "VM_POWER_ON_SUCCESSFUL" +const IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_REGISTRATION_IN_PROGRESS = "VM_REGISTRATION_IN_PROGRESS" +const IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_REGISTRATION_SUCCESSFUL = "VM_REGISTRATION_SUCCESSFUL" +const IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_REGISTRATION_FAILED = "VM_REGISTRATION_FAILED" +const IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_WAITING_TO_COME_ONLINE = "VM_WAITING_TO_COME_ONLINE" +const IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_ONLINE_FAILED = "VM_ONLINE_FAILED" +const IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_POWER_OFF_IN_PROGRESS = "VM_POWER_OFF_IN_PROGRESS" +const IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_WAITING_TO_UNDEPLOY_VM = "WAITING_TO_UNDEPLOY_VM" +const IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_UNDEPLOY_IN_PROGRESS = "VM_UNDEPLOY_IN_PROGRESS" +const IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_VM_UNDEPLOY_SUCCESSFUL = "VM_UNDEPLOY_SUCCESSFUL" +const IntelligenceClusterNodeVMDeploymentStatusReport_STATUS_UNKNOWN_STATE = "UNKNOWN_STATE" + +func (s *IntelligenceClusterNodeVMDeploymentStatusReport) GetType__() bindings.BindingType { + return IntelligenceClusterNodeVMDeploymentStatusReportBindingType() +} + +func (s *IntelligenceClusterNodeVMDeploymentStatusReport) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IntelligenceClusterNodeVMDeploymentStatusReport._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This is deprecated. Please use CommonAgentPrivateIpRangeInfo instead. An IP prefix to mark the private network that NSX-Intelligence network flow is collected from. +type IntelligenceFlowPrivateIpPrefixInfo struct { + // The prefix of IP address that marks the range of private network. format: ip + Address *string + // Possible values are: + // + // * IntelligenceFlowPrivateIpPrefixInfo#IntelligenceFlowPrivateIpPrefixInfo_ADDRESS_TYPE_IPV4 + // * IntelligenceFlowPrivateIpPrefixInfo#IntelligenceFlowPrivateIpPrefixInfo_ADDRESS_TYPE_IPV6 + // + // The type of IP address. + AddressType *string + // The length of IP address prefix that marks the range of private network. format: int64 + PrefixLength *int64 +} + +const IntelligenceFlowPrivateIpPrefixInfo_ADDRESS_TYPE_IPV4 = "IPV4" +const IntelligenceFlowPrivateIpPrefixInfo_ADDRESS_TYPE_IPV6 = "IPV6" + +func (s *IntelligenceFlowPrivateIpPrefixInfo) GetType__() bindings.BindingType { + return IntelligenceFlowPrivateIpPrefixInfoBindingType() +} + +func (s *IntelligenceFlowPrivateIpPrefixInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IntelligenceFlowPrivateIpPrefixInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Napp cluster form factor +type IntelligenceFormFactor struct { + // Default number of Napp worker nodes. format: int64 + DefaultWorkerCount *int64 + // Disk size of the Napp worker nodes in GBs. format: int64 + Disk *int64 + // Memory size of the Napp worker nodes in GBs format: int64 + Memory *int64 + // Possible values are: + // + // * IntelligenceFormFactor#IntelligenceFormFactor_TYPE_EVALUATION + // * IntelligenceFormFactor#IntelligenceFormFactor_TYPE_STANDARD + // * IntelligenceFormFactor#IntelligenceFormFactor_TYPE_ADVANCED + // * IntelligenceFormFactor#IntelligenceFormFactor_TYPE_SMALL + // * IntelligenceFormFactor#IntelligenceFormFactor_TYPE_LARGE + // * IntelligenceFormFactor#IntelligenceFormFactor_TYPE_EXTRA_LARGE + // + // NSX Intelligence node form factor type + Type_ *string + // Number of virtual cpus on the Napp worker nodes format: int64 + Vcpu *int64 +} + +const IntelligenceFormFactor_TYPE_EVALUATION = "EVALUATION" +const IntelligenceFormFactor_TYPE_STANDARD = "STANDARD" +const IntelligenceFormFactor_TYPE_ADVANCED = "ADVANCED" +const IntelligenceFormFactor_TYPE_SMALL = "SMALL" +const IntelligenceFormFactor_TYPE_LARGE = "LARGE" +const IntelligenceFormFactor_TYPE_EXTRA_LARGE = "EXTRA_LARGE" + +func (s *IntelligenceFormFactor) GetType__() bindings.BindingType { + return IntelligenceFormFactorBindingType() +} + +func (s *IntelligenceFormFactor) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IntelligenceFormFactor._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Napp cluster form factors list result +type IntelligenceFormFactors struct { + // Napp cluster form factor list + FormFactors []IntelligenceFormFactor +} + +func (s *IntelligenceFormFactors) GetType__() bindings.BindingType { + return IntelligenceFormFactorsBindingType() +} + +func (s *IntelligenceFormFactors) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IntelligenceFormFactors._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This is deprecated. Please use IntelligenceTransportNodeProfile instead. NSX-Intelligence configuration that can be applied to host nodes. +type IntelligenceHostConfigurationInfo struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // List of NSX-Intelligence broker endpoints that host nodes contact initially. + BrokerBootstrapServers []IntelligenceBrokerEndpointInfo + // A broker certificate to verify the identity of brokers. + BrokerCertificate *string + // A truststore to establish the trust between NSX and NSX-Intelligence brokers. + BrokerTruststore *string + // Interval in minute of reporting VM guest context data to NSX-Intelligence. Recommend to keep this value the same as flow_data_collection_interval. format: int64 + ContextDataCollectionInterval *int64 + // List of hashes of processes to collect context data. Empty implies all processes. + ContextProcessHashes []string + // List of processes to collect context data. Empty implies all processes. + ContextProcessNames []string + // List of windows user sid to collect context data. Empty implies all users. + ContextUserSids []string + // List of linux user uid to collect context data. Empty implies all users. + ContextUserUids []string + // Enable NSX-Intelligence context data collection in host nodes. + EnableContextDataCollection *bool + // Enable NSX-Intelligence data collection in host nodes. This property has been deprecated. To enable flow data collection, use property enable_flow_data_collection instead. To enable context data collection, use property enable_context_data_collection instead. When this property is set to false, no data collection is performed even if enable_flow_data_collection or enable_context_data_collection is set to true. When this property is set to true, property enable_flow_data_collection and enable_context_data_collection control whether to collect flow data and context data separately. + EnableDataCollection *bool + // Enable NSX-Intelligence deep packet inspection in host nodes. + EnableDeepPacketInspection *bool + // When this property is set to true, if the source or destination of network traffic uses an IP address that is not included in property private_ip_prefix, it is reported as ANY (255.255.255.255) to NSX-Intelligence. When this property is set to false, the original IP addresses of network traffic are reported to NSX-Intelligence, regardless whether they are included in property private_ip_prefix. + EnableExternalIpAggregation *bool + // Enable NSX-Intelligence flow data collection in host nodes. + EnableFlowDataCollection *bool + // Interval in minute of reporting network flow data to NSX-Intelligence. Recommend to keep this value the same as context_data_collection_interval. format: int64 + FlowDataCollectionInterval *int64 + // Maximum active network flow to collect in collection interval. format: int64 + MaxActiveFlowCount *int64 + // Maximum active network flow to collect in collection interval for Bare Metal server. format: int64 + MaxActiveFlowCountBm *int64 + // Maximum inactive network flow to collect in collection interval. format: int64 + MaxInactiveFlowCount *int64 + // Maximum inactive network flow to collect in collection interval for Bare Metal server. format: int64 + MaxInactiveFlowCountBm *int64 + // List of private IP prefix that NSX-Intelligence network flow is collected from. + PrivateIpPrefix []IntelligenceFlowPrivateIpPrefixInfo +} + +func (s *IntelligenceHostConfigurationInfo) GetType__() bindings.BindingType { + return IntelligenceHostConfigurationInfoBindingType() +} + +func (s *IntelligenceHostConfigurationInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IntelligenceHostConfigurationInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The Vsphere deployment configuration determines where to deploy the NSX-Intelligence cluster node VM through a vCenter server. It contains settings that are applied during install time. If using DHCP, the following fields must be left unset - dns_servers, management_port_subnets, and default_gateway_addresses +type IntelligenceVsphereClusterNodeVMDeploymentConfig struct { + // If true, the root user will be allowed to log into the VM. Allowing root SSH logins is not recommended for security reasons. + AllowSshRootLogin *bool + // The NSX-Intelligence cluster node VM will be deployed on the specified cluster or resourcepool for specified VC server. + ComputeId *string + // The default gateway for the VM to be deployed must be specified if all the other VMs it communicates with are not in the same subnet. Do not specify this field and management_port_subnets to use DHCP. Note: only single IPv4 default gateway address is supported and it must belong to management network. IMPORTANT: VMs deployed using DHCP are currently not supported, so this parameter should be specified. format: ip + DefaultGatewayAddresses []string + // Possible values are: + // + // * IntelligenceVsphereClusterNodeVMDeploymentConfig#IntelligenceVsphereClusterNodeVMDeploymentConfig_DISK_PROVISIONING_THIN + // * IntelligenceVsphereClusterNodeVMDeploymentConfig#IntelligenceVsphereClusterNodeVMDeploymentConfig_DISK_PROVISIONING_LAZY_ZEROED_THICK + // * IntelligenceVsphereClusterNodeVMDeploymentConfig#IntelligenceVsphereClusterNodeVMDeploymentConfig_DISK_PROVISIONING_EAGER_ZEROED_THICK + // + // Specifies the disk provisioning type of the VM. + DiskProvisioning *string + // Desired display name for NSX-Intelligence VM to be deployed + DisplayName *string + // List of DNS servers. If DHCP is used, the default DNS servers associated with the DHCP server will be used instead. Required if using static IP. format: ipv4 + DnsServers []string + // If true, the SSH service will automatically be started on the VM. Enabling SSH service is not recommended for security reasons. + EnableSsh *bool + // The NSX-Intelligence cluster node VM will be deployed on the specified host in the specified VC server within the cluster if host_id is specified. Note: User must ensure that storage and specified networks are accessible by this host. + HostId *string + // Desired host name/FQDN for the VM to be deployed + Hostname *string + // Distributed portgroup identifier to which the management vnic of NSX-Intelligence cluster node VM will be connected. + ManagementNetworkId *string + // IP Address and subnet configuration for the management port. Do not specify this field and default_gateway_addresses to use DHCP. Note: only one IPv4 address is supported for the management port. IMPORTANT: VMs deployed using DHCP are currently not supported, so this parameter should be specified. + ManagementPortSubnets []IPSubnet + // List of NTP servers. To use hostnames, a DNS server must be defined. If not using DHCP, a DNS server should be specified under dns_servers. format: hostname-or-ipv4 + NtpServers []string + // The NSX-Intelligence cluster node VM OVF URL to download and install the OVF file. This field is deprecated now. Please upload OVA file using \"/repository/bundles\" API and then try deployment without providing this field. + OvfUrl *string + // The NSX-Intelligence cluster node VM will be deployed on the specified datastore in the specified VC server. User must ensure that storage is accessible by the specified cluster/host. + StorageId *string + // The VC-specific identifiers will be resolved on this VC, so all other identifiers specified in the config must belong to this vCenter server. + VcId *string + // Possible values are: + // + // * IntelligenceClusterNodeVMDeploymentConfig#IntelligenceClusterNodeVMDeploymentConfig_PLACEMENT_TYPE_INTELLIGENCEVSPHERECLUSTERNODEVMDEPLOYMENTCONFIG + // + // Specifies the config for the platform through which to deploy the VM + PlacementType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IntelligenceVsphereClusterNodeVMDeploymentConfig__TYPE_IDENTIFIER = "IntelligenceVsphereClusterNodeVMDeploymentConfig" +const IntelligenceVsphereClusterNodeVMDeploymentConfig_DISK_PROVISIONING_THIN = "THIN" +const IntelligenceVsphereClusterNodeVMDeploymentConfig_DISK_PROVISIONING_LAZY_ZEROED_THICK = "LAZY_ZEROED_THICK" +const IntelligenceVsphereClusterNodeVMDeploymentConfig_DISK_PROVISIONING_EAGER_ZEROED_THICK = "EAGER_ZEROED_THICK" + +func (s *IntelligenceVsphereClusterNodeVMDeploymentConfig) GetType__() bindings.BindingType { + return IntelligenceVsphereClusterNodeVMDeploymentConfigBindingType() +} + +func (s *IntelligenceVsphereClusterNodeVMDeploymentConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IntelligenceVsphereClusterNodeVMDeploymentConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Inter SR IBGP configuration +type InterSRRoutingConfig struct { + // While creation of BGP config this flag will be set to - true for Tier0 logical router with Active-Active high-availability mode - false for Tier0 logical router with Active-Standby high-availability mode. User can change this value while updating inter-sr config. + Enabled *bool +} + +func (s *InterSRRoutingConfig) GetType__() bindings.BindingType { + return InterSRRoutingConfigBindingType() +} + +func (s *InterSRRoutingConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InterSRRoutingConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type InterSiteBgpSummary struct { + // Timestamp when the inter-site IBgp neighbors status was last updated. format: int64 + LastUpdateTimestamp *int64 + // Status of all inter-site IBgp neighbors. + NeighborStatus []BgpNeighborStatus + // Edge node id whose status is being reported. + TransportNodeId *string +} + +func (s *InterSiteBgpSummary) GetType__() bindings.BindingType { + return InterSiteBgpSummaryBindingType() +} + +func (s *InterSiteBgpSummary) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InterSiteBgpSummary._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type InterSitePortCounters struct { + // The total number of packets blocked. format: int64 + BlockedPackets *int64 + // Number of duplicate address detected packets dropped. format: int64 + DadDroppedPackets *int64 + // Number of packtes dropped as destination is not supported. format: int64 + DestinationUnsupportedDroppedPackets *int64 + // The total number of packets dropped. format: int64 + DroppedPackets *int64 + // Number of firewall packets dropped. format: int64 + FirewallDroppedPackets *int64 + // Number of fragmentation needed packets dropped. format: int64 + FragNeededDroppedPackets *int64 + // Number of IPSec packets dropped format: int64 + IpsecDroppedPackets *int64 + // Number of IPSec no security association packets dropped. format: int64 + IpsecNoSaDroppedPackets *int64 + // Number of IPSec packets dropped as no VTI is present. format: int64 + IpsecNoVtiDroppedPackets *int64 + // Number of IPSec policy block packets dropped. format: int64 + IpsecPolBlockDroppedPackets *int64 + // Number of IPSec policy error packets dropped. format: int64 + IpsecPolErrDroppedPackets *int64 + // Number of IPV6 packets dropped. format: int64 + Ipv6DroppedPackets *int64 + // Number of DPDK kernal NIC interface packets dropped. format: int64 + KniDroppedPackets *int64 + // Number of packets dropped due to unsupported L4 port. format: int64 + L4portUnsupportedDroppedPackets *int64 + // Number of packtes dropped as they are malformed. format: int64 + MalformedDroppedPackets *int64 + // Number of no ARP packets dropped. format: int64 + NoArpDroppedPackets *int64 + // Number of packets dropped as no linked ports are present. format: int64 + NoLinkedDroppedPackets *int64 + // Number of packets dropped due to insufficient memory. format: int64 + NoMemDroppedPackets *int64 + // Number of packets dropped due to absence of receiver. format: int64 + NoReceiverDroppedPackets *int64 + // The number of no route packets dropped format: int64 + NoRouteDroppedPackets *int64 + // Number of non IP packets dropped. format: int64 + NonIpDroppedPackets *int64 + // Number of packets dropped as protocol is unsupported. format: int64 + ProtoUnsupportedDroppedPackets *int64 + // Number of redirect packets dropped. format: int64 + RedirectDroppedPackets *int64 + // Number of reverse-path forwarding check packets dropped. format: int64 + RpfCheckDroppedPackets *int64 + // Number of service insert packets dropped. format: int64 + ServiceInsertDroppedPackets *int64 + // The total number of bytes transferred. format: int64 + TotalBytes *int64 + // The total number of packets transferred. format: int64 + TotalPackets *int64 + // Number of time to live exceeded packets dropped. format: int64 + TtlExceededDroppedPackets *int64 +} + +func (s *InterSitePortCounters) GetType__() bindings.BindingType { + return InterSitePortCountersBindingType() +} + +func (s *InterSitePortCounters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InterSitePortCounters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Interface IGMP[Internet Group Management Protocol] configuration parameters. +type InterfaceIgmpLocalGroupConfig struct { + // IGMP join group manages the membership of hosts and routing devices in the multicast group. Host will join the group by conveying its information through IGMP. format: ip + IgmpLocalJoinGroups []string +} + +func (s *InterfaceIgmpLocalGroupConfig) GetType__() bindings.BindingType { + return InterfaceIgmpLocalGroupConfigBindingType() +} + +func (s *InterfaceIgmpLocalGroupConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InterfaceIgmpLocalGroupConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Interface neighbor properties +type InterfaceNeighborProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Interface index format: int64 + Ifindex *int64 + // Interface MAC address + Mac *string + // Interface Name + Name *string + // Neighbor properties + Neighbors []NeighborProperties +} + +func (s *InterfaceNeighborProperties) GetType__() bindings.BindingType { + return InterfaceNeighborPropertiesBindingType() +} + +func (s *InterfaceNeighborProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InterfaceNeighborProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Interface neighbor property query results +type InterfaceNeighborPropertyListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Interface neighbor property results + Results []InterfaceNeighborProperties +} + +func (s *InterfaceNeighborPropertyListResult) GetType__() bindings.BindingType { + return InterfaceNeighborPropertyListResultBindingType() +} + +func (s *InterfaceNeighborPropertyListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InterfaceNeighborPropertyListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Interface PIM[Protocol Independent Multicast] configuration parameters. +type InterfacePimConfig struct { + // If the flag is set to true - it will enable PIM on the uplink interface. If the flag is set to false - it will disable PIM on the uplink interface. + Enabled *bool + // PIM hello interval. Ranges from 1 to 180 seconds. format: int64 + HelloInterval *int64 + // PIM hold interval. Ranges from 1 to 630 seconds. hold_interval should be greater than hello_interval. If hold interval is not provided then it will be considered as 3.5 times of hello_interval. format: int64 + HoldInterval *int64 +} + +func (s *InterfacePimConfig) GetType__() bindings.BindingType { + return InterfacePimConfigBindingType() +} + +func (s *InterfacePimConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InterfacePimConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Schedule to specify the interval time at which automated backups need to be taken +type IntervalBackupSchedule struct { + // Time interval in seconds between two consecutive automated backups format: int64 + SecondsBetweenBackups *int64 + // Possible values are: + // + // * BackupSchedule#BackupSchedule_RESOURCE_TYPE_WEEKLYBACKUPSCHEDULE + // * BackupSchedule#BackupSchedule_RESOURCE_TYPE_INTERVALBACKUPSCHEDULE + // + // Schedule type + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IntervalBackupSchedule__TYPE_IDENTIFIER = "IntervalBackupSchedule" + +func (s *IntervalBackupSchedule) GetType__() bindings.BindingType { + return IntervalBackupScheduleBindingType() +} + +func (s *IntervalBackupSchedule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IntervalBackupSchedule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type IntervalSampling struct { + // Time interval in ms between two sampling actions. format: int64 + SamplingInterval *int64 + // Possible values are: + // + // * SamplingArgument#SamplingArgument_SAMPLING_TYPE_FIRSTNSAMPLING + // * SamplingArgument#SamplingArgument_SAMPLING_TYPE_PACKETNUMBERSAMPLING + // * SamplingArgument#SamplingArgument_SAMPLING_TYPE_INTERVALSAMPLING + // + // Sampling type + SamplingType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IntervalSampling__TYPE_IDENTIFIER = "IntervalSampling" + +func (s *IntervalSampling) GetType__() bindings.BindingType { + return IntervalSamplingBindingType() +} + +func (s *IntervalSampling) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IntervalSampling._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type InventoryConfig struct { + // Soft limit on number of compute managers, which can be added, beyond which, addition of compute managers will result in warning getting logged format: int32 + ComputeManagersSoftLimit *int64 +} + +func (s *InventoryConfig) GetType__() bindings.BindingType { + return InventoryConfigBindingType() +} + +func (s *InventoryConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for InventoryConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Ipaddress information of the fabric node. +type IpAddressInfo struct { + // IP Addresses of the the virtual network interface, as discovered in the source. format: ip + IpAddresses []string + // Possible values are: + // + // * IpAddressInfo#IpAddressInfo_SOURCE_TOOLS + // + // Source of the ipaddress information. + Source *string +} + +const IpAddressInfo_SOURCE_TOOLS = "VM_TOOLS" + +func (s *IpAddressInfo) GetType__() bindings.BindingType { + return IpAddressInfoBindingType() +} + +func (s *IpAddressInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpAddressInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Base type of ip-allocation extended by ip pool and static binding. +type IpAllocationBase struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Gateway ip address of the allocation. format: ip + GatewayIp *string + // Lease time, in seconds, [60-(2^32-1)]. Default is 86400. format: int64 + LeaseTime *int64 + Options *DhcpOptions +} + +func (s *IpAllocationBase) GetType__() bindings.BindingType { + return IpAllocationBaseBindingType() +} + +func (s *IpAllocationBase) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpAllocationBase._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Abstract base type for specification of IPs to be used with host switch virtual tunnel endpoints +type IpAssignmentSpec struct { + // Possible values are: + // + // * IpAssignmentSpec#IpAssignmentSpec_RESOURCE_TYPE_STATICIPPOOLSPEC + // * IpAssignmentSpec#IpAssignmentSpec_RESOURCE_TYPE_STATICIPLISTSPEC + // * IpAssignmentSpec#IpAssignmentSpec_RESOURCE_TYPE_ASSIGNEDBYDHCP + // * IpAssignmentSpec#IpAssignmentSpec_RESOURCE_TYPE_STATICIPMACLISTSPEC + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IpAssignmentSpec__TYPE_IDENTIFIER = "IpAssignmentSpec" +const IpAssignmentSpec_RESOURCE_TYPE_STATICIPPOOLSPEC = "StaticIpPoolSpec" +const IpAssignmentSpec_RESOURCE_TYPE_STATICIPLISTSPEC = "StaticIpListSpec" +const IpAssignmentSpec_RESOURCE_TYPE_ASSIGNEDBYDHCP = "AssignedByDhcp" +const IpAssignmentSpec_RESOURCE_TYPE_STATICIPMACLISTSPEC = "StaticIpMacListSpec" + +func (s *IpAssignmentSpec) GetType__() bindings.BindingType { + return IpAssignmentSpecBindingType() +} + +func (s *IpAssignmentSpec) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpAssignmentSpec._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A block of IPv4/IPv6 addresses defined by a start address and a mask/prefix (network CIDR). An IP block is typically large & allocated to a tenant for automated consumption. An IP block is always a contiguous address space, for example 192.0.0.1/8. An IP block can be further subdivided into subnets called IP block subnets. These IP block subnets can later be added to IP pools and used for IP allocation. An IP pool is typically a collection of subnets that are often not a contiguous address space. Clients are allocated IP addresses only from IP pools. Sample Structure Diagram IpBlock_VMware 192.0.0.1/8 ======================================================================= / ___________________________________________/________ / IpBlockSubnet_Finance ( IpBlockSubnet_Eng1 IpBlockSubnet_Eng2 / ) / 192.168.0.1/16 ( 192.170.1.1/16 192.180.1.1/24 / ) IpPool_Eng / (___________________________________________/________) / / ======================================================================= +type IpBlock struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Represents network address and the prefix length which will be associated with a layer-2 broadcast domain format: ip-cidr-block + Cidr *string +} + +func (s *IpBlock) GetType__() bindings.BindingType { + return IpBlockBindingType() +} + +func (s *IpBlock) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpBlock._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type IpBlockListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // IP block list results + Results []IpBlock +} + +func (s *IpBlockListResult) GetType__() bindings.BindingType { + return IpBlockListResultBindingType() +} + +func (s *IpBlockListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpBlockListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A set of IPv4/IPv6 addresses defined by a start address and a mask/prefix which will typically be associated with a layer-2 broadcast domain. +type IpBlockSubnet struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // A collection of IPv4/IPv6 IP ranges used for IP allocation. + AllocationRanges []IpPoolRange + // Block id for which the subnet is created. + BlockId *string + // Represents network address and the prefix length which will be associated with a layer-2 broadcast domain format: ip-cidr-block + Cidr *string + // Represents the size or number of ip addresses in the subnet format: int64 + Size *int64 + // For internal system use Only. Represents start ip address of the subnet from IP block. Subnet ip adddress will start from this ip address. format: ip + StartIp *string +} + +func (s *IpBlockSubnet) GetType__() bindings.BindingType { + return IpBlockSubnetBindingType() +} + +func (s *IpBlockSubnet) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpBlockSubnet._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type IpBlockSubnetListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // IP block subnet list results + Results []IpBlockSubnet +} + +func (s *IpBlockSubnetListResult) GetType__() bindings.BindingType { + return IpBlockSubnetListResultBindingType() +} + +func (s *IpBlockSubnetListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpBlockSubnetListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type IpDiscoverySwitchingProfile struct { + // Indicates the number of arp snooped IP addresses to be remembered per LogicalPort. Decreasing this value, will retain the latest bindings from the existing list of address bindings. Increasing this value will retain existing bindings and also learn any new address bindings discovered on the port until the new limit is reached. This limit only applies to IPv4 addresses and is independent of the nd_bindings_limit used for IPv6 snooping. format: int32 + ArpBindingsLimit *int64 + // This property controls the ARP and ND cache timeout period.It is recommended that this property be greater than the ARP/ND cache timeout on the VM. format: int32 + ArpNdBindingTimeout *int64 + // Indicates whether ARP snooping is enabled + ArpSnoopingEnabled *bool + // Indicates whether DHCP snooping is enabled + DhcpSnoopingEnabled *bool + // This option is the IPv6 equivalent of DHCP snooping. + Dhcpv6SnoopingEnabled *bool + DuplicateIpDetection *DuplicateIPDetection + // Indicates the number of neighbor-discovery snooped IP addresses to be remembered per LogicalPort. Decreasing this value, will retain the latest bindings from the existing list of address bindings. Increasing this value will retain existing bindings and also learn any new address bindings discovered on the port until the new limit is reached. This limit only applies to IPv6 addresses and is independent of the arp_bindings_limit used for IPv4 snooping. format: int32 + NdBindingsLimit *int64 + // This option is the IPv6 equivalent of ARP snooping. + NdSnoopingEnabled *bool + // ARP snooping being inherently susceptible to ARP spoofing, uses a turst-on-fisrt-use (TOFU) paradigm where only the first IP address discovered via ARP snooping is trusted. The remaining are ignored. In order to allow for more flexibility, we allow the user to configure how many ARP snooped address bindings should be trusted for the lifetime of the logical port. This is controlled by the arp_bindings_limit property in the IP Discovery profile. We refer to this extension of TOFU as N-TOFU. However, if TOFU is disabled, then N ARP snooped IP addresses will be trusted until they are timed out, where N is configured by arp_bindings_limit. + TrustOnFirstUseEnabled *bool + // This option is only supported on ESX where vm-tools is installed. + VmToolsEnabled *bool + // This option is only supported on ESX where vm-tools is installed. + VmToolsV6Enabled *bool + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + RequiredCapabilities []string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IpDiscoverySwitchingProfile__TYPE_IDENTIFIER = "IpDiscoverySwitchingProfile" + +func (s *IpDiscoverySwitchingProfile) GetType__() bindings.BindingType { + return IpDiscoverySwitchingProfileBindingType() +} + +func (s *IpDiscoverySwitchingProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpDiscoverySwitchingProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Only support IP address or subnet. Its type can be of IPv4 or IPv6. It will be converted to subnet when netmask is specified(e.g., 192.168.1.3/24 => 192.168.1.0/24, 2008:12:12:12::2/64 => 2008:12:12:12::/64). +type IpInfo struct { + // The destination IP address or subnet format: address-or-block-or-range + DstIp *string + // The source IP address or subnet format: address-or-block-or-range + SrcIp *string +} + +func (s *IpInfo) GetType__() bindings.BindingType { + return IpInfoBindingType() +} + +func (s *IpInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// IP and MAC pair. +type IpMacPair struct { + // IP address format: ip + Ip *string + // MAC address format: mac-address + Mac *string +} + +func (s *IpMacPair) GetType__() bindings.BindingType { + return IpMacPairBindingType() +} + +func (s *IpMacPair) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpMacPair._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A collection of one or more IPv4 or IPv6 subnets or ranges that are often not a contiguous address space. Clients are allocated IPs from an IP pool. Often used when a client that consumes addresses exhausts an initial subnet or range and needs to be expanded but the adjoining address space is not available as it has been allocated to a different client. +type IpPool struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If true, a validation error will be thrown if another IP pool is found to be overlapping with this pool. The flag is false by default. + CheckOverlapWithExistingPools *bool + // Delay in milliseconds, while releasing allocated IP address from IP pool (Default is 2 mins). format: int64 + IpReleaseDelay *int64 + PoolUsage *PoolUsage + // Subnets can be IPv4 or IPv6 and they should not overlap. The maximum number will not exceed 5 subnets. + Subnets []IpPoolSubnet +} + +func (s *IpPool) GetType__() bindings.BindingType { + return IpPoolBindingType() +} + +func (s *IpPool) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpPool._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type IpPoolListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // IP pool list results + Results []IpPool +} + +func (s *IpPoolListResult) GetType__() bindings.BindingType { + return IpPoolListResultBindingType() +} + +func (s *IpPoolListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpPoolListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A set of IPv4 or IPv6 addresses defined by a start and end address. +type IpPoolRange struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The end IP Address of the IP Range. format: ip + End *string + // The start IP Address of the IP Range. format: ip + Start *string +} + +func (s *IpPoolRange) GetType__() bindings.BindingType { + return IpPoolRangeBindingType() +} + +func (s *IpPoolRange) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpPoolRange._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A set of IPv4 or IPv6 addresses defined by a network CIDR. +type IpPoolSubnet struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // A collection of IPv4 or IPv6 IP Pool Ranges. + AllocationRanges []IpPoolRange + // Represents network address and the prefix length which will be associated with a layer-2 broadcast domain + Cidr *string + // The collection of upto 3 DNS servers for the subnet. format: ip + DnsNameservers []string + // The DNS suffix for the DNS server. format: hostname + DnsSuffix *string + // The default gateway address on a layer-3 router. format: ip + GatewayIp *string +} + +func (s *IpPoolSubnet) GetType__() bindings.BindingType { + return IpPoolSubnetBindingType() +} + +func (s *IpPoolSubnet) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpPoolSubnet._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type IpfixCollector struct { + // IP address for the IPFIX collector format: ip + CollectorIpAddress *string + // Port for the IPFIX collector format: int32 + CollectorPort *int64 +} + +func (s *IpfixCollector) GetType__() bindings.BindingType { + return IpfixCollectorBindingType() +} + +func (s *IpfixCollector) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpfixCollector._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This managed entity contains a set of IPFIX collectors. +type IpfixCollectorConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // IPFIX Collectors + Collectors []IpfixCollector +} + +func (s *IpfixCollectorConfig) GetType__() bindings.BindingType { + return IpfixCollectorConfigBindingType() +} + +func (s *IpfixCollectorConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpfixCollectorConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of IPFIX Collector Configs +type IpfixCollectorConfigListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // IPFIX Collector Config + Results []IpfixCollectorConfig +} + +func (s *IpfixCollectorConfigListResult) GetType__() bindings.BindingType { + return IpfixCollectorConfigListResultBindingType() +} + +func (s *IpfixCollectorConfigListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpfixCollectorConfigListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The configuration for Internet protocol flow information export (IPFIX) collector. It should be referenced in other IPFIX profile as a collecor config. The IPFIX exporter will send records to these collectors. +type IpfixCollectorUpmProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * IpfixCollectorUpmProfile#IpfixCollectorUpmProfile_RESOURCE_TYPE_IPFIXCOLLECTORUPMPROFILE + // + // All IPFIX collector profile types. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // IPFIX Collector Set + Collectors []IpfixCollector +} + +const IpfixCollectorUpmProfile_RESOURCE_TYPE_IPFIXCOLLECTORUPMPROFILE = "IpfixCollectorUpmProfile" + +func (s *IpfixCollectorUpmProfile) GetType__() bindings.BindingType { + return IpfixCollectorUpmProfileBindingType() +} + +func (s *IpfixCollectorUpmProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpfixCollectorUpmProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// IPFIX collector profile list result for query with profile list parameters +type IpfixCollectorUpmProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // IPFIX Collector Profile List + Results []IpfixCollectorUpmProfile +} + +func (s *IpfixCollectorUpmProfileListResult) GetType__() bindings.BindingType { + return IpfixCollectorUpmProfileListResultBindingType() +} + +func (s *IpfixCollectorUpmProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpfixCollectorUpmProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// IPFIX Config base representation +type IpfixConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * IpfixConfig#IpfixConfig_RESOURCE_TYPE_IPFIXDFWCONFIG + // + // Supported IPFIX Config Types. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // List of objects where the IPFIX Config will be enabled. + AppliedTos []ResourceReference +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IpfixConfig__TYPE_IDENTIFIER = "IpfixConfig" +const IpfixConfig_RESOURCE_TYPE_IPFIXDFWCONFIG = "IpfixDfwConfig" + +func (s *IpfixConfig) GetType__() bindings.BindingType { + return IpfixConfigBindingType() +} + +func (s *IpfixConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpfixConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of IPFIX Config +type IpfixConfigListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // IPFIX Config + Results []*data.StructValue +} + +func (s *IpfixConfigListResult) GetType__() bindings.BindingType { + return IpfixConfigListResultBindingType() +} + +func (s *IpfixConfigListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpfixConfigListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// It defines IPFIX DFW Configuration. +type IpfixDfwConfig struct { + // For long standing active flows, IPFIX records will be sent per timeout period format: int64 + ActiveFlowExportTimeout *int64 + // Each IPFIX DFW config can have its own collector config. + Collector *string + // An identifier that is unique to the exporting process and used to meter the Flows. format: int64 + ObservationDomainId *int64 + // This priority field is used to resolve conflicts in Logical Ports which are covered by more than one IPFIX profiles. The IPFIX exporter will send records to Collectors in highest priority profile (lowest number) only. format: int64 + Priority *int64 + TemplateParameters *IpfixDfwTemplateParameters + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * IpfixConfig#IpfixConfig_RESOURCE_TYPE_IPFIXDFWCONFIG + // + // Supported IPFIX Config Types. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // List of objects where the IPFIX Config will be enabled. + AppliedTos []ResourceReference +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IpfixDfwConfig__TYPE_IDENTIFIER = "IpfixDfwConfig" + +func (s *IpfixDfwConfig) GetType__() bindings.BindingType { + return IpfixDfwConfigBindingType() +} + +func (s *IpfixDfwConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpfixDfwConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This entity represents the flow parameters which are exported. +type IpfixDfwTemplateParameters struct { + // The destination IP address of a monitored network flow. + DestinationAddress *bool + // The destination transport port of a monitored network flow. + DestinationTransportPort *bool + // Five valid values are allowed: 1. Flow Created. 2. Flow Deleted. 3. Flow Denied. 4. Flow Alert (not used in DropKick implementation). 5. Flow Update. + FirewallEvent *bool + // Two valid values are allowed: 1. 0x00: igress flow to VM. 2. 0x01: egress flow from VM. + FlowDirection *bool + // The absolute timestamp (seconds) of the last packet of this flow. + FlowEnd *bool + // The absolute timestamp (seconds) of the first packet of this flow. + FlowStart *bool + // Code of the IPv4 ICMP message. + IcmpCode *bool + // The number of octets since the previous report (if any) in incoming packets for this flow at the observation point. The number of octets include IP header(s) and payload. + OctetDeltaCount *bool + // The number of incoming packets since the previous report (if any) for this flow at the observation point. + PacketDeltaCount *bool + // The value of the protocol number in the IP packet header. + ProtocolIdentifier *bool + // Firewall rule Id - enterprise specific Information Element that uniquely identifies firewall rule. + RuleId *bool + // The source IP address of a monitored network flow. + SourceAddress *bool + // Type of the IPv4 ICMP message. + SourceIcmpType *bool + // The source transport port of a monitored network flow. + SourceTransportPort *bool + // VIF UUID - enterprise specific Information Element that uniquely identifies VIF. + VifUuid *bool +} + +func (s *IpfixDfwTemplateParameters) GetType__() bindings.BindingType { + return IpfixDfwTemplateParametersBindingType() +} + +func (s *IpfixDfwTemplateParameters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpfixDfwTemplateParameters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type IpfixServiceAssociationListResult struct { + // Ipfix config list result with pagination support. + Results []*data.StructValue + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Possible values are: + // + // * ServiceAssociationListResult#ServiceAssociationListResult_SERVICE_TYPE_FIREWALLSERVICEASSOCIATIONLISTRESULT + // * ServiceAssociationListResult#ServiceAssociationListResult_SERVICE_TYPE_IPFIXSERVICEASSOCIATIONLISTRESULT + ServiceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IpfixServiceAssociationListResult__TYPE_IDENTIFIER = "IpfixServiceAssociationListResult" + +func (s *IpfixServiceAssociationListResult) GetType__() bindings.BindingType { + return IpfixServiceAssociationListResultBindingType() +} + +func (s *IpfixServiceAssociationListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpfixServiceAssociationListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The configuration for Internet protocol flow information export (IPFIX) and would be enabled on the switching module to collect flow information. +type IpfixSwitchUpmProfile struct { + // The time in seconds after a flow is expired even if more packets matching this Flow are received by the cache. format: int32 + ActiveTimeout *int64 + AppliedTos *AppliedTos + // Each IPFIX switching profile can have its own collector profile. + CollectorProfile *string + // It controls whether sample result includes overlay flow info. + ExportOverlayFlow *bool + // The time in seconds after a flow is expired if no more packets matching this flow are received by the cache. format: int32 + IdleTimeout *int64 + // The maximum number of flow entries in each exporter flow cache. format: int64 + MaxFlows *int64 + // An identifier that is unique to the exporting process and used to meter the Flows. format: int64 + ObservationDomainId *int64 + // The probability in percentage that a packet is sampled. The value should be in range (0,100] and can only have three decimal places at most. The probability is equal for every packet. + PacketSampleProbability *float64 + // This priority field is used to resolve conflicts in logical ports/switch which inherit multiple switch IPFIX profiles from NSGroups. Override rule is : for multiple profiles inherited from NSGroups, the one with highest priority (lowest number) overrides others; the profile directly applied to logical switch overrides profiles inherited from NSGroup; the profile directly applied to logical port overides profiles inherited from logical switch and/or nsgroup; The IPFIX exporter will send records to collectors of final effective profile only. format: int32 + Priority *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * IpfixUpmProfile#IpfixUpmProfile_RESOURCE_TYPE_IPFIXSWITCHUPMPROFILE + // + // All IPFIX profile types. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IpfixSwitchUpmProfile__TYPE_IDENTIFIER = "IpfixSwitchUpmProfile" + +func (s *IpfixSwitchUpmProfile) GetType__() bindings.BindingType { + return IpfixSwitchUpmProfileBindingType() +} + +func (s *IpfixSwitchUpmProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpfixSwitchUpmProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Parent profile of all IPFIX profiles. +type IpfixUpmProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * IpfixUpmProfile#IpfixUpmProfile_RESOURCE_TYPE_IPFIXSWITCHUPMPROFILE + // + // All IPFIX profile types. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const IpfixUpmProfile__TYPE_IDENTIFIER = "IpfixUpmProfile" +const IpfixUpmProfile_RESOURCE_TYPE_IPFIXSWITCHUPMPROFILE = "IpfixSwitchUpmProfile" + +func (s *IpfixUpmProfile) GetType__() bindings.BindingType { + return IpfixUpmProfileBindingType() +} + +func (s *IpfixUpmProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpfixUpmProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// IPFIX profile list result for query with list parameters +type IpfixUpmProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // IPFIX Profile List + Results []*data.StructValue +} + +func (s *IpfixUpmProfileListResult) GetType__() bindings.BindingType { + return IpfixUpmProfileListResultBindingType() +} + +func (s *IpfixUpmProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IpfixUpmProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type Ipv4Header struct { + // The destination ip address. format: ipv4 + DstIp *string + // IP flags format: int64 + Flags *int64 + // IP protocol - defaults to ICMP format: int64 + Protocol *int64 + // The source ip address. format: ipv4 + SrcIp *string + // This is used together with src_ip to calculate dst_ip for broadcast when dst_ip is not given; not used in all other cases. format: int64 + SrcSubnetPrefixLen *int64 + // Time to live (ttl) format: int64 + Ttl *int64 +} + +func (s *Ipv4Header) GetType__() bindings.BindingType { + return Ipv4HeaderBindingType() +} + +func (s *Ipv4Header) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Ipv4Header._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type Ipv6Header struct { + // The destination ip address. format: ipv6 + DstIp *string + // Decremented by 1 by each node that forwards the packets. The packet is discarded if Hop Limit is decremented to zero. format: int64 + HopLimit *int64 + // Identifies the type of header immediately following the IPv6 header. format: int64 + NextHeader *int64 + // The source ip address. format: ipv6 + SrcIp *string +} + +func (s *Ipv6Header) GetType__() bindings.BindingType { + return Ipv6HeaderBindingType() +} + +func (s *Ipv6Header) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Ipv6Header._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type IssuerSerialNumber struct { + // Issuer Distinguished Name of the revoked certificates. + Issuer *string + // List of Certificate Serial Numbers issued by the specified issuers. + SerialNumbers []string +} + +func (s *IssuerSerialNumber) GetType__() bindings.BindingType { + return IssuerSerialNumberBindingType() +} + +func (s *IssuerSerialNumber) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for IssuerSerialNumber._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// To join a new node to the NSX cluster, issue a JoinCluster API on the new node. The JoinCluster API takes this object as a parameter. Provide the ID of the NSX cluster you want the new node to join and the IP address of one of the nodes already in that cluster. The Cluster Boot Manager running on the new node will then add the new node to the NSX cluster by making a AttachClusterNode REST API call on the node that is already part of the cluster. In order to make a REST API call to the node in the cluster, the Cluster Boot Manager will need username and password of a priviledged user on the node in the cluster. In place of a username and password, Cluster Boot Manager could also use a OAuth token provided. The Cluster Boot Manager needs either the username and password or the OAuth token to make the REST call but not both. +type JoinClusterParameters struct { + // SHA256 Thumbprint of the API certificate of the cluster node + CertficateSha256Thumbprint *string + // UUID of the cluster to join + ClusterId *string + // IP address of a node already part of the cluster to join + IpAddress *string + // Password of the user on the cluster node + Password *string + // API port on the cluster node format: int64 + Port *int64 + // Limited time OAuth token instead of the username/password + Token *string + // Username on the cluster node + Username *string +} + +func (s *JoinClusterParameters) GetType__() bindings.BindingType { + return JoinClusterParametersBindingType() +} + +func (s *JoinClusterParameters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for JoinClusterParameters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Key Store information about the url alias or datasource. +type KeyStoreInfo struct { + // A location of the keystor file which stores private key and identity certificates that will be presented to both parties (server or client) for verification. + Keystore *string + // Its an alias specified when an entity is added to the keystore. + KeystoreAlias *string + // A location of the key store pass phrase file. + KeystorePhrase *string + // A location of the trust store file which stores the certificate from CA that verify the certificate presented by the server in SSL connection. + Truststore *string +} + +func (s *KeyStoreInfo) GetType__() bindings.BindingType { + return KeyStoreInfoBindingType() +} + +func (s *KeyStoreInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for KeyStoreInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type KeyValue struct { + // Key name. + Key *string + // Key value. + Value *string +} + +func (s *KeyValue) GetType__() bindings.BindingType { + return KeyValueBindingType() +} + +func (s *KeyValue) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for KeyValue._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// An arbitrary key-value pair +type KeyValuePair struct { + // Key + Key *string + // Value + Value *string +} + +func (s *KeyValuePair) GetType__() bindings.BindingType { + return KeyValuePairBindingType() +} + +func (s *KeyValuePair) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for KeyValuePair._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type KnownHostParameter struct { + // Known host hostname or IP address format: hostname-or-ipv4 + Host *string + // Known host port format: int64 + Port *int64 +} + +func (s *KnownHostParameter) GetType__() bindings.BindingType { + return KnownHostParameterBindingType() +} + +func (s *KnownHostParameter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for KnownHostParameter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type L2ForwarderRemoteMacs struct { + // Inter-site forwarder status per node. + InterSiteForwarderStatus []L2ForwarderStatusPerNode + // Timestamp when the l2 forwarder remote mac addresses was last updated. format: int64 + LastUpdateTimestamp *int64 + // Logical switch id on which the L2 forwarder is created. + LogicalSwitchId *string + // L2 forwarder remote mac addresses per site for logical switch. + RemoteMacsPerSite []L2ForwarderRemoteMacsPerSite +} + +func (s *L2ForwarderRemoteMacs) GetType__() bindings.BindingType { + return L2ForwarderRemoteMacsBindingType() +} + +func (s *L2ForwarderRemoteMacs) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2ForwarderRemoteMacs._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type L2ForwarderRemoteMacsPerSite struct { + // Remote active IP addresses. format: ip + RemoteActiveIps []string + // Remote mac addresses. + RemoteMacAddresses []string + RemoteSite *ResourceReference + // Remote standby IP addresses. format: ip + RemoteStandbyIps []string + // 32 bit unique RTEP group id of the logical switch per site. format: int64 + RtepGroupId *int64 +} + +func (s *L2ForwarderRemoteMacsPerSite) GetType__() bindings.BindingType { + return L2ForwarderRemoteMacsPerSiteBindingType() +} + +func (s *L2ForwarderRemoteMacsPerSite) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2ForwarderRemoteMacsPerSite._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type L2ForwarderStatistics struct { + // Timestamp when the l2 forwarder statistics was last updated. format: int64 + LastUpdateTimestamp *int64 + // Logical switch id on which the L2 forwarder is created. + LogicalSwitchId *string + Rx *InterSitePortCounters + Tx *InterSitePortCounters +} + +func (s *L2ForwarderStatistics) GetType__() bindings.BindingType { + return L2ForwarderStatisticsBindingType() +} + +func (s *L2ForwarderStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2ForwarderStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type L2ForwarderStatus struct { + // Timestamp when the service router status was last updated. format: int64 + LastUpdateTimestamp *int64 + // Logical switch id on which the L2 forwarder is created. + LogicalSwitchId *string + // L2 forwarder status per node. + StatusPerNode []L2ForwarderStatusPerNode +} + +func (s *L2ForwarderStatus) GetType__() bindings.BindingType { + return L2ForwarderStatusBindingType() +} + +func (s *L2ForwarderStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2ForwarderStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type L2ForwarderStatusPerNode struct { + // Possible values are: + // + // * L2ForwarderStatusPerNode#L2ForwarderStatusPerNode_HIGH_AVAILABILITY_STATUS_ACTIVE + // * L2ForwarderStatusPerNode#L2ForwarderStatusPerNode_HIGH_AVAILABILITY_STATUS_STANDBY + // * L2ForwarderStatusPerNode#L2ForwarderStatusPerNode_HIGH_AVAILABILITY_STATUS_DOWN + // * L2ForwarderStatusPerNode#L2ForwarderStatusPerNode_HIGH_AVAILABILITY_STATUS_SYNC + // * L2ForwarderStatusPerNode#L2ForwarderStatusPerNode_HIGH_AVAILABILITY_STATUS_UNKNOWN + // + // High Availability status of a service router on the edge node. + HighAvailabilityStatus *string + TransportNode *ResourceReference +} + +const L2ForwarderStatusPerNode_HIGH_AVAILABILITY_STATUS_ACTIVE = "ACTIVE" +const L2ForwarderStatusPerNode_HIGH_AVAILABILITY_STATUS_STANDBY = "STANDBY" +const L2ForwarderStatusPerNode_HIGH_AVAILABILITY_STATUS_DOWN = "DOWN" +const L2ForwarderStatusPerNode_HIGH_AVAILABILITY_STATUS_SYNC = "SYNC" +const L2ForwarderStatusPerNode_HIGH_AVAILABILITY_STATUS_UNKNOWN = "UNKNOWN" + +func (s *L2ForwarderStatusPerNode) GetType__() bindings.BindingType { + return L2ForwarderStatusPerNodeBindingType() +} + +func (s *L2ForwarderStatusPerNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2ForwarderStatusPerNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Traffic statistics for a logical switch. +type L2VPNPerLSTrafficStatistics struct { + // Total number of incoming Broadcast, Unknown unicast and Multicast (BUM) bytes. format: int64 + BumBytesIn *int64 + // Total number of outgoing Broadcast, Unknown unicast and Multicast (BUM) bytes. format: int64 + BumBytesOut *int64 + // Total number of incoming Broadcast, Unknown unicast and Multicast (BUM) packets. format: int64 + BumPacketsIn *int64 + // Total number of outgoing Broadcast, Unknown unicast and Multicast (BUM) packets. format: int64 + BumPacketsOut *int64 + // Total number of incoming bytes. format: int64 + BytesIn *int64 + // Total number of outgoing bytes. format: int64 + BytesOut *int64 + LogicalSwitch *ResourceReference + // Total number of incoming packets. format: int64 + PacketsIn *int64 + // Total number of outgoing packets. format: int64 + PacketsOut *int64 + // Total number of incoming packets dropped. format: int64 + PacketsReceiveError *int64 + // Total number of packets dropped while sending for any reason. format: int64 + PacketsSentError *int64 +} + +func (s *L2VPNPerLSTrafficStatistics) GetType__() bindings.BindingType { + return L2VPNPerLSTrafficStatisticsBindingType() +} + +func (s *L2VPNPerLSTrafficStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2VPNPerLSTrafficStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Remote MAC addresses for all logical switches for a L2VPN session. +type L2VPNSessionRemoteMacs struct { + // L2VPN display name. + DisplayName *string + // List MAC addresses for all logical switch for a particular L2VPN session. + RemoteMacAddresses []L2VPNSessionRemoteMacsForLS + // L2VPN session identifier. + SessionId *string +} + +func (s *L2VPNSessionRemoteMacs) GetType__() bindings.BindingType { + return L2VPNSessionRemoteMacsBindingType() +} + +func (s *L2VPNSessionRemoteMacs) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2VPNSessionRemoteMacs._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Remote MAC addresses for logical switch. +type L2VPNSessionRemoteMacsForLS struct { + LogicalSwitch *ResourceReference + // Mac addresses. + RemoteMacAddresses []string + // Contains policy specific information like policy path. + Tags []Tag +} + +func (s *L2VPNSessionRemoteMacsForLS) GetType__() bindings.BindingType { + return L2VPNSessionRemoteMacsForLSBindingType() +} + +func (s *L2VPNSessionRemoteMacsForLS) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2VPNSessionRemoteMacsForLS._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Session statistics gives VPN session status and traffic statistics per logical switch. +type L2VPNSessionStatistics struct { + // L2VPN display name. + DisplayName *string + // Partial statistics is set to true if onle active node responds while standby does not. In case of both nodes responded statistics will be summed and partial stats will be false. If cluster has only active node, partial statistics will always be false. + PartialStats *bool + // Session identifier for L2VPN. + SessionId *string + // Tunnel port traffic counters. + TapTrafficCounters []L2VPNTapTrafficStatistics + // Traffic statistics per logical switch. + TrafficStatisticsPerLogicalSwitch []L2VPNPerLSTrafficStatistics +} + +func (s *L2VPNSessionStatistics) GetType__() bindings.BindingType { + return L2VPNSessionStatisticsBindingType() +} + +func (s *L2VPNSessionStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2VPNSessionStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// L2VPN session status. +type L2VPNSessionStatus struct { + // L2VPN display name. + DisplayName *string + // L2VPN session identifier. + SessionId *string + // Possible values are: + // + // * L2VPNSessionStatus#L2VPNSessionStatus_STATUS_UP + // * L2VPNSessionStatus#L2VPNSessionStatus_STATUS_DOWN + // + // L2 VPN session status, specifies UP/DOWN. + Status *string + // Transport tunnels status. + TransportTunnels []*data.StructValue +} + +const L2VPNSessionStatus_STATUS_UP = "UP" +const L2VPNSessionStatus_STATUS_DOWN = "DOWN" + +func (s *L2VPNSessionStatus) GetType__() bindings.BindingType { + return L2VPNSessionStatusBindingType() +} + +func (s *L2VPNSessionStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2VPNSessionStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List summary of L2VPN sessions. +type L2VPNSessionSummary struct { + // Number of established L2VPN sessions. L2VPN session is established when all the tunnels are up. format: int64 + EstablishedL2vpnSessions *int64 + // Number of failed L2VPN sessions. L2VPN session is failed when all the tunnels are down. format: int64 + FailedL2vpnSessions *int64 + // Total L2VPN sessions configured. format: int64 + TotalL2vpnSessions *int64 +} + +func (s *L2VPNSessionSummary) GetType__() bindings.BindingType { + return L2VPNSessionSummaryBindingType() +} + +func (s *L2VPNSessionSummary) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2VPNSessionSummary._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// TAP (Terminal access point) traffic statistics for L2VPN. +type L2VPNTapTrafficStatistics struct { + // Total number of incoming bytes. format: int64 + BytesIn *int64 + // Total number of outgoing bytes. format: int64 + BytesOut *int64 + // Total number of incoming packets. format: int64 + PacketsIn *int64 + // Total number of outgoing packets. format: int64 + PacketsOut *int64 + // Total number of incoming packets dropped. format: int64 + PacketsReceiveError *int64 + // Total number of packets dropped while sending for any reason. format: int64 + PacketsSentError *int64 +} + +func (s *L2VPNTapTrafficStatistics) GetType__() bindings.BindingType { + return L2VPNTapTrafficStatisticsBindingType() +} + +func (s *L2VPNTapTrafficStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2VPNTapTrafficStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Transport tunnel status. +type L2VPNTransportTunnelStatus struct { + // Possible values are: + // + // * L2VPNTransportTunnelStatus#L2VPNTransportTunnelStatus_RESOURCE_TYPE_IPSECVPNTRANSPORTSTATUS + // + // Resource types of L2VPN Transport tunnels + ResourceType string + TunnelId *ResourceReference +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const L2VPNTransportTunnelStatus__TYPE_IDENTIFIER = "L2VPNTransportTunnelStatus" +const L2VPNTransportTunnelStatus_RESOURCE_TYPE_IPSECVPNTRANSPORTSTATUS = "IPSecVPNTransportStatus" + +func (s *L2VPNTransportTunnelStatus) GetType__() bindings.BindingType { + return L2VPNTransportTunnelStatusBindingType() +} + +func (s *L2VPNTransportTunnelStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2VPNTransportTunnelStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type L2VpnAttachmentContext struct { + // List of local egress IP addresses, used for local egress optimization. format: address-or-block-or-range + LocalEgressIp []string + // Tunnel Id to uniquely identify the extension. format: int32 + TunnelId *int64 + // Possible values are: + // + // * AttachmentContext#AttachmentContext_ALLOCATE_ADDRESSES_IPPOOL + // * AttachmentContext#AttachmentContext_ALLOCATE_ADDRESSES_MACPOOL + // * AttachmentContext#AttachmentContext_ALLOCATE_ADDRESSES_BOTH + // * AttachmentContext#AttachmentContext_ALLOCATE_ADDRESSES_NONE + // * AttachmentContext#AttachmentContext_ALLOCATE_ADDRESSES_DHCP + // + // A flag to indicate whether to allocate addresses from allocation pools bound to the parent logical switch. + AllocateAddresses *string + // Used to identify which concrete class it is + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const L2VpnAttachmentContext__TYPE_IDENTIFIER = "L2VpnAttachmentContext" + +func (s *L2VpnAttachmentContext) GetType__() bindings.BindingType { + return L2VpnAttachmentContextBindingType() +} + +func (s *L2VpnAttachmentContext) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2VpnAttachmentContext._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Defines if service running as server or client Also defines all the common properties for the multiple L2VpnSessions associated with this service. +type L2VpnService struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Full mesh topology auto disables traffic replication between connected peers. However, this property is deprecated. Please refer enable_hub property instead to control client to client forwarding via the server. The value of enable_full_mesh will not be used anymore. If enable_hub is not provided explicitly, the default value of it will be used. + EnableFullMesh *bool + // This property only applies in SERVER mode. If set to true, traffic from any client will be replicated to all other clients. If set to false, traffic received from clients is only replicated to the local VPN endpoint. + EnableHub *bool + // Logical router id + LogicalRouterId *string + // IP Pool to allocate local and peer endpoint IPs for L2VpnSession logical Tap. format: ipv4-cidr-block + LogicalTapIpPool []string + // Possible values are: + // + // * L2VpnService#L2VpnService_MODE_SERVER + // * L2VpnService#L2VpnService_MODE_CLIENT + // + // Specify an L2VPN service mode as SERVER or CLIENT. L2VPN service in SERVER mode requires user to configure L2VPN session explicitly. L2VPN service in CLIENT mode can use peercode generated from SERVER to configure L2VPN session. + Mode *string +} + +const L2VpnService_MODE_SERVER = "SERVER" +const L2VpnService_MODE_CLIENT = "CLIENT" + +func (s *L2VpnService) GetType__() bindings.BindingType { + return L2VpnServiceBindingType() +} + +func (s *L2VpnService) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2VpnService._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Paginated list all the L2VPN services. +type L2VpnServiceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // L2VPN serivce list result + Results []L2VpnService +} + +func (s *L2VpnServiceListResult) GetType__() bindings.BindingType { + return L2VpnServiceListResultBindingType() +} + +func (s *L2VpnServiceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2VpnServiceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Defines the tunnel local and peer addresses along with the multiple tansport tunnels for redundancy. L2VpnSession belongs on to only one L2VpnService. +type L2VpnSession struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Enable to extend all the associated logical switches. + Enabled *bool + // L2VPN service id + L2vpnServiceId *string + L2vpnTcpMssClamping *L2VpnTcpMssClamping + // List of transport tunnels for redundancy. + TransportTunnels []ResourceReference + TunnelEncapsulation *L2VpnTunnelEncapsulation +} + +func (s *L2VpnSession) GetType__() bindings.BindingType { + return L2VpnSessionBindingType() +} + +func (s *L2VpnSession) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2VpnSession._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Paginated list all the L2VPN sessions +type L2VpnSessionListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // L2VPN sessions list result + Results []L2VpnSession +} + +func (s *L2VpnSessionListResult) GetType__() bindings.BindingType { + return L2VpnSessionListResultBindingType() +} + +func (s *L2VpnSessionListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2VpnSessionListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Get the peer_code for each tunnel to paste on the remote end of the tunnel. Currently only stand-along/unmanaged edge is supported on the remote end of the tunnel. +type L2VpnSessionPeerCodes struct { + // List of peer codes per transport tunnel. + PeerCodes []L2VpnTunnelPeerCode +} + +func (s *L2VpnSessionPeerCodes) GetType__() bindings.BindingType { + return L2VpnSessionPeerCodesBindingType() +} + +func (s *L2VpnSessionPeerCodes) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2VpnSessionPeerCodes._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// TCP MSS Clamping Direction and value for L2VPN session. +type L2VpnTcpMssClamping struct { + // Possible values are: + // + // * L2VpnTcpMssClamping#L2VpnTcpMssClamping_DIRECTION_NONE + // * L2VpnTcpMssClamping#L2VpnTcpMssClamping_DIRECTION_BOTH + // + // Specifies the traffic direction for which to apply MSS Clamping. If direction is None, the feature is disabled. + Direction *string + // It defines the maximum amount of data that a host is willing to accept in a single TCP segment. This field is set in TCP header during connection establishment. To avoid packet fragmentation, you can set this field depending on uplink MTU and VPN overhead. This is optional field and in case it is left unconfigured, best possible MSS value will be calculated based on effective mtu of uplink interface. Supported MSS range is 108 to 8860. format: int64 + MaxSegmentSize *int64 +} + +const L2VpnTcpMssClamping_DIRECTION_NONE = "NONE" +const L2VpnTcpMssClamping_DIRECTION_BOTH = "BOTH" + +func (s *L2VpnTcpMssClamping) GetType__() bindings.BindingType { + return L2VpnTcpMssClampingBindingType() +} + +func (s *L2VpnTcpMssClamping) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2VpnTcpMssClamping._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// L2VPN tunnel encapsulation config +type L2VpnTunnelEncapsulation struct { + // IP Address of the tunnel port. For hub, the IP is allocated from L2VpnService logical_tap_ip_pool. All sessions on same L2VpnService get the same local_endpoint_ip. For spoke, the IP must be provided. format: ipv4 + LocalEndpointIp *string + // IP Address of the peer tunnel port. For hub, the IP is allocated from L2VpnService logical_tap_ip_pool. For spoke, the IP must be provided. format: ipv4 + PeerEndpointIp *string + // Possible values are: + // + // * L2VpnTunnelEncapsulation#L2VpnTunnelEncapsulation_PROTOCOL_GRE + // + // Encapsulation protocol used by the tunnel + Protocol *string +} + +const L2VpnTunnelEncapsulation_PROTOCOL_GRE = "GRE" + +func (s *L2VpnTunnelEncapsulation) GetType__() bindings.BindingType { + return L2VpnTunnelEncapsulationBindingType() +} + +func (s *L2VpnTunnelEncapsulation) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2VpnTunnelEncapsulation._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// L2Vpn tunnel peer code +type L2VpnTunnelPeerCode struct { + // Copy this code to paste on the remote end of the tunnel. This is a base64 encoded string which has all the configuration for tunnel. E.g tap device local/peer ips and protocol, encryption algorithm, etc. The peer code also contains a pre-shared key; be careful when sharing or storing it. + PeerCode *string + TransportTunnel *ResourceReference +} + +func (s *L2VpnTunnelPeerCode) GetType__() bindings.BindingType { + return L2VpnTunnelPeerCodeBindingType() +} + +func (s *L2VpnTunnelPeerCode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L2VpnTunnelPeerCode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// L4PortSet can be specified in comma separated notation of parts. Parts of a L4PortSet includes single integer or range of port in hyphen notation. Example of a PortSet: \"22, 33-70, 44\". +type L4PortSetNSService struct { + // Number of values should not exceed 15, ranges count as 2 values. format: port-or-range + DestinationPorts []string + // Possible values are: + // + // * L4PortSetNSService#L4PortSetNSService_L4PROTOCOL_TCP + // * L4PortSetNSService#L4PortSetNSService_L4PROTOCOL_UDP + L4Protocol *string + // Number of values should not exceed 15, ranges count as 2 values. format: port-or-range + SourcePorts []string + // Possible values are: + // + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_ETHERTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_IPPROTOCOLNSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_IGMPTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_ICMPTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_ALGTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_L4PORTSETNSSERVICE + // + // The specific type of NSServiceElement + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const L4PortSetNSService__TYPE_IDENTIFIER = "L4PortSetNSService" +const L4PortSetNSService_L4PROTOCOL_TCP = "TCP" +const L4PortSetNSService_L4PROTOCOL_UDP = "UDP" + +func (s *L4PortSetNSService) GetType__() bindings.BindingType { + return L4PortSetNSServiceBindingType() +} + +func (s *L4PortSetNSService) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for L4PortSetNSService._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Label that will be displayed for a UI element. +type Label struct { + // If the condition is met then the label will be applied. Examples of expression syntax are provided under example_request section of CreateWidgetConfiguration API. + Condition *string + // If true, displays the label only on hover + Hover *bool + // Icons to be applied at dashboard for the label + Icons []Icon + // Hyperlink of the specified UI page that provides details. + Navigation *string + // Text to be displayed at the label. + Text *string +} + +func (s *Label) GetType__() bindings.BindingType { + return LabelBindingType() +} + +func (s *Label) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Label._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents a Label-Value widget configuration +type LabelValueConfiguration struct { + Layout *Layout + // Hyperlink of the specified UI page that provides details. + Navigation *string + // An array of label-value properties. + Properties []PropertyItem + // Possible values are: + // + // * LabelValueConfiguration#LabelValueConfiguration_SUB_TYPE_VERTICALLY_ALIGNED + // * LabelValueConfiguration#LabelValueConfiguration_SUB_TYPE_HORIZONTALLY_ALIGNED + // + // A sub-type of LabelValueConfiguration. If sub-type is not specified the parent type is rendered. For VERTICALLY_ALIGNED sub_type, the value is placed below the label. For HORIZONTALLY_ALIGNED sub_type, the value is placed right hand side of the label. + SubType *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_TIMERANGEDROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_SPACERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LEGENDWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration, CustomFilterWidgetConfiguration, TimeRangeDropdownFilterWidgetConfiguration, SpacerWidgetConfiguration, LegendWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If the condition is met then the widget will be displayed to UI. If no condition is provided, then the widget will be displayed unconditionally. + Condition *string + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + FeatureSet *FeatureSet + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. This field is deprecated instead use 'filters' property. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + // A List of filter applied to this widget configuration. This will be used to identify the filters applied to this widget. + Filters []string + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + Legend *Legend + // List of plotting configuration for a given widget. Widget plotting configurations which are common across all the widgets types should be define here. + PlotConfigs []WidgetPlotConfiguration + // Represents the vertical span of the widget / container. 1 Row span is equal to 20px. format: int32 + Rowspan *int64 + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // If the value of this field is set to true then card header will be displayed otherwise only card will be displayed without header. + ShowHeader *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LabelValueConfiguration__TYPE_IDENTIFIER = "LabelValueConfiguration" +const LabelValueConfiguration_SUB_TYPE_VERTICALLY_ALIGNED = "VERTICALLY_ALIGNED" +const LabelValueConfiguration_SUB_TYPE_HORIZONTALLY_ALIGNED = "HORIZONTALLY_ALIGNED" + +func (s *LabelValueConfiguration) GetType__() bindings.BindingType { + return LabelValueConfigurationBindingType() +} + +func (s *LabelValueConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LabelValueConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LacpGroupConfigInfo struct { + // The key represents the identifier for the group that is unique across VC. + Key *string + // Load balance algorithm used in LACP group. The possible values are dictated by the values available in VC. Please refer VMwareDvsLacpLoadBalanceAlgorithm documentation for a full list of values. A few examples are srcDestIp where source and destination IP are considered, srcIp where only source IP is considered. + LoadBalanceAlgorithm *string + // Possible values are: + // + // * LacpGroupConfigInfo#LacpGroupConfigInfo_MODE_ACTIVE + // * LacpGroupConfigInfo#LacpGroupConfigInfo_MODE_PASSIVE + // + // The mode of LACP can be ACTIVE or PASSIVE. If the mode is ACTIVE, LACP is enabled unconditionally. If the mode is PASSIVE, LACP is enabled only if LACP device is detected. + Mode *string + // The display name of the LACP group. + Name *string + // Possible values are: + // + // * LacpGroupConfigInfo#LacpGroupConfigInfo_TIMEOUT_TYPE_FAST + // * LacpGroupConfigInfo#LacpGroupConfigInfo_TIMEOUT_TYPE_SLOW + // + // To set the lag mode as fast for LACP. By default, it will be slow. + TimeoutType *string + // Names for the uplink ports in the group. + UplinkNames []string + // The number of uplink ports format: int64 + UplinkNum *int64 + // Keys for the uplink ports in the group. Each uplink port is assigned a key that is unique across VC. + UplinkPortKeys []string +} + +const LacpGroupConfigInfo_MODE_ACTIVE = "ACTIVE" +const LacpGroupConfigInfo_MODE_PASSIVE = "PASSIVE" +const LacpGroupConfigInfo_TIMEOUT_TYPE_FAST = "FAST" +const LacpGroupConfigInfo_TIMEOUT_TYPE_SLOW = "SLOW" + +func (s *LacpGroupConfigInfo) GetType__() bindings.BindingType { + return LacpGroupConfigInfoBindingType() +} + +func (s *LacpGroupConfigInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LacpGroupConfigInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// LACP group +type Lag struct { + // unique id + Id *string + // Possible values are: + // + // * Lag#Lag_LOAD_BALANCE_ALGORITHM_SRCMAC + // * Lag#Lag_LOAD_BALANCE_ALGORITHM_DESTMAC + // * Lag#Lag_LOAD_BALANCE_ALGORITHM_SRCDESTMAC + // * Lag#Lag_LOAD_BALANCE_ALGORITHM_SRCDESTIPVLAN + // * Lag#Lag_LOAD_BALANCE_ALGORITHM_SRCDESTMACIPPORT + // + // LACP load balance Algorithm + LoadBalanceAlgorithm *string + // Possible values are: + // + // * Lag#Lag_MODE_ACTIVE + // * Lag#Lag_MODE_PASSIVE + // + // LACP group mode + Mode *string + // Lag name + Name *string + // number of uplinks format: int32 + NumberOfUplinks *int64 + // Possible values are: + // + // * Lag#Lag_TIMEOUT_TYPE_SLOW + // * Lag#Lag_TIMEOUT_TYPE_FAST + // + // LACP timeout type + TimeoutType *string + // uplink names + Uplinks []Uplink +} + +const Lag_LOAD_BALANCE_ALGORITHM_SRCMAC = "SRCMAC" +const Lag_LOAD_BALANCE_ALGORITHM_DESTMAC = "DESTMAC" +const Lag_LOAD_BALANCE_ALGORITHM_SRCDESTMAC = "SRCDESTMAC" +const Lag_LOAD_BALANCE_ALGORITHM_SRCDESTIPVLAN = "SRCDESTIPVLAN" +const Lag_LOAD_BALANCE_ALGORITHM_SRCDESTMACIPPORT = "SRCDESTMACIPPORT" +const Lag_MODE_ACTIVE = "ACTIVE" +const Lag_MODE_PASSIVE = "PASSIVE" +const Lag_TIMEOUT_TYPE_SLOW = "SLOW" +const Lag_TIMEOUT_TYPE_FAST = "FAST" + +func (s *Lag) GetType__() bindings.BindingType { + return LagBindingType() +} + +func (s *Lag) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Lag._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Latency stat service profile +type LatencyStatProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Enable or Disable pnic latency. + PnicLatencyEnabled *bool + // Event nth milliseconds packet is sampled. When a value less than 1000 is given, the realized sampling interval will be 1000 milliseconds. format: int64 + SamplingInterval *int64 + // Event nth packet is sampled. format: int64 + SamplingRate *int64 +} + +func (s *LatencyStatProfile) GetType__() bindings.BindingType { + return LatencyStatProfileBindingType() +} + +func (s *LatencyStatProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LatencyStatProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of latency profile +type LatencyStatProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Latency stat profile list. + Results []LatencyStatProfile +} + +func (s *LatencyStatProfileListResult) GetType__() bindings.BindingType { + return LatencyStatProfileListResultBindingType() +} + +func (s *LatencyStatProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LatencyStatProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents layout of a container or widget +type Layout struct { + Properties *LayoutProperties + // Possible values are: + // + // * Layout#Layout_TYPE_HORIZONTAL + // * Layout#Layout_TYPE_VERTICAL + // * Layout#Layout_TYPE_GRID + // * Layout#Layout_TYPE_AUTO + // + // Describes layout of a container or widget. Layout describes how individual widgets are placed inside the container. For example, if HORIZONTAL is chosen widgets are placed side by side inside the container. If VERTICAL is chosen then widgets are placed one below the other. If GRID is chosen then the container or widget display area is divided into a grid of m rows and n columns, as specified in the properties, and the widgets are placed inside the grid. If AUTO is chosen then container or widgets display area will be automatically calculated depending upon the required width. + Type_ *string +} + +const Layout_TYPE_HORIZONTAL = "HORIZONTAL" +const Layout_TYPE_VERTICAL = "VERTICAL" +const Layout_TYPE_GRID = "GRID" +const Layout_TYPE_AUTO = "AUTO" + +func (s *Layout) GetType__() bindings.BindingType { + return LayoutBindingType() +} + +func (s *Layout) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Layout._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Properties of the layout of a container or widget +type LayoutProperties struct { + // Describes the number of columns of grid layout of a container or widget. This property is applicable for grid layout only. format: int32 + NumColumns *int64 + // Describes the number of rows of grid layout of a container or widget. This property is applicable for grid layout only. format: int32 + NumRows *int64 +} + +func (s *LayoutProperties) GetType__() bindings.BindingType { + return LayoutPropertiesBindingType() +} + +func (s *LayoutProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LayoutProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// LbAccessListControl is used to define how IP access list control can filter the connections from clients. +type LbAccessListControl struct { + // Possible values are: + // + // * LbAccessListControl#LbAccessListControl_ACTION_ALLOW + // * LbAccessListControl#LbAccessListControl_ACTION_DROP + // + // ALLOW means connections matching grouping object IP list are allowed and requests not matching grouping object IP list are dropped. DROP means connections matching grouping object IP list are dropped and requests not matching grouping object IP list are allowed. + Action *string + // The enabled flag indicates whether to enable access list control option. It is false by default. + Enabled *bool + // The identifier of grouping object which defines the IP addresses or ranges to match the client IP. + GroupId *string +} + +const LbAccessListControl_ACTION_ALLOW = "ALLOW" +const LbAccessListControl_ACTION_DROP = "DROP" + +func (s *LbAccessListControl) GetType__() bindings.BindingType { + return LbAccessListControlBindingType() +} + +func (s *LbAccessListControl) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbAccessListControl._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbActiveMonitor struct { + // num of consecutive checks must fail before marking it down format: int64 + FallCount *int64 + // the frequency at which the system issues the monitor check (in second) format: int64 + Interval *int64 + // If the monitor port is specified, it would override pool member port setting for healthcheck. A port range is not supported. For ICMP monitor, monitor_port is not required. format: port-or-range + MonitorPort *string + // num of consecutive checks must pass before marking it up format: int64 + RiseCount *int64 + // the number of seconds the target has in which to respond to the monitor request format: int64 + Timeout *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBHTTPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBHTTPSMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBICMPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBTCPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBUDPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBPASSIVEMONITOR + // + // Load balancers monitor the health of backend servers to ensure traffic is not black holed. There are two types of healthchecks: active and passive. Passive healthchecks depend on failures in actual client traffic (e.g. RST from server in response to a client connection) to detect that the server or the application is down. In case of active healthchecks, load balancer itself initiates new connections (or sends ICMP ping) to the servers periodically to check their health, completely independent of any data traffic. Currently, active health monitors are supported for HTTP, HTTPS, TCP, UDP and ICMP protocols. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbActiveMonitor__TYPE_IDENTIFIER = "LbActiveMonitor" + +func (s *LbActiveMonitor) GetType__() bindings.BindingType { + return LbActiveMonitorBindingType() +} + +func (s *LbActiveMonitor) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbActiveMonitor._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbAppProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LbAppProfile#LbAppProfile_RESOURCE_TYPE_LBHTTPPROFILE + // * LbAppProfile#LbAppProfile_RESOURCE_TYPE_LBFASTTCPPROFILE + // * LbAppProfile#LbAppProfile_RESOURCE_TYPE_LBFASTUDPPROFILE + // + // An application profile can be bound to a virtual server to specify the application protocol characteristics. It is used to influence how load balancing is performed. Currently, three types of application profiles are supported: LbFastTCPProfile, LbFastUDPProfile and LbHttpProfile. LbFastTCPProfile or LbFastUDPProfile is typically used when the application is using a custom protocol or a standard protocol not supported by the load balancer. It is also used in cases where the user only wants L4 load balancing mainly because L4 load balancing has much higher performance and scalability, and/or supports connection mirroring. LbHttpProfile is used for both HTTP and HTTPS applications. Though application rules, if bound to the virtual server, can be used to accomplish the same goal, LbHttpProfile is intended to simplify enabling certain common use cases. LbHttpProfile is deprecated as NSX-T Load Balancer is deprecated. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbAppProfile__TYPE_IDENTIFIER = "LbAppProfile" +const LbAppProfile_RESOURCE_TYPE_LBHTTPPROFILE = "LbHttpProfile" +const LbAppProfile_RESOURCE_TYPE_LBFASTTCPPROFILE = "LbFastTcpProfile" +const LbAppProfile_RESOURCE_TYPE_LBFASTUDPPROFILE = "LbFastUdpProfile" + +func (s *LbAppProfile) GetType__() bindings.BindingType { + return LbAppProfileBindingType() +} + +func (s *LbAppProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbAppProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbAppProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // paginated list of load balancer application profiles + Results []*data.StructValue +} + +func (s *LbAppProfileListResult) GetType__() bindings.BindingType { + return LbAppProfileListResultBindingType() +} + +func (s *LbAppProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbAppProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Match condition for client certficate issuer DN +type LbClientCertificateIssuerDnCondition struct { + // If true, case is significant when comparing issuer DN value. + CaseSensitive *bool + // Value of issuer DN + IssuerDn *string + // Possible values are: + // + // * LbClientCertificateIssuerDnCondition#LbClientCertificateIssuerDnCondition_MATCH_TYPE_STARTS_WITH + // * LbClientCertificateIssuerDnCondition#LbClientCertificateIssuerDnCondition_MATCH_TYPE_ENDS_WITH + // * LbClientCertificateIssuerDnCondition#LbClientCertificateIssuerDnCondition_MATCH_TYPE_EQUALS + // * LbClientCertificateIssuerDnCondition#LbClientCertificateIssuerDnCondition_MATCH_TYPE_CONTAINS + // * LbClientCertificateIssuerDnCondition#LbClientCertificateIssuerDnCondition_MATCH_TYPE_REGEX + // + // Match type of issuer DN + MatchType *string +} + +const LbClientCertificateIssuerDnCondition_MATCH_TYPE_STARTS_WITH = "STARTS_WITH" +const LbClientCertificateIssuerDnCondition_MATCH_TYPE_ENDS_WITH = "ENDS_WITH" +const LbClientCertificateIssuerDnCondition_MATCH_TYPE_EQUALS = "EQUALS" +const LbClientCertificateIssuerDnCondition_MATCH_TYPE_CONTAINS = "CONTAINS" +const LbClientCertificateIssuerDnCondition_MATCH_TYPE_REGEX = "REGEX" + +func (s *LbClientCertificateIssuerDnCondition) GetType__() bindings.BindingType { + return LbClientCertificateIssuerDnConditionBindingType() +} + +func (s *LbClientCertificateIssuerDnCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbClientCertificateIssuerDnCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Match condition for client certficate subject DN +type LbClientCertificateSubjectDnCondition struct { + // If true, case is significant when comparing subject DN value. + CaseSensitive *bool + // Possible values are: + // + // * LbClientCertificateSubjectDnCondition#LbClientCertificateSubjectDnCondition_MATCH_TYPE_STARTS_WITH + // * LbClientCertificateSubjectDnCondition#LbClientCertificateSubjectDnCondition_MATCH_TYPE_ENDS_WITH + // * LbClientCertificateSubjectDnCondition#LbClientCertificateSubjectDnCondition_MATCH_TYPE_EQUALS + // * LbClientCertificateSubjectDnCondition#LbClientCertificateSubjectDnCondition_MATCH_TYPE_CONTAINS + // * LbClientCertificateSubjectDnCondition#LbClientCertificateSubjectDnCondition_MATCH_TYPE_REGEX + // + // Match type of subject DN + MatchType *string + // Value of subject DN + SubjectDn *string +} + +const LbClientCertificateSubjectDnCondition_MATCH_TYPE_STARTS_WITH = "STARTS_WITH" +const LbClientCertificateSubjectDnCondition_MATCH_TYPE_ENDS_WITH = "ENDS_WITH" +const LbClientCertificateSubjectDnCondition_MATCH_TYPE_EQUALS = "EQUALS" +const LbClientCertificateSubjectDnCondition_MATCH_TYPE_CONTAINS = "CONTAINS" +const LbClientCertificateSubjectDnCondition_MATCH_TYPE_REGEX = "REGEX" + +func (s *LbClientCertificateSubjectDnCondition) GetType__() bindings.BindingType { + return LbClientCertificateSubjectDnConditionBindingType() +} + +func (s *LbClientCertificateSubjectDnCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbClientCertificateSubjectDnCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The object is deprecated as NSX-T Load Balancer is deprecated. +type LbClientSslProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * LbClientSslProfile#LbClientSslProfile_CIPHER_GROUP_LABEL_BALANCED + // * LbClientSslProfile#LbClientSslProfile_CIPHER_GROUP_LABEL_HIGH_SECURITY + // * LbClientSslProfile#LbClientSslProfile_CIPHER_GROUP_LABEL_HIGH_COMPATIBILITY + // * LbClientSslProfile#LbClientSslProfile_CIPHER_GROUP_LABEL_CUSTOM + // + // It is a label of cipher group which is mostly consumed by GUI. + CipherGroupLabel *string + // Possible values are: + // + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_RSA_WITH_AES_256_CBC_SHA + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_RSA_WITH_AES_128_CBC_SHA + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_RSA_WITH_3DES_EDE_CBC_SHA + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_RSA_WITH_AES_128_CBC_SHA256 + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_RSA_WITH_AES_128_GCM_SHA256 + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_RSA_WITH_AES_256_CBC_SHA256 + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_RSA_WITH_AES_256_GCM_SHA384 + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA256 + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_GCM_SHA256 + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA384 + // * LbClientSslProfile#LbClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_GCM_SHA384 + // + // supported SSL cipher list to client side + Ciphers []string + // This flag is set to true when all the ciphers and protocols are FIPS compliant. It is set to false when one of the ciphers or protocols are not FIPS compliant.. + IsFips *bool + // This flag is set to true when all the ciphers and protocols are secure. It is set to false when one of the ciphers or protocols is insecure. + IsSecure *bool + // During SSL handshake as part of the SSL client Hello client sends an ordered list of ciphers that it can support (or prefers) and typically server selects the first one from the top of that list it can also support. For Perfect Forward Secrecy(PFS), server could override the client's preference. + PreferServerCiphers *bool + // Possible values are: + // + // * LbClientSslProfile#LbClientSslProfile_PROTOCOLS_SSL_V2 + // * LbClientSslProfile#LbClientSslProfile_PROTOCOLS_SSL_V3 + // * LbClientSslProfile#LbClientSslProfile_PROTOCOLS_TLS_V1 + // * LbClientSslProfile#LbClientSslProfile_PROTOCOLS_TLS_V1_1 + // * LbClientSslProfile#LbClientSslProfile_PROTOCOLS_TLS_V1_2 + // + // SSL versions TLS1.1 and TLS1.2 are supported and enabled by default. SSLv2, SSLv3, and TLS1.0 are supported, but disabled by default. + Protocols []string + // SSL session caching allows SSL client and server to reuse previously negotiated security parameters avoiding the expensive public key operation during handshake. + SessionCacheEnabled *bool + // Session cache timeout specifies how long the SSL session parameters are held on to and can be reused. format: int64 + SessionCacheTimeout *int64 +} + +const LbClientSslProfile_CIPHER_GROUP_LABEL_BALANCED = "BALANCED" +const LbClientSslProfile_CIPHER_GROUP_LABEL_HIGH_SECURITY = "HIGH_SECURITY" +const LbClientSslProfile_CIPHER_GROUP_LABEL_HIGH_COMPATIBILITY = "HIGH_COMPATIBILITY" +const LbClientSslProfile_CIPHER_GROUP_LABEL_CUSTOM = "CUSTOM" +const LbClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" +const LbClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" +const LbClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" +const LbClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" +const LbClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA = "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA" +const LbClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA = "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA" +const LbClientSslProfile_CIPHERS_RSA_WITH_AES_256_CBC_SHA = "TLS_RSA_WITH_AES_256_CBC_SHA" +const LbClientSslProfile_CIPHERS_RSA_WITH_AES_128_CBC_SHA = "TLS_RSA_WITH_AES_128_CBC_SHA" +const LbClientSslProfile_CIPHERS_RSA_WITH_3DES_EDE_CBC_SHA = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" +const LbClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" +const LbClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" +const LbClientSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" +const LbClientSslProfile_CIPHERS_RSA_WITH_AES_128_CBC_SHA256 = "TLS_RSA_WITH_AES_128_CBC_SHA256" +const LbClientSslProfile_CIPHERS_RSA_WITH_AES_128_GCM_SHA256 = "TLS_RSA_WITH_AES_128_GCM_SHA256" +const LbClientSslProfile_CIPHERS_RSA_WITH_AES_256_CBC_SHA256 = "TLS_RSA_WITH_AES_256_CBC_SHA256" +const LbClientSslProfile_CIPHERS_RSA_WITH_AES_256_GCM_SHA384 = "TLS_RSA_WITH_AES_256_GCM_SHA384" +const LbClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" +const LbClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" +const LbClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" +const LbClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" +const LbClientSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" +const LbClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA = "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA" +const LbClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256" +const LbClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256" +const LbClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384" +const LbClientSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384" +const LbClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA = "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA" +const LbClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256" +const LbClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256" +const LbClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384" +const LbClientSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384" +const LbClientSslProfile_PROTOCOLS_SSL_V2 = "SSL_V2" +const LbClientSslProfile_PROTOCOLS_SSL_V3 = "SSL_V3" +const LbClientSslProfile_PROTOCOLS_TLS_V1 = "TLS_V1" +const LbClientSslProfile_PROTOCOLS_TLS_V1_1 = "TLS_V1_1" +const LbClientSslProfile_PROTOCOLS_TLS_V1_2 = "TLS_V1_2" + +func (s *LbClientSslProfile) GetType__() bindings.BindingType { + return LbClientSslProfileBindingType() +} + +func (s *LbClientSslProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbClientSslProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbClientSslProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // paginated list of load balancer client SSL profiles + Results []LbClientSslProfile +} + +func (s *LbClientSslProfileListResult) GetType__() bindings.BindingType { + return LbClientSslProfileListResultBindingType() +} + +func (s *LbClientSslProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbClientSslProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This action is used to drop the connections. There is no extra propery in this action. If there is no match condition specified, the connection will be always dropped. This action can be specified at HTTP_ACCESS or HTTP_FORWARDING pahse. +type LbConnectionDropAction struct { + // Possible values are: + // + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREJECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTPOOLACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTSERVERACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LbRuleAction#LbRuleAction_TYPE_LBJWTAUTHACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbConnectionDropAction__TYPE_IDENTIFIER = "LbConnectionDropAction" + +func (s *LbConnectionDropAction) GetType__() bindings.BindingType { + return LbConnectionDropActionBindingType() +} + +func (s *LbConnectionDropAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbConnectionDropAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The object is deprecated as NSX-T Load Balancer is deprecated. +type LbCookiePersistenceProfile struct { + // HTTP cookie domain could be configured, only available for insert mode. + CookieDomain *string + // If fallback is true, once the cookie points to a server that is down (i.e. admin state DISABLED or healthcheck state is DOWN), then a new server is selected by default to handle that request. If fallback is false, it will cause the request to be rejected if cookie points to a server + CookieFallback *bool + // If garble is set to true, cookie value (server IP and port) would be encrypted. If garble is set to false, cookie value would be plain text. + CookieGarble *bool + // If cookie httponly flag is true, it prevents a script running in the browser from accessing the cookie. Only available for insert mode. + CookieHttponly *bool + // Possible values are: + // + // * LbCookiePersistenceProfile#LbCookiePersistenceProfile_COOKIE_MODE_INSERT + // * LbCookiePersistenceProfile#LbCookiePersistenceProfile_COOKIE_MODE_PREFIX + // * LbCookiePersistenceProfile#LbCookiePersistenceProfile_COOKIE_MODE_REWRITE + // + // cookie persistence mode + CookieMode *string + // cookie name + CookieName *string + // HTTP cookie path could be set, only available for insert mode. + CookiePath *string + // If cookie secure flag is true, it prevents the browser from sending a cookie over http. The cookie is sent only over https. Only available for insert mode. + CookieSecure *bool + CookieTime *data.StructValue + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LbPersistenceProfile#LbPersistenceProfile_RESOURCE_TYPE_LBCOOKIEPERSISTENCEPROFILE + // * LbPersistenceProfile#LbPersistenceProfile_RESOURCE_TYPE_LBSOURCEIPPERSISTENCEPROFILE + // * LbPersistenceProfile#LbPersistenceProfile_RESOURCE_TYPE_LBGENERICPERSISTENCEPROFILE + // + // The resource_type property identifies persistence profile type. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The persistence shared flag identifies whether the persistence table is shared among virtual-servers referring this profile. If persistence shared flag is not set in the cookie persistence profile bound to a virtual server, it defaults to cookie persistence that is private to each virtual server and is qualified by the pool. This is accomplished by load balancer inserting a cookie with name in the format ... If persistence shared flag is set in the cookie persistence profile, in cookie insert mode, cookie persistence could be shared across multiple virtual servers that are bound to the same pools. The cookie name would be changed to ... If persistence shared flag is not set in the sourceIp persistence profile bound to a virtual server, each virtual server that the profile is bound to maintains its own private persistence table. If persistence shared flag is set in the sourceIp persistence profile, all virtual servers the profile is bound to share the same persistence table. If persistence shared flag is not set in the generic persistence profile, the persistence entries are matched and stored in the table which is identified using both virtual server ID and profile ID. If persistence shared flag is set in the generic persistence profile, the persistence entries are matched and stored in the table which is identified using profile ID. It means that virtual servers which consume the same profile in the LbRule with this flag enabled are sharing the same persistence table. + PersistenceShared *bool +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbCookiePersistenceProfile__TYPE_IDENTIFIER = "LbCookiePersistenceProfile" +const LbCookiePersistenceProfile_COOKIE_MODE_INSERT = "INSERT" +const LbCookiePersistenceProfile_COOKIE_MODE_PREFIX = "PREFIX" +const LbCookiePersistenceProfile_COOKIE_MODE_REWRITE = "REWRITE" + +func (s *LbCookiePersistenceProfile) GetType__() bindings.BindingType { + return LbCookiePersistenceProfileBindingType() +} + +func (s *LbCookiePersistenceProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbCookiePersistenceProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbCookieTime struct { + // Possible values are: + // + // * LbCookieTime#LbCookieTime_TYPE_LBSESSIONCOOKIETIME + // * LbCookieTime#LbCookieTime_TYPE_LBPERSISTENCECOOKIETIME + // + // Both session cookie and persistence cookie are supported, Use LbSessionCookieTime for session cookie time setting, Use LbPersistenceCookieTime for persistence cookie time setting + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbCookieTime__TYPE_IDENTIFIER = "LbCookieTime" +const LbCookieTime_TYPE_LBSESSIONCOOKIETIME = "LbSessionCookieTime" +const LbCookieTime_TYPE_LBPERSISTENCECOOKIETIME = "LbPersistenceCookieTime" + +func (s *LbCookieTime) GetType__() bindings.BindingType { + return LbCookieTimeBindingType() +} + +func (s *LbCookieTime) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbCookieTime._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The capacity contains basic information and load balancer entity usages and capacity for the given edge node. +type LbEdgeNodeUsage struct { + // The current credit number reflects the current usage on the node. For example, configuring a medium load balancer on a node consumes 10 credits. If there are 2 medium instances configured on a node, the current credit number is 2 \* 10 = 20. format: int64 + CurrentCreditNumber *int64 + // The number of large load balancer services configured on the node. format: int64 + CurrentLargeLoadBalancerServices *int64 + // The number of medium load balancer services configured on the node. format: int64 + CurrentMediumLoadBalancerServices *int64 + // The number of pool members configured on the node. format: int64 + CurrentPoolMembers *int64 + // The number of pools configured on the node. format: int64 + CurrentPools *int64 + // The number of small load balancer services configured on the node. format: int64 + CurrentSmallLoadBalancerServices *int64 + // The number of virtual servers configured on the node. format: int64 + CurrentVirtualServers *int64 + // The number of xlarge load balancer services configured on the node. format: int64 + CurrentXlargeLoadBalancerServices *int64 + // The ID of edge cluster which contains the edge node. + EdgeClusterId *string + // Possible values are: + // + // * LbEdgeNodeUsage#LbEdgeNodeUsage_FORM_FACTOR_SMALL_VIRTUAL_MACHINE + // * LbEdgeNodeUsage#LbEdgeNodeUsage_FORM_FACTOR_MEDIUM_VIRTUAL_MACHINE + // * LbEdgeNodeUsage#LbEdgeNodeUsage_FORM_FACTOR_LARGE_VIRTUAL_MACHINE + // * LbEdgeNodeUsage#LbEdgeNodeUsage_FORM_FACTOR_XLARGE_VIRTUAL_MACHINE + // * LbEdgeNodeUsage#LbEdgeNodeUsage_FORM_FACTOR_PHYSICAL_MACHINE + // + // The form factor of the given edge node. + FormFactor *string + // The remaining credit number is the remaining credits that can be used for load balancer service configuration. For example, an edge node with form factor LARGE_VIRTUAL_MACHINE has 40 credits, and a medium load balancer instance costs 10 credits. If there are currently 3 medium instances configured, the remaining credit number is 40 - (3 \* 10) = 10. format: int64 + RemainingCreditNumber *int64 + // The remaining number of large load balancer services which could be configured on the given edge node. format: int64 + RemainingLargeLoadBalancerServices *int64 + // The remaining number of medium load balancer services which could be configured on the given edge node. format: int64 + RemainingMediumLoadBalancerServices *int64 + // The remaining number of pool members which could be configured on the given edge node. format: int64 + RemainingPoolMembers *int64 + // The remaining number of small load balancer services which could be configured on the given edge node. format: int64 + RemainingSmallLoadBalancerServices *int64 + // The remaining number of xlarge load balancer services which could be configured on the given edge node. format: int64 + RemainingXlargeLoadBalancerServices *int64 + // Possible values are: + // + // * LbEdgeNodeUsage#LbEdgeNodeUsage_SEVERITY_GREEN + // * LbEdgeNodeUsage#LbEdgeNodeUsage_SEVERITY_ORANGE + // * LbEdgeNodeUsage#LbEdgeNodeUsage_SEVERITY_RED + // + // The severity calculation is based on current credit usage percentage of load balancer for one node. + Severity *string + // The usage percentage of the edge node for load balancer. The value is the larger value between load balancer credit usage percentage and pool member usage percentage for the edge node. + UsagePercentage *float64 + // The property identifies the node UUID for load balancer node usage. + NodeId *string + // Possible values are: + // + // * LbNodeUsage#LbNodeUsage_TYPE_LBEDGENODEUSAGE + // + // The property identifies the load balancer node usage type. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbEdgeNodeUsage__TYPE_IDENTIFIER = "LbEdgeNodeUsage" +const LbEdgeNodeUsage_FORM_FACTOR_SMALL_VIRTUAL_MACHINE = "SMALL_VIRTUAL_MACHINE" +const LbEdgeNodeUsage_FORM_FACTOR_MEDIUM_VIRTUAL_MACHINE = "MEDIUM_VIRTUAL_MACHINE" +const LbEdgeNodeUsage_FORM_FACTOR_LARGE_VIRTUAL_MACHINE = "LARGE_VIRTUAL_MACHINE" +const LbEdgeNodeUsage_FORM_FACTOR_XLARGE_VIRTUAL_MACHINE = "XLARGE_VIRTUAL_MACHINE" +const LbEdgeNodeUsage_FORM_FACTOR_PHYSICAL_MACHINE = "PHYSICAL_MACHINE" +const LbEdgeNodeUsage_SEVERITY_GREEN = "GREEN" +const LbEdgeNodeUsage_SEVERITY_ORANGE = "ORANGE" +const LbEdgeNodeUsage_SEVERITY_RED = "RED" + +func (s *LbEdgeNodeUsage) GetType__() bindings.BindingType { + return LbEdgeNodeUsageBindingType() +} + +func (s *LbEdgeNodeUsage) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbEdgeNodeUsage._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbFastTcpProfile struct { + // It is used to specify how long a closing TCP connection (both FINs received or a RST is received) should be kept for this application before cleaning up the connection. format: int64 + CloseTimeout *int64 + // If flow mirroring is enabled, all the flows to the bounded virtual server are mirrored to the standby node. + HaFlowMirroringEnabled *bool + // It is used to configure how long an idle TCP connection in ESTABLISHED state should be kept for this application before cleaning up. format: int64 + IdleTimeout *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LbAppProfile#LbAppProfile_RESOURCE_TYPE_LBHTTPPROFILE + // * LbAppProfile#LbAppProfile_RESOURCE_TYPE_LBFASTTCPPROFILE + // * LbAppProfile#LbAppProfile_RESOURCE_TYPE_LBFASTUDPPROFILE + // + // An application profile can be bound to a virtual server to specify the application protocol characteristics. It is used to influence how load balancing is performed. Currently, three types of application profiles are supported: LbFastTCPProfile, LbFastUDPProfile and LbHttpProfile. LbFastTCPProfile or LbFastUDPProfile is typically used when the application is using a custom protocol or a standard protocol not supported by the load balancer. It is also used in cases where the user only wants L4 load balancing mainly because L4 load balancing has much higher performance and scalability, and/or supports connection mirroring. LbHttpProfile is used for both HTTP and HTTPS applications. Though application rules, if bound to the virtual server, can be used to accomplish the same goal, LbHttpProfile is intended to simplify enabling certain common use cases. LbHttpProfile is deprecated as NSX-T Load Balancer is deprecated. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbFastTcpProfile__TYPE_IDENTIFIER = "LbFastTcpProfile" + +func (s *LbFastTcpProfile) GetType__() bindings.BindingType { + return LbFastTcpProfileBindingType() +} + +func (s *LbFastTcpProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbFastTcpProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbFastUdpProfile struct { + // If flow mirroring is enabled, all the flows to the bounded virtual server are mirrored to the standby node. + FlowMirroringEnabled *bool + // Though UDP is a connectionless protocol, for the purposes of load balancing, all UDP packets with the same flow signature (source and destination IP/ports and IP protocol) received within the idle timeout period are considered to belong to the same connection and are sent to the same backend server. If no packets are received for idle timeout period, the connection (association between flow signature and the selected server) is cleaned up. format: int64 + IdleTimeout *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LbAppProfile#LbAppProfile_RESOURCE_TYPE_LBHTTPPROFILE + // * LbAppProfile#LbAppProfile_RESOURCE_TYPE_LBFASTTCPPROFILE + // * LbAppProfile#LbAppProfile_RESOURCE_TYPE_LBFASTUDPPROFILE + // + // An application profile can be bound to a virtual server to specify the application protocol characteristics. It is used to influence how load balancing is performed. Currently, three types of application profiles are supported: LbFastTCPProfile, LbFastUDPProfile and LbHttpProfile. LbFastTCPProfile or LbFastUDPProfile is typically used when the application is using a custom protocol or a standard protocol not supported by the load balancer. It is also used in cases where the user only wants L4 load balancing mainly because L4 load balancing has much higher performance and scalability, and/or supports connection mirroring. LbHttpProfile is used for both HTTP and HTTPS applications. Though application rules, if bound to the virtual server, can be used to accomplish the same goal, LbHttpProfile is intended to simplify enabling certain common use cases. LbHttpProfile is deprecated as NSX-T Load Balancer is deprecated. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbFastUdpProfile__TYPE_IDENTIFIER = "LbFastUdpProfile" + +func (s *LbFastUdpProfile) GetType__() bindings.BindingType { + return LbFastUdpProfileBindingType() +} + +func (s *LbFastUdpProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbFastUdpProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The profile is used to define the persistence entry expiration time, mirroring enabled flag to synchronize persistence entries, persistence shared flag for the associated virtual servers. The profile cannot be attached to virtual server directly, it can be only consumed by LB rule action. In HTTP forwarding phase, LBVariablePersistenceOnAction can be used to consume LbGenericPersistenceProfile. In HTTP response rewriting phase, LBVariablePersistenceLearnAction is used instead. The object is deprecated as NSX-T Load Balancer is deprecated. +type LbGenericPersistenceProfile struct { + // The mirroring enabled flag is to synchronize persistence entries. Persistence entries are not synchronized to the HA peer by default. + HaPersistenceMirroringEnabled *bool + // When all connections complete (reference count reaches 0), persistence entry timer is started with the expiration time. format: int64 + Timeout *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LbPersistenceProfile#LbPersistenceProfile_RESOURCE_TYPE_LBCOOKIEPERSISTENCEPROFILE + // * LbPersistenceProfile#LbPersistenceProfile_RESOURCE_TYPE_LBSOURCEIPPERSISTENCEPROFILE + // * LbPersistenceProfile#LbPersistenceProfile_RESOURCE_TYPE_LBGENERICPERSISTENCEPROFILE + // + // The resource_type property identifies persistence profile type. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The persistence shared flag identifies whether the persistence table is shared among virtual-servers referring this profile. If persistence shared flag is not set in the cookie persistence profile bound to a virtual server, it defaults to cookie persistence that is private to each virtual server and is qualified by the pool. This is accomplished by load balancer inserting a cookie with name in the format ... If persistence shared flag is set in the cookie persistence profile, in cookie insert mode, cookie persistence could be shared across multiple virtual servers that are bound to the same pools. The cookie name would be changed to ... If persistence shared flag is not set in the sourceIp persistence profile bound to a virtual server, each virtual server that the profile is bound to maintains its own private persistence table. If persistence shared flag is set in the sourceIp persistence profile, all virtual servers the profile is bound to share the same persistence table. If persistence shared flag is not set in the generic persistence profile, the persistence entries are matched and stored in the table which is identified using both virtual server ID and profile ID. If persistence shared flag is set in the generic persistence profile, the persistence entries are matched and stored in the table which is identified using profile ID. It means that virtual servers which consume the same profile in the LbRule with this flag enabled are sharing the same persistence table. + PersistenceShared *bool +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbGenericPersistenceProfile__TYPE_IDENTIFIER = "LbGenericPersistenceProfile" + +func (s *LbGenericPersistenceProfile) GetType__() bindings.BindingType { + return LbGenericPersistenceProfileBindingType() +} + +func (s *LbGenericPersistenceProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbGenericPersistenceProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbHttpMonitor struct { + // String to send as part of HTTP health check request body. Valid only for certain HTTP methods like POST. + RequestBody *string + // Array of HTTP request headers + RequestHeaders []LbHttpRequestHeader + // Possible values are: + // + // * LbHttpMonitor#LbHttpMonitor_REQUEST_METHOD_GET + // * LbHttpMonitor#LbHttpMonitor_REQUEST_METHOD_OPTIONS + // * LbHttpMonitor#LbHttpMonitor_REQUEST_METHOD_POST + // * LbHttpMonitor#LbHttpMonitor_REQUEST_METHOD_HEAD + // * LbHttpMonitor#LbHttpMonitor_REQUEST_METHOD_PUT + // + // the health check method for HTTP monitor type + RequestMethod *string + // URL used for HTTP monitor + RequestUrl *string + // Possible values are: + // + // * LbHttpMonitor#LbHttpMonitor_REQUEST_VERSION_0 + // * LbHttpMonitor#LbHttpMonitor_REQUEST_VERSION_1 + // + // HTTP request version + RequestVersion *string + // If HTTP response body match string (regular expressions not supported) is specified (using LbHttpMonitor.response_body) then the healthcheck HTTP response body is matched against the specified string and server is considered healthy only if there is a match. If the response body string is not specified, HTTP healthcheck is considered successful if the HTTP response status code is 2xx, but it can be configured to accept other status codes as successful. + ResponseBody *string + // The HTTP response status code should be a valid HTTP status code. format: int32 + ResponseStatusCodes []int64 + // num of consecutive checks must fail before marking it down format: int64 + FallCount *int64 + // the frequency at which the system issues the monitor check (in second) format: int64 + Interval *int64 + // If the monitor port is specified, it would override pool member port setting for healthcheck. A port range is not supported. For ICMP monitor, monitor_port is not required. format: port-or-range + MonitorPort *string + // num of consecutive checks must pass before marking it up format: int64 + RiseCount *int64 + // the number of seconds the target has in which to respond to the monitor request format: int64 + Timeout *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBHTTPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBHTTPSMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBICMPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBTCPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBUDPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBPASSIVEMONITOR + // + // Load balancers monitor the health of backend servers to ensure traffic is not black holed. There are two types of healthchecks: active and passive. Passive healthchecks depend on failures in actual client traffic (e.g. RST from server in response to a client connection) to detect that the server or the application is down. In case of active healthchecks, load balancer itself initiates new connections (or sends ICMP ping) to the servers periodically to check their health, completely independent of any data traffic. Currently, active health monitors are supported for HTTP, HTTPS, TCP, UDP and ICMP protocols. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +const LbHttpMonitor_REQUEST_METHOD_GET = "GET" +const LbHttpMonitor_REQUEST_METHOD_OPTIONS = "OPTIONS" +const LbHttpMonitor_REQUEST_METHOD_POST = "POST" +const LbHttpMonitor_REQUEST_METHOD_HEAD = "HEAD" +const LbHttpMonitor_REQUEST_METHOD_PUT = "PUT" +const LbHttpMonitor_REQUEST_VERSION_0 = "HTTP_VERSION_1_0" +const LbHttpMonitor_REQUEST_VERSION_1 = "HTTP_VERSION_1_1" + +func (s *LbHttpMonitor) GetType__() bindings.BindingType { + return LbHttpMonitorBindingType() +} + +func (s *LbHttpMonitor) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbHttpMonitor._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The object is deprecated as NSX-T Load Balancer is deprecated. +type LbHttpProfile struct { + // If a website is temporarily down or has moved, incoming requests for that virtual server can be temporarily redirected to a URL + HttpRedirectTo *string + // Certain secure applications may want to force communication over SSL, but instead of rejecting non-SSL connections, they may choose to redirect the client automatically to use SSL. + HttpRedirectToHttps *bool + // It is used to specify the HTTP application idle timeout, it means that how long the load balancer will keep the connection idle to wait for the client to send the next keep-alive request. It is not a TCP socket setting. format: int64 + IdleTimeout *int64 + // NTLM is an authentication protocol that can be used over HTTP. If the flag is set to true, LB will use NTLM challenge/response methodology. This property is deprecated. Please use the property server_keep_alive in order to keep the backend server connection alive for the client connection. When create a new profile, if both ntlm and server_keep_alive are set as different values, ERROR will be reported. When update an existing profile, if either ntlm or server_keep_alive value is changed, both of them are updated with the changed value. + Ntlm *bool + // If it is not specified, it means that request body size is unlimited. format: int64 + RequestBodySize *int64 + // A request with header equal to or below this size is guaranteed to be processed. A request with header larger than request_header_size will be processed up to 32K bytes on best effort basis. format: int64 + RequestHeaderSize *int64 + // When buffering is disabled, the response is passed to a client synchronously, immediately as it is received. When buffering is enabled, LB receives a response from the backend server as soon as possible, saving it into the buffers. + ResponseBuffering *bool + // A response with header larger than response_header_size will be dropped. format: int64 + ResponseHeaderSize *int64 + // If server doesn't send any packet within this time, the connection is closed. format: int64 + ResponseTimeout *int64 + // If server_keep_alive is true, it means the backend connection will keep alive for the client connection. Every client connection is tied 1:1 with the corresponding server-side connection. If server_keep_alive is false, it means the backend connection won't keep alive for the client connection. The default value is false. If server_keep_alive is not specified for API input, its value in API output will be the same with the property ntlm. + ServerKeepAlive *bool + // Possible values are: + // + // * LbHttpProfile#LbHttpProfile_XFORWARDED_FOR_INSERT + // * LbHttpProfile#LbHttpProfile_XFORWARDED_FOR_REPLACE + // + // When X-Forwareded-For is configured, X-Forwarded-Proto and X-Forwarded-Port information is added automatically. The two additional header information can be also modified or deleted in load balancer rules. + XForwardedFor *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LbAppProfile#LbAppProfile_RESOURCE_TYPE_LBHTTPPROFILE + // * LbAppProfile#LbAppProfile_RESOURCE_TYPE_LBFASTTCPPROFILE + // * LbAppProfile#LbAppProfile_RESOURCE_TYPE_LBFASTUDPPROFILE + // + // An application profile can be bound to a virtual server to specify the application protocol characteristics. It is used to influence how load balancing is performed. Currently, three types of application profiles are supported: LbFastTCPProfile, LbFastUDPProfile and LbHttpProfile. LbFastTCPProfile or LbFastUDPProfile is typically used when the application is using a custom protocol or a standard protocol not supported by the load balancer. It is also used in cases where the user only wants L4 load balancing mainly because L4 load balancing has much higher performance and scalability, and/or supports connection mirroring. LbHttpProfile is used for both HTTP and HTTPS applications. Though application rules, if bound to the virtual server, can be used to accomplish the same goal, LbHttpProfile is intended to simplify enabling certain common use cases. LbHttpProfile is deprecated as NSX-T Load Balancer is deprecated. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbHttpProfile__TYPE_IDENTIFIER = "LbHttpProfile" +const LbHttpProfile_XFORWARDED_FOR_INSERT = "INSERT" +const LbHttpProfile_XFORWARDED_FOR_REPLACE = "REPLACE" + +func (s *LbHttpProfile) GetType__() bindings.BindingType { + return LbHttpProfileBindingType() +} + +func (s *LbHttpProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbHttpProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This action is used to redirect HTTP request messages to a new URL. The reply_status value specified in this action is used as the status code of HTTP response message which is sent back to client (Normally a browser). The HTTP status code for redirection is 3xx, for example, 301, 302, 303, 307, etc. The redirect_url is the new URL that the HTTP request message is redirected to. Normally browser will send another HTTP request to the new URL after receiving a redirection response message. Captured variables and built-in variables can be used in redirect_url field. For example, to redirect all HTTP requests to HTTPS requests for a virtual server. We create an LbRule without any conditions, add an LbHttpRedirectAction to the rule. Set the redirect_url field of the LbHttpRedirectAction to: https://$_host$_request_uri And set redirect_status to \"302\", which means found. This rule will redirect all HTTP requests to HTTPS server port on the same host. +type LbHttpRedirectAction struct { + // HTTP response status code + RedirectStatus *string + // The URL that the HTTP request is redirected to + RedirectUrl *string + // Possible values are: + // + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREJECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTPOOLACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTSERVERACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LbRuleAction#LbRuleAction_TYPE_LBJWTAUTHACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbHttpRedirectAction__TYPE_IDENTIFIER = "LbHttpRedirectAction" + +func (s *LbHttpRedirectAction) GetType__() bindings.BindingType { + return LbHttpRedirectActionBindingType() +} + +func (s *LbHttpRedirectAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbHttpRedirectAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This action is used to reject HTTP request messages. The specified reply_status value is used as the status code for the corresponding HTTP response message which is sent back to client (Normally a browser) indicating the reason it was rejected. Reference official HTTP status code list for your specific HTTP version to set the reply_status properly. LbHttpRejectAction does not support variables. +type LbHttpRejectAction struct { + // Response message + ReplyMessage *string + // HTTP response status code + ReplyStatus *string + // Possible values are: + // + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREJECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTPOOLACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTSERVERACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LbRuleAction#LbRuleAction_TYPE_LBJWTAUTHACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbHttpRejectAction__TYPE_IDENTIFIER = "LbHttpRejectAction" + +func (s *LbHttpRejectAction) GetType__() bindings.BindingType { + return LbHttpRejectActionBindingType() +} + +func (s *LbHttpRejectAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbHttpRejectAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This condition is used to match the message body of an HTTP request. Typically, only HTTP POST, PATCH, or PUT requests have request body. The match_type field defines how body_value field is used to match the body of HTTP requests. +type LbHttpRequestBodyCondition struct { + // HTTP request body + BodyValue *string + // If true, case is significant when comparing HTTP body value. + CaseSensitive *bool + // Possible values are: + // + // * LbHttpRequestBodyCondition#LbHttpRequestBodyCondition_MATCH_TYPE_STARTS_WITH + // * LbHttpRequestBodyCondition#LbHttpRequestBodyCondition_MATCH_TYPE_ENDS_WITH + // * LbHttpRequestBodyCondition#LbHttpRequestBodyCondition_MATCH_TYPE_EQUALS + // * LbHttpRequestBodyCondition#LbHttpRequestBodyCondition_MATCH_TYPE_CONTAINS + // * LbHttpRequestBodyCondition#LbHttpRequestBodyCondition_MATCH_TYPE_REGEX + // + // Match type of HTTP body + MatchType *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBIPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBVARIABLECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbHttpRequestBodyCondition__TYPE_IDENTIFIER = "LbHttpRequestBodyCondition" +const LbHttpRequestBodyCondition_MATCH_TYPE_STARTS_WITH = "STARTS_WITH" +const LbHttpRequestBodyCondition_MATCH_TYPE_ENDS_WITH = "ENDS_WITH" +const LbHttpRequestBodyCondition_MATCH_TYPE_EQUALS = "EQUALS" +const LbHttpRequestBodyCondition_MATCH_TYPE_CONTAINS = "CONTAINS" +const LbHttpRequestBodyCondition_MATCH_TYPE_REGEX = "REGEX" + +func (s *LbHttpRequestBodyCondition) GetType__() bindings.BindingType { + return LbHttpRequestBodyConditionBindingType() +} + +func (s *LbHttpRequestBodyCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbHttpRequestBodyCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This condition is used to match HTTP request messages by cookie which is a specific type of HTTP header. The match_type and case_sensitive define how to compare cookie value. +type LbHttpRequestCookieCondition struct { + // If true, case is significant when comparing cookie value. + CaseSensitive *bool + // Name of cookie + CookieName *string + // Value of cookie + CookieValue *string + // Possible values are: + // + // * LbHttpRequestCookieCondition#LbHttpRequestCookieCondition_MATCH_TYPE_STARTS_WITH + // * LbHttpRequestCookieCondition#LbHttpRequestCookieCondition_MATCH_TYPE_ENDS_WITH + // * LbHttpRequestCookieCondition#LbHttpRequestCookieCondition_MATCH_TYPE_EQUALS + // * LbHttpRequestCookieCondition#LbHttpRequestCookieCondition_MATCH_TYPE_CONTAINS + // * LbHttpRequestCookieCondition#LbHttpRequestCookieCondition_MATCH_TYPE_REGEX + // + // Match type of cookie value + MatchType *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBIPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBVARIABLECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbHttpRequestCookieCondition__TYPE_IDENTIFIER = "LbHttpRequestCookieCondition" +const LbHttpRequestCookieCondition_MATCH_TYPE_STARTS_WITH = "STARTS_WITH" +const LbHttpRequestCookieCondition_MATCH_TYPE_ENDS_WITH = "ENDS_WITH" +const LbHttpRequestCookieCondition_MATCH_TYPE_EQUALS = "EQUALS" +const LbHttpRequestCookieCondition_MATCH_TYPE_CONTAINS = "CONTAINS" +const LbHttpRequestCookieCondition_MATCH_TYPE_REGEX = "REGEX" + +func (s *LbHttpRequestCookieCondition) GetType__() bindings.BindingType { + return LbHttpRequestCookieConditionBindingType() +} + +func (s *LbHttpRequestCookieCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbHttpRequestCookieCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbHttpRequestHeader struct { + // Name of HTTP request header + HeaderName *string + // Value of HTTP request header + HeaderValue *string +} + +func (s *LbHttpRequestHeader) GetType__() bindings.BindingType { + return LbHttpRequestHeaderBindingType() +} + +func (s *LbHttpRequestHeader) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbHttpRequestHeader._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This condition is used to match HTTP request messages by HTTP header fields. HTTP header fields are components of the header section of HTTP request and response messages. They define the operating parameters of an HTTP transaction. For example, Cookie, Authorization, User-Agent, etc. One condition can be used to match one header field, to match multiple header fields, multiple conditions must be specified. The match_type field defines how header_value field is used to match HTTP requests. The header_name field does not support match types. +type LbHttpRequestHeaderCondition struct { + // If true, case is significant when comparing HTTP header value. + CaseSensitive *bool + // Name of HTTP header + HeaderName *string + // Value of HTTP header + HeaderValue *string + // Possible values are: + // + // * LbHttpRequestHeaderCondition#LbHttpRequestHeaderCondition_MATCH_TYPE_STARTS_WITH + // * LbHttpRequestHeaderCondition#LbHttpRequestHeaderCondition_MATCH_TYPE_ENDS_WITH + // * LbHttpRequestHeaderCondition#LbHttpRequestHeaderCondition_MATCH_TYPE_EQUALS + // * LbHttpRequestHeaderCondition#LbHttpRequestHeaderCondition_MATCH_TYPE_CONTAINS + // * LbHttpRequestHeaderCondition#LbHttpRequestHeaderCondition_MATCH_TYPE_REGEX + // + // Match type of HTTP header value + MatchType *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBIPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBVARIABLECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbHttpRequestHeaderCondition__TYPE_IDENTIFIER = "LbHttpRequestHeaderCondition" +const LbHttpRequestHeaderCondition_MATCH_TYPE_STARTS_WITH = "STARTS_WITH" +const LbHttpRequestHeaderCondition_MATCH_TYPE_ENDS_WITH = "ENDS_WITH" +const LbHttpRequestHeaderCondition_MATCH_TYPE_EQUALS = "EQUALS" +const LbHttpRequestHeaderCondition_MATCH_TYPE_CONTAINS = "CONTAINS" +const LbHttpRequestHeaderCondition_MATCH_TYPE_REGEX = "REGEX" + +func (s *LbHttpRequestHeaderCondition) GetType__() bindings.BindingType { + return LbHttpRequestHeaderConditionBindingType() +} + +func (s *LbHttpRequestHeaderCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbHttpRequestHeaderCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This action is used to delete header fields of HTTP request messages at HTTP_REQUEST_REWRITE phase. One action can be used to delete all headers with same header name. To delete headers with different header names, multiple actions must be defined. +type LbHttpRequestHeaderDeleteAction struct { + // Name of a header field of HTTP request message + HeaderName *string + // Possible values are: + // + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREJECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTPOOLACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTSERVERACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LbRuleAction#LbRuleAction_TYPE_LBJWTAUTHACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbHttpRequestHeaderDeleteAction__TYPE_IDENTIFIER = "LbHttpRequestHeaderDeleteAction" + +func (s *LbHttpRequestHeaderDeleteAction) GetType__() bindings.BindingType { + return LbHttpRequestHeaderDeleteActionBindingType() +} + +func (s *LbHttpRequestHeaderDeleteAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbHttpRequestHeaderDeleteAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This action is used to rewrite header fields of matched HTTP request messages to specified new values. One action can be used to rewrite one header field. To rewrite multiple header fields, multiple actions must be defined. Captured variables and built-in variables can be used in the header_value field, header_name field does not support variables. +type LbHttpRequestHeaderRewriteAction struct { + // Name of HTTP request header + HeaderName *string + // Value of HTTP request header + HeaderValue *string + // Possible values are: + // + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREJECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTPOOLACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTSERVERACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LbRuleAction#LbRuleAction_TYPE_LBJWTAUTHACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbHttpRequestHeaderRewriteAction__TYPE_IDENTIFIER = "LbHttpRequestHeaderRewriteAction" + +func (s *LbHttpRequestHeaderRewriteAction) GetType__() bindings.BindingType { + return LbHttpRequestHeaderRewriteActionBindingType() +} + +func (s *LbHttpRequestHeaderRewriteAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbHttpRequestHeaderRewriteAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This condition is used to match method of HTTP requests. If the method of an HTTP request is same as the method specified in this condition, the HTTP request match this condition. For example, if the method field is set to GET in this condition, any HTTP request with GET method matches the condition. +type LbHttpRequestMethodCondition struct { + // Possible values are: + // + // * LbHttpRequestMethodCondition#LbHttpRequestMethodCondition_METHOD_GET + // * LbHttpRequestMethodCondition#LbHttpRequestMethodCondition_METHOD_OPTIONS + // * LbHttpRequestMethodCondition#LbHttpRequestMethodCondition_METHOD_POST + // * LbHttpRequestMethodCondition#LbHttpRequestMethodCondition_METHOD_HEAD + // * LbHttpRequestMethodCondition#LbHttpRequestMethodCondition_METHOD_PUT + // + // Type of HTTP request method + Method *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBIPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBVARIABLECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbHttpRequestMethodCondition__TYPE_IDENTIFIER = "LbHttpRequestMethodCondition" +const LbHttpRequestMethodCondition_METHOD_GET = "GET" +const LbHttpRequestMethodCondition_METHOD_OPTIONS = "OPTIONS" +const LbHttpRequestMethodCondition_METHOD_POST = "POST" +const LbHttpRequestMethodCondition_METHOD_HEAD = "HEAD" +const LbHttpRequestMethodCondition_METHOD_PUT = "PUT" + +func (s *LbHttpRequestMethodCondition) GetType__() bindings.BindingType { + return LbHttpRequestMethodConditionBindingType() +} + +func (s *LbHttpRequestMethodCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbHttpRequestMethodCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This condition is used to match URI arguments aka query string of Http request messages, for example, in URI http://exaple.com?foo=1&bar=2, the \"foo=1&bar=2\" is the query string containing URI arguments. In an URI scheme, query string is indicated by the first question mark (\"?\") character and terminated by a number sign (\"#\") character or by the end of the URI. The uri_arguments field can be specified as a regular expression(Set match_type to REGEX). For example, \"foo=(?<x>\\d+)\". It matches HTTP requests whose URI arguments containing \"foo\", the value of foo contains only digits. And the value of foo is captured as $x which can be used in LbRuleAction fields which support variables. +type LbHttpRequestUriArgumentsCondition struct { + // If true, case is significant when comparing URI arguments. + CaseSensitive *bool + // Possible values are: + // + // * LbHttpRequestUriArgumentsCondition#LbHttpRequestUriArgumentsCondition_MATCH_TYPE_STARTS_WITH + // * LbHttpRequestUriArgumentsCondition#LbHttpRequestUriArgumentsCondition_MATCH_TYPE_ENDS_WITH + // * LbHttpRequestUriArgumentsCondition#LbHttpRequestUriArgumentsCondition_MATCH_TYPE_EQUALS + // * LbHttpRequestUriArgumentsCondition#LbHttpRequestUriArgumentsCondition_MATCH_TYPE_CONTAINS + // * LbHttpRequestUriArgumentsCondition#LbHttpRequestUriArgumentsCondition_MATCH_TYPE_REGEX + // + // Match type of URI arguments + MatchType *string + // URI arguments, aka query string of URI. + UriArguments *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBIPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBVARIABLECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbHttpRequestUriArgumentsCondition__TYPE_IDENTIFIER = "LbHttpRequestUriArgumentsCondition" +const LbHttpRequestUriArgumentsCondition_MATCH_TYPE_STARTS_WITH = "STARTS_WITH" +const LbHttpRequestUriArgumentsCondition_MATCH_TYPE_ENDS_WITH = "ENDS_WITH" +const LbHttpRequestUriArgumentsCondition_MATCH_TYPE_EQUALS = "EQUALS" +const LbHttpRequestUriArgumentsCondition_MATCH_TYPE_CONTAINS = "CONTAINS" +const LbHttpRequestUriArgumentsCondition_MATCH_TYPE_REGEX = "REGEX" + +func (s *LbHttpRequestUriArgumentsCondition) GetType__() bindings.BindingType { + return LbHttpRequestUriArgumentsConditionBindingType() +} + +func (s *LbHttpRequestUriArgumentsCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbHttpRequestUriArgumentsCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This condition is used to match URIs(Uniform Resource Identifier) of HTTP request messages. The URI field can be specified as a regular expression. If an HTTP request message is requesting an URI which matches specified regular expression, it matches the condition. The syntax of whole URI looks like this: scheme:[//[user[:password]\\\\@]host[:port]][/path][?query][#fragment] This condition matches only the path part of entire URI. When match_type field is specified as REGEX, the uri field is used as a regular expression to match URI path of HTTP requests. For example, to match any URI that has \"/image/\" or \"/images/\", uri field can be specified as: \"/image[s]?/\". Named capturing groups can be used in the uri field to capture substrings of matched URIs and store them in variables for use in LbRuleAction. For example, specify uri field as: \"/news/(?<year>\\d+)/(?<month>\\d+)/(?<article>.\*)\" If the URI path is /articles/news/2017/06/xyz.html, then substring \"2017\" is captured in variable year, \"06\" is captured in variable month, and \"xyz.html\" is captured in variable article. These variables can then be used in an LbRuleAction field which supports variables, such as uri field of LbHttpRequestUriRewriteAction. For example, set the uri field of LbHttpRequestUriRewriteAction as: \"/articles/news/$year-$month-$article\" Then the URI path /articles/news/2017/06/xyz.html is rewritten to: \"/articles/news/2017-06-xyz.html\" +type LbHttpRequestUriCondition struct { + // If true, case is significant when comparing URI. + CaseSensitive *bool + // Possible values are: + // + // * LbHttpRequestUriCondition#LbHttpRequestUriCondition_MATCH_TYPE_STARTS_WITH + // * LbHttpRequestUriCondition#LbHttpRequestUriCondition_MATCH_TYPE_ENDS_WITH + // * LbHttpRequestUriCondition#LbHttpRequestUriCondition_MATCH_TYPE_EQUALS + // * LbHttpRequestUriCondition#LbHttpRequestUriCondition_MATCH_TYPE_CONTAINS + // * LbHttpRequestUriCondition#LbHttpRequestUriCondition_MATCH_TYPE_REGEX + // + // Match type of URI + MatchType *string + // A string used to identify resource + Uri *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBIPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBVARIABLECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbHttpRequestUriCondition__TYPE_IDENTIFIER = "LbHttpRequestUriCondition" +const LbHttpRequestUriCondition_MATCH_TYPE_STARTS_WITH = "STARTS_WITH" +const LbHttpRequestUriCondition_MATCH_TYPE_ENDS_WITH = "ENDS_WITH" +const LbHttpRequestUriCondition_MATCH_TYPE_EQUALS = "EQUALS" +const LbHttpRequestUriCondition_MATCH_TYPE_CONTAINS = "CONTAINS" +const LbHttpRequestUriCondition_MATCH_TYPE_REGEX = "REGEX" + +func (s *LbHttpRequestUriCondition) GetType__() bindings.BindingType { + return LbHttpRequestUriConditionBindingType() +} + +func (s *LbHttpRequestUriCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbHttpRequestUriCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This action is used to rewrite URIs in matched HTTP request messages. Specify the uri and uri_arguments fields in this condition to rewrite the matched HTTP request message's URI and URI arguments to the new values. Full URI scheme of HTTP messages have following syntax: scheme:[//[user[:password]\\\\@]host[:port]][/path][?query][#fragment] The uri field of this action is used to rewrite the /path part in above scheme. And the uri_arguments field is used to rewrite the query part. Captured variables and built-in variables can be used in the uri and uri_arguments fields. Check the example in LbRuleAction to see how to use variables in this action. +type LbHttpRequestUriRewriteAction struct { + // URI of HTTP request + Uri *string + // Query string of URI, typically contains key value pairs, for example: foo1=bar1&foo2=bar2 + UriArguments *string + // Possible values are: + // + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREJECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTPOOLACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTSERVERACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LbRuleAction#LbRuleAction_TYPE_LBJWTAUTHACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbHttpRequestUriRewriteAction__TYPE_IDENTIFIER = "LbHttpRequestUriRewriteAction" + +func (s *LbHttpRequestUriRewriteAction) GetType__() bindings.BindingType { + return LbHttpRequestUriRewriteActionBindingType() +} + +func (s *LbHttpRequestUriRewriteAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbHttpRequestUriRewriteAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This condition is used to match the HTTP protocol version of the HTTP request messages. +type LbHttpRequestVersionCondition struct { + // Possible values are: + // + // * LbHttpRequestVersionCondition#LbHttpRequestVersionCondition_VERSION_0 + // * LbHttpRequestVersionCondition#LbHttpRequestVersionCondition_VERSION_1 + // + // HTTP version + Version *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBIPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBVARIABLECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbHttpRequestVersionCondition__TYPE_IDENTIFIER = "LbHttpRequestVersionCondition" +const LbHttpRequestVersionCondition_VERSION_0 = "HTTP_VERSION_1_0" +const LbHttpRequestVersionCondition_VERSION_1 = "HTTP_VERSION_1_1" + +func (s *LbHttpRequestVersionCondition) GetType__() bindings.BindingType { + return LbHttpRequestVersionConditionBindingType() +} + +func (s *LbHttpRequestVersionCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbHttpRequestVersionCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This condition is used to match HTTP response messages from backend servers by HTTP header fields. HTTP header fields are components of the header section of HTTP request and response messages. They define the operating parameters of an HTTP transaction. For example, Cookie, Authorization, User-Agent, etc. One condition can be used to match one header field, to match multiple header fields, multiple conditions must be specified. The match_type field defines how header_value field is used to match HTTP responses. The header_name field does not support match types. +type LbHttpResponseHeaderCondition struct { + // If true, case is significant when comparing HTTP header value. + CaseSensitive *bool + // Name of HTTP header field + HeaderName *string + // Value of HTTP header field + HeaderValue *string + // Possible values are: + // + // * LbHttpResponseHeaderCondition#LbHttpResponseHeaderCondition_MATCH_TYPE_STARTS_WITH + // * LbHttpResponseHeaderCondition#LbHttpResponseHeaderCondition_MATCH_TYPE_ENDS_WITH + // * LbHttpResponseHeaderCondition#LbHttpResponseHeaderCondition_MATCH_TYPE_EQUALS + // * LbHttpResponseHeaderCondition#LbHttpResponseHeaderCondition_MATCH_TYPE_CONTAINS + // * LbHttpResponseHeaderCondition#LbHttpResponseHeaderCondition_MATCH_TYPE_REGEX + // + // Match type of HTTP header value + MatchType *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBIPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBVARIABLECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbHttpResponseHeaderCondition__TYPE_IDENTIFIER = "LbHttpResponseHeaderCondition" +const LbHttpResponseHeaderCondition_MATCH_TYPE_STARTS_WITH = "STARTS_WITH" +const LbHttpResponseHeaderCondition_MATCH_TYPE_ENDS_WITH = "ENDS_WITH" +const LbHttpResponseHeaderCondition_MATCH_TYPE_EQUALS = "EQUALS" +const LbHttpResponseHeaderCondition_MATCH_TYPE_CONTAINS = "CONTAINS" +const LbHttpResponseHeaderCondition_MATCH_TYPE_REGEX = "REGEX" + +func (s *LbHttpResponseHeaderCondition) GetType__() bindings.BindingType { + return LbHttpResponseHeaderConditionBindingType() +} + +func (s *LbHttpResponseHeaderCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbHttpResponseHeaderCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This action is used to delete header fields of HTTP response messages at HTTP_RESPONSE_REWRITE phase. One action can be used to delete allgi headers with same header name. To delete headers with different header names, multiple actions must be defined +type LbHttpResponseHeaderDeleteAction struct { + // Name of a header field of HTTP response message + HeaderName *string + // Possible values are: + // + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREJECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTPOOLACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTSERVERACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LbRuleAction#LbRuleAction_TYPE_LBJWTAUTHACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbHttpResponseHeaderDeleteAction__TYPE_IDENTIFIER = "LbHttpResponseHeaderDeleteAction" + +func (s *LbHttpResponseHeaderDeleteAction) GetType__() bindings.BindingType { + return LbHttpResponseHeaderDeleteActionBindingType() +} + +func (s *LbHttpResponseHeaderDeleteAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbHttpResponseHeaderDeleteAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This action is used to rewrite header fields of HTTP response messages to specified new values at HTTP_RESPONSE_REWRITE phase. One action can be used to rewrite one header field. To rewrite multiple header fields, multiple actions must be defined. Captured variables and built-in variables can be used in the header_value field, header_name field does not support variables. +type LbHttpResponseHeaderRewriteAction struct { + // Name of a header field of HTTP request message + HeaderName *string + // Value of header field + HeaderValue *string + // Possible values are: + // + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREJECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTPOOLACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTSERVERACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LbRuleAction#LbRuleAction_TYPE_LBJWTAUTHACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbHttpResponseHeaderRewriteAction__TYPE_IDENTIFIER = "LbHttpResponseHeaderRewriteAction" + +func (s *LbHttpResponseHeaderRewriteAction) GetType__() bindings.BindingType { + return LbHttpResponseHeaderRewriteActionBindingType() +} + +func (s *LbHttpResponseHeaderRewriteAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbHttpResponseHeaderRewriteAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This condition is used to match SSL handshake and SSL connection at all phases.If multiple properties are configured, the rule is considered a match when all the configured properties are matched. +type LbHttpSslCondition struct { + ClientCertificateIssuerDn *LbClientCertificateIssuerDnCondition + ClientCertificateSubjectDn *LbClientCertificateSubjectDnCondition + // Possible values are: + // + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_256_CBC_SHA + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_128_CBC_SHA + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_3DES_EDE_CBC_SHA + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_128_CBC_SHA256 + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_128_GCM_SHA256 + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_256_CBC_SHA256 + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_256_GCM_SHA384 + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA256 + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_128_GCM_SHA256 + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA384 + // * LbHttpSslCondition#LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_256_GCM_SHA384 + // + // Cipher list which supported by client + ClientSupportedSslCiphers []string + // Possible values are: + // + // * LbHttpSslCondition#LbHttpSslCondition_SESSION_REUSED_IGNORE + // * LbHttpSslCondition#LbHttpSslCondition_SESSION_REUSED_REUSED + // * LbHttpSslCondition#LbHttpSslCondition_SESSION_REUSED_NEW + // + // The type of SSL session reused + SessionReused *string + // Possible values are: + // + // * LbHttpSslCondition#LbHttpSslCondition_USED_PROTOCOL_SSL_V2 + // * LbHttpSslCondition#LbHttpSslCondition_USED_PROTOCOL_SSL_V3 + // * LbHttpSslCondition#LbHttpSslCondition_USED_PROTOCOL_TLS_V1 + // * LbHttpSslCondition#LbHttpSslCondition_USED_PROTOCOL_TLS_V1_1 + // * LbHttpSslCondition#LbHttpSslCondition_USED_PROTOCOL_TLS_V1_2 + // + // Protocol of an established SSL connection + UsedProtocol *string + // Possible values are: + // + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_128_GCM_SHA256 + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_256_GCM_SHA384 + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_256_CBC_SHA + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_256_CBC_SHA + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_256_CBC_SHA + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_256_CBC_SHA + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_3DES_EDE_CBC_SHA + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_256_CBC_SHA384 + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA256 + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_128_GCM_SHA256 + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA256 + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_256_GCM_SHA384 + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_128_CBC_SHA + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_128_CBC_SHA + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_128_CBC_SHA256 + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_128_GCM_SHA256 + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_256_CBC_SHA384 + // * LbHttpSslCondition#LbHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_256_GCM_SHA384 + // + // Cipher used for an established SSL connection + UsedSslCipher *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBIPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBVARIABLECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbHttpSslCondition__TYPE_IDENTIFIER = "LbHttpSslCondition" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA = "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA = "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_256_CBC_SHA = "TLS_RSA_WITH_AES_256_CBC_SHA" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_128_CBC_SHA = "TLS_RSA_WITH_AES_128_CBC_SHA" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_3DES_EDE_CBC_SHA = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_128_CBC_SHA256 = "TLS_RSA_WITH_AES_128_CBC_SHA256" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_128_GCM_SHA256 = "TLS_RSA_WITH_AES_128_GCM_SHA256" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_256_CBC_SHA256 = "TLS_RSA_WITH_AES_256_CBC_SHA256" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_RSA_WITH_AES_256_GCM_SHA384 = "TLS_RSA_WITH_AES_256_GCM_SHA384" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA = "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA = "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384" +const LbHttpSslCondition_CLIENT_SUPPORTED_SSL_CIPHERS_ECDH_RSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384" +const LbHttpSslCondition_SESSION_REUSED_IGNORE = "IGNORE" +const LbHttpSslCondition_SESSION_REUSED_REUSED = "REUSED" +const LbHttpSslCondition_SESSION_REUSED_NEW = "NEW" +const LbHttpSslCondition_USED_PROTOCOL_SSL_V2 = "SSL_V2" +const LbHttpSslCondition_USED_PROTOCOL_SSL_V3 = "SSL_V3" +const LbHttpSslCondition_USED_PROTOCOL_TLS_V1 = "TLS_V1" +const LbHttpSslCondition_USED_PROTOCOL_TLS_V1_1 = "TLS_V1_1" +const LbHttpSslCondition_USED_PROTOCOL_TLS_V1_2 = "TLS_V1_2" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_256_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_256_CBC_SHA = "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_256_CBC_SHA = "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA" +const LbHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA = "TLS_RSA_WITH_AES_256_CBC_SHA" +const LbHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA = "TLS_RSA_WITH_AES_128_CBC_SHA" +const LbHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_3DES_EDE_CBC_SHA = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" +const LbHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA256 = "TLS_RSA_WITH_AES_128_CBC_SHA256" +const LbHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_128_GCM_SHA256 = "TLS_RSA_WITH_AES_128_GCM_SHA256" +const LbHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA256 = "TLS_RSA_WITH_AES_256_CBC_SHA256" +const LbHttpSslCondition_USED_SSL_CIPHER_RSA_WITH_AES_256_GCM_SHA384 = "TLS_RSA_WITH_AES_256_GCM_SHA384" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_128_CBC_SHA = "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_128_CBC_SHA = "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384" +const LbHttpSslCondition_USED_SSL_CIPHER_ECDH_RSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384" + +func (s *LbHttpSslCondition) GetType__() bindings.BindingType { + return LbHttpSslConditionBindingType() +} + +func (s *LbHttpSslCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbHttpSslCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbHttpsMonitor struct { + // authentication depth is used to set the verification depth in the server certificates chain. format: int64 + CertificateChainDepth *int64 + // Possible values are: + // + // * LbHttpsMonitor#LbHttpsMonitor_CIPHER_GROUP_LABEL_BALANCED + // * LbHttpsMonitor#LbHttpsMonitor_CIPHER_GROUP_LABEL_HIGH_SECURITY + // * LbHttpsMonitor#LbHttpsMonitor_CIPHER_GROUP_LABEL_HIGH_COMPATIBILITY + // * LbHttpsMonitor#LbHttpsMonitor_CIPHER_GROUP_LABEL_CUSTOM + // + // It is a label of cipher group which is mostly consumed by GUI. + CipherGroupLabel *string + // Possible values are: + // + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_RSA_WITH_AES_256_CBC_SHA + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_RSA_WITH_AES_128_CBC_SHA + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_RSA_WITH_3DES_EDE_CBC_SHA + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_RSA_WITH_AES_128_CBC_SHA256 + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_RSA_WITH_AES_128_GCM_SHA256 + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_RSA_WITH_AES_256_CBC_SHA256 + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_RSA_WITH_AES_256_GCM_SHA384 + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA256 + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDH_RSA_WITH_AES_128_GCM_SHA256 + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA384 + // * LbHttpsMonitor#LbHttpsMonitor_CIPHERS_ECDH_RSA_WITH_AES_256_GCM_SHA384 + // + // supported SSL cipher list to servers + Ciphers []string + // client certificate can be specified to support client authentication. + ClientCertificateId *string + // This flag is set to true when all the ciphers and protocols are FIPS compliant. It is set to false when one of the ciphers or protocols are not FIPS compliant.. + IsFips *bool + // This flag is set to true when all the ciphers and protocols are secure. It is set to false when one of the ciphers or protocols is insecure. + IsSecure *bool + // Possible values are: + // + // * LbHttpsMonitor#LbHttpsMonitor_PROTOCOLS_SSL_V2 + // * LbHttpsMonitor#LbHttpsMonitor_PROTOCOLS_SSL_V3 + // * LbHttpsMonitor#LbHttpsMonitor_PROTOCOLS_TLS_V1 + // * LbHttpsMonitor#LbHttpsMonitor_PROTOCOLS_TLS_V1_1 + // * LbHttpsMonitor#LbHttpsMonitor_PROTOCOLS_TLS_V1_2 + // + // SSL versions TLS1.1 and TLS1.2 are supported and enabled by default. SSLv2, SSLv3, and TLS1.0 are supported, but disabled by default. + Protocols []string + // String to send as part of HTTP health check request body. Valid only for certain HTTP methods like POST. + RequestBody *string + // Array of HTTP request headers + RequestHeaders []LbHttpRequestHeader + // Possible values are: + // + // * LbHttpsMonitor#LbHttpsMonitor_REQUEST_METHOD_GET + // * LbHttpsMonitor#LbHttpsMonitor_REQUEST_METHOD_OPTIONS + // * LbHttpsMonitor#LbHttpsMonitor_REQUEST_METHOD_POST + // * LbHttpsMonitor#LbHttpsMonitor_REQUEST_METHOD_HEAD + // * LbHttpsMonitor#LbHttpsMonitor_REQUEST_METHOD_PUT + // + // the health check method for HTTP monitor type + RequestMethod *string + // URL used for HTTP monitor + RequestUrl *string + // Possible values are: + // + // * LbHttpsMonitor#LbHttpsMonitor_REQUEST_VERSION_0 + // * LbHttpsMonitor#LbHttpsMonitor_REQUEST_VERSION_1 + // + // HTTP request version + RequestVersion *string + // If HTTP response body match string (regular expressions not supported) is specified (using LbHttpMonitor.response_body) then the healthcheck HTTP response body is matched against the specified string and server is considered healthy only if there is a match. If the response body string is not specified, HTTP healthcheck is considered successful if the HTTP response status code is 2xx, but it can be configured to accept other status codes as successful. + ResponseBody *string + // The HTTP response status code should be a valid HTTP status code. format: int32 + ResponseStatusCodes []int64 + // Possible values are: + // + // * LbHttpsMonitor#LbHttpsMonitor_SERVER_AUTH_REQUIRED + // * LbHttpsMonitor#LbHttpsMonitor_SERVER_AUTH_IGNORE + // + // server authentication mode + ServerAuth *string + // If server auth type is REQUIRED, server certificate must be signed by one of the trusted Certificate Authorities (CAs), also referred to as root CAs, whose self signed certificates are specified. + ServerAuthCaIds []string + // A Certificate Revocation List (CRL) can be specified in the server-side SSL profile binding to disallow compromised server certificates. + ServerAuthCrlIds []string + // num of consecutive checks must fail before marking it down format: int64 + FallCount *int64 + // the frequency at which the system issues the monitor check (in second) format: int64 + Interval *int64 + // If the monitor port is specified, it would override pool member port setting for healthcheck. A port range is not supported. For ICMP monitor, monitor_port is not required. format: port-or-range + MonitorPort *string + // num of consecutive checks must pass before marking it up format: int64 + RiseCount *int64 + // the number of seconds the target has in which to respond to the monitor request format: int64 + Timeout *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBHTTPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBHTTPSMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBICMPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBTCPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBUDPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBPASSIVEMONITOR + // + // Load balancers monitor the health of backend servers to ensure traffic is not black holed. There are two types of healthchecks: active and passive. Passive healthchecks depend on failures in actual client traffic (e.g. RST from server in response to a client connection) to detect that the server or the application is down. In case of active healthchecks, load balancer itself initiates new connections (or sends ICMP ping) to the servers periodically to check their health, completely independent of any data traffic. Currently, active health monitors are supported for HTTP, HTTPS, TCP, UDP and ICMP protocols. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +const LbHttpsMonitor_CIPHER_GROUP_LABEL_BALANCED = "BALANCED" +const LbHttpsMonitor_CIPHER_GROUP_LABEL_HIGH_SECURITY = "HIGH_SECURITY" +const LbHttpsMonitor_CIPHER_GROUP_LABEL_HIGH_COMPATIBILITY = "HIGH_COMPATIBILITY" +const LbHttpsMonitor_CIPHER_GROUP_LABEL_CUSTOM = "CUSTOM" +const LbHttpsMonitor_CIPHERS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" +const LbHttpsMonitor_CIPHERS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" +const LbHttpsMonitor_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" +const LbHttpsMonitor_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" +const LbHttpsMonitor_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA = "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA" +const LbHttpsMonitor_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA = "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA" +const LbHttpsMonitor_CIPHERS_RSA_WITH_AES_256_CBC_SHA = "TLS_RSA_WITH_AES_256_CBC_SHA" +const LbHttpsMonitor_CIPHERS_RSA_WITH_AES_128_CBC_SHA = "TLS_RSA_WITH_AES_128_CBC_SHA" +const LbHttpsMonitor_CIPHERS_RSA_WITH_3DES_EDE_CBC_SHA = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" +const LbHttpsMonitor_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" +const LbHttpsMonitor_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" +const LbHttpsMonitor_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" +const LbHttpsMonitor_CIPHERS_RSA_WITH_AES_128_CBC_SHA256 = "TLS_RSA_WITH_AES_128_CBC_SHA256" +const LbHttpsMonitor_CIPHERS_RSA_WITH_AES_128_GCM_SHA256 = "TLS_RSA_WITH_AES_128_GCM_SHA256" +const LbHttpsMonitor_CIPHERS_RSA_WITH_AES_256_CBC_SHA256 = "TLS_RSA_WITH_AES_256_CBC_SHA256" +const LbHttpsMonitor_CIPHERS_RSA_WITH_AES_256_GCM_SHA384 = "TLS_RSA_WITH_AES_256_GCM_SHA384" +const LbHttpsMonitor_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" +const LbHttpsMonitor_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" +const LbHttpsMonitor_CIPHERS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" +const LbHttpsMonitor_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" +const LbHttpsMonitor_CIPHERS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" +const LbHttpsMonitor_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA = "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA" +const LbHttpsMonitor_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256" +const LbHttpsMonitor_CIPHERS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256" +const LbHttpsMonitor_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384" +const LbHttpsMonitor_CIPHERS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384" +const LbHttpsMonitor_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA = "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA" +const LbHttpsMonitor_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256" +const LbHttpsMonitor_CIPHERS_ECDH_RSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256" +const LbHttpsMonitor_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384" +const LbHttpsMonitor_CIPHERS_ECDH_RSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384" +const LbHttpsMonitor_PROTOCOLS_SSL_V2 = "SSL_V2" +const LbHttpsMonitor_PROTOCOLS_SSL_V3 = "SSL_V3" +const LbHttpsMonitor_PROTOCOLS_TLS_V1 = "TLS_V1" +const LbHttpsMonitor_PROTOCOLS_TLS_V1_1 = "TLS_V1_1" +const LbHttpsMonitor_PROTOCOLS_TLS_V1_2 = "TLS_V1_2" +const LbHttpsMonitor_REQUEST_METHOD_GET = "GET" +const LbHttpsMonitor_REQUEST_METHOD_OPTIONS = "OPTIONS" +const LbHttpsMonitor_REQUEST_METHOD_POST = "POST" +const LbHttpsMonitor_REQUEST_METHOD_HEAD = "HEAD" +const LbHttpsMonitor_REQUEST_METHOD_PUT = "PUT" +const LbHttpsMonitor_REQUEST_VERSION_0 = "HTTP_VERSION_1_0" +const LbHttpsMonitor_REQUEST_VERSION_1 = "HTTP_VERSION_1_1" +const LbHttpsMonitor_SERVER_AUTH_REQUIRED = "REQUIRED" +const LbHttpsMonitor_SERVER_AUTH_IGNORE = "IGNORE" + +func (s *LbHttpsMonitor) GetType__() bindings.BindingType { + return LbHttpsMonitorBindingType() +} + +func (s *LbHttpsMonitor) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbHttpsMonitor._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbIcmpMonitor struct { + // The data size(in byte) of the ICMP healthcheck packet format: int64 + DataLength *int64 + // num of consecutive checks must fail before marking it down format: int64 + FallCount *int64 + // the frequency at which the system issues the monitor check (in second) format: int64 + Interval *int64 + // If the monitor port is specified, it would override pool member port setting for healthcheck. A port range is not supported. For ICMP monitor, monitor_port is not required. format: port-or-range + MonitorPort *string + // num of consecutive checks must pass before marking it up format: int64 + RiseCount *int64 + // the number of seconds the target has in which to respond to the monitor request format: int64 + Timeout *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBHTTPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBHTTPSMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBICMPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBTCPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBUDPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBPASSIVEMONITOR + // + // Load balancers monitor the health of backend servers to ensure traffic is not black holed. There are two types of healthchecks: active and passive. Passive healthchecks depend on failures in actual client traffic (e.g. RST from server in response to a client connection) to detect that the server or the application is down. In case of active healthchecks, load balancer itself initiates new connections (or sends ICMP ping) to the servers periodically to check their health, completely independent of any data traffic. Currently, active health monitors are supported for HTTP, HTTPS, TCP, UDP and ICMP protocols. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +func (s *LbIcmpMonitor) GetType__() bindings.BindingType { + return LbIcmpMonitorBindingType() +} + +func (s *LbIcmpMonitor) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbIcmpMonitor._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This condition is used to match IP header fields of HTTP messages. Either source_address or group_id should be specified. +type LbIpHeaderCondition struct { + // Source IP address of HTTP message should match IP addresses which are configured in Group in order to perform actions. + GroupId *string + // Source IP address of HTTP message. IP Address can be expressed as a single IP address like 10.1.1.1, or a range of IP addresses like 10.1.1.101-10.1.1.160. Both IPv4 and IPv6 addresses are supported. format: address-or-block-or-range + SourceAddress *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBIPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBVARIABLECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbIpHeaderCondition__TYPE_IDENTIFIER = "LbIpHeaderCondition" + +func (s *LbIpHeaderCondition) GetType__() bindings.BindingType { + return LbIpHeaderConditionBindingType() +} + +func (s *LbIpHeaderCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbIpHeaderCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This action is used to control access to backend server resources using JSON Web Token(JWT) authentication. The JWT authentication is done before any HTTP manipulation if the HTTP request matches the given condition in LbRule. Any verification failed, the HTTP process will be terminated, and HTTP response with 401 status code and WWW-Authentication header will be returned to client. +type LbJwtAuthAction struct { + Key *data.StructValue + // Specify whether to pass the JWT to backend server or remove it. By default, it is false which means will not pass the JWT to backend servers. + PassJwtToPool *bool + // A description of the protected area. If no realm is specified, clients often display a formatted hostname instead. The configured realm is returned when client request is rejected with 401 http status. In the response, it will be \"WWW-Authentication: Bearer realm=\". + Realm *string + // JWT is an open standard that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. Load balancer will search for every specified tokens one by one for the jwt message until found. This parameter is optional. In case not found or this field is not configured, load balancer searches the Bearer header by default in the http request \"Authorization: Bearer \". + Tokens []string + // Possible values are: + // + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREJECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTPOOLACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTSERVERACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LbRuleAction#LbRuleAction_TYPE_LBJWTAUTHACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbJwtAuthAction__TYPE_IDENTIFIER = "LbJwtAuthAction" + +func (s *LbJwtAuthAction) GetType__() bindings.BindingType { + return LbJwtAuthActionBindingType() +} + +func (s *LbJwtAuthAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbJwtAuthAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The key is used to specify certificate which is used to verify the signature of JWT tokens. +type LbJwtCertificateKey struct { + // Certificate identifier + CertificateId *string + // Possible values are: + // + // * LbJwtKey#LbJwtKey_TYPE_LBJWTCERTIFICATEKEY + // * LbJwtKey#LbJwtKey_TYPE_LBJWTSYMMETRICKEY + // * LbJwtKey#LbJwtKey_TYPE_LBJWTPUBLICKEY + // + // The property is used to identify JWT key type. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbJwtCertificateKey__TYPE_IDENTIFIER = "LbJwtCertificateKey" + +func (s *LbJwtCertificateKey) GetType__() bindings.BindingType { + return LbJwtCertificateKeyBindingType() +} + +func (s *LbJwtCertificateKey) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbJwtCertificateKey._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// LbJwtKey specifies the symmetric key or asymmetric public key used to decrypt the data in JWT. +type LbJwtKey struct { + // Possible values are: + // + // * LbJwtKey#LbJwtKey_TYPE_LBJWTCERTIFICATEKEY + // * LbJwtKey#LbJwtKey_TYPE_LBJWTSYMMETRICKEY + // * LbJwtKey#LbJwtKey_TYPE_LBJWTPUBLICKEY + // + // The property is used to identify JWT key type. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbJwtKey__TYPE_IDENTIFIER = "LbJwtKey" +const LbJwtKey_TYPE_LBJWTCERTIFICATEKEY = "LbJwtCertificateKey" +const LbJwtKey_TYPE_LBJWTSYMMETRICKEY = "LbJwtSymmetricKey" +const LbJwtKey_TYPE_LBJWTPUBLICKEY = "LbJwtPublicKey" + +func (s *LbJwtKey) GetType__() bindings.BindingType { + return LbJwtKeyBindingType() +} + +func (s *LbJwtKey) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbJwtKey._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The key is used to specify the public key content which is used to verify the signature of JWT tokens. +type LbJwtPublicKey struct { + // Content of public key + PublicKeyContent *string + // Possible values are: + // + // * LbJwtKey#LbJwtKey_TYPE_LBJWTCERTIFICATEKEY + // * LbJwtKey#LbJwtKey_TYPE_LBJWTSYMMETRICKEY + // * LbJwtKey#LbJwtKey_TYPE_LBJWTPUBLICKEY + // + // The property is used to identify JWT key type. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbJwtPublicKey__TYPE_IDENTIFIER = "LbJwtPublicKey" + +func (s *LbJwtPublicKey) GetType__() bindings.BindingType { + return LbJwtPublicKeyBindingType() +} + +func (s *LbJwtPublicKey) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbJwtPublicKey._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The key is used to specify the symmetric key which is used to verify the signature of JWT tokens. +type LbJwtSymmetricKey struct { + // Possible values are: + // + // * LbJwtKey#LbJwtKey_TYPE_LBJWTCERTIFICATEKEY + // * LbJwtKey#LbJwtKey_TYPE_LBJWTSYMMETRICKEY + // * LbJwtKey#LbJwtKey_TYPE_LBJWTPUBLICKEY + // + // The property is used to identify JWT key type. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbJwtSymmetricKey__TYPE_IDENTIFIER = "LbJwtSymmetricKey" + +func (s *LbJwtSymmetricKey) GetType__() bindings.BindingType { + return LbJwtSymmetricKeyBindingType() +} + +func (s *LbJwtSymmetricKey) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbJwtSymmetricKey._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The object is deprecated as NSX-T Load Balancer is deprecated. +type LbMonitor struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBHTTPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBHTTPSMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBICMPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBTCPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBUDPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBPASSIVEMONITOR + // + // Load balancers monitor the health of backend servers to ensure traffic is not black holed. There are two types of healthchecks: active and passive. Passive healthchecks depend on failures in actual client traffic (e.g. RST from server in response to a client connection) to detect that the server or the application is down. In case of active healthchecks, load balancer itself initiates new connections (or sends ICMP ping) to the servers periodically to check their health, completely independent of any data traffic. Currently, active health monitors are supported for HTTP, HTTPS, TCP, UDP and ICMP protocols. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbMonitor__TYPE_IDENTIFIER = "LbMonitor" +const LbMonitor_RESOURCE_TYPE_LBHTTPMONITOR = "LbHttpMonitor" +const LbMonitor_RESOURCE_TYPE_LBHTTPSMONITOR = "LbHttpsMonitor" +const LbMonitor_RESOURCE_TYPE_LBICMPMONITOR = "LbIcmpMonitor" +const LbMonitor_RESOURCE_TYPE_LBTCPMONITOR = "LbTcpMonitor" +const LbMonitor_RESOURCE_TYPE_LBUDPMONITOR = "LbUdpMonitor" +const LbMonitor_RESOURCE_TYPE_LBPASSIVEMONITOR = "LbPassiveMonitor" + +func (s *LbMonitor) GetType__() bindings.BindingType { + return LbMonitorBindingType() +} + +func (s *LbMonitor) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbMonitor._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbMonitorListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // paginated list of load balancer monitors + Results []*data.StructValue +} + +func (s *LbMonitorListResult) GetType__() bindings.BindingType { + return LbMonitorListResultBindingType() +} + +func (s *LbMonitorListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbMonitorListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The node count for specific load balancer usage severity. +type LbNodeCountPerSeverity struct { + // Node count for specific serverity. format: int64 + NodeCount *int64 + // Possible values are: + // + // * LbNodeCountPerSeverity#LbNodeCountPerSeverity_SEVERITY_GREEN + // * LbNodeCountPerSeverity#LbNodeCountPerSeverity_SEVERITY_ORANGE + // * LbNodeCountPerSeverity#LbNodeCountPerSeverity_SEVERITY_RED + // + // The severity calculation is based on credit usage percentage of load balancer for one node. + Severity *string +} + +const LbNodeCountPerSeverity_SEVERITY_GREEN = "GREEN" +const LbNodeCountPerSeverity_SEVERITY_ORANGE = "ORANGE" +const LbNodeCountPerSeverity_SEVERITY_RED = "RED" + +func (s *LbNodeCountPerSeverity) GetType__() bindings.BindingType { + return LbNodeCountPerSeverityBindingType() +} + +func (s *LbNodeCountPerSeverity) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbNodeCountPerSeverity._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node usage for load balancer contains basic information and LB entity usages and capacity for the given node. +type LbNodeUsage struct { + // The property identifies the node UUID for load balancer node usage. + NodeId *string + // Possible values are: + // + // * LbNodeUsage#LbNodeUsage_TYPE_LBEDGENODEUSAGE + // + // The property identifies the load balancer node usage type. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbNodeUsage__TYPE_IDENTIFIER = "LbNodeUsage" +const LbNodeUsage_TYPE_LBEDGENODEUSAGE = "LbEdgeNodeUsage" + +func (s *LbNodeUsage) GetType__() bindings.BindingType { + return LbNodeUsageBindingType() +} + +func (s *LbNodeUsage) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbNodeUsage._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The load balancer node usage summary for all nodes. Only EdgeNode is supported. The summary calculation is based on all edge nodes configured in edge clusters. +type LbNodeUsageSummary struct { + // The current credit number reflects the overall credit usage for all nodes. format: int64 + CurrentCreditNumber *int64 + // The overall number of pool members configured on all nodes. format: int64 + CurrentPoolMembers *int64 + // The property identifies array of node count for each severity (RED, ORANGE and GREEN). + NodeCounts []LbNodeCountPerSeverity + // The property contains lb node usages for each node. + NodeUsages []*data.StructValue + // The remaining credit number is the overall remaining credits that can be used for load balancer service configuration for all nodes. format: int64 + RemainingCreditNumber *int64 + // The overall remaining number of pool members which could be configured on all nodes. format: int64 + RemainingPoolMembers *int64 + // Possible values are: + // + // * LbNodeUsageSummary#LbNodeUsageSummary_SEVERITY_GREEN + // * LbNodeUsageSummary#LbNodeUsageSummary_SEVERITY_ORANGE + // * LbNodeUsageSummary#LbNodeUsageSummary_SEVERITY_RED + // + // The severity calculation is based on current credit usage percentage of load balancer for all nodes. + Severity *string + // The overall usage percentage of all nodes for load balancer. The value is the larger value between overall pool member usage percentage and overall load balancer credit usage percentage. + UsagePercentage *float64 +} + +const LbNodeUsageSummary_SEVERITY_GREEN = "GREEN" +const LbNodeUsageSummary_SEVERITY_ORANGE = "ORANGE" +const LbNodeUsageSummary_SEVERITY_RED = "RED" + +func (s *LbNodeUsageSummary) GetType__() bindings.BindingType { + return LbNodeUsageSummaryBindingType() +} + +func (s *LbNodeUsageSummary) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbNodeUsageSummary._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbPassiveMonitor struct { + // When the consecutive failures reach this value, then the member is considered temporarily unavailable for a configurable period format: int64 + MaxFails *int64 + // After this timeout period, the member is tried again for a new connection to see if it is available. format: int64 + Timeout *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBHTTPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBHTTPSMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBICMPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBTCPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBUDPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBPASSIVEMONITOR + // + // Load balancers monitor the health of backend servers to ensure traffic is not black holed. There are two types of healthchecks: active and passive. Passive healthchecks depend on failures in actual client traffic (e.g. RST from server in response to a client connection) to detect that the server or the application is down. In case of active healthchecks, load balancer itself initiates new connections (or sends ICMP ping) to the servers periodically to check their health, completely independent of any data traffic. Currently, active health monitors are supported for HTTP, HTTPS, TCP, UDP and ICMP protocols. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbPassiveMonitor__TYPE_IDENTIFIER = "LbPassiveMonitor" + +func (s *LbPassiveMonitor) GetType__() bindings.BindingType { + return LbPassiveMonitorBindingType() +} + +func (s *LbPassiveMonitor) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbPassiveMonitor._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbPersistenceCookieTime struct { + // HTTP cookie max-age to expire cookie, only available for insert mode. format: int64 + CookieMaxIdle *int64 + // Possible values are: + // + // * LbCookieTime#LbCookieTime_TYPE_LBSESSIONCOOKIETIME + // * LbCookieTime#LbCookieTime_TYPE_LBPERSISTENCECOOKIETIME + // + // Both session cookie and persistence cookie are supported, Use LbSessionCookieTime for session cookie time setting, Use LbPersistenceCookieTime for persistence cookie time setting + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbPersistenceCookieTime__TYPE_IDENTIFIER = "LbPersistenceCookieTime" + +func (s *LbPersistenceCookieTime) GetType__() bindings.BindingType { + return LbPersistenceCookieTimeBindingType() +} + +func (s *LbPersistenceCookieTime) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbPersistenceCookieTime._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// LB persistence profile contains the information related to load balancer persistence options. Some applications maintain state and require all relevant connections to be sent to the same server as the application state is not synchronized among servers. Persistence can be enabled on a LbVirtualServer by binding a persistence profile to it. LbGenericPersistenceProfile cannot be attached to virtual server directly, it can be only consumed by LB rule action. If a user attaches a generic persistence profile directly to a virtual server, the operation is rejected. +type LbPersistenceProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LbPersistenceProfile#LbPersistenceProfile_RESOURCE_TYPE_LBCOOKIEPERSISTENCEPROFILE + // * LbPersistenceProfile#LbPersistenceProfile_RESOURCE_TYPE_LBSOURCEIPPERSISTENCEPROFILE + // * LbPersistenceProfile#LbPersistenceProfile_RESOURCE_TYPE_LBGENERICPERSISTENCEPROFILE + // + // The resource_type property identifies persistence profile type. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The persistence shared flag identifies whether the persistence table is shared among virtual-servers referring this profile. If persistence shared flag is not set in the cookie persistence profile bound to a virtual server, it defaults to cookie persistence that is private to each virtual server and is qualified by the pool. This is accomplished by load balancer inserting a cookie with name in the format ... If persistence shared flag is set in the cookie persistence profile, in cookie insert mode, cookie persistence could be shared across multiple virtual servers that are bound to the same pools. The cookie name would be changed to ... If persistence shared flag is not set in the sourceIp persistence profile bound to a virtual server, each virtual server that the profile is bound to maintains its own private persistence table. If persistence shared flag is set in the sourceIp persistence profile, all virtual servers the profile is bound to share the same persistence table. If persistence shared flag is not set in the generic persistence profile, the persistence entries are matched and stored in the table which is identified using both virtual server ID and profile ID. If persistence shared flag is set in the generic persistence profile, the persistence entries are matched and stored in the table which is identified using profile ID. It means that virtual servers which consume the same profile in the LbRule with this flag enabled are sharing the same persistence table. + PersistenceShared *bool +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbPersistenceProfile__TYPE_IDENTIFIER = "LbPersistenceProfile" +const LbPersistenceProfile_RESOURCE_TYPE_LBCOOKIEPERSISTENCEPROFILE = "LbCookiePersistenceProfile" +const LbPersistenceProfile_RESOURCE_TYPE_LBSOURCEIPPERSISTENCEPROFILE = "LbSourceIpPersistenceProfile" +const LbPersistenceProfile_RESOURCE_TYPE_LBGENERICPERSISTENCEPROFILE = "LbGenericPersistenceProfile" + +func (s *LbPersistenceProfile) GetType__() bindings.BindingType { + return LbPersistenceProfileBindingType() +} + +func (s *LbPersistenceProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbPersistenceProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbPersistenceProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // paginated list of load balancer persistence profiles + Results []*data.StructValue +} + +func (s *LbPersistenceProfileListResult) GetType__() bindings.BindingType { + return LbPersistenceProfileListResultBindingType() +} + +func (s *LbPersistenceProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbPersistenceProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbPool struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // In case of active healthchecks, load balancer itself initiates new connections (or sends ICMP ping) to the servers periodically to check their health, completely independent of any data traffic. Active healthchecks are disabled by default and can be enabled for a server pool by binding a health monitor to the pool. If multiple active monitors are configured, the pool member status is UP only when the health check status for all the monitors are UP. The property is deprecated as NSX-T Load Balancer is deprecated. + ActiveMonitorIds []string + // Possible values are: + // + // * LbPool#LbPool_ALGORITHM_ROUND_ROBIN + // * LbPool#LbPool_ALGORITHM_WEIGHTED_ROUND_ROBIN + // * LbPool#LbPool_ALGORITHM_LEAST_CONNECTION + // * LbPool#LbPool_ALGORITHM_WEIGHTED_LEAST_CONNECTION + // * LbPool#LbPool_ALGORITHM_IP_HASH + // + // Load balancing algorithm, configurable per pool controls how the incoming connections are distributed among the members. + Algorithm *string + MemberGroup *PoolMemberGroup + // Server pool consists of one or more pool members. Each pool member is identified, typically, by an IP address and a port. + Members []PoolMember + // A pool is considered active if there are at least certain minimum number of members. format: int64 + MinActiveMembers *int64 + // Passive healthchecks are disabled by default and can be enabled by attaching a passive health monitor to a server pool. Each time a client connection to a pool member fails, its failed count is incremented. For pools bound to L7 virtual servers, a connection is considered to be failed and failed count is incremented if any TCP connection errors (e.g. TCP RST or failure to send data) or SSL handshake failures occur. For pools bound to L4 virtual servers, if no response is received to a TCP SYN sent to the pool member or if a TCP RST is received in response to a TCP SYN, then the pool member is considered to have failed and the failed count is incremented. The property is deprecated as NSX-T Load Balancer is deprecated. + PassiveMonitorId *string + SnatTranslation *data.StructValue + // TCP multiplexing allows the same TCP connection between load balancer and the backend server to be used for sending multiple client requests from different client TCP connections. The property is deprecated as NSX-T Load Balancer is deprecated. + TcpMultiplexingEnabled *bool + // The maximum number of TCP connections per pool that are idly kept alive for sending future client requests. The property is deprecated as NSX-T Load Balancer is deprecated. format: int64 + TcpMultiplexingNumber *int64 +} + +const LbPool_ALGORITHM_ROUND_ROBIN = "ROUND_ROBIN" +const LbPool_ALGORITHM_WEIGHTED_ROUND_ROBIN = "WEIGHTED_ROUND_ROBIN" +const LbPool_ALGORITHM_LEAST_CONNECTION = "LEAST_CONNECTION" +const LbPool_ALGORITHM_WEIGHTED_LEAST_CONNECTION = "WEIGHTED_LEAST_CONNECTION" +const LbPool_ALGORITHM_IP_HASH = "IP_HASH" + +func (s *LbPool) GetType__() bindings.BindingType { + return LbPoolBindingType() +} + +func (s *LbPool) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbPool._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbPoolListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // paginated list of pools + Results []LbPool +} + +func (s *LbPoolListResult) GetType__() bindings.BindingType { + return LbPoolListResultBindingType() +} + +func (s *LbPoolListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbPoolListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbPoolMemberStatistics struct { + // Pool member IP address format: ip + IpAddress *string + // The port is configured in pool member. For virtual server port range case, pool member port must be null. format: port-or-range + Port *string + Statistics *LbStatisticsCounter +} + +func (s *LbPoolMemberStatistics) GetType__() bindings.BindingType { + return LbPoolMemberStatisticsBindingType() +} + +func (s *LbPoolMemberStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbPoolMemberStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbPoolMemberStatus struct { + // If multiple active monitors are configured, the failure_cause contains failure cause for each monitors. Like \"Monitor_1:failure_cause_1. Monitor_2:failure_cause_2.\" + FailureCause *string + // Pool member IP address format: ip + IpAddress *string + // If multiple active monitors are configured, the property value is the latest last_check_time among all the monitors. format: int64 + LastCheckTime *int64 + // If multiple active monitors are configured, the property value is the latest last_state_change_time among all the monitors. format: int64 + LastStateChangeTime *int64 + // The port is configured in pool member. For virtual server port range case, pool member port must be null. format: port-or-range + Port *string + // Possible values are: + // + // * LbPoolMemberStatus#LbPoolMemberStatus_STATUS_UP + // * LbPoolMemberStatus#LbPoolMemberStatus_STATUS_DOWN + // * LbPoolMemberStatus#LbPoolMemberStatus_STATUS_DISABLED + // * LbPoolMemberStatus#LbPoolMemberStatus_STATUS_GRACEFUL_DISABLED + // * LbPoolMemberStatus#LbPoolMemberStatus_STATUS_UNUSED + // * LbPoolMemberStatus#LbPoolMemberStatus_STATUS_UNKNOWN + // + // UP means that pool member is enabled and monitors have marked the pool member as UP. If the pool member has no monitor configured, it would be treated as UP. DOWN means that pool member is enabled and monitors have marked the pool member as DOWN. DISABLED means that admin state of pool member is set to DISABLED. GRACEFUL_DISABLED means that admin state of pool member is set to GRACEFUL_DISABLED. UNUSED means that the pool member is not used when the IP list size of member group exceeds the maximum setting. The remaining IP addresses would not be used as available backend servers, hence mark the status as UNUSED. UNKNOWN means that the related pool is not associated to any enabled virtual servers, or no status reported from transport-nodes, the associated load balancer service may be working(or not working). + Status *string +} + +const LbPoolMemberStatus_STATUS_UP = "UP" +const LbPoolMemberStatus_STATUS_DOWN = "DOWN" +const LbPoolMemberStatus_STATUS_DISABLED = "DISABLED" +const LbPoolMemberStatus_STATUS_GRACEFUL_DISABLED = "GRACEFUL_DISABLED" +const LbPoolMemberStatus_STATUS_UNUSED = "UNUSED" +const LbPoolMemberStatus_STATUS_UNKNOWN = "UNKNOWN" + +func (s *LbPoolMemberStatus) GetType__() bindings.BindingType { + return LbPoolMemberStatusBindingType() +} + +func (s *LbPoolMemberStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbPoolMemberStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbPoolStatistics struct { + // Timestamp when the data was last updated format: int64 + LastUpdateTimestamp *int64 + // Statistics of load balancer pool members + Members []LbPoolMemberStatistics + // Load balancer pool identifier + PoolId *string + Statistics *LbStatisticsCounter +} + +func (s *LbPoolStatistics) GetType__() bindings.BindingType { + return LbPoolStatisticsBindingType() +} + +func (s *LbPoolStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbPoolStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbPoolStatisticsListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // paginated statistics list of pools + Results []LbPoolStatistics +} + +func (s *LbPoolStatisticsListResult) GetType__() bindings.BindingType { + return LbPoolStatisticsListResultBindingType() +} + +func (s *LbPoolStatisticsListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbPoolStatisticsListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbPoolStatus struct { + // Timestamp when the data was last updated format: int64 + LastUpdateTimestamp *int64 + // Status of load balancer pool members + Members []LbPoolMemberStatus + // Load balancer pool identifier + PoolId *string + // Possible values are: + // + // * LbPoolStatus#LbPoolStatus_STATUS_UP + // * LbPoolStatus#LbPoolStatus_STATUS_PARTIALLY_UP + // * LbPoolStatus#LbPoolStatus_STATUS_PRIMARY_DOWN + // * LbPoolStatus#LbPoolStatus_STATUS_DOWN + // * LbPoolStatus#LbPoolStatus_STATUS_DETACHED + // * LbPoolStatus#LbPoolStatus_STATUS_UNKNOWN + // + // UP means that all primary members are in UP status. PARTIALLY_UP means that some(not all) primary members are in UP status, the number of these active members is larger or equal to certain number(min_active_members) which is defined in LbPool. When there are no backup members which are in the UP status, the number(min_active_members) would be ignored. PRIMARY_DOWN means that less than certain(min_active_members) primary members are in UP status but backup members are in UP status, connections to this pool would be dispatched to backup members. DOWN means that all primary and backup members are DOWN. DETACHED means that the pool is not bound to any virtual server. UNKNOWN means that the pool is not associated to any enabled virtual servers, or no status reported from transport-nodes, the associated load balancer service may be working(or not working). + Status *string +} + +const LbPoolStatus_STATUS_UP = "UP" +const LbPoolStatus_STATUS_PARTIALLY_UP = "PARTIALLY_UP" +const LbPoolStatus_STATUS_PRIMARY_DOWN = "PRIMARY_DOWN" +const LbPoolStatus_STATUS_DOWN = "DOWN" +const LbPoolStatus_STATUS_DETACHED = "DETACHED" +const LbPoolStatus_STATUS_UNKNOWN = "UNKNOWN" + +func (s *LbPoolStatus) GetType__() bindings.BindingType { + return LbPoolStatusBindingType() +} + +func (s *LbPoolStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbPoolStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbPoolStatusListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // paginated status list of pools + Results []LbPoolStatus +} + +func (s *LbPoolStatusListResult) GetType__() bindings.BindingType { + return LbPoolStatusListResultBindingType() +} + +func (s *LbPoolStatusListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbPoolStatusListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Load balancer rules allow customization of load balancing behavior using match/action rules. Currently, load balancer rules are supported for only layer 7 virtual servers with application profile LbHttpProfile. Each application rule consists of one or more match conditions and one or more actions. Load balancer rules could be used by different load balancer services. +type LbRule struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // A list of actions to be executed at specified phase when load balancer rule matches. The actions are used to manipulate application traffic, such as rewrite URI of HTTP messages, redirect HTTP messages, etc. + Actions []*data.StructValue + // A list of match conditions used to match application traffic. Multiple match conditions can be specified in one load balancer rule, each match condition defines a criterion to match application traffic. If no match conditions are specified, then the load balancer rule will always match and it is used typically to define default rules. If more than one match condition is specified, then match strategy determines if all conditions should match or any one condition should match for the load balancer rule to considered a match. + MatchConditions []*data.StructValue + // Possible values are: + // + // * LbRule#LbRule_MATCH_STRATEGY_ALL + // * LbRule#LbRule_MATCH_STRATEGY_ANY + // + // Strategy to define how load balancer rule is considered a match when multiple match conditions are specified in one rule. If match_stragety is set to ALL, then load balancer rule is considered a match only if all the conditions match. If match_strategy is set to ANY, then load balancer rule is considered a match if any one of the conditions match. + MatchStrategy *string + // Possible values are: + // + // * LbRule#LbRule_PHASE_HTTP_REQUEST_REWRITE + // * LbRule#LbRule_PHASE_HTTP_FORWARDING + // * LbRule#LbRule_PHASE_HTTP_RESPONSE_REWRITE + // * LbRule#LbRule_PHASE_HTTP_ACCESS + // * LbRule#LbRule_PHASE_TRANSPORT + // + // Each load balancer rule is used at a specific phase of load balancer processing. Currently five phases are supported, HTTP_REQUEST_REWRITE, HTTP_FORWARDING, HTTP_RESPONSE_REWRITE, HTTP_ACCESS and TRANSPORT. When an HTTP request message is received by load balancer, all HTTP_REQUEST_REWRITE rules, if present are executed in the order they are applied to virtual server. And then if HTTP_FORWARDING rules present, only first matching rule's action is executed, remaining rules are not checked. HTTP_FORWARDING rules can have only one action. If the request is forwarded to a backend server and the response goes back to load balancer, all HTTP_RESPONSE_REWRITE rules, if present, are executed in the order they are applied to the virtual server. In HTTP_ACCESS phase, user can define action to control access using JWT authentication. In TRANSPORT phase, user can define the condition to match SNI in TLS client hello and define the action to do SSL end-to-end, SSL offloading or SSL passthrough using a specific load balancer server pool. + Phase *string +} + +const LbRule_MATCH_STRATEGY_ALL = "ALL" +const LbRule_MATCH_STRATEGY_ANY = "ANY" +const LbRule_PHASE_HTTP_REQUEST_REWRITE = "HTTP_REQUEST_REWRITE" +const LbRule_PHASE_HTTP_FORWARDING = "HTTP_FORWARDING" +const LbRule_PHASE_HTTP_RESPONSE_REWRITE = "HTTP_RESPONSE_REWRITE" +const LbRule_PHASE_HTTP_ACCESS = "HTTP_ACCESS" +const LbRule_PHASE_TRANSPORT = "TRANSPORT" + +func (s *LbRule) GetType__() bindings.BindingType { + return LbRuleBindingType() +} + +func (s *LbRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Load balancer rule actions are used to manipulate application traffic. Currently load balancer rules can be used at three load balancer processing phases. Each phase has its own supported type of actions. Supported actions in HTTP_REQUST_REWRITE phase are: LbHttpRequestUriRewriteAction LbHttpRequestHeaderRewriteAction LbHttpRequestHeaderDeleteAction LbVariableAssignmentAction Supported actions in HTTP_FORWARDING phase are: LbHttpRejectAction LbHttpRedirectAction LbSelectPoolAction LbVariablePersistenceOnAction LbConnectionDropAction Supported action in HTTP_RESPONSE_REWRITE phase is: LbHttpResponseHeaderRewriteAction LbHttpResponseHeaderDeleteAction LbVariablePersistenceLearnAction Supported action in HTTP_ACCESS phase is: LbJwtAuthAction LbConnectionDropAction LbVariableAssignmentAction Supported action in TRANSPORT phase is: LbSslModeSelectionAction LbSelectPoolAction If the match type of an LbRuleCondition field is specified as REGEX and named capturing groups are used in the specified regular expression. The groups can be used as variables in LbRuleAction fields. For example, define a rule with LbHttpRequestUriCondition as match condition and LbHttpRequestUriRewriteAction as action. Set match_type field of LbHttpRequestUriCondition to REGEX, and set uri field to \"/news/(?<year>\\d+)/(?<month>\\d+)/(?<article>.\*)\". Set uri field of LbHttpRequestUriRewriteAction to: \"/news/$year-$month/$article\" In uri field of LbHttpRequestUriCondition, the (?<year>\\d+), (?<month>\\d+) and (?<article>.\*) are named capturing groups, they define variables named $year, $month and $article respectively. The defined variables are used in LbHttpRequestUriRewriteAction. For a matched HTTP request with URI \"/news/2017/06/xyz.html\", the substring \"2017\" is captured in variable $year, \"06\" is captured in variable $month, and \"xyz.html\" is captured in variable $article. The LbHttpRequestUriRewriteAction will rewrite the URI to: \"/news/2017-06/xyz.html\" A set of built-in variables can be used in LbRuleAction as well. The name of built-in variables start with underscore, the name of user defined variables is not allowed to start with underscore. Following are some of the built-in variables: $_scheme: Reference the scheme part of matched HTTP messages, could be \"http\" or \"https\". $_host: Host of matched HTTP messages, for example \"www.example.com\". $_server_port: Port part of URI, it is also the port of the server which accepted a request. Default port is 80 for http and 443 for https. $_uri: The URI path, for example \"/products/sample.html\". $_request_uri: Full original request URI with arguments, for example, \"/products/sample.html?a=b&c=d\". $_args: URI arguments, for instance \"a=b&c=d\" $_is_args: \"?\" if a request has URI arguments, or an empty string otherwise. For the full list of built-in variables, please reference the NSX-T Administrator's Guide. +type LbRuleAction struct { + // Possible values are: + // + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREJECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTPOOLACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTSERVERACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LbRuleAction#LbRuleAction_TYPE_LBJWTAUTHACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbRuleAction__TYPE_IDENTIFIER = "LbRuleAction" +const LbRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION = "LbHttpRequestUriRewriteAction" +const LbRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION = "LbHttpRequestHeaderRewriteAction" +const LbRuleAction_TYPE_LBHTTPREJECTACTION = "LbHttpRejectAction" +const LbRuleAction_TYPE_LBHTTPREDIRECTACTION = "LbHttpRedirectAction" +const LbRuleAction_TYPE_LBSELECTPOOLACTION = "LbSelectPoolAction" +const LbRuleAction_TYPE_LBSELECTSERVERACTION = "LbSelectServerAction" +const LbRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION = "LbHttpResponseHeaderRewriteAction" +const LbRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION = "LbHttpRequestHeaderDeleteAction" +const LbRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION = "LbHttpResponseHeaderDeleteAction" +const LbRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION = "LbVariableAssignmentAction" +const LbRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION = "LbVariablePersistenceOnAction" +const LbRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION = "LbVariablePersistenceLearnAction" +const LbRuleAction_TYPE_LBJWTAUTHACTION = "LbJwtAuthAction" +const LbRuleAction_TYPE_LBSSLMODESELECTIONACTION = "LbSslModeSelectionAction" +const LbRuleAction_TYPE_LBCONNECTIONDROPACTION = "LbConnectionDropAction" + +func (s *LbRuleAction) GetType__() bindings.BindingType { + return LbRuleActionBindingType() +} + +func (s *LbRuleAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbRuleAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Match conditions are used to match application traffic passing through load balancers. Multiple match conditions can be specified in one load balancer rule, each match condition defines a criterion for application traffic. If inverse field is set to true, the match result of the condition is inverted. If more than one match condition is specified, match strategy determines if all conditions should match or any one condition should match for the load balancer rule to be considered a match. Currently only HTTP messages are supported by load balancer rules. Each load balancer rule is used at a specific phase of load balancer processing. Currently three phases are supported, HTTP_REQUEST_REWRITE, HTTP_FORWARDING and HTTP_RESPONSE_REWRITE. Each phase supports certain types of match conditions, supported match conditions in HTTP_REQUEST_REWRITE phase are: LbHttpRequestMethodCondition LbHttpRequestUriCondition LbHttpRequestUriArgumentsCondition LbHttpRequestVersionCondition LbHttpRequestHeaderCondition LbHttpRequestCookieCondition LbHttpRequestBodyCondition LbTcpHeaderCondition LbIpHeaderCondition LbVariableCondition LbHttpSslCondition Supported match conditions in HTTP_FORWARDING phase are: LbHttpRequestMethodCondition LbHttpRequestUriCondition LbHttpRequestUriArgumentsCondition LbHttpRequestVersionCondition LbHttpRequestHeaderCondition LbHttpRequestCookieCondition LbHttpRequestBodyCondition LbTcpHeaderCondition LbIpHeaderCondition LbVariableCondition LbHttpSslCondition LbSslSniCondition Supported match condition in HTTP_RESPONSE_REWRITE phase is: LbHttpResponseHeaderCondition LbHttpRequestMethodCondition LbHttpRequestUriCondition LbHttpRequestUriArgumentsCondition LbHttpRequestVersionCondition LbHttpRequestHeaderCondition LbHttpRequestCookieCondition LbTcpHeaderCondition LbIpHeaderCondition LbVariableCondition LbHttpSslCondition Supported match condition in HTTP_ACCESS phase is: LbHttpRequestMethodCondition LbHttpRequestUriCondition LbHttpRequestUriArgumentsCondition LbHttpRequestVersionCondition LbHttpRequestHeaderCondition LbHttpRequestCookieCondition LbHttpRequestBodyCondition LbTcpHeaderCondition LbIpHeaderCondition LbVariableCondition LbHttpSslCondition Supported match condition in TRANSPORT phase is: LbSslSniCondition +type LbRuleCondition struct { + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBIPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBVARIABLECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbRuleCondition__TYPE_IDENTIFIER = "LbRuleCondition" +const LbRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION = "LbHttpRequestMethodCondition" +const LbRuleCondition_TYPE_LBHTTPREQUESTURICONDITION = "LbHttpRequestUriCondition" +const LbRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION = "LbHttpRequestUriArgumentsCondition" +const LbRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION = "LbHttpRequestVersionCondition" +const LbRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION = "LbHttpRequestHeaderCondition" +const LbRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION = "LbHttpRequestCookieCondition" +const LbRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION = "LbHttpRequestBodyCondition" +const LbRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION = "LbHttpResponseHeaderCondition" +const LbRuleCondition_TYPE_LBTCPHEADERCONDITION = "LbTcpHeaderCondition" +const LbRuleCondition_TYPE_LBIPHEADERCONDITION = "LbIpHeaderCondition" +const LbRuleCondition_TYPE_LBVARIABLECONDITION = "LbVariableCondition" +const LbRuleCondition_TYPE_LBHTTPSSLCONDITION = "LbHttpSslCondition" +const LbRuleCondition_TYPE_LBSSLSNICONDITION = "LbSslSniCondition" + +func (s *LbRuleCondition) GetType__() bindings.BindingType { + return LbRuleConditionBindingType() +} + +func (s *LbRuleCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbRuleCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbRuleListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // paginated list of LB rules + Results []LbRule +} + +func (s *LbRuleListResult) GetType__() bindings.BindingType { + return LbRuleListResultBindingType() +} + +func (s *LbRuleListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbRuleListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This action is used to select a pool for matched HTTP request messages. The pool is specified by UUID. The matched HTTP request messages are forwarded to the specified pool. +type LbSelectPoolAction struct { + // UUID of load balancer pool + PoolId *string + // Display name of load balancer pool + PoolName *string + // Possible values are: + // + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREJECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTPOOLACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTSERVERACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LbRuleAction#LbRuleAction_TYPE_LBJWTAUTHACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbSelectPoolAction__TYPE_IDENTIFIER = "LbSelectPoolAction" + +func (s *LbSelectPoolAction) GetType__() bindings.BindingType { + return LbSelectPoolActionBindingType() +} + +func (s *LbSelectPoolAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbSelectPoolAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The object is deprecated as NSX-T Load Balancer is deprecated. +type LbServerSslProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * LbServerSslProfile#LbServerSslProfile_CIPHER_GROUP_LABEL_BALANCED + // * LbServerSslProfile#LbServerSslProfile_CIPHER_GROUP_LABEL_HIGH_SECURITY + // * LbServerSslProfile#LbServerSslProfile_CIPHER_GROUP_LABEL_HIGH_COMPATIBILITY + // * LbServerSslProfile#LbServerSslProfile_CIPHER_GROUP_LABEL_CUSTOM + // + // It is a label of cipher group which is mostly consumed by GUI. + CipherGroupLabel *string + // Possible values are: + // + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_RSA_WITH_AES_256_CBC_SHA + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_RSA_WITH_AES_128_CBC_SHA + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_RSA_WITH_3DES_EDE_CBC_SHA + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_RSA_WITH_AES_128_CBC_SHA256 + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_RSA_WITH_AES_128_GCM_SHA256 + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_RSA_WITH_AES_256_CBC_SHA256 + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_RSA_WITH_AES_256_GCM_SHA384 + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA256 + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_GCM_SHA256 + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA384 + // * LbServerSslProfile#LbServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_GCM_SHA384 + // + // supported SSL cipher list to client side + Ciphers []string + // This flag is set to true when all the ciphers and protocols are FIPS compliant. It is set to false when one of the ciphers or protocols are not FIPS compliant. + IsFips *bool + // This flag is set to true when all the ciphers and protocols are secure. It is set to false when one of the ciphers or protocols is insecure. + IsSecure *bool + // Possible values are: + // + // * LbServerSslProfile#LbServerSslProfile_PROTOCOLS_SSL_V2 + // * LbServerSslProfile#LbServerSslProfile_PROTOCOLS_SSL_V3 + // * LbServerSslProfile#LbServerSslProfile_PROTOCOLS_TLS_V1 + // * LbServerSslProfile#LbServerSslProfile_PROTOCOLS_TLS_V1_1 + // * LbServerSslProfile#LbServerSslProfile_PROTOCOLS_TLS_V1_2 + // + // SSL versions TLS1.1 and TLS1.2 are supported and enabled by default. SSLv2, SSLv3, and TLS1.0 are supported, but disabled by default. + Protocols []string + // SSL session caching allows SSL client and server to reuse previously negotiated security parameters avoiding the expensive public key operation during handshake. + SessionCacheEnabled *bool +} + +const LbServerSslProfile_CIPHER_GROUP_LABEL_BALANCED = "BALANCED" +const LbServerSslProfile_CIPHER_GROUP_LABEL_HIGH_SECURITY = "HIGH_SECURITY" +const LbServerSslProfile_CIPHER_GROUP_LABEL_HIGH_COMPATIBILITY = "HIGH_COMPATIBILITY" +const LbServerSslProfile_CIPHER_GROUP_LABEL_CUSTOM = "CUSTOM" +const LbServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" +const LbServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" +const LbServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" +const LbServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" +const LbServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA = "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA" +const LbServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA = "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA" +const LbServerSslProfile_CIPHERS_RSA_WITH_AES_256_CBC_SHA = "TLS_RSA_WITH_AES_256_CBC_SHA" +const LbServerSslProfile_CIPHERS_RSA_WITH_AES_128_CBC_SHA = "TLS_RSA_WITH_AES_128_CBC_SHA" +const LbServerSslProfile_CIPHERS_RSA_WITH_3DES_EDE_CBC_SHA = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" +const LbServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" +const LbServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" +const LbServerSslProfile_CIPHERS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" +const LbServerSslProfile_CIPHERS_RSA_WITH_AES_128_CBC_SHA256 = "TLS_RSA_WITH_AES_128_CBC_SHA256" +const LbServerSslProfile_CIPHERS_RSA_WITH_AES_128_GCM_SHA256 = "TLS_RSA_WITH_AES_128_GCM_SHA256" +const LbServerSslProfile_CIPHERS_RSA_WITH_AES_256_CBC_SHA256 = "TLS_RSA_WITH_AES_256_CBC_SHA256" +const LbServerSslProfile_CIPHERS_RSA_WITH_AES_256_GCM_SHA384 = "TLS_RSA_WITH_AES_256_GCM_SHA384" +const LbServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" +const LbServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" +const LbServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" +const LbServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" +const LbServerSslProfile_CIPHERS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" +const LbServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA = "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA" +const LbServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256" +const LbServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256" +const LbServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384" +const LbServerSslProfile_CIPHERS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384" +const LbServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA = "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA" +const LbServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256" +const LbServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256" +const LbServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384" +const LbServerSslProfile_CIPHERS_ECDH_RSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384" +const LbServerSslProfile_PROTOCOLS_SSL_V2 = "SSL_V2" +const LbServerSslProfile_PROTOCOLS_SSL_V3 = "SSL_V3" +const LbServerSslProfile_PROTOCOLS_TLS_V1 = "TLS_V1" +const LbServerSslProfile_PROTOCOLS_TLS_V1_1 = "TLS_V1_1" +const LbServerSslProfile_PROTOCOLS_TLS_V1_2 = "TLS_V1_2" + +func (s *LbServerSslProfile) GetType__() bindings.BindingType { + return LbServerSslProfileBindingType() +} + +func (s *LbServerSslProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbServerSslProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbServerSslProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // paginated list of load balancer server SSL profiles + Results []LbServerSslProfile +} + +func (s *LbServerSslProfileListResult) GetType__() bindings.BindingType { + return LbServerSslProfileListResultBindingType() +} + +func (s *LbServerSslProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbServerSslProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbService struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Whether access log is enabled + AccessLogEnabled *bool + Attachment *ResourceReference + // Whether the load balancer service is enabled + Enabled *bool + // Possible values are: + // + // * LbService#LbService_ERROR_LOG_LEVEL_DEBUG + // * LbService#LbService_ERROR_LOG_LEVEL_INFO + // * LbService#LbService_ERROR_LOG_LEVEL_WARNING + // * LbService#LbService_ERROR_LOG_LEVEL_ERROR + // * LbService#LbService_ERROR_LOG_LEVEL_CRITICAL + // * LbService#LbService_ERROR_LOG_LEVEL_ALERT + // * LbService#LbService_ERROR_LOG_LEVEL_EMERGENCY + // + // Load balancer engine writes information about encountered issues of different severity levels to the error log. This setting is used to define the severity level of the error log. + ErrorLogLevel *string + // If relax_scale_validation is true, the scale validations for virtual servers/pools/pool members/rules are relaxed for load balancer service. When load balancer service is deployed on edge nodes, the scale of virtual servers/pools/pool members for the load balancer service should not exceed the scale number of the largest load balancer size which could be configured on a certain edge form factor. For example, the largest load balancer size supported on a MEDIUM edge node is MEDIUM. So one SMALL load balancer deployed on MEDIUM edge nodes can support the scale number of MEDIUM load balancer. It is not recommended to enable active monitors if relax_scale_validation is true due to performance consideration. If relax_scale_validation is false, scale numbers should be validated for load balancer service. The property is deprecated as NSX-T Load Balancer is deprecated. + RelaxScaleValidation *bool + // Possible values are: + // + // * LbService#LbService_SIZE_SMALL + // * LbService#LbService_SIZE_MEDIUM + // * LbService#LbService_SIZE_LARGE + // * LbService#LbService_SIZE_XLARGE + // * LbService#LbService_SIZE_DLB + // + // The size of load balancer service + Size *string + // virtual servers can be associated to LbService(which is similar to physical/virtual load balancer), Lb virtual servers, pools and other entities could be defined independently, the virtual server identifier list here would be used to maintain the relationship of LbService and other Lb entities. + VirtualServerIds []string +} + +const LbService_ERROR_LOG_LEVEL_DEBUG = "DEBUG" +const LbService_ERROR_LOG_LEVEL_INFO = "INFO" +const LbService_ERROR_LOG_LEVEL_WARNING = "WARNING" +const LbService_ERROR_LOG_LEVEL_ERROR = "ERROR" +const LbService_ERROR_LOG_LEVEL_CRITICAL = "CRITICAL" +const LbService_ERROR_LOG_LEVEL_ALERT = "ALERT" +const LbService_ERROR_LOG_LEVEL_EMERGENCY = "EMERGENCY" +const LbService_SIZE_SMALL = "SMALL" +const LbService_SIZE_MEDIUM = "MEDIUM" +const LbService_SIZE_LARGE = "LARGE" +const LbService_SIZE_XLARGE = "XLARGE" +const LbService_SIZE_DLB = "DLB" + +func (s *LbService) GetType__() bindings.BindingType { + return LbServiceBindingType() +} + +func (s *LbService) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbService._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The information for a given load balancer service could be used for debugging and troubleshooting. It includes load balancer service, associated virtual servers, associated pools, associated profiles such as persistence, SSL, application, associated monitors and associated rules. +type LbServiceDebugInfo struct { + // The application profiles are associated to virtual servers + ApplicationProfiles []*data.StructValue + // The client SSL profiles are associated to virtual servers. The property is deprecated as NSX-T Load Balancer is deprecated. + ClientSslProfiles []LbClientSslProfile + // The load balancer monitors are associated to pools. The property is deprecated as NSX-T Load Balancer is deprecated. + Monitors []*data.StructValue + // The persistence profiles are associated to virtual servers + PersistenceProfiles []*data.StructValue + // The pools which are associated to the given load balancer service would be included. The pools could be defined in virtual server default pool, sorry pool or load balancer rule action. + Pools []LbPool + // The load balancer rules are associated to virtual servers. The property is deprecated as NSX-T Load Balancer is deprecated. + Rules []LbRule + // The server SSL profiles are associated to virtual servers. The property is deprecated as NSX-T Load Balancer is deprecated. + ServerSslProfiles []LbServerSslProfile + Service *LbService + // The virtual servers which are associated to the given load balancer service would be included. + VirtualServers []LbVirtualServer +} + +func (s *LbServiceDebugInfo) GetType__() bindings.BindingType { + return LbServiceDebugInfoBindingType() +} + +func (s *LbServiceDebugInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbServiceDebugInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbServiceInstanceDetail struct { + Attachment *ResourceReference + // The error message for the load balancer instance. If the instance status is NOT_READY, error message will be attached. + ErrorMessage *string +} + +func (s *LbServiceInstanceDetail) GetType__() bindings.BindingType { + return LbServiceInstanceDetailBindingType() +} + +func (s *LbServiceInstanceDetail) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbServiceInstanceDetail._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbServiceInstanceDetailPerStatus struct { + // The detailed information of the load balancer instance. This field will be only returned on realtime status API. + InstanceDetails []LbServiceInstanceDetail + // It means the total number of instances in this status type for the given transport node. format: int64 + InstanceNumber *int64 + // Possible values are: + // + // * LbServiceInstanceDetailPerStatus#LbServiceInstanceDetailPerStatus_STATUS_READY + // * LbServiceInstanceDetailPerStatus#LbServiceInstanceDetailPerStatus_STATUS_CONFLICT + // * LbServiceInstanceDetailPerStatus#LbServiceInstanceDetailPerStatus_STATUS_NOT_READY + // + // The type of load balancer instance status. + Status *string +} + +const LbServiceInstanceDetailPerStatus_STATUS_READY = "READY" +const LbServiceInstanceDetailPerStatus_STATUS_CONFLICT = "CONFLICT" +const LbServiceInstanceDetailPerStatus_STATUS_NOT_READY = "NOT_READY" + +func (s *LbServiceInstanceDetailPerStatus) GetType__() bindings.BindingType { + return LbServiceInstanceDetailPerStatusBindingType() +} + +func (s *LbServiceInstanceDetailPerStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbServiceInstanceDetailPerStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbServiceInstanceDetailPerTransportNode struct { + // Load balancer instances details for each load balancer instance status type from the given transport node. + InstanceDetailPerStatus []LbServiceInstanceDetailPerStatus + // The UUID of the transport node. + TransportNodeId *string +} + +func (s *LbServiceInstanceDetailPerTransportNode) GetType__() bindings.BindingType { + return LbServiceInstanceDetailPerTransportNodeBindingType() +} + +func (s *LbServiceInstanceDetailPerTransportNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbServiceInstanceDetailPerTransportNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbServiceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // paginated list of load balancer services + Results []LbService +} + +func (s *LbServiceListResult) GetType__() bindings.BindingType { + return LbServiceListResultBindingType() +} + +func (s *LbServiceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbServiceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbServiceStatistics struct { + // Timestamp when the data was last updated format: int64 + LastUpdateTimestamp *int64 + // Statistics of load balancer pools + Pools []LbPoolStatistics + // load balancer service identifier + ServiceId *string + Statistics *LbServiceStatisticsCounter + // Statistics of load balancer virtual servers + VirtualServers []LbVirtualServerStatistics +} + +func (s *LbServiceStatistics) GetType__() bindings.BindingType { + return LbServiceStatisticsBindingType() +} + +func (s *LbServiceStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbServiceStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbServiceStatisticsCounter struct { + // The average number of l4 current sessions per second, the number is averaged over the last 5 one-second intervals. + L4CurrentSessionRate *float64 + // Number of l4 current sessions format: int64 + L4CurrentSessions *int64 + // L4 max sessions is used to show the peak L4 max session data since load balancer starts to provide service. format: int64 + L4MaxSessions *int64 + // Number of l4 total sessions format: int64 + L4TotalSessions *int64 + // The average number of l7 current requests per second, the number is averaged over the last 5 one-second intervals. + L7CurrentSessionRate *float64 + // Number of l7 current sessions format: int64 + L7CurrentSessions *int64 + // L7 max sessions is used to show the peak L7 max session data since load balancer starts to provide service. format: int64 + L7MaxSessions *int64 + // Number of l7 total sessions format: int64 + L7TotalSessions *int64 +} + +func (s *LbServiceStatisticsCounter) GetType__() bindings.BindingType { + return LbServiceStatisticsCounterBindingType() +} + +func (s *LbServiceStatisticsCounter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbServiceStatisticsCounter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbServiceStatus struct { + // Ids of load balancer service related active transport nodes + ActiveTransportNodes []string + // Cpu usage in percentage format: int64 + CpuUsage *int64 + // Error message, if available + ErrorMessage *string + // Details of load balancer service instance per transport node. + InstanceDetailPerTn []LbServiceInstanceDetailPerTransportNode + // Timestamp when the data was last updated format: int64 + LastUpdateTimestamp *int64 + // Memory usage in percentage format: int64 + MemoryUsage *int64 + // status of load balancer pools + Pools []LbPoolStatus + // Load balancer service identifier + ServiceId *string + // Possible values are: + // + // * LbServiceStatus#LbServiceStatus_SERVICE_STATUS_UP + // * LbServiceStatus#LbServiceStatus_SERVICE_STATUS_PARTIALLY_UP + // * LbServiceStatus#LbServiceStatus_SERVICE_STATUS_DOWN + // * LbServiceStatus#LbServiceStatus_SERVICE_STATUS_ERROR + // * LbServiceStatus#LbServiceStatus_SERVICE_STATUS_NO_STANDBY + // * LbServiceStatus#LbServiceStatus_SERVICE_STATUS_DETACHED + // * LbServiceStatus#LbServiceStatus_SERVICE_STATUS_DISABLED + // * LbServiceStatus#LbServiceStatus_SERVICE_STATUS_UNKNOWN + // + // UP means the load balancer service is working fine on both transport-nodes(if have); PARTIALLY_UP means that some DLB instances on transport node are working successfully and some instances are not working successfully; DOWN means the load balancer service is down on both transport-nodes (if have), hence the load balancer will not respond to any requests; ERROR means error happens on transport-node(s) or no status is reported from transport-node(s). The load balancer service may be working (or not working); NO_STANDBY means load balancer service is working in one of the transport node while not in the other transport-node (if have). Hence if the load balancer service in the working transport-node goes down, the load balancer service will go down; DETACHED means that the load balancer service has no attachment setting and is not instantiated in any transport nodes; DISABLED means that admin state of load balancer service is DISABLED; UNKNOWN means that no status reported from transport-nodes.The load balancer service may be working(or not working). + ServiceStatus *string + // Ids of load balancer service related standby transport nodes + StandbyTransportNodes []string + // status of load balancer virtual servers + VirtualServers []LbVirtualServerStatus +} + +const LbServiceStatus_SERVICE_STATUS_UP = "UP" +const LbServiceStatus_SERVICE_STATUS_PARTIALLY_UP = "PARTIALLY_UP" +const LbServiceStatus_SERVICE_STATUS_DOWN = "DOWN" +const LbServiceStatus_SERVICE_STATUS_ERROR = "ERROR" +const LbServiceStatus_SERVICE_STATUS_NO_STANDBY = "NO_STANDBY" +const LbServiceStatus_SERVICE_STATUS_DETACHED = "DETACHED" +const LbServiceStatus_SERVICE_STATUS_DISABLED = "DISABLED" +const LbServiceStatus_SERVICE_STATUS_UNKNOWN = "UNKNOWN" + +func (s *LbServiceStatus) GetType__() bindings.BindingType { + return LbServiceStatusBindingType() +} + +func (s *LbServiceStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbServiceStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Describes the capacity and current usage of virtual servers, pools, pool members for the given load balancer service. +type LbServiceUsage struct { + // The current number of pools which have been configured in the given load balancer service. format: int64 + CurrentPoolCount *int64 + // The current number of pool members which have been configured in the given load balancer service. format: int64 + CurrentPoolMemberCount *int64 + // The current number of virtual servers which have been configured in the given load balancer service. format: int64 + CurrentVirtualServerCount *int64 + // Pool capacity means maximum number of pools which could be configured in the given load balancer service. format: int64 + PoolCapacity *int64 + // Pool member capacity means maximum number of pool members which could be configured in the given load balancer service. format: int64 + PoolMemberCapacity *int64 + // UUID of load balancer service + ServiceId *string + // Possible values are: + // + // * LbServiceUsage#LbServiceUsage_SERVICE_SIZE_SMALL + // * LbServiceUsage#LbServiceUsage_SERVICE_SIZE_MEDIUM + // * LbServiceUsage#LbServiceUsage_SERVICE_SIZE_LARGE + // * LbServiceUsage#LbServiceUsage_SERVICE_SIZE_XLARGE + // * LbServiceUsage#LbServiceUsage_SERVICE_SIZE_DLB + // + // The size of load balancer service + ServiceSize *string + // Possible values are: + // + // * LbServiceUsage#LbServiceUsage_SEVERITY_GREEN + // * LbServiceUsage#LbServiceUsage_SEVERITY_ORANGE + // * LbServiceUsage#LbServiceUsage_SEVERITY_RED + // + // The severity calculation is based on the largest usage percentage from virtual servers, pools, pool members and rules for one load balancer service. + Severity *string + // The usage percentage is the largest usage percentage from virtual servers, pools and pool members for the load balancer service. If the property relax_scale_validation is set as true for LbService, it is possible that the value is larger than 100.0. For example, if SMALL LBS is deployed on MEDIUM edge node and configured with MEDIUM LBS virtual server scale number, LBS usage percentage is shown larger than 100.0. + UsagePercentage *float64 + // Virtual server capacity means maximum number of virtual servers which could be configured in the given load balancer service. format: int64 + VirtualServerCapacity *int64 +} + +const LbServiceUsage_SERVICE_SIZE_SMALL = "SMALL" +const LbServiceUsage_SERVICE_SIZE_MEDIUM = "MEDIUM" +const LbServiceUsage_SERVICE_SIZE_LARGE = "LARGE" +const LbServiceUsage_SERVICE_SIZE_XLARGE = "XLARGE" +const LbServiceUsage_SERVICE_SIZE_DLB = "DLB" +const LbServiceUsage_SEVERITY_GREEN = "GREEN" +const LbServiceUsage_SEVERITY_ORANGE = "ORANGE" +const LbServiceUsage_SEVERITY_RED = "RED" + +func (s *LbServiceUsage) GetType__() bindings.BindingType { + return LbServiceUsageBindingType() +} + +func (s *LbServiceUsage) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbServiceUsage._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbSessionCookieTime struct { + // Instead of using HTTP Cookie max-age and relying on client to expire the cookie, max idle time and/or max lifetime of the cookie can be used. Max idle time, if configured, specifies the maximum interval the cookie is valid for from the last time it was seen in a request. It is available for insert mode. format: int64 + CookieMaxIdle *int64 + // Max life time, if configured, specifies the maximum interval the cookie is valid for from the first time the cookie was seen in a request. It is available for insert mode. format: int64 + CookieMaxLife *int64 + // Possible values are: + // + // * LbCookieTime#LbCookieTime_TYPE_LBSESSIONCOOKIETIME + // * LbCookieTime#LbCookieTime_TYPE_LBPERSISTENCECOOKIETIME + // + // Both session cookie and persistence cookie are supported, Use LbSessionCookieTime for session cookie time setting, Use LbPersistenceCookieTime for persistence cookie time setting + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbSessionCookieTime__TYPE_IDENTIFIER = "LbSessionCookieTime" + +func (s *LbSessionCookieTime) GetType__() bindings.BindingType { + return LbSessionCookieTimeBindingType() +} + +func (s *LbSessionCookieTime) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbSessionCookieTime._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbSnatAutoMap struct { + // Both SNAT automap and SNAT IP list modes support port overloading which allows the same SNAT IP and port to be used for multiple backend connections as long as the tuple (source IP, source port, destination IP, destination port, IP protocol) after SNAT is performed is unique. The valid number is 1, 2, 4, 8, 16, 32. This is a deprecated property. The port overload factor is fixed to 32 in load balancer engine. If it is upgraded from an old version, the value would be changed to 32 automatically. format: int64 + PortOverload *int64 + // Possible values are: + // + // * LbSnatTranslation#LbSnatTranslation_TYPE_LBSNATAUTOMAP + // * LbSnatTranslation#LbSnatTranslation_TYPE_LBSNATIPPOOL + // + // Load balancers may need to perform SNAT to ensure reverse traffic from the server can be received and processed by them. There are two modes: LbSnatAutoMap uses the load balancer interface IP and an ephemeral port as the source IP and port of the server side connection. LbSnatIpPool allows user to specify one or more IP addresses along with their subnet masks that should be used for SNAT while connecting to any of the servers in the pool. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbSnatAutoMap__TYPE_IDENTIFIER = "LbSnatAutoMap" + +func (s *LbSnatAutoMap) GetType__() bindings.BindingType { + return LbSnatAutoMapBindingType() +} + +func (s *LbSnatAutoMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbSnatAutoMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbSnatIpElement struct { + // Ip address or ip range such as 1.1.1.1 or 1.1.1.101-1.1.1.160 format: address-or-block-or-range + IpAddress *string + // Subnet prefix length should be not specified if there is only one single IP address or IP range. format: int64 + PrefixLength *int64 +} + +func (s *LbSnatIpElement) GetType__() bindings.BindingType { + return LbSnatIpElementBindingType() +} + +func (s *LbSnatIpElement) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbSnatIpElement._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbSnatIpPool struct { + // If an IP range is specified, the range may contain no more than 64 IP addresses. + IpAddresses []LbSnatIpElement + // Both SNAT automap and SNAT IP list modes support port overloading which allows the same SNAT IP and port to be used for multiple backend connections as long as the tuple (source IP, source port, destination IP, destination port, IP protocol) after SNAT is performed is unique. The valid number is 1, 2, 4, 8, 16, 32. This is a deprecated property. The port overload factor is fixed to 32 in load balancer engine. If it is upgraded from an old version, the value would be changed to 32 automatically. format: int64 + PortOverload *int64 + // Possible values are: + // + // * LbSnatTranslation#LbSnatTranslation_TYPE_LBSNATAUTOMAP + // * LbSnatTranslation#LbSnatTranslation_TYPE_LBSNATIPPOOL + // + // Load balancers may need to perform SNAT to ensure reverse traffic from the server can be received and processed by them. There are two modes: LbSnatAutoMap uses the load balancer interface IP and an ephemeral port as the source IP and port of the server side connection. LbSnatIpPool allows user to specify one or more IP addresses along with their subnet masks that should be used for SNAT while connecting to any of the servers in the pool. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbSnatIpPool__TYPE_IDENTIFIER = "LbSnatIpPool" + +func (s *LbSnatIpPool) GetType__() bindings.BindingType { + return LbSnatIpPoolBindingType() +} + +func (s *LbSnatIpPool) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbSnatIpPool._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbSnatTranslation struct { + // Both SNAT automap and SNAT IP list modes support port overloading which allows the same SNAT IP and port to be used for multiple backend connections as long as the tuple (source IP, source port, destination IP, destination port, IP protocol) after SNAT is performed is unique. The valid number is 1, 2, 4, 8, 16, 32. This is a deprecated property. The port overload factor is fixed to 32 in load balancer engine. If it is upgraded from an old version, the value would be changed to 32 automatically. format: int64 + PortOverload *int64 + // Possible values are: + // + // * LbSnatTranslation#LbSnatTranslation_TYPE_LBSNATAUTOMAP + // * LbSnatTranslation#LbSnatTranslation_TYPE_LBSNATIPPOOL + // + // Load balancers may need to perform SNAT to ensure reverse traffic from the server can be received and processed by them. There are two modes: LbSnatAutoMap uses the load balancer interface IP and an ephemeral port as the source IP and port of the server side connection. LbSnatIpPool allows user to specify one or more IP addresses along with their subnet masks that should be used for SNAT while connecting to any of the servers in the pool. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbSnatTranslation__TYPE_IDENTIFIER = "LbSnatTranslation" +const LbSnatTranslation_TYPE_LBSNATAUTOMAP = "LbSnatAutoMap" +const LbSnatTranslation_TYPE_LBSNATIPPOOL = "LbSnatIpPool" + +func (s *LbSnatTranslation) GetType__() bindings.BindingType { + return LbSnatTranslationBindingType() +} + +func (s *LbSnatTranslation) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbSnatTranslation._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbSourceIpPersistenceProfile struct { + // Persistence entries are not synchronized to the HA peer by default. The property is deprecated as NSX-T Load Balancer is deprecated. + HaPersistenceMirroringEnabled *bool + // Possible values are: + // + // * LbSourceIpPersistenceProfile#LbSourceIpPersistenceProfile_PURGE_NO_PURGE + // * LbSourceIpPersistenceProfile#LbSourceIpPersistenceProfile_PURGE_FULL + // + // persistence purge setting + Purge *string + // When all connections complete (reference count reaches 0), persistence entry timer is started with the expiration time. format: int64 + Timeout *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LbPersistenceProfile#LbPersistenceProfile_RESOURCE_TYPE_LBCOOKIEPERSISTENCEPROFILE + // * LbPersistenceProfile#LbPersistenceProfile_RESOURCE_TYPE_LBSOURCEIPPERSISTENCEPROFILE + // * LbPersistenceProfile#LbPersistenceProfile_RESOURCE_TYPE_LBGENERICPERSISTENCEPROFILE + // + // The resource_type property identifies persistence profile type. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The persistence shared flag identifies whether the persistence table is shared among virtual-servers referring this profile. If persistence shared flag is not set in the cookie persistence profile bound to a virtual server, it defaults to cookie persistence that is private to each virtual server and is qualified by the pool. This is accomplished by load balancer inserting a cookie with name in the format ... If persistence shared flag is set in the cookie persistence profile, in cookie insert mode, cookie persistence could be shared across multiple virtual servers that are bound to the same pools. The cookie name would be changed to ... If persistence shared flag is not set in the sourceIp persistence profile bound to a virtual server, each virtual server that the profile is bound to maintains its own private persistence table. If persistence shared flag is set in the sourceIp persistence profile, all virtual servers the profile is bound to share the same persistence table. If persistence shared flag is not set in the generic persistence profile, the persistence entries are matched and stored in the table which is identified using both virtual server ID and profile ID. If persistence shared flag is set in the generic persistence profile, the persistence entries are matched and stored in the table which is identified using profile ID. It means that virtual servers which consume the same profile in the LbRule with this flag enabled are sharing the same persistence table. + PersistenceShared *bool +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbSourceIpPersistenceProfile__TYPE_IDENTIFIER = "LbSourceIpPersistenceProfile" +const LbSourceIpPersistenceProfile_PURGE_NO_PURGE = "NO_PURGE" +const LbSourceIpPersistenceProfile_PURGE_FULL = "FULL" + +func (s *LbSourceIpPersistenceProfile) GetType__() bindings.BindingType { + return LbSourceIpPersistenceProfileBindingType() +} + +func (s *LbSourceIpPersistenceProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbSourceIpPersistenceProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbSslCipherAndProtocolListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of SSL ciphers + Ciphers []LbSslCipherInfo + // List of SSL protocols + Protocols []LbSslProtocolInfo +} + +func (s *LbSslCipherAndProtocolListResult) GetType__() bindings.BindingType { + return LbSslCipherAndProtocolListResultBindingType() +} + +func (s *LbSslCipherAndProtocolListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbSslCipherAndProtocolListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// SSL cipher +type LbSslCipherInfo struct { + // Possible values are: + // + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDHE_RSA_WITH_AES_128_GCM_SHA256 + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDHE_RSA_WITH_AES_256_GCM_SHA384 + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDHE_RSA_WITH_AES_256_CBC_SHA + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDHE_ECDSA_WITH_AES_256_CBC_SHA + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDH_ECDSA_WITH_AES_256_CBC_SHA + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDH_RSA_WITH_AES_256_CBC_SHA + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_RSA_WITH_AES_256_CBC_SHA + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_RSA_WITH_AES_128_CBC_SHA + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_RSA_WITH_3DES_EDE_CBC_SHA + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA256 + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDHE_RSA_WITH_AES_256_CBC_SHA384 + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_RSA_WITH_AES_128_CBC_SHA256 + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_RSA_WITH_AES_128_GCM_SHA256 + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_RSA_WITH_AES_256_CBC_SHA256 + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_RSA_WITH_AES_256_GCM_SHA384 + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDH_ECDSA_WITH_AES_128_CBC_SHA + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDH_RSA_WITH_AES_128_CBC_SHA + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDH_RSA_WITH_AES_128_CBC_SHA256 + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDH_RSA_WITH_AES_128_GCM_SHA256 + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDH_RSA_WITH_AES_256_CBC_SHA384 + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_ECDH_RSA_WITH_AES_256_GCM_SHA384 + // + // SSL cipher + Cipher *string + // Possible values are: + // + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_GROUP_LABELS_BALANCED + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_GROUP_LABELS_HIGH_SECURITY + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_GROUP_LABELS_HIGH_COMPATIBILITY + // * LbSslCipherInfo#LbSslCipherInfo_CIPHER_GROUP_LABELS_CUSTOM + // + // Several cipher groups might contain the same cipher suite, each cipher suite could have multiple cipher group labels. + CipherGroupLabels []string + // Default SSL cipher flag + IsDefault *bool + // Secure/insecure SSL cipher flag + IsSecure *bool +} + +const LbSslCipherInfo_CIPHER_ECDHE_RSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" +const LbSslCipherInfo_CIPHER_ECDHE_RSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" +const LbSslCipherInfo_CIPHER_ECDHE_RSA_WITH_AES_256_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" +const LbSslCipherInfo_CIPHER_ECDHE_ECDSA_WITH_AES_256_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" +const LbSslCipherInfo_CIPHER_ECDH_ECDSA_WITH_AES_256_CBC_SHA = "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA" +const LbSslCipherInfo_CIPHER_ECDH_RSA_WITH_AES_256_CBC_SHA = "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA" +const LbSslCipherInfo_CIPHER_RSA_WITH_AES_256_CBC_SHA = "TLS_RSA_WITH_AES_256_CBC_SHA" +const LbSslCipherInfo_CIPHER_RSA_WITH_AES_128_CBC_SHA = "TLS_RSA_WITH_AES_128_CBC_SHA" +const LbSslCipherInfo_CIPHER_RSA_WITH_3DES_EDE_CBC_SHA = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" +const LbSslCipherInfo_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" +const LbSslCipherInfo_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" +const LbSslCipherInfo_CIPHER_ECDHE_RSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" +const LbSslCipherInfo_CIPHER_RSA_WITH_AES_128_CBC_SHA256 = "TLS_RSA_WITH_AES_128_CBC_SHA256" +const LbSslCipherInfo_CIPHER_RSA_WITH_AES_128_GCM_SHA256 = "TLS_RSA_WITH_AES_128_GCM_SHA256" +const LbSslCipherInfo_CIPHER_RSA_WITH_AES_256_CBC_SHA256 = "TLS_RSA_WITH_AES_256_CBC_SHA256" +const LbSslCipherInfo_CIPHER_RSA_WITH_AES_256_GCM_SHA384 = "TLS_RSA_WITH_AES_256_GCM_SHA384" +const LbSslCipherInfo_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" +const LbSslCipherInfo_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" +const LbSslCipherInfo_CIPHER_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" +const LbSslCipherInfo_CIPHER_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" +const LbSslCipherInfo_CIPHER_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" +const LbSslCipherInfo_CIPHER_ECDH_ECDSA_WITH_AES_128_CBC_SHA = "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA" +const LbSslCipherInfo_CIPHER_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256" +const LbSslCipherInfo_CIPHER_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256" +const LbSslCipherInfo_CIPHER_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384" +const LbSslCipherInfo_CIPHER_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384" +const LbSslCipherInfo_CIPHER_ECDH_RSA_WITH_AES_128_CBC_SHA = "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA" +const LbSslCipherInfo_CIPHER_ECDH_RSA_WITH_AES_128_CBC_SHA256 = "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256" +const LbSslCipherInfo_CIPHER_ECDH_RSA_WITH_AES_128_GCM_SHA256 = "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256" +const LbSslCipherInfo_CIPHER_ECDH_RSA_WITH_AES_256_CBC_SHA384 = "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384" +const LbSslCipherInfo_CIPHER_ECDH_RSA_WITH_AES_256_GCM_SHA384 = "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384" +const LbSslCipherInfo_CIPHER_GROUP_LABELS_BALANCED = "BALANCED" +const LbSslCipherInfo_CIPHER_GROUP_LABELS_HIGH_SECURITY = "HIGH_SECURITY" +const LbSslCipherInfo_CIPHER_GROUP_LABELS_HIGH_COMPATIBILITY = "HIGH_COMPATIBILITY" +const LbSslCipherInfo_CIPHER_GROUP_LABELS_CUSTOM = "CUSTOM" + +func (s *LbSslCipherInfo) GetType__() bindings.BindingType { + return LbSslCipherInfoBindingType() +} + +func (s *LbSslCipherInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbSslCipherInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This action is used to select SSL mode. Three types of SSL mode actions can be specified in Transport phase, ssl passthrough, ssl offloading and ssl end-to-end. +type LbSslModeSelectionAction struct { + // Possible values are: + // + // * LbSslModeSelectionAction#LbSslModeSelectionAction_SSL_MODE_PASSTHROUGH + // * LbSslModeSelectionAction#LbSslModeSelectionAction_SSL_MODE_END_TO_END + // * LbSslModeSelectionAction#LbSslModeSelectionAction_SSL_MODE_OFFLOAD + // + // SSL Passthrough: LB establishes a TCP connection with client and another connection with selected backend server. LB won't inspect the stream data between client and backend server, but just pass it through. Backend server exchanges SSL connection with client. SSL Offloading: LB terminiates the connections from client, and establishes SSL connection with it. After receiving the HTTP request, LB connects the selected backend server and talk with it via HTTP without SSL. LB estalishes new connection to selected backend server for each HTTP request, in case server_keep_alive or multiplexing are NOT configured. SSL End-to-End: LB terminiates the connections from client, and establishes SSL connection with it. After receiving the HTTP request, LB connects the selected backend server and talk with it via HTTPS. LB estalishes new SSL connection to selected backend server for each HTTP request, in case server_keep_alive or multiplexing are NOT configured. + SslMode *string + // Possible values are: + // + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREJECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTPOOLACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTSERVERACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LbRuleAction#LbRuleAction_TYPE_LBJWTAUTHACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbSslModeSelectionAction__TYPE_IDENTIFIER = "LbSslModeSelectionAction" +const LbSslModeSelectionAction_SSL_MODE_PASSTHROUGH = "SSL_PASSTHROUGH" +const LbSslModeSelectionAction_SSL_MODE_END_TO_END = "SSL_END_TO_END" +const LbSslModeSelectionAction_SSL_MODE_OFFLOAD = "SSL_OFFLOAD" + +func (s *LbSslModeSelectionAction) GetType__() bindings.BindingType { + return LbSslModeSelectionActionBindingType() +} + +func (s *LbSslModeSelectionAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbSslModeSelectionAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Load balancer abstract SSL profile +type LbSslProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +func (s *LbSslProfile) GetType__() bindings.BindingType { + return LbSslProfileBindingType() +} + +func (s *LbSslProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbSslProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// SSL protocol +type LbSslProtocolInfo struct { + // Default SSL protocol flag + IsDefault *bool + // Secure/insecure SSL protocol flag + IsSecure *bool + // Possible values are: + // + // * LbSslProtocolInfo#LbSslProtocolInfo_PROTOCOL_SSL_V2 + // * LbSslProtocolInfo#LbSslProtocolInfo_PROTOCOL_SSL_V3 + // * LbSslProtocolInfo#LbSslProtocolInfo_PROTOCOL_TLS_V1 + // * LbSslProtocolInfo#LbSslProtocolInfo_PROTOCOL_TLS_V1_1 + // * LbSslProtocolInfo#LbSslProtocolInfo_PROTOCOL_TLS_V1_2 + // + // SSL protocol + Protocol *string +} + +const LbSslProtocolInfo_PROTOCOL_SSL_V2 = "SSL_V2" +const LbSslProtocolInfo_PROTOCOL_SSL_V3 = "SSL_V3" +const LbSslProtocolInfo_PROTOCOL_TLS_V1 = "TLS_V1" +const LbSslProtocolInfo_PROTOCOL_TLS_V1_1 = "TLS_V1_1" +const LbSslProtocolInfo_PROTOCOL_TLS_V1_2 = "TLS_V1_2" + +func (s *LbSslProtocolInfo) GetType__() bindings.BindingType { + return LbSslProtocolInfoBindingType() +} + +func (s *LbSslProtocolInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbSslProtocolInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This condition is used to match SSL SNI in client hello. This condition is only supported in TRANSPORT phase and HTTP_FORWARDING phase. +type LbSslSniCondition struct { + // If true, case is significant when comparing SNI value. + CaseSensitive *bool + // Possible values are: + // + // * LbSslSniCondition#LbSslSniCondition_MATCH_TYPE_STARTS_WITH + // * LbSslSniCondition#LbSslSniCondition_MATCH_TYPE_ENDS_WITH + // * LbSslSniCondition#LbSslSniCondition_MATCH_TYPE_EQUALS + // * LbSslSniCondition#LbSslSniCondition_MATCH_TYPE_CONTAINS + // * LbSslSniCondition#LbSslSniCondition_MATCH_TYPE_REGEX + // + // Determine how a specified string value is used to match SNI. + MatchType *string + // The SNI(Server Name indication) in client hello message. + Sni *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBIPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBVARIABLECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbSslSniCondition__TYPE_IDENTIFIER = "LbSslSniCondition" +const LbSslSniCondition_MATCH_TYPE_STARTS_WITH = "STARTS_WITH" +const LbSslSniCondition_MATCH_TYPE_ENDS_WITH = "ENDS_WITH" +const LbSslSniCondition_MATCH_TYPE_EQUALS = "EQUALS" +const LbSslSniCondition_MATCH_TYPE_CONTAINS = "CONTAINS" +const LbSslSniCondition_MATCH_TYPE_REGEX = "REGEX" + +func (s *LbSslSniCondition) GetType__() bindings.BindingType { + return LbSslSniConditionBindingType() +} + +func (s *LbSslSniCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbSslSniCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbStatisticsCounter struct { + // Number of bytes in format: int64 + BytesIn *int64 + // The average number of inbound bytes per second, the number is averaged over the last 5 one-second intervals. + BytesInRate *float64 + // Number of bytes out format: int64 + BytesOut *int64 + // The average number of outbound bytes per second, the number is averaged over the last 5 one-second intervals. + BytesOutRate *float64 + // The average number of current sessions per second, the number is averaged over the last 5 one-second intervals. + CurrentSessionRate *float64 + // Number of current sessions format: int64 + CurrentSessions *int64 + // The total number of dropped TCP SYN or UDP packets by access list control. format: int64 + DroppedPacketsByAccessList *int64 + // The total number of dropped sessions by LB rule action. format: int64 + DroppedSessionsByLbruleAction *int64 + // The average number of http requests per second, the number is averaged over the last 5 one-second intervals. + HttpRequestRate *float64 + // The total number of http requests. format: int64 + HttpRequests *int64 + // Number of maximum sessions format: int64 + MaxSessions *int64 + // Number of packets in format: int64 + PacketsIn *int64 + // The average number of inbound packets per second, the number is averaged over the last 5 one-second intervals. + PacketsInRate *float64 + // Number of packets out format: int64 + PacketsOut *int64 + // The average number of outbound packets per second, the number is averaged over the last 5 one-second intervals. + PacketsOutRate *float64 + // Number of source IP persistence entries format: int64 + SourceIpPersistenceEntrySize *int64 + // Number of total sessions format: int64 + TotalSessions *int64 +} + +func (s *LbStatisticsCounter) GetType__() bindings.BindingType { + return LbStatisticsCounterBindingType() +} + +func (s *LbStatisticsCounter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbStatisticsCounter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This condition is used to match TCP header fields of HTTP messages. Currently, only the TCP source port is supported. Ports can be expressed as a single port number like 80, or a port range like 1024-1030. +type LbTcpHeaderCondition struct { + // TCP source port of HTTP message format: port-or-range + SourcePort *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBIPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBVARIABLECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbTcpHeaderCondition__TYPE_IDENTIFIER = "LbTcpHeaderCondition" + +func (s *LbTcpHeaderCondition) GetType__() bindings.BindingType { + return LbTcpHeaderConditionBindingType() +} + +func (s *LbTcpHeaderCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbTcpHeaderCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbTcpMonitor struct { + // Expected data, if specified, can be anywhere in the response and it has to be a string, regular expressions are not supported. + Receive *string + // If both send and receive are not specified, then just a TCP connection is established (3-way handshake) to validate server is healthy, no data is sent. + Send *string + // num of consecutive checks must fail before marking it down format: int64 + FallCount *int64 + // the frequency at which the system issues the monitor check (in second) format: int64 + Interval *int64 + // If the monitor port is specified, it would override pool member port setting for healthcheck. A port range is not supported. For ICMP monitor, monitor_port is not required. format: port-or-range + MonitorPort *string + // num of consecutive checks must pass before marking it up format: int64 + RiseCount *int64 + // the number of seconds the target has in which to respond to the monitor request format: int64 + Timeout *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBHTTPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBHTTPSMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBICMPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBTCPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBUDPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBPASSIVEMONITOR + // + // Load balancers monitor the health of backend servers to ensure traffic is not black holed. There are two types of healthchecks: active and passive. Passive healthchecks depend on failures in actual client traffic (e.g. RST from server in response to a client connection) to detect that the server or the application is down. In case of active healthchecks, load balancer itself initiates new connections (or sends ICMP ping) to the servers periodically to check their health, completely independent of any data traffic. Currently, active health monitors are supported for HTTP, HTTPS, TCP, UDP and ICMP protocols. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +func (s *LbTcpMonitor) GetType__() bindings.BindingType { + return LbTcpMonitorBindingType() +} + +func (s *LbTcpMonitor) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbTcpMonitor._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbUdpMonitor struct { + // Expected data, can be anywhere in the response and it has to be a string, regular expressions are not supported. UDP healthcheck is considered failed if there is no server response within the timeout period. + Receive *string + // The data to be sent to the monitored server. + Send *string + // num of consecutive checks must fail before marking it down format: int64 + FallCount *int64 + // the frequency at which the system issues the monitor check (in second) format: int64 + Interval *int64 + // If the monitor port is specified, it would override pool member port setting for healthcheck. A port range is not supported. For ICMP monitor, monitor_port is not required. format: port-or-range + MonitorPort *string + // num of consecutive checks must pass before marking it up format: int64 + RiseCount *int64 + // the number of seconds the target has in which to respond to the monitor request format: int64 + Timeout *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBHTTPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBHTTPSMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBICMPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBTCPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBUDPMONITOR + // * LbMonitor#LbMonitor_RESOURCE_TYPE_LBPASSIVEMONITOR + // + // Load balancers monitor the health of backend servers to ensure traffic is not black holed. There are two types of healthchecks: active and passive. Passive healthchecks depend on failures in actual client traffic (e.g. RST from server in response to a client connection) to detect that the server or the application is down. In case of active healthchecks, load balancer itself initiates new connections (or sends ICMP ping) to the servers periodically to check their health, completely independent of any data traffic. Currently, active health monitors are supported for HTTP, HTTPS, TCP, UDP and ICMP protocols. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +func (s *LbUdpMonitor) GetType__() bindings.BindingType { + return LbUdpMonitorBindingType() +} + +func (s *LbUdpMonitor) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbUdpMonitor._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This action is used to create a new variable and assign value to it. One action can be used to create one variable. To create multiple variables, multiple actions must be defined. The variables can be used by LbVariableCondition, etc. +type LbVariableAssignmentAction struct { + // Name of the variable to be assigned + VariableName *string + // Value of variable + VariableValue *string + // Possible values are: + // + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREJECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTPOOLACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTSERVERACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LbRuleAction#LbRuleAction_TYPE_LBJWTAUTHACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbVariableAssignmentAction__TYPE_IDENTIFIER = "LbVariableAssignmentAction" + +func (s *LbVariableAssignmentAction) GetType__() bindings.BindingType { + return LbVariableAssignmentActionBindingType() +} + +func (s *LbVariableAssignmentAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbVariableAssignmentAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This condition is used to match variable's name and value at all phases. The variables could be captured from REGEX or assigned by LbVariableAssignmentAction or system embedded variable. Varialbe_name and variable_value should be matched at the same time. +type LbVariableCondition struct { + // If true, case is significant when comparing variable value. + CaseSensitive *bool + // Possible values are: + // + // * LbVariableCondition#LbVariableCondition_MATCH_TYPE_STARTS_WITH + // * LbVariableCondition#LbVariableCondition_MATCH_TYPE_ENDS_WITH + // * LbVariableCondition#LbVariableCondition_MATCH_TYPE_EQUALS + // * LbVariableCondition#LbVariableCondition_MATCH_TYPE_CONTAINS + // * LbVariableCondition#LbVariableCondition_MATCH_TYPE_REGEX + // + // Match type of variable value + MatchType *string + // Name of the variable to be matched + VariableName *string + // Value of variable to be matched + VariableValue *string + // A flag to indicate whether reverse the match result of this condition + Inverse *bool + // Possible values are: + // + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTMETHODCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURICONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTURIARGUMENTSCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTVERSIONCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTCOOKIECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPREQUESTBODYCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPRESPONSEHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBTCPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBIPHEADERCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBVARIABLECONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBHTTPSSLCONDITION + // * LbRuleCondition#LbRuleCondition_TYPE_LBSSLSNICONDITION + // + // Type of load balancer rule condition + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbVariableCondition__TYPE_IDENTIFIER = "LbVariableCondition" +const LbVariableCondition_MATCH_TYPE_STARTS_WITH = "STARTS_WITH" +const LbVariableCondition_MATCH_TYPE_ENDS_WITH = "ENDS_WITH" +const LbVariableCondition_MATCH_TYPE_EQUALS = "EQUALS" +const LbVariableCondition_MATCH_TYPE_CONTAINS = "CONTAINS" +const LbVariableCondition_MATCH_TYPE_REGEX = "REGEX" + +func (s *LbVariableCondition) GetType__() bindings.BindingType { + return LbVariableConditionBindingType() +} + +func (s *LbVariableCondition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbVariableCondition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This action is performed in HTTP response rewrite phase. It is used to learn the value of variable from the HTTP response, and insert an entry into the persistence table if the entry doesn't exist. +type LbVariablePersistenceLearnAction struct { + // If the persistence profile UUID is not specified, a default persistence table is created per virtual server. Currently, only LbGenericPersistenceProfile is supported. + PersistenceProfileId *string + // The property is used to enable a hash operation for variable value when composing the persistence key. + VariableHashEnabled *bool + // The property is the name of variable to be learnt. It is used to identify which variable's value is learnt from HTTP response. The variable can be a system embedded variable such as \"_cookie_JSESSIONID\", a customized variable defined in LbVariableAssignmentAction or a captured variable in regular expression such as \"article\". + VariableName *string + // Possible values are: + // + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREJECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTPOOLACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTSERVERACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LbRuleAction#LbRuleAction_TYPE_LBJWTAUTHACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbVariablePersistenceLearnAction__TYPE_IDENTIFIER = "LbVariablePersistenceLearnAction" + +func (s *LbVariablePersistenceLearnAction) GetType__() bindings.BindingType { + return LbVariablePersistenceLearnActionBindingType() +} + +func (s *LbVariablePersistenceLearnAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbVariablePersistenceLearnAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This action is performed in HTTP forwarding phase. It is used to inspect the variable of HTTP request, and look up the persistence entry with its value and pool uuid as key. If the persistence entry is found, the HTTP request is forwarded to the recorded backend server according to the persistence entry. If the persistence entry is not found, a new entry is created in the table after backend server is selected. +type LbVariablePersistenceOnAction struct { + // If the persistence profile UUID is not specified, a default persistence table is created per virtual server. Currently, only LbGenericPersistenceProfile is supported. + PersistenceProfileId *string + // The property is used to enable a hash operation for variable value when composing the persistence key. + VariableHashEnabled *bool + // The property is the name of variable to be used. It specifies which variable's value of a HTTP Request will be used in the key of persistence entry. The variable can be a system embedded variable such as \"_cookie_JSESSIONID\", a customized variable defined in LbVariableAssignmentAction or a captured variable in regular expression such as \"article\". + VariableName *string + // Possible values are: + // + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTURIREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREJECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREDIRECTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTPOOLACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSELECTSERVERACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERREWRITEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPREQUESTHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBHTTPRESPONSEHEADERDELETEACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEASSIGNMENTACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCEONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBVARIABLEPERSISTENCELEARNACTION + // * LbRuleAction#LbRuleAction_TYPE_LBJWTAUTHACTION + // * LbRuleAction#LbRuleAction_TYPE_LBSSLMODESELECTIONACTION + // * LbRuleAction#LbRuleAction_TYPE_LBCONNECTIONDROPACTION + // + // The property identifies the load balancer rule action type. + Type_ string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LbVariablePersistenceOnAction__TYPE_IDENTIFIER = "LbVariablePersistenceOnAction" + +func (s *LbVariablePersistenceOnAction) GetType__() bindings.BindingType { + return LbVariablePersistenceOnActionBindingType() +} + +func (s *LbVariablePersistenceOnAction) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbVariablePersistenceOnAction._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbVirtualServer struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + AccessListControl *LbAccessListControl + // Whether access log is enabled + AccessLogEnabled *bool + // The application profile defines the application protocol characteristics. It is used to influence how load balancing is performed. Currently, LbFastTCPProfile, LbFastUDPProfile and LbHttpProfile, etc are supported. + ApplicationProfileId *string + ClientSslProfileBinding *ClientSslProfileBinding + // This is a deprecated property, please use 'default_pool_member_ports' instead. If default_pool_member_port is configured and default_pool_member_ports are not specified, both default_pool_member_port and default_pool_member_ports in response payload would return the same port value. If both are specified, default_pool_member_ports setting would take effect with higher priority. format: port-or-range + DefaultPoolMemberPort *string + // If default_pool_member_ports are configured, both default_pool_member_port and default_pool_member_ports in the response payload would include port settings, notice that the value of default_pool_member_port is the first element of default_pool_member_ports. format: port-or-range + DefaultPoolMemberPorts []string + // whether the virtual server is enabled + Enabled *bool + // virtual server IP address format: ip + IpAddress *string + // Possible values are: + // + // * LbVirtualServer#LbVirtualServer_IP_PROTOCOL_TCP + // * LbVirtualServer#LbVirtualServer_IP_PROTOCOL_UDP + // + // Assigned Internet Protocol in IP header, TCP, UDP are supported. + IpProtocol *string + // The property log_significant_event_only can take effect only when access_log_enabled is true. If log_significant_event_only is true, significant events are logged in access log. For L4 virtual server, significant event means unsuccessful(error or dropped) TCP/UDP connections. For L7 virtual server, significant event means unsuccessful connections or HTTP/HTTPS requests which have error response code(e.g. 4xx, 5xx). + LogSignificantEventOnly *bool + // To ensure one virtual server does not over consume resources, affecting other applications hosted on the same LBS, connections to a virtual server can be capped. If it is not specified, it means that connections are unlimited. The property is deprecated as NSX-T Load Balancer is deprecated. format: int64 + MaxConcurrentConnections *int64 + // To ensure one virtual server does not over consume resources, connections to a member can be rate limited. If it is not specified, it means that connection rate is unlimited. The property is deprecated as NSX-T Load Balancer is deprecated. format: int64 + MaxNewConnectionRate *int64 + // Persistence profile is used to allow related client connections to be sent to the same backend server. + PersistenceProfileId *string + // The server pool(LbPool) contains backend servers. Server pool consists of one or more servers, also referred to as pool members, that are similarly configured and are running the same application. + PoolId *string + // This is a deprecated property, please use 'ports' instead. Port setting could be single port for both L7 mode and L4 mode. For L4 mode, a single port range is also supported. The port setting could be a single port or port range such as \"80\", \"1234-1236\". If port is configured and ports are not specified, both port and ports in response payload would return the same port value. If both port and ports are configured, ports setting would take effect with higher priority. format: port-or-range + Port *string + // Port setting could be a single port for both L7 mode and L4 mode. For L4 mode, multiple ports or port ranges are also supported such as \"80\", \"443\", \"1234-1236\". If ports is configured, both port and ports in the response payload would include port settings, notice that the port field value is the first element of ports. format: port-or-range + Ports []string + // Load balancer rules allow customization of load balancing behavior using match/action rules. Currently, load balancer rules are supported for only layer 7 virtual servers with LbHttpProfile. The property is deprecated as NSX-T Load Balancer is deprecated. + RuleIds []string + ServerSslProfileBinding *ServerSslProfileBinding + // When load balancer can not select a backend server to serve the request in default pool or pool in rules, the request would be served by sorry server pool. The property is deprecated as NSX-T Load Balancer is deprecated. + SorryPoolId *string +} + +const LbVirtualServer_IP_PROTOCOL_TCP = "TCP" +const LbVirtualServer_IP_PROTOCOL_UDP = "UDP" + +func (s *LbVirtualServer) GetType__() bindings.BindingType { + return LbVirtualServerBindingType() +} + +func (s *LbVirtualServer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbVirtualServer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbVirtualServerListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // paginated list of virtual servers + Results []LbVirtualServer +} + +func (s *LbVirtualServerListResult) GetType__() bindings.BindingType { + return LbVirtualServerListResultBindingType() +} + +func (s *LbVirtualServerListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbVirtualServerListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbVirtualServerStatistics struct { + // Timestamp when the data was last updated format: int64 + LastUpdateTimestamp *int64 + Statistics *LbStatisticsCounter + // load balancer virtual server identifier + VirtualServerId *string +} + +func (s *LbVirtualServerStatistics) GetType__() bindings.BindingType { + return LbVirtualServerStatisticsBindingType() +} + +func (s *LbVirtualServerStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbVirtualServerStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbVirtualServerStatisticsListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // paginated statistics list of virtual servers + Results []LbVirtualServerStatistics +} + +func (s *LbVirtualServerStatisticsListResult) GetType__() bindings.BindingType { + return LbVirtualServerStatisticsListResultBindingType() +} + +func (s *LbVirtualServerStatisticsListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbVirtualServerStatisticsListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbVirtualServerStatus struct { + // Timestamp when the data was last updated. format: int64 + LastUpdateTimestamp *int64 + // Possible values are: + // + // * LbVirtualServerStatus#LbVirtualServerStatus_STATUS_UP + // * LbVirtualServerStatus#LbVirtualServerStatus_STATUS_PARTIALLY_UP + // * LbVirtualServerStatus#LbVirtualServerStatus_STATUS_PRIMARY_DOWN + // * LbVirtualServerStatus#LbVirtualServerStatus_STATUS_DOWN + // * LbVirtualServerStatus#LbVirtualServerStatus_STATUS_DETACHED + // * LbVirtualServerStatus#LbVirtualServerStatus_STATUS_DISABLED + // * LbVirtualServerStatus#LbVirtualServerStatus_STATUS_UNKNOWN + // + // UP means that all primary members in default pool are in UP status. For L7 virtual server, if there is no default pool, the virtual server would be treated as UP. PARTIALLY_UP means that some(not all) primary members in default pool are in UP status. The size of these active primary members should be larger than or equal to the certain number(min_active_members) which is defined in LbPool. When there are no backup members which are in the UP status, the number(min_active_members) would be ignored. PRIMARY_DOWN means that less than certain(min_active_members) primary members in default pool are in UP status but backup members are in UP status, the connections would be dispatched to backup members. DOWN means that all primary and backup members are in DOWN status. DETACHED means that the virtual server is not bound to any service. DISABLED means that the admin state of the virtual server is disabled. UNKNOWN means that no status reported from transport-nodes. The associated load balancer service may be working(or not working). + Status *string + // load balancer virtual server identifier + VirtualServerId *string +} + +const LbVirtualServerStatus_STATUS_UP = "UP" +const LbVirtualServerStatus_STATUS_PARTIALLY_UP = "PARTIALLY_UP" +const LbVirtualServerStatus_STATUS_PRIMARY_DOWN = "PRIMARY_DOWN" +const LbVirtualServerStatus_STATUS_DOWN = "DOWN" +const LbVirtualServerStatus_STATUS_DETACHED = "DETACHED" +const LbVirtualServerStatus_STATUS_DISABLED = "DISABLED" +const LbVirtualServerStatus_STATUS_UNKNOWN = "UNKNOWN" + +func (s *LbVirtualServerStatus) GetType__() bindings.BindingType { + return LbVirtualServerStatusBindingType() +} + +func (s *LbVirtualServerStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbVirtualServerStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbVirtualServerStatusListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // paginated status list of virtual servers + Results []LbVirtualServerStatus +} + +func (s *LbVirtualServerStatusListResult) GetType__() bindings.BindingType { + return LbVirtualServerStatusListResultBindingType() +} + +func (s *LbVirtualServerStatusListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbVirtualServerStatusListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LbVirtualServerWithRule struct { + // It is used to add rules, update rules and bind rules to the virtual server. To add new rules, make sure that the rules have no identifier specified, the new rules are automatically generated and associated to the virtual server. If the virtual server need to consume some existed rules without change, those rules should not be specified in the list, otherwise, the rules are updated. For update_with_rules action, it supports rules delete and update. To delete old rules, the rules should not be configured in new action, the UUID of deleted rules should be removed from rule_ids. To update rules, the rules should be specified with new change and configured with identifier. If there are some rules which are not modified, those rule should not be specified in the rules list, the UUID list of rules should be specified in rule_ids of LbVirtualServer. The property is deprecated as NSX-T Load Balancer is deprecated. + Rules []LbRule + VirtualServer *LbVirtualServer +} + +func (s *LbVirtualServerWithRule) GetType__() bindings.BindingType { + return LbVirtualServerWithRuleBindingType() +} + +func (s *LbVirtualServerWithRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LbVirtualServerWithRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents legend that describes the entities of the widget. +type Legend struct { + // Possible values are: + // + // * Legend#Legend_ALIGNMENT_HORIZONTAL + // * Legend#Legend_ALIGNMENT_VERTICAL + // + // Describes the alignment of legend. Alignment of a legend denotes how individual items of the legend are aligned in a container. For example, if VERTICAL is chosen then the items of the legend will appear one below the other and if HORIZONTAL is chosen then the items will appear side by side. + Alignment *string + // If set to true, it will display the counts in legend. If set to false, counts of entities are not displayed in the legend. + DisplayCount *bool + // Possible values are: + // + // * Legend#Legend_DISPLAY_MODE_ALL_LEGENDS + // * Legend#Legend_DISPLAY_MODE_MIN_NO_OF_LEGENDS + // * Legend#Legend_DISPLAY_MODE_OTHER_GROUP_WITH_LEGENDS + // + // Display mode for legends. + DisplayMode *string + // Show checkbox along with legends if value is set to true. Widget filtering capability can be enable based on legend checkbox selection. for 'display_mode' SHOW_OTHER_GROUP_WITH_LEGENDS filterable property is not supported. + Filterable *bool + // A minimum number of legends to be displayed upfront. if 'display_mode' is set to SHOW_MIN_NO_OF_LEGENDS then this property value will be used to display number of legends upfront in the UI. format: int32 + MinLegendsDisplayCount *int64 + // A translated label for showing other category label in legends. + OtherGroupLegendLabel *string + // Possible values are: + // + // * Legend#Legend_POSITION_TOP + // * Legend#Legend_POSITION_BOTTOM + // * Legend#Legend_POSITION_LEFT + // * Legend#Legend_POSITION_RIGHT + // * Legend#Legend_POSITION_TOP_RIGHT + // + // Describes the relative placement of legend. The legend of a widget can be placed either to the TOP or BOTTOM or LEFT or RIGHT relative to the widget. For example, if RIGHT is chosen then legend is placed to the right of the widget. + Position *string + // Possible values are: + // + // * Legend#Legend_TYPE_CIRCLE + // + // Describes the render type for the legend. The legend for an entity describes the entity in the widget. The supported legend type is a circle against which the entity's details such as display_name are shown. The color of the circle denotes the color of the entity shown inside the widget. + Type_ *string + // Show unit of entities in the legend. + Unit *string +} + +const Legend_ALIGNMENT_HORIZONTAL = "HORIZONTAL" +const Legend_ALIGNMENT_VERTICAL = "VERTICAL" +const Legend_DISPLAY_MODE_ALL_LEGENDS = "SHOW_ALL_LEGENDS" +const Legend_DISPLAY_MODE_MIN_NO_OF_LEGENDS = "SHOW_MIN_NO_OF_LEGENDS" +const Legend_DISPLAY_MODE_OTHER_GROUP_WITH_LEGENDS = "SHOW_OTHER_GROUP_WITH_LEGENDS" +const Legend_POSITION_TOP = "TOP" +const Legend_POSITION_BOTTOM = "BOTTOM" +const Legend_POSITION_LEFT = "LEFT" +const Legend_POSITION_RIGHT = "RIGHT" +const Legend_POSITION_TOP_RIGHT = "TOP_RIGHT" +const Legend_TYPE_CIRCLE = "CIRCLE" + +func (s *Legend) GetType__() bindings.BindingType { + return LegendBindingType() +} + +func (s *Legend) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Legend._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents configuration for Legend widget. For this widget the data source is not applicable. This widget can be use to add the Legend inside the dashboard container. +type LegendWidgetConfiguration struct { + Layout *Legend + // Id of source widget, if any. Id should be a valid id of an existing widget. This property can be used to identify the source of the data for this legend widget. + SourceWidgetId *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_TIMERANGEDROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_SPACERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LEGENDWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration, CustomFilterWidgetConfiguration, TimeRangeDropdownFilterWidgetConfiguration, SpacerWidgetConfiguration, LegendWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If the condition is met then the widget will be displayed to UI. If no condition is provided, then the widget will be displayed unconditionally. + Condition *string + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + FeatureSet *FeatureSet + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. This field is deprecated instead use 'filters' property. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + // A List of filter applied to this widget configuration. This will be used to identify the filters applied to this widget. + Filters []string + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + Legend *Legend + // List of plotting configuration for a given widget. Widget plotting configurations which are common across all the widgets types should be define here. + PlotConfigs []WidgetPlotConfiguration + // Represents the vertical span of the widget / container. 1 Row span is equal to 20px. format: int32 + Rowspan *int64 + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // If the value of this field is set to true then card header will be displayed otherwise only card will be displayed without header. + ShowHeader *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LegendWidgetConfiguration__TYPE_IDENTIFIER = "LegendWidgetConfiguration" + +func (s *LegendWidgetConfiguration) GetType__() bindings.BindingType { + return LegendWidgetConfigurationBindingType() +} + +func (s *LegendWidgetConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LegendWidgetConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// license properties +type License struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Possible values are: + // + // * License#License_CAPACITY_TYPE_VM + // * License#License_CAPACITY_TYPE_CPU + // * License#License_CAPACITY_TYPE_USER + // * License#License_CAPACITY_TYPE_CORE + // * License#License_CAPACITY_TYPE_HOST + // + // License metrics specifying the capacity type of license key. Types are: - VM - CPU - USER(Concurrent User) - CORE - HOST + CapacityType *string + // license edition + Description *string + // date that license expires format: int64 + Expiry *int64 + // semicolon delimited feature list + Features *string + // true for evalution license + IsEval *bool + // whether the license has expired + IsExpired *bool + // multi-hypervisor support + IsMh *bool + // license key + LicenseKey *string + // product name + ProductName *string + // product version + ProductVersion *string + // license capacity; 0 for unlimited format: int64 + Quantity *int64 +} + +const License_CAPACITY_TYPE_VM = "VM" +const License_CAPACITY_TYPE_CPU = "CPU" +const License_CAPACITY_TYPE_USER = "USER" +const License_CAPACITY_TYPE_CORE = "CORE" +const License_CAPACITY_TYPE_HOST = "HOST" + +func (s *License) GetType__() bindings.BindingType { + return LicenseBindingType() +} + +func (s *License) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for License._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Licenses queries result +type LicensesListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Licenses Results + Results []License +} + +func (s *LicensesListResult) GetType__() bindings.BindingType { + return LicensesListResultBindingType() +} + +func (s *LicensesListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LicensesListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A line chart plotting configuration. +type LineChartPlotConfiguration struct { + // Allow maximize capability for this widget + AllowMaximize *bool + // If the condition is met then the given chart config is applied to the widget configuration. + Condition *string + // Fill the line chart area with a gradient series color. + FillGradientArea *bool + // Specifies the number of series to be displayed in a line chart. If no value is provided all the series will be displayed. format: int32 + NumOfSeriesToDisplay *int64 + // Used for displaying the curved lines for a series in a line chart. By default, straight line is used to for a series in a line chart. + ShowCurvedLines *bool + // Show the data in tooltip. + ShowDataInTooltip *bool + // Controls the visiblity of the data points on the line chart. If value is set to false data points wont be high- lighted on the lines. + ShowDataPoints *bool + // Controls the visiblity of the grid lines in line chart. + ShowGridLines *bool + // Controls the visiblity of the grouped tooltip in a line chart across all series. + ShowGroupedTooltip *bool + // Controls the visiblity of the min and max value across line series in line chart. + ShowMinMaxOnSeries *bool + // Show the data unit in tooltip. + ShowUnitInTooltip *bool + // Sort the data in grouped tooltip. + SortDataInGroupedTooltip *bool + // Specifies whether the series should be sorted by the latest data point. + SortSeries *bool +} + +func (s *LineChartPlotConfiguration) GetType__() bindings.BindingType { + return LineChartPlotConfigurationBindingType() +} + +func (s *LineChartPlotConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LineChartPlotConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Base class for list results from collections +type ListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string +} + +func (s *ListResult) GetType__() bindings.BindingType { + return ListResultBindingType() +} + +func (s *ListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Parameters that affect how list results are processed +type ListResultQueryParameters struct { + // Comma-separated field names to include in query result + Fields *string +} + +func (s *ListResultQueryParameters) GetType__() bindings.BindingType { + return ListResultQueryParametersBindingType() +} + +func (s *ListResultQueryParameters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ListResultQueryParameters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LiveTraceActionConfig struct { + PktcapConfig *PktcapActionConfig + TraceConfig *TraceActionConfig +} + +func (s *LiveTraceActionConfig) GetType__() bindings.BindingType { + return LiveTraceActionConfigBindingType() +} + +func (s *LiveTraceActionConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LiveTraceActionConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LiveTraceFilterData struct { + // Possible values are: + // + // * LiveTraceFilterData#LiveTraceFilterData_RESOURCE_TYPE_FIELDSFILTERDATA + // * LiveTraceFilterData#LiveTraceFilterData_RESOURCE_TYPE_PLAINFILTERDATA + // + // Filter type + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LiveTraceFilterData__TYPE_IDENTIFIER = "LiveTraceFilterData" +const LiveTraceFilterData_RESOURCE_TYPE_FIELDSFILTERDATA = "FieldsFilterData" +const LiveTraceFilterData_RESOURCE_TYPE_PLAINFILTERDATA = "PlainFilterData" + +func (s *LiveTraceFilterData) GetType__() bindings.BindingType { + return LiveTraceFilterDataBindingType() +} + +func (s *LiveTraceFilterData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LiveTraceFilterData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LiveTraceFilterInvalidInfo struct { + Filter *data.StructValue + // The description of why the filter is rejected by the transport node. + Reason *string +} + +func (s *LiveTraceFilterInvalidInfo) GetType__() bindings.BindingType { + return LiveTraceFilterInvalidInfoBindingType() +} + +func (s *LiveTraceFilterInvalidInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LiveTraceFilterInvalidInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LiveTraceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Livetrace status list + Results []LiveTraceStatus +} + +func (s *LiveTraceListResult) GetType__() bindings.BindingType { + return LiveTraceListResultBindingType() +} + +func (s *LiveTraceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LiveTraceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LiveTraceRequest struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + Actions *LiveTraceActionConfig + Filter *data.StructValue + // Source logical port + SourceLport *string + // Timeout in seconds for livetrace session format: int64 + Timeout *int64 +} + +func (s *LiveTraceRequest) GetType__() bindings.BindingType { + return LiveTraceRequestBindingType() +} + +func (s *LiveTraceRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LiveTraceRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LiveTraceResult struct { + // The id is assigned by Livetrace and cannot be specified by user. + Id *string + // PktCap action results + PktcapResults []PktCapResult + // Trace action observation list results + TraceResults []TraceResult +} + +func (s *LiveTraceResult) GetType__() bindings.BindingType { + return LiveTraceResultBindingType() +} + +func (s *LiveTraceResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LiveTraceResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LiveTraceStatus struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + Actions *LiveTraceActionConfig + Filter *data.StructValue + // The detail of invalid filter(s) in a Livetrace session. This field is only applicable for filters of PlainFilterData type. + FilterInvalidInfo []LiveTraceFilterInvalidInfo + // Possible values are: + // + // * LiveTraceStatus#LiveTraceStatus_INVALIDATION_REASON_PORT_DISCONNECT + // * LiveTraceStatus#LiveTraceStatus_INVALIDATION_REASON_DP_DESTROY + // * LiveTraceStatus#LiveTraceStatus_INVALIDATION_REASON_UNKNOWN + // * LiveTraceStatus#LiveTraceStatus_INVALIDATION_REASON_PCAP_IO_FAILURE + // + // The reason of invalidating a Livetrace session. PORT_DISCONNECT - Source or destination logical port of the session is disconnected. DP_DESTROY - Dataplane is destroyed. UNKNOWN - The invalidation reason cannot be determined. PCAP_IO_FAILURE - Exception occurred when writing captured packets to file. In general, this issue could be caused by insufficient disk partition space of /tmp on ESXi or Edge. + InvalidationReason *string + // Possible values are: + // + // * LiveTraceStatus#LiveTraceStatus_OPERATION_STATE_IN_PROGRESS + // * LiveTraceStatus#LiveTraceStatus_OPERATION_STATE_FINISHED + // * LiveTraceStatus#LiveTraceStatus_OPERATION_STATE_PARTIAL_FINISHED + // * LiveTraceStatus#LiveTraceStatus_OPERATION_STATE_CANCELED + // * LiveTraceStatus#LiveTraceStatus_OPERATION_STATE_INVALIDATED + // * LiveTraceStatus#LiveTraceStatus_OPERATION_STATE_TIMEOUT + // + // The operation state of Livetrace. IN_PROGRESS - collecting the session results. FINISHED - session results collection completes. PARTIAL_FINISHED - session results may be incomplete. CANCELED - session is cancelled by exception. INVALIDATED - session is invalidated by configuration changes such as VM migration. TIMEOUT - session is not completed on time. + OperationState *string + // Possible values are: + // + // * LiveTraceStatus#LiveTraceStatus_REQUEST_STATUS_SUCCESS_DELIVERED + // * LiveTraceStatus#LiveTraceStatus_REQUEST_STATUS_LCP_FAILURE + // * LiveTraceStatus#LiveTraceStatus_REQUEST_STATUS_INVALID_FILTER + // * LiveTraceStatus#LiveTraceStatus_REQUEST_STATUS_DATAPATH_FAILURE + // * LiveTraceStatus#LiveTraceStatus_REQUEST_STATUS_CONNECTION_ERROR + // * LiveTraceStatus#LiveTraceStatus_REQUEST_STATUS_TIMEOUT + // * LiveTraceStatus#LiveTraceStatus_REQUEST_STATUS_UNKNOWN + // + // The status of a Livetrace request. SUCCESS_DELIVERED - The request is delivered successfully. LCP_FAILURE - LCP agent fails to realize the request. INVALID_FILTER - Filter is invalid. DATAPATH_FAILURE - Dataplane fails to realize the request. TIMEOUT - The response to the request is not received within timeout. CONNECTION_ERROR - There is connection error between host components. UNKNOWN - The status of request cannot be determined. + RequestStatus *string + // The source logical port + SourceLport *string + // Timeout in seconds for livetrace session format: int64 + Timeout *int64 +} + +const LiveTraceStatus_INVALIDATION_REASON_PORT_DISCONNECT = "PORT_DISCONNECT" +const LiveTraceStatus_INVALIDATION_REASON_DP_DESTROY = "DP_DESTROY" +const LiveTraceStatus_INVALIDATION_REASON_UNKNOWN = "UNKNOWN" +const LiveTraceStatus_INVALIDATION_REASON_PCAP_IO_FAILURE = "PCAP_IO_FAILURE" +const LiveTraceStatus_OPERATION_STATE_IN_PROGRESS = "IN_PROGRESS" +const LiveTraceStatus_OPERATION_STATE_FINISHED = "FINISHED" +const LiveTraceStatus_OPERATION_STATE_PARTIAL_FINISHED = "PARTIAL_FINISHED" +const LiveTraceStatus_OPERATION_STATE_CANCELED = "CANCELED" +const LiveTraceStatus_OPERATION_STATE_INVALIDATED = "INVALIDATED" +const LiveTraceStatus_OPERATION_STATE_TIMEOUT = "TIMEOUT" +const LiveTraceStatus_REQUEST_STATUS_SUCCESS_DELIVERED = "SUCCESS_DELIVERED" +const LiveTraceStatus_REQUEST_STATUS_LCP_FAILURE = "LCP_FAILURE" +const LiveTraceStatus_REQUEST_STATUS_INVALID_FILTER = "INVALID_FILTER" +const LiveTraceStatus_REQUEST_STATUS_DATAPATH_FAILURE = "DATAPATH_FAILURE" +const LiveTraceStatus_REQUEST_STATUS_CONNECTION_ERROR = "CONNECTION_ERROR" +const LiveTraceStatus_REQUEST_STATUS_TIMEOUT = "TIMEOUT" +const LiveTraceStatus_REQUEST_STATUS_UNKNOWN = "UNKNOWN" + +func (s *LiveTraceStatus) GetType__() bindings.BindingType { + return LiveTraceStatusBindingType() +} + +func (s *LiveTraceStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LiveTraceStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Host Switch for LLDP +type LldpHostSwitchProfile struct { + // Enabled or disabled sending LLDP packets + SendEnabled *bool + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * BaseHostSwitchProfile#BaseHostSwitchProfile_RESOURCE_TYPE_UPLINKHOSTSWITCHPROFILE + // * BaseHostSwitchProfile#BaseHostSwitchProfile_RESOURCE_TYPE_LLDPHOSTSWITCHPROFILE + // * BaseHostSwitchProfile#BaseHostSwitchProfile_RESOURCE_TYPE_NIOCPROFILE + // * BaseHostSwitchProfile#BaseHostSwitchProfile_RESOURCE_TYPE_EXTRACONFIGHOSTSWITCHPROFILE + // + // Supported HostSwitch profiles. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + RequiredCapabilities []string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LldpHostSwitchProfile__TYPE_IDENTIFIER = "LldpHostSwitchProfile" + +func (s *LldpHostSwitchProfile) GetType__() bindings.BindingType { + return LldpHostSwitchProfileBindingType() +} + +func (s *LldpHostSwitchProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LldpHostSwitchProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LoadBalancerAllocationPool struct { + // Possible values are: + // + // * LoadBalancerAllocationPool#LoadBalancerAllocationPool_ALLOCATION_SIZE_SMALL + // * LoadBalancerAllocationPool#LoadBalancerAllocationPool_ALLOCATION_SIZE_MEDIUM + // * LoadBalancerAllocationPool#LoadBalancerAllocationPool_ALLOCATION_SIZE_LARGE + // * LoadBalancerAllocationPool#LoadBalancerAllocationPool_ALLOCATION_SIZE_XLARGE + // + // To address varied customer performance and scalability requirements, different sizes for load balancer service are supported: SMALL, MEDIUM, LARGE and XLARGE, each with its own set of resource and performance. Specify size of load balancer service which you will bind to TIER1 router. + AllocationSize *string + // Possible values are: + // + // * EdgeClusterMemberAllocationPool#EdgeClusterMemberAllocationPool_ALLOCATION_POOL_TYPE_LOADBALANCERALLOCATIONPOOL + // + // Types of logical router allocation pool based on services + AllocationPoolType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LoadBalancerAllocationPool__TYPE_IDENTIFIER = "LoadBalancerAllocationPool" +const LoadBalancerAllocationPool_ALLOCATION_SIZE_SMALL = "SMALL" +const LoadBalancerAllocationPool_ALLOCATION_SIZE_MEDIUM = "MEDIUM" +const LoadBalancerAllocationPool_ALLOCATION_SIZE_LARGE = "LARGE" +const LoadBalancerAllocationPool_ALLOCATION_SIZE_XLARGE = "XLARGE" + +func (s *LoadBalancerAllocationPool) GetType__() bindings.BindingType { + return LoadBalancerAllocationPoolBindingType() +} + +func (s *LoadBalancerAllocationPool) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LoadBalancerAllocationPool._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Local site with federation id and epoch. +type LocalSiteConfiguration struct { + // Epoch format: int64 + Epoch *int64 + // Federation id + Id *string + Site *FederationSite +} + +func (s *LocalSiteConfiguration) GetType__() bindings.BindingType { + return LocalSiteConfigurationBindingType() +} + +func (s *LocalSiteConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LocalSiteConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Service properties +type LoggingServiceProperties struct { + // Possible values are: + // + // * LoggingServiceProperties#LoggingServiceProperties_LOGGING_LEVEL_OFF + // * LoggingServiceProperties#LoggingServiceProperties_LOGGING_LEVEL_FATAL + // * LoggingServiceProperties#LoggingServiceProperties_LOGGING_LEVEL_ERROR + // * LoggingServiceProperties#LoggingServiceProperties_LOGGING_LEVEL_WARN + // * LoggingServiceProperties#LoggingServiceProperties_LOGGING_LEVEL_INFO + // * LoggingServiceProperties#LoggingServiceProperties_LOGGING_LEVEL_DEBUG + // * LoggingServiceProperties#LoggingServiceProperties_LOGGING_LEVEL_TRACE + // + // Service logging level + LoggingLevel *string + // Modified package logging levels + ModifiedPackageLoggingLevels *string + // Package logging levels + PackageLoggingLevel []PackageLoggingLevels +} + +const LoggingServiceProperties_LOGGING_LEVEL_OFF = "OFF" +const LoggingServiceProperties_LOGGING_LEVEL_FATAL = "FATAL" +const LoggingServiceProperties_LOGGING_LEVEL_ERROR = "ERROR" +const LoggingServiceProperties_LOGGING_LEVEL_WARN = "WARN" +const LoggingServiceProperties_LOGGING_LEVEL_INFO = "INFO" +const LoggingServiceProperties_LOGGING_LEVEL_DEBUG = "DEBUG" +const LoggingServiceProperties_LOGGING_LEVEL_TRACE = "TRACE" + +func (s *LoggingServiceProperties) GetType__() bindings.BindingType { + return LoggingServicePropertiesBindingType() +} + +func (s *LoggingServiceProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LoggingServiceProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Contains migration related information about logical constructs +type LogicalConstructMigrationStats struct { + // Federation site id. + SiteId *string + // Number of objects of source type. + SourceCount *string + // Type of the vSphere object (e.g. dvportgroup). + SourceType *string + // Number of objects of target type. + TargetCount *string + // Type of the Policy object corresponding to the source type (e.g. Segment). + TargetType *string + // Functional area that this vSphere object falls into + Vertical *string +} + +func (s *LogicalConstructMigrationStats) GetType__() bindings.BindingType { + return LogicalConstructMigrationStatsBindingType() +} + +func (s *LogicalConstructMigrationStats) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalConstructMigrationStats._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalConstructMigrationStatsListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged collection of migration stats for logical constructs + Results []LogicalConstructMigrationStats +} + +func (s *LogicalConstructMigrationStatsListResult) GetType__() bindings.BindingType { + return LogicalConstructMigrationStatsListResultBindingType() +} + +func (s *LogicalConstructMigrationStatsListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalConstructMigrationStatsListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Definition of a logical DHCP server which can be attached a logical switch via a logical port. Both ipv4_dhcp_server and ipv6_dhcp_server can be configured at the same time, or only configure either ipv4_dhcp_server or ipv6_dhcp_server. +type LogicalDhcpServer struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The uuid of the attached logical port. Read only. + AttachedLogicalPortId *string + // The DHCP profile uuid the logical DHCP server references. + DhcpProfileId *string + Ipv4DhcpServer *IPv4DhcpServer + Ipv6DhcpServer *IPv6DhcpServer +} + +func (s *LogicalDhcpServer) GetType__() bindings.BindingType { + return LogicalDhcpServerBindingType() +} + +func (s *LogicalDhcpServer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalDhcpServer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A paginated list of logical DHCP servers. +type LogicalDhcpServerListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // A paginated list of logical DHCP servers. + Results []LogicalDhcpServer +} + +func (s *LogicalDhcpServerListResult) GetType__() bindings.BindingType { + return LogicalDhcpServerListResultBindingType() +} + +func (s *LogicalDhcpServerListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalDhcpServerListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalPort struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Each address binding must contain both an IPElement and MAC address. VLAN ID is optional. This binding configuration can be used by features such as spoof-guard and overrides any discovered bindings. Any non unique entries are deduplicated to generate a unique set of address bindings and then stored. For IP addresses, a subnet address cannot have host bits set. A maximum of 128 unique address bindings is allowed per port. + AddressBindings []PacketAddressClassifier + // Possible values are: + // + // * LogicalPort#LogicalPort_ADMIN_STATE_UP + // * LogicalPort#LogicalPort_ADMIN_STATE_DOWN + // + // Represents Desired state of the logical port + AdminState *string + Attachment *LogicalPortAttachment + // This property could be used for vendor specific configuration in key value string pairs. Logical port setting will override logical switch setting if the same key was set on both logical switch and logical port. + ExtraConfigs []ExtraConfig + // IP Discovery module uses various mechanisms to discover address bindings being used on each port. If a user would like to ignore any specific discovered address bindings or prevent the discovery of a particular set of discovered bindings, then those address bindings can be provided here. Currently IP range in CIDR format is not supported. + IgnoreAddressBindings []PacketAddressClassifier + // Possible values are: + // + // * LogicalPort#LogicalPort_INIT_STATE_UNBLOCKED_VLAN + // * LogicalPort#LogicalPort_INIT_STATE_RESTORE_VIF + // + // Set initial state when a new logical port is created. 'UNBLOCKED_VLAN' means new port will be unblocked on traffic in creation, also VLAN will be set with corresponding logical switch setting. This port setting can only be configured at port creation (POST), and cannot be modified. 'RESTORE_VIF' fetches and restores VIF attachment from ESX host. + InitState *string + // The internal_id of the logical port may or may not be identical to it's managed resource ID. If a VirtualMachine connected to logical port migrates from one site to another, then on the destination site, it will be connected to different logical port managed resource. However, the internal_id field will be persisted across vmotion. + InternalId *string + // Id of the Logical switch that this port belongs to. + LogicalSwitchId *string + // ID populated by NSX when NSX on DVPG is used to indicate the source distributed virtual port and the corresponding distributed virtual switch. This ID is populated only for logical ports that belong to a logical switch of type DVPG. + OriginId *string + SwitchingProfileIds []SwitchingProfileTypeIdEntry +} + +const LogicalPort_ADMIN_STATE_UP = "UP" +const LogicalPort_ADMIN_STATE_DOWN = "DOWN" +const LogicalPort_INIT_STATE_UNBLOCKED_VLAN = "UNBLOCKED_VLAN" +const LogicalPort_INIT_STATE_RESTORE_VIF = "RESTORE_VIF" + +func (s *LogicalPort) GetType__() bindings.BindingType { + return LogicalPortBindingType() +} + +func (s *LogicalPort) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalPort._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Logical port attachment +type LogicalPortAttachment struct { + // Possible values are: + // + // * LogicalPortAttachment#LogicalPortAttachment_ATTACHMENT_TYPE_VIF + // * LogicalPortAttachment#LogicalPortAttachment_ATTACHMENT_TYPE_LOGICALROUTER + // * LogicalPortAttachment#LogicalPortAttachment_ATTACHMENT_TYPE_BRIDGEENDPOINT + // * LogicalPortAttachment#LogicalPortAttachment_ATTACHMENT_TYPE_DHCP_SERVICE + // * LogicalPortAttachment#LogicalPortAttachment_ATTACHMENT_TYPE_METADATA_PROXY + // * LogicalPortAttachment#LogicalPortAttachment_ATTACHMENT_TYPE_L2VPN_SESSION + // * LogicalPortAttachment#LogicalPortAttachment_ATTACHMENT_TYPE_L2FORWARDER + // + // Indicates the type of logical port attachment. By default it is Virtual Machine interface (VIF) + AttachmentType *string + Context *data.StructValue + // Identifier of the interface attached to the logical port + Id *string +} + +const LogicalPortAttachment_ATTACHMENT_TYPE_VIF = "VIF" +const LogicalPortAttachment_ATTACHMENT_TYPE_LOGICALROUTER = "LOGICALROUTER" +const LogicalPortAttachment_ATTACHMENT_TYPE_BRIDGEENDPOINT = "BRIDGEENDPOINT" +const LogicalPortAttachment_ATTACHMENT_TYPE_DHCP_SERVICE = "DHCP_SERVICE" +const LogicalPortAttachment_ATTACHMENT_TYPE_METADATA_PROXY = "METADATA_PROXY" +const LogicalPortAttachment_ATTACHMENT_TYPE_L2VPN_SESSION = "L2VPN_SESSION" +const LogicalPortAttachment_ATTACHMENT_TYPE_L2FORWARDER = "L2FORWARDER" + +func (s *LogicalPortAttachment) GetType__() bindings.BindingType { + return LogicalPortAttachmentBindingType() +} + +func (s *LogicalPortAttachment) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalPortAttachment._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// VIF attachment state of a logical port +type LogicalPortAttachmentState struct { + // VM or vmknic entities that are attached to the LogicalPort + Attachers []PortAttacher + // VIF ID + Id *string + // Possible values are: + // + // * LogicalPortAttachmentState#LogicalPortAttachmentState_STATE_FREE + // * LogicalPortAttachmentState#LogicalPortAttachmentState_STATE_ATTACHED + // * LogicalPortAttachmentState#LogicalPortAttachmentState_STATE_ATTACHED_PENDING_CONF + // * LogicalPortAttachmentState#LogicalPortAttachmentState_STATE_ATTACHED_IN_MOTION + // * LogicalPortAttachmentState#LogicalPortAttachmentState_STATE_DETACHED + // + // A logicalPort must be in one of following state. FREE - If there are no active attachers. The LogicalPort may or may not have an attachment ID configured on it. This state is applicable only to LogialPort of static type. ATTACHED - LogicalPort has exactly one active attacher and no further configuration is pending. ATTACHED_PENDING_CONF - LogicalPort has exactly one attacher, however it may not have been configured completely. Additional configuration will be provided by other nsx components. ATTACHED_IN_MOTION - LogicalPort has multiple active attachers. This state represents a scenario where VM is moving from one location (host or storage) to another (e.g. vmotion, vSphere HA) DETACHED - A temporary state after all LogialPort attachers have been detached. This state is applicable only to LogicalPort of ephemeral type and the LogicalPort will soon be deleted. + State *string +} + +const LogicalPortAttachmentState_STATE_FREE = "FREE" +const LogicalPortAttachmentState_STATE_ATTACHED = "ATTACHED" +const LogicalPortAttachmentState_STATE_ATTACHED_PENDING_CONF = "ATTACHED_PENDING_CONF" +const LogicalPortAttachmentState_STATE_ATTACHED_IN_MOTION = "ATTACHED_IN_MOTION" +const LogicalPortAttachmentState_STATE_DETACHED = "DETACHED" + +func (s *LogicalPortAttachmentState) GetType__() bindings.BindingType { + return LogicalPortAttachmentStateBindingType() +} + +func (s *LogicalPortAttachmentState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalPortAttachmentState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Logical port queries result +type LogicalPortListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // LogicalPort Results + Results []LogicalPort +} + +func (s *LogicalPortListResult) GetType__() bindings.BindingType { + return LogicalPortListResultBindingType() +} + +func (s *LogicalPortListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalPortListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalPortMacAddressCsvListResult struct { + // File name set by HTTP server if API returns CSV result as a file. + FileName *string + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + Results []LogicalPortMacTableCsvEntry +} + +func (s *LogicalPortMacAddressCsvListResult) GetType__() bindings.BindingType { + return LogicalPortMacAddressCsvListResultBindingType() +} + +func (s *LogicalPortMacAddressCsvListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalPortMacAddressCsvListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalPortMacAddressListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // The id of the logical port + LogicalPortId *string + Results []LogicalPortMacTableEntry + // Transport node identifier + TransportNodeId *string +} + +func (s *LogicalPortMacAddressListResult) GetType__() bindings.BindingType { + return LogicalPortMacAddressListResultBindingType() +} + +func (s *LogicalPortMacAddressListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalPortMacAddressListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalPortMacTableCsvEntry struct { + // The MAC address + MacAddress *string + // Possible values are: + // + // * LogicalPortMacTableCsvEntry#LogicalPortMacTableCsvEntry_MAC_TYPE_STATIC + // * LogicalPortMacTableCsvEntry#LogicalPortMacTableCsvEntry_MAC_TYPE_LEARNED + // + // The type of the MAC address + MacType *string +} + +const LogicalPortMacTableCsvEntry_MAC_TYPE_STATIC = "STATIC" +const LogicalPortMacTableCsvEntry_MAC_TYPE_LEARNED = "LEARNED" + +func (s *LogicalPortMacTableCsvEntry) GetType__() bindings.BindingType { + return LogicalPortMacTableCsvEntryBindingType() +} + +func (s *LogicalPortMacTableCsvEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalPortMacTableCsvEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalPortMacTableEntry struct { + // The MAC address + MacAddress *string + // Possible values are: + // + // * LogicalPortMacTableEntry#LogicalPortMacTableEntry_MAC_TYPE_STATIC + // * LogicalPortMacTableEntry#LogicalPortMacTableEntry_MAC_TYPE_LEARNED + // + // The type of the MAC address + MacType *string +} + +const LogicalPortMacTableEntry_MAC_TYPE_STATIC = "STATIC" +const LogicalPortMacTableEntry_MAC_TYPE_LEARNED = "LEARNED" + +func (s *LogicalPortMacTableEntry) GetType__() bindings.BindingType { + return LogicalPortMacTableEntryBindingType() +} + +func (s *LogicalPortMacTableEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalPortMacTableEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalPortMirrorDestination struct { + // Destination logical port identifier list. + PortIds []string + // Possible values are: + // + // * MirrorDestination#MirrorDestination_RESOURCE_TYPE_LOGICALPORTMIRRORDESTINATION + // * MirrorDestination#MirrorDestination_RESOURCE_TYPE_PNICMIRRORDESTINATION + // * MirrorDestination#MirrorDestination_RESOURCE_TYPE_IPMIRRORDESTINATION + // + // Resource types of mirror destination + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LogicalPortMirrorDestination__TYPE_IDENTIFIER = "LogicalPortMirrorDestination" + +func (s *LogicalPortMirrorDestination) GetType__() bindings.BindingType { + return LogicalPortMirrorDestinationBindingType() +} + +func (s *LogicalPortMirrorDestination) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalPortMirrorDestination._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalPortMirrorSource struct { + // Source logical port identifier list + PortIds []string + // Possible values are: + // + // * MirrorSource#MirrorSource_RESOURCE_TYPE_LOGICALPORTMIRRORSOURCE + // * MirrorSource#MirrorSource_RESOURCE_TYPE_PNICMIRRORSOURCE + // * MirrorSource#MirrorSource_RESOURCE_TYPE_VLANMIRRORSOURCE + // * MirrorSource#MirrorSource_RESOURCE_TYPE_LOGICALSWITCHMIRRORSOURCE + // + // Resource types of mirror source + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LogicalPortMirrorSource__TYPE_IDENTIFIER = "LogicalPortMirrorSource" + +func (s *LogicalPortMirrorSource) GetType__() bindings.BindingType { + return LogicalPortMirrorSourceBindingType() +} + +func (s *LogicalPortMirrorSource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalPortMirrorSource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalPortOperationalStatus struct { + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // The id of the logical port + LogicalPortId *string + // Possible values are: + // + // * LogicalPortOperationalStatus#LogicalPortOperationalStatus_STATUS_UP + // * LogicalPortOperationalStatus#LogicalPortOperationalStatus_STATUS_DOWN + // * LogicalPortOperationalStatus#LogicalPortOperationalStatus_STATUS_UNKNOWN + // + // The Operational status of the logical port + Status *string +} + +const LogicalPortOperationalStatus_STATUS_UP = "UP" +const LogicalPortOperationalStatus_STATUS_DOWN = "DOWN" +const LogicalPortOperationalStatus_STATUS_UNKNOWN = "UNKNOWN" + +func (s *LogicalPortOperationalStatus) GetType__() bindings.BindingType { + return LogicalPortOperationalStatusBindingType() +} + +func (s *LogicalPortOperationalStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalPortOperationalStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Contians realized state of the logical port. For example, transport node on which the port is located, discovered and realized address bindings of the logical port. +type LogicalPortState struct { + Attachment *LogicalPortAttachmentState + // Contains the list of address bindings for a logical port that were automatically dicovered using various snooping methods like ARP, DHCP etc. + DiscoveredBindings []AddressBindingEntry + // If any address binding discovered on the port is also found on other port on the same logical switch, then it is included in the duplicate bindings list along with the ID of the port with which it conflicts. + DuplicateBindings []DuplicateAddressBindingEntry + // Id of the logical port + Id *string + // List of logical port bindings that are realized. This list may be populated from the discovered bindings or manual user specified bindings. This binding configuration can be used by features such as firewall, spoof-guard, traceflow etc. + RealizedBindings []AddressBindingEntry + // Identifiers of the transport node where the port is located + TransportNodeIds []string +} + +func (s *LogicalPortState) GetType__() bindings.BindingType { + return LogicalPortStateBindingType() +} + +func (s *LogicalPortState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalPortState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalPortStatistics struct { + RxBytes *DataCounter + RxPackets *DataCounter + TxBytes *DataCounter + TxPackets *DataCounter + DroppedBySecurityPackets *PacketsDroppedBySecurity + MacLearning *MacLearningCounters + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // The id of the logical port + LogicalPortId *string +} + +func (s *LogicalPortStatistics) GetType__() bindings.BindingType { + return LogicalPortStatisticsBindingType() +} + +func (s *LogicalPortStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalPortStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalPortStatusSummary struct { + // The filters used to find the logical ports- TransportZone id, LogicalSwitch id or LogicalSwitchProfile id + Filters []Filter + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // The total number of logical ports. format: int64 + TotalPorts *int64 + // The number of logical ports whose Operational status is UP format: int64 + UpPorts *int64 +} + +func (s *LogicalPortStatusSummary) GetType__() bindings.BindingType { + return LogicalPortStatusSummaryBindingType() +} + +func (s *LogicalPortStatusSummary) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalPortStatusSummary._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalRouter struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + AdvancedConfig *LogicalRouterConfig + AllocationProfile *EdgeClusterMemberAllocationProfile + // Used for tier0 routers + EdgeClusterId *string + // For stateful services, the logical router should be associated with edge cluster. For TIER 1 logical router, for manual placement of service router within the cluster, edge cluster member indices needs to be provided else same will be auto-allocated. You can provide maximum two indices for HA ACTIVE_STANDBY. For TIER0 logical router this property is no use and placement is derived from logical router uplink or loopback port. format: int64 + EdgeClusterMemberIndices []int64 + // Possible values are: + // + // * LogicalRouter#LogicalRouter_FAILOVER_MODE_PREEMPTIVE + // * LogicalRouter#LogicalRouter_FAILOVER_MODE_NON_PREEMPTIVE + // + // Determines the behavior when a logical router instance restarts after a failure. If set to PREEMPTIVE, the preferred node will take over, even if it causes another failure. If set to NON_PREEMPTIVE, then the instance that restarted will remain secondary. This property must not be populated unless the high_availability_mode property is set to ACTIVE_STANDBY. If high_availability_mode property is set to ACTIVE_STANDBY and this property is not specified then default will be NON_PREEMPTIVE. + FailoverMode *string + // List of Firewall sections related to Logical Router. + FirewallSections []ResourceReference + // Possible values are: + // + // * LogicalRouter#LogicalRouter_HIGH_AVAILABILITY_MODE_ACTIVE + // * LogicalRouter#LogicalRouter_HIGH_AVAILABILITY_MODE_STANDBY + // + // High availability mode + HighAvailabilityMode *string + Ipv6Profiles *IPv6Profiles + // Preferred edge cluster member index which is required for PREEMPTIVE failover mode. Used for Tier0 routers only. format: int64 + PreferredEdgeClusterMemberIndex *int64 + // Possible values are: + // + // * LogicalRouter#LogicalRouter_ROUTER_TYPE_TIER0 + // * LogicalRouter#LogicalRouter_ROUTER_TYPE_TIER1 + // * LogicalRouter#LogicalRouter_ROUTER_TYPE_VRF + // + // TIER0 for external connectivity. TIER1 for two tier topology with TIER0 on top. VRF for isolation of routing table on TIER0. + RouterType *string +} + +const LogicalRouter_FAILOVER_MODE_PREEMPTIVE = "PREEMPTIVE" +const LogicalRouter_FAILOVER_MODE_NON_PREEMPTIVE = "NON_PREEMPTIVE" +const LogicalRouter_HIGH_AVAILABILITY_MODE_ACTIVE = "ACTIVE_ACTIVE" +const LogicalRouter_HIGH_AVAILABILITY_MODE_STANDBY = "ACTIVE_STANDBY" +const LogicalRouter_ROUTER_TYPE_TIER0 = "TIER0" +const LogicalRouter_ROUTER_TYPE_TIER1 = "TIER1" +const LogicalRouter_ROUTER_TYPE_VRF = "VRF" + +func (s *LogicalRouter) GetType__() bindings.BindingType { + return LogicalRouterBindingType() +} + +func (s *LogicalRouter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This port can be configured on both TIER0 and TIER1 logical router. Port can be connected to VLAN or overlay logical switch. Unlike downlink port it does not participate in distributed routing and hosted on all edge cluster members associated with logical router. Stateful services can be applied on this port. +type LogicalRouterCentralizedServicePort struct { + // Port is exclusively used for N-S service insertion + EnableNetx *bool + LinkedLogicalSwitchPortId *ResourceReference + // Maximum transmission unit specifies the size of the largest packet that a network protocol can transmit. If not specified, the global logical MTU set in the /api/v1/global-configs/RoutingGlobalConfig API will be used. format: int64 + Mtu *int64 + // Identifier of Neighbor Discovery Router Advertisement profile associated with port. When NDRA profile id is associated at both the port level and logical router level, the profile id specified at port level takes the precedence. + NdraProfileId *string + // Logical router port subnets + Subnets []IPSubnet + // Possible values are: + // + // * LogicalRouterCentralizedServicePort#LogicalRouterCentralizedServicePort_URPF_MODE_NONE + // * LogicalRouterCentralizedServicePort#LogicalRouterCentralizedServicePort_URPF_MODE_STRICT + // + // Unicast Reverse Path Forwarding mode + UrpfMode *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERUPLINKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERDOWNLINKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLINKPORTONTIER0 + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLINKPORTONTIER1 + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLOOPBACKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERIPTUNNELPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERCENTRALIZEDSERVICEPORT + // + // LogicalRouterUpLinkPort is allowed only on TIER0 logical router. It is the north facing port of the logical router. LogicalRouterLinkPortOnTIER0 is allowed only on TIER0 logical router. This is the port where the LogicalRouterLinkPortOnTIER1 of TIER1 logical router connects to. LogicalRouterLinkPortOnTIER1 is allowed only on TIER1 logical router. This is the port using which the user connected to TIER1 logical router for upwards connectivity via TIER0 logical router. Connect this port to the LogicalRouterLinkPortOnTIER0 of the TIER0 logical router. LogicalRouterDownLinkPort is for the connected subnets on the logical router. LogicalRouterLoopbackPort is a loopback port for logical router component which is placed on chosen edge cluster member. LogicalRouterIPTunnelPort is a IPSec VPN tunnel port created on logical router when route based VPN session configured. LogicalRouterCentralizedServicePort is allowed only on Active/Standby TIER0 and TIER1 logical router. Port can be connected to VLAN or overlay logical switch. Unlike downlink port it does not participate in distributed routing and hosted on all edge cluster members associated with logical router. Stateful services can be applied on this port. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Identifier for logical router on which this port is created + LogicalRouterId *string + // Service Bindings + ServiceBindings []ServiceBinding +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LogicalRouterCentralizedServicePort__TYPE_IDENTIFIER = "LogicalRouterCentralizedServicePort" +const LogicalRouterCentralizedServicePort_URPF_MODE_NONE = "NONE" +const LogicalRouterCentralizedServicePort_URPF_MODE_STRICT = "STRICT" + +func (s *LogicalRouterCentralizedServicePort) GetType__() bindings.BindingType { + return LogicalRouterCentralizedServicePortBindingType() +} + +func (s *LogicalRouterCentralizedServicePort) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterCentralizedServicePort._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Logical router configuration parameters. +type LogicalRouterConfig struct { + // CIDR block defining addresses for Tier0 to Tier1 links. If the value for this field is not provided, then it will be considered as default IPv4 CIDR \"100.64.0.0/16\" format: ip-cidr-block + ExternalTransitNetworks []string + // This configuration can be defined only for Active-Standby LogicalRouter to provide | redundancy. For mulitple uplink ports, multiple HaVipConfigs must be defined | and each config will pair exactly two uplink ports. The VIP will move and will | always be owned by the Active node. Note - when HaVipConfig[s] are defined, | configuring dynamic-routing is disallowed. + HaVipConfigs []HaVipConfig + // CIDR block defining service router to distributed router links. If the value for this field is not provided, then it will be considered as default IPv4 CIDR- \"169.254.0.0/28\" for logical router with ACTIVE_STANDBY HA mode \"169.254.0.0/24\" for logical router with ACTIVE_ACTIVE HA mode format: ipv4-cidr-block + InternalTransitNetwork *string + // Transport zone of the logical router. If specified then all downlink switches should belong to this transport zone and an error will be thrown if transport zone of the downlink switch doesn't match with this transport zone. All internal and external transit switches will be created in this transport zone. + TransportZoneId *string +} + +func (s *LogicalRouterConfig) GetType__() bindings.BindingType { + return LogicalRouterConfigBindingType() +} + +func (s *LogicalRouterConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalRouterDownLinkPort struct { + // If this flag is set to true - it will enable multicast on the downlink interface. If this flag is set to false - it will disable multicast on the downlink interface. This is supported only on Tier0 downlinks. Default value for Tier0 downlink will be true. + EnableMulticast *bool + LinkedLogicalSwitchPortId *ResourceReference + // MAC address + MacAddress *string + // Configuration to override the neighbor discovery router advertisement prefix time parameters at the subnet level. Note that users are allowed to override the prefix time only for IPv6 subnets which are configured on the port. + NdraPrefixConfig []NDRAPrefixConfig + // Identifier of Neighbor Discovery Router Advertisement profile associated with port. When NDRA profile id is associated at both the port level and logical router level, the profile id specified at port level takes the precedence. + NdraProfileId *string + // Routing policies used to specify how the traffic, which matches the policy routes, will be processed. + RoutingPolicies []RoutingPolicy + // Logical router port subnets + Subnets []IPSubnet + // Possible values are: + // + // * LogicalRouterDownLinkPort#LogicalRouterDownLinkPort_URPF_MODE_NONE + // * LogicalRouterDownLinkPort#LogicalRouterDownLinkPort_URPF_MODE_STRICT + // + // Unicast Reverse Path Forwarding mode + UrpfMode *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERUPLINKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERDOWNLINKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLINKPORTONTIER0 + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLINKPORTONTIER1 + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLOOPBACKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERIPTUNNELPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERCENTRALIZEDSERVICEPORT + // + // LogicalRouterUpLinkPort is allowed only on TIER0 logical router. It is the north facing port of the logical router. LogicalRouterLinkPortOnTIER0 is allowed only on TIER0 logical router. This is the port where the LogicalRouterLinkPortOnTIER1 of TIER1 logical router connects to. LogicalRouterLinkPortOnTIER1 is allowed only on TIER1 logical router. This is the port using which the user connected to TIER1 logical router for upwards connectivity via TIER0 logical router. Connect this port to the LogicalRouterLinkPortOnTIER0 of the TIER0 logical router. LogicalRouterDownLinkPort is for the connected subnets on the logical router. LogicalRouterLoopbackPort is a loopback port for logical router component which is placed on chosen edge cluster member. LogicalRouterIPTunnelPort is a IPSec VPN tunnel port created on logical router when route based VPN session configured. LogicalRouterCentralizedServicePort is allowed only on Active/Standby TIER0 and TIER1 logical router. Port can be connected to VLAN or overlay logical switch. Unlike downlink port it does not participate in distributed routing and hosted on all edge cluster members associated with logical router. Stateful services can be applied on this port. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Identifier for logical router on which this port is created + LogicalRouterId *string + // Service Bindings + ServiceBindings []ServiceBinding +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LogicalRouterDownLinkPort__TYPE_IDENTIFIER = "LogicalRouterDownLinkPort" +const LogicalRouterDownLinkPort_URPF_MODE_NONE = "NONE" +const LogicalRouterDownLinkPort_URPF_MODE_STRICT = "STRICT" + +func (s *LogicalRouterDownLinkPort) GetType__() bindings.BindingType { + return LogicalRouterDownLinkPortBindingType() +} + +func (s *LogicalRouterDownLinkPort) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterDownLinkPort._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Logical router IP tunnel port. +type LogicalRouterIPTunnelPort struct { + // Possible values are: + // + // * LogicalRouterIPTunnelPort#LogicalRouterIPTunnelPort_ADMIN_STATE_UP + // * LogicalRouterIPTunnelPort#LogicalRouterIPTunnelPort_ADMIN_STATE_DOWN + // + // Admin state of port. + AdminState *string + // Tunnel port subnets. + Subnets []IPSubnet + // Associated VPN session identifier. + VpnSessionId *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERUPLINKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERDOWNLINKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLINKPORTONTIER0 + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLINKPORTONTIER1 + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLOOPBACKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERIPTUNNELPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERCENTRALIZEDSERVICEPORT + // + // LogicalRouterUpLinkPort is allowed only on TIER0 logical router. It is the north facing port of the logical router. LogicalRouterLinkPortOnTIER0 is allowed only on TIER0 logical router. This is the port where the LogicalRouterLinkPortOnTIER1 of TIER1 logical router connects to. LogicalRouterLinkPortOnTIER1 is allowed only on TIER1 logical router. This is the port using which the user connected to TIER1 logical router for upwards connectivity via TIER0 logical router. Connect this port to the LogicalRouterLinkPortOnTIER0 of the TIER0 logical router. LogicalRouterDownLinkPort is for the connected subnets on the logical router. LogicalRouterLoopbackPort is a loopback port for logical router component which is placed on chosen edge cluster member. LogicalRouterIPTunnelPort is a IPSec VPN tunnel port created on logical router when route based VPN session configured. LogicalRouterCentralizedServicePort is allowed only on Active/Standby TIER0 and TIER1 logical router. Port can be connected to VLAN or overlay logical switch. Unlike downlink port it does not participate in distributed routing and hosted on all edge cluster members associated with logical router. Stateful services can be applied on this port. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Identifier for logical router on which this port is created + LogicalRouterId *string + // Service Bindings + ServiceBindings []ServiceBinding +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LogicalRouterIPTunnelPort__TYPE_IDENTIFIER = "LogicalRouterIPTunnelPort" +const LogicalRouterIPTunnelPort_ADMIN_STATE_UP = "UP" +const LogicalRouterIPTunnelPort_ADMIN_STATE_DOWN = "DOWN" + +func (s *LogicalRouterIPTunnelPort) GetType__() bindings.BindingType { + return LogicalRouterIPTunnelPortBindingType() +} + +func (s *LogicalRouterIPTunnelPort) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterIPTunnelPort._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This port can be configured only on a TIER0 LogicalRouter. Create an empty port to generate an id. Use this id in the linked_logical_router_port_id on LogicalRouterLinkPortOnTIER1 on TIER1 logical router. +type LogicalRouterLinkPortOnTIER0 struct { + // Identifier of connected LogicalRouterLinkPortOnTIER1 of TIER1 logical router + LinkedLogicalRouterPortId *string + // MAC address + MacAddress *string + // Logical router port subnets + Subnets []IPSubnet + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERUPLINKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERDOWNLINKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLINKPORTONTIER0 + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLINKPORTONTIER1 + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLOOPBACKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERIPTUNNELPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERCENTRALIZEDSERVICEPORT + // + // LogicalRouterUpLinkPort is allowed only on TIER0 logical router. It is the north facing port of the logical router. LogicalRouterLinkPortOnTIER0 is allowed only on TIER0 logical router. This is the port where the LogicalRouterLinkPortOnTIER1 of TIER1 logical router connects to. LogicalRouterLinkPortOnTIER1 is allowed only on TIER1 logical router. This is the port using which the user connected to TIER1 logical router for upwards connectivity via TIER0 logical router. Connect this port to the LogicalRouterLinkPortOnTIER0 of the TIER0 logical router. LogicalRouterDownLinkPort is for the connected subnets on the logical router. LogicalRouterLoopbackPort is a loopback port for logical router component which is placed on chosen edge cluster member. LogicalRouterIPTunnelPort is a IPSec VPN tunnel port created on logical router when route based VPN session configured. LogicalRouterCentralizedServicePort is allowed only on Active/Standby TIER0 and TIER1 logical router. Port can be connected to VLAN or overlay logical switch. Unlike downlink port it does not participate in distributed routing and hosted on all edge cluster members associated with logical router. Stateful services can be applied on this port. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Identifier for logical router on which this port is created + LogicalRouterId *string + // Service Bindings + ServiceBindings []ServiceBinding +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LogicalRouterLinkPortOnTIER0__TYPE_IDENTIFIER = "LogicalRouterLinkPortOnTIER0" + +func (s *LogicalRouterLinkPortOnTIER0) GetType__() bindings.BindingType { + return LogicalRouterLinkPortOnTIER0BindingType() +} + +func (s *LogicalRouterLinkPortOnTIER0) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterLinkPortOnTIER0._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This port can be configured only on a TIER1 LogicalRouter. Use the id of the LogicalRouterLinkPortOnTIER0 from TIER0 logical router to set the linked_logical_router_port_id on the port on TIER1 logical router. +type LogicalRouterLinkPortOnTIER1 struct { + // Please use logical router API to pass edge cluster members indexes manually. format: int64 + EdgeClusterMemberIndex []int64 + LinkedLogicalRouterPortId *ResourceReference + // MAC address + MacAddress *string + // Logical router port subnets + Subnets []IPSubnet + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERUPLINKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERDOWNLINKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLINKPORTONTIER0 + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLINKPORTONTIER1 + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLOOPBACKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERIPTUNNELPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERCENTRALIZEDSERVICEPORT + // + // LogicalRouterUpLinkPort is allowed only on TIER0 logical router. It is the north facing port of the logical router. LogicalRouterLinkPortOnTIER0 is allowed only on TIER0 logical router. This is the port where the LogicalRouterLinkPortOnTIER1 of TIER1 logical router connects to. LogicalRouterLinkPortOnTIER1 is allowed only on TIER1 logical router. This is the port using which the user connected to TIER1 logical router for upwards connectivity via TIER0 logical router. Connect this port to the LogicalRouterLinkPortOnTIER0 of the TIER0 logical router. LogicalRouterDownLinkPort is for the connected subnets on the logical router. LogicalRouterLoopbackPort is a loopback port for logical router component which is placed on chosen edge cluster member. LogicalRouterIPTunnelPort is a IPSec VPN tunnel port created on logical router when route based VPN session configured. LogicalRouterCentralizedServicePort is allowed only on Active/Standby TIER0 and TIER1 logical router. Port can be connected to VLAN or overlay logical switch. Unlike downlink port it does not participate in distributed routing and hosted on all edge cluster members associated with logical router. Stateful services can be applied on this port. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Identifier for logical router on which this port is created + LogicalRouterId *string + // Service Bindings + ServiceBindings []ServiceBinding +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LogicalRouterLinkPortOnTIER1__TYPE_IDENTIFIER = "LogicalRouterLinkPortOnTIER1" + +func (s *LogicalRouterLinkPortOnTIER1) GetType__() bindings.BindingType { + return LogicalRouterLinkPortOnTIER1BindingType() +} + +func (s *LogicalRouterLinkPortOnTIER1) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterLinkPortOnTIER1._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalRouterListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Logical router list results + Results []LogicalRouter +} + +func (s *LogicalRouterListResult) GetType__() bindings.BindingType { + return LogicalRouterListResultBindingType() +} + +func (s *LogicalRouterListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalRouterLoopbackPort struct { + // Member index of the edge node on the cluster format: int64 + EdgeClusterMemberIndex []int64 + // Loopback port subnets + Subnets []IPSubnet + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERUPLINKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERDOWNLINKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLINKPORTONTIER0 + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLINKPORTONTIER1 + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLOOPBACKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERIPTUNNELPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERCENTRALIZEDSERVICEPORT + // + // LogicalRouterUpLinkPort is allowed only on TIER0 logical router. It is the north facing port of the logical router. LogicalRouterLinkPortOnTIER0 is allowed only on TIER0 logical router. This is the port where the LogicalRouterLinkPortOnTIER1 of TIER1 logical router connects to. LogicalRouterLinkPortOnTIER1 is allowed only on TIER1 logical router. This is the port using which the user connected to TIER1 logical router for upwards connectivity via TIER0 logical router. Connect this port to the LogicalRouterLinkPortOnTIER0 of the TIER0 logical router. LogicalRouterDownLinkPort is for the connected subnets on the logical router. LogicalRouterLoopbackPort is a loopback port for logical router component which is placed on chosen edge cluster member. LogicalRouterIPTunnelPort is a IPSec VPN tunnel port created on logical router when route based VPN session configured. LogicalRouterCentralizedServicePort is allowed only on Active/Standby TIER0 and TIER1 logical router. Port can be connected to VLAN or overlay logical switch. Unlike downlink port it does not participate in distributed routing and hosted on all edge cluster members associated with logical router. Stateful services can be applied on this port. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Identifier for logical router on which this port is created + LogicalRouterId *string + // Service Bindings + ServiceBindings []ServiceBinding +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LogicalRouterLoopbackPort__TYPE_IDENTIFIER = "LogicalRouterLoopbackPort" + +func (s *LogicalRouterLoopbackPort) GetType__() bindings.BindingType { + return LogicalRouterLoopbackPortBindingType() +} + +func (s *LogicalRouterLoopbackPort) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterLoopbackPort._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalRouterPort struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERUPLINKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERDOWNLINKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLINKPORTONTIER0 + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLINKPORTONTIER1 + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLOOPBACKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERIPTUNNELPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERCENTRALIZEDSERVICEPORT + // + // LogicalRouterUpLinkPort is allowed only on TIER0 logical router. It is the north facing port of the logical router. LogicalRouterLinkPortOnTIER0 is allowed only on TIER0 logical router. This is the port where the LogicalRouterLinkPortOnTIER1 of TIER1 logical router connects to. LogicalRouterLinkPortOnTIER1 is allowed only on TIER1 logical router. This is the port using which the user connected to TIER1 logical router for upwards connectivity via TIER0 logical router. Connect this port to the LogicalRouterLinkPortOnTIER0 of the TIER0 logical router. LogicalRouterDownLinkPort is for the connected subnets on the logical router. LogicalRouterLoopbackPort is a loopback port for logical router component which is placed on chosen edge cluster member. LogicalRouterIPTunnelPort is a IPSec VPN tunnel port created on logical router when route based VPN session configured. LogicalRouterCentralizedServicePort is allowed only on Active/Standby TIER0 and TIER1 logical router. Port can be connected to VLAN or overlay logical switch. Unlike downlink port it does not participate in distributed routing and hosted on all edge cluster members associated with logical router. Stateful services can be applied on this port. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Identifier for logical router on which this port is created + LogicalRouterId *string + // Service Bindings + ServiceBindings []ServiceBinding +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LogicalRouterPort__TYPE_IDENTIFIER = "LogicalRouterPort" +const LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERUPLINKPORT = "LogicalRouterUpLinkPort" +const LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERDOWNLINKPORT = "LogicalRouterDownLinkPort" +const LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLINKPORTONTIER0 = "LogicalRouterLinkPortOnTIER0" +const LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLINKPORTONTIER1 = "LogicalRouterLinkPortOnTIER1" +const LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLOOPBACKPORT = "LogicalRouterLoopbackPort" +const LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERIPTUNNELPORT = "LogicalRouterIPTunnelPort" +const LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERCENTRALIZEDSERVICEPORT = "LogicalRouterCentralizedServicePort" + +func (s *LogicalRouterPort) GetType__() bindings.BindingType { + return LogicalRouterPortBindingType() +} + +func (s *LogicalRouterPort) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterPort._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalRouterPortArpCsvRecord struct { + // The IP address format: ip + Ip *string + // The MAC address + MacAddress *string +} + +func (s *LogicalRouterPortArpCsvRecord) GetType__() bindings.BindingType { + return LogicalRouterPortArpCsvRecordBindingType() +} + +func (s *LogicalRouterPortArpCsvRecord) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterPortArpCsvRecord._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalRouterPortArpEntry struct { + // The IP address format: ip + Ip *string + // The MAC address + MacAddress *string +} + +func (s *LogicalRouterPortArpEntry) GetType__() bindings.BindingType { + return LogicalRouterPortArpEntryBindingType() +} + +func (s *LogicalRouterPortArpEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterPortArpEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalRouterPortArpTable struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // The ID of the logical router port + LogicalRouterPortId *string + Results []LogicalRouterPortArpEntry +} + +func (s *LogicalRouterPortArpTable) GetType__() bindings.BindingType { + return LogicalRouterPortArpTableBindingType() +} + +func (s *LogicalRouterPortArpTable) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterPortArpTable._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalRouterPortArpTableInCsvFormat struct { + // File name set by HTTP server if API returns CSV result as a file. + FileName *string + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + Results []LogicalRouterPortArpCsvRecord +} + +func (s *LogicalRouterPortArpTableInCsvFormat) GetType__() bindings.BindingType { + return LogicalRouterPortArpTableInCsvFormatBindingType() +} + +func (s *LogicalRouterPortArpTableInCsvFormat) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterPortArpTableInCsvFormat._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalRouterPortCounters struct { + // The total number of packets blocked. format: int64 + BlockedPackets *int64 + // Number of duplicate address detected packets dropped. format: int64 + DadDroppedPackets *int64 + // Number of packtes dropped as destination is not supported. format: int64 + DestinationUnsupportedDroppedPackets *int64 + // The total number of packets dropped. format: int64 + DroppedPackets *int64 + // Number of firewall packets dropped. format: int64 + FirewallDroppedPackets *int64 + // Number of fragmentation needed packets dropped. format: int64 + FragNeededDroppedPackets *int64 + // Number of IPSec packets dropped format: int64 + IpsecDroppedPackets *int64 + // Number of IPSec no security association packets dropped. format: int64 + IpsecNoSaDroppedPackets *int64 + // Number of IPSec packets dropped as no VTI is present. format: int64 + IpsecNoVtiDroppedPackets *int64 + // Number of IPSec policy block packets dropped. format: int64 + IpsecPolBlockDroppedPackets *int64 + // Number of IPSec policy error packets dropped. format: int64 + IpsecPolErrDroppedPackets *int64 + // Number of IPV6 packets dropped. format: int64 + Ipv6DroppedPackets *int64 + // Number of DPDK kernal NIC interface packets dropped. format: int64 + KniDroppedPackets *int64 + // Number of packets dropped due to unsupported L4 port. format: int64 + L4portUnsupportedDroppedPackets *int64 + // Number of packtes dropped as they are malformed. format: int64 + MalformedDroppedPackets *int64 + // Number of no ARP packets dropped. format: int64 + NoArpDroppedPackets *int64 + // Number of packets dropped as no linked ports are present. format: int64 + NoLinkedDroppedPackets *int64 + // Number of packets dropped due to insufficient memory. format: int64 + NoMemDroppedPackets *int64 + // Number of packets dropped due to absence of receiver. format: int64 + NoReceiverDroppedPackets *int64 + // The number of no route packets dropped format: int64 + NoRouteDroppedPackets *int64 + // Number of non IP packets dropped. format: int64 + NonIpDroppedPackets *int64 + // Number of packets dropped as protocol is unsupported. format: int64 + ProtoUnsupportedDroppedPackets *int64 + // Number of redirect packets dropped. format: int64 + RedirectDroppedPackets *int64 + // Number of reverse-path forwarding check packets dropped. format: int64 + RpfCheckDroppedPackets *int64 + // Number of service insert packets dropped. format: int64 + ServiceInsertDroppedPackets *int64 + // The total number of bytes transferred. format: int64 + TotalBytes *int64 + // The total number of packets transferred. format: int64 + TotalPackets *int64 + // Number of time to live exceeded packets dropped. format: int64 + TtlExceededDroppedPackets *int64 +} + +func (s *LogicalRouterPortCounters) GetType__() bindings.BindingType { + return LogicalRouterPortCountersBindingType() +} + +func (s *LogicalRouterPortCounters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterPortCounters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalRouterPortListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Logical router port list results + Results []*data.StructValue +} + +func (s *LogicalRouterPortListResult) GetType__() bindings.BindingType { + return LogicalRouterPortListResultBindingType() +} + +func (s *LogicalRouterPortListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterPortListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This holds the state of Logical Router Port. If there are errors in realizing LRP outside of MP, it gives details of the components and specific errors. +type LogicalRouterPortState struct { + // Array of configuration state of various sub systems + Details []ConfigurationStateElement + // Error code format: int64 + FailureCode *int64 + // Error message in case of failure + FailureMessage *string + // Possible values are: + // + // * LogicalRouterPortState#LogicalRouterPortState_STATE_PENDING + // * LogicalRouterPortState#LogicalRouterPortState_STATE_IN_PROGRESS + // * LogicalRouterPortState#LogicalRouterPortState_STATE_SUCCESS + // * LogicalRouterPortState#LogicalRouterPortState_STATE_FAILED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_PARTIAL_SUCCESS + // * LogicalRouterPortState#LogicalRouterPortState_STATE_ORPHANED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_UNKNOWN + // * LogicalRouterPortState#LogicalRouterPortState_STATE_ERROR + // * LogicalRouterPortState#LogicalRouterPortState_STATE_IN_SYNC + // * LogicalRouterPortState#LogicalRouterPortState_STATE_NOT_AVAILABLE + // * LogicalRouterPortState#LogicalRouterPortState_STATE_VM_DEPLOYMENT_QUEUED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_VM_DEPLOYMENT_IN_PROGRESS + // * LogicalRouterPortState#LogicalRouterPortState_STATE_VM_DEPLOYMENT_FAILED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_VM_POWER_ON_IN_PROGRESS + // * LogicalRouterPortState#LogicalRouterPortState_STATE_VM_POWER_ON_FAILED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_REGISTRATION_PENDING + // * LogicalRouterPortState#LogicalRouterPortState_STATE_NODE_NOT_READY + // * LogicalRouterPortState#LogicalRouterPortState_STATE_NODE_READY + // * LogicalRouterPortState#LogicalRouterPortState_STATE_VM_POWER_OFF_IN_PROGRESS + // * LogicalRouterPortState#LogicalRouterPortState_STATE_VM_POWER_OFF_FAILED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_VM_UNDEPLOY_IN_PROGRESS + // * LogicalRouterPortState#LogicalRouterPortState_STATE_VM_UNDEPLOY_FAILED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_VM_UNDEPLOY_SUCCESSFUL + // * LogicalRouterPortState#LogicalRouterPortState_STATE_EDGE_CONFIG_ERROR + // * LogicalRouterPortState#LogicalRouterPortState_STATE_VM_DEPLOYMENT_RESTARTED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_REGISTRATION_FAILED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_TRANSPORT_NODE_SYNC_PENDING + // * LogicalRouterPortState#LogicalRouterPortState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING + // * LogicalRouterPortState#LogicalRouterPortState_STATE_EDGE_HARDWARE_NOT_SUPPORTED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER + // * LogicalRouterPortState#LogicalRouterPortState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_NO_PNIC_PREPARED_IN_EDGE + // * LogicalRouterPortState#LogicalRouterPortState_STATE_APPLIANCE_INTERNAL_ERROR + // * LogicalRouterPortState#LogicalRouterPortState_STATE_VTEP_DHCP_NOT_SUPPORTED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE + // * LogicalRouterPortState#LogicalRouterPortState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND + // * LogicalRouterPortState#LogicalRouterPortState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY + // * LogicalRouterPortState#LogicalRouterPortState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM + // * LogicalRouterPortState#LogicalRouterPortState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM + // * LogicalRouterPortState#LogicalRouterPortState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM + // * LogicalRouterPortState#LogicalRouterPortState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE + // * LogicalRouterPortState#LogicalRouterPortState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE + // * LogicalRouterPortState#LogicalRouterPortState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_NO_PNIC_SPECIFIED_IN_TN + // * LogicalRouterPortState#LogicalRouterPortState_STATE_INVALID_PNIC_DEVICE_NAME + // * LogicalRouterPortState#LogicalRouterPortState_STATE_TRANSPORT_NODE_READY + // * LogicalRouterPortState#LogicalRouterPortState_STATE_VM_NETWORK_EDIT_PENDING + // * LogicalRouterPortState#LogicalRouterPortState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY + // * LogicalRouterPortState#LogicalRouterPortState_STATE_MPA_DISCONNECTED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_VM_RENAME_PENDING + // * LogicalRouterPortState#LogicalRouterPortState_STATE_VM_CONFIG_EDIT_PENDING + // * LogicalRouterPortState#LogicalRouterPortState_STATE_VM_NETWORK_EDIT_FAILED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_VM_RENAME_FAILED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_VM_CONFIG_EDIT_FAILED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_VM_CONFIG_DISCREPANCY + // * LogicalRouterPortState#LogicalRouterPortState_STATE_VM_NODE_REFRESH_FAILED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_VM_PLACEMENT_REFRESH_FAILED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_REGISTRATION_TIMEDOUT + // * LogicalRouterPortState#LogicalRouterPortState_STATE_REPLACE_FAILED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING + // * LogicalRouterPortState#LogicalRouterPortState_STATE_DELETE_VM_IN_REDEPLOY_FAILED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE + // * LogicalRouterPortState#LogicalRouterPortState_STATE_VM_RESOURCE_RESERVATION_FAILED + // * LogicalRouterPortState#LogicalRouterPortState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER + // * LogicalRouterPortState#LogicalRouterPortState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING + // * LogicalRouterPortState#LogicalRouterPortState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE + // * LogicalRouterPortState#LogicalRouterPortState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE + // * LogicalRouterPortState#LogicalRouterPortState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE + // * LogicalRouterPortState#LogicalRouterPortState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE + // * LogicalRouterPortState#LogicalRouterPortState_STATE_COMPUTE_MANAGER_NOT_FOUND + // * LogicalRouterPortState#LogicalRouterPortState_STATE_DELETE_IN_PROGRESS + // + // Gives details of state of desired configuration. Additional enums with more details on progress/success/error states are sent for edge node. The success states are NODE_READY and TRANSPORT_NODE_READY, pending states are {VM_DEPLOYMENT_QUEUED, VM_DEPLOYMENT_IN_PROGRESS, REGISTRATION_PENDING} and other values indicate failures. \"in_sync\" state indicates that the desired configuration has been received by the host to which it applies, but is not yet in effect. When the configuration is actually in effect, the state will change to \"success\". Please note, failed state is deprecated. + State *string + // Request identifier of the API which modified the entity. + PendingChangeList []string + // Array of DAD status which contains DAD information for IP addresses on the port. + Ipv6DadStatuses []IPv6DADStatus +} + +const LogicalRouterPortState_STATE_PENDING = "pending" +const LogicalRouterPortState_STATE_IN_PROGRESS = "in_progress" +const LogicalRouterPortState_STATE_SUCCESS = "success" +const LogicalRouterPortState_STATE_FAILED = "failed" +const LogicalRouterPortState_STATE_PARTIAL_SUCCESS = "partial_success" +const LogicalRouterPortState_STATE_ORPHANED = "orphaned" +const LogicalRouterPortState_STATE_UNKNOWN = "unknown" +const LogicalRouterPortState_STATE_ERROR = "error" +const LogicalRouterPortState_STATE_IN_SYNC = "in_sync" +const LogicalRouterPortState_STATE_NOT_AVAILABLE = "NOT_AVAILABLE" +const LogicalRouterPortState_STATE_VM_DEPLOYMENT_QUEUED = "VM_DEPLOYMENT_QUEUED" +const LogicalRouterPortState_STATE_VM_DEPLOYMENT_IN_PROGRESS = "VM_DEPLOYMENT_IN_PROGRESS" +const LogicalRouterPortState_STATE_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const LogicalRouterPortState_STATE_VM_POWER_ON_IN_PROGRESS = "VM_POWER_ON_IN_PROGRESS" +const LogicalRouterPortState_STATE_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const LogicalRouterPortState_STATE_REGISTRATION_PENDING = "REGISTRATION_PENDING" +const LogicalRouterPortState_STATE_NODE_NOT_READY = "NODE_NOT_READY" +const LogicalRouterPortState_STATE_NODE_READY = "NODE_READY" +const LogicalRouterPortState_STATE_VM_POWER_OFF_IN_PROGRESS = "VM_POWER_OFF_IN_PROGRESS" +const LogicalRouterPortState_STATE_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const LogicalRouterPortState_STATE_VM_UNDEPLOY_IN_PROGRESS = "VM_UNDEPLOY_IN_PROGRESS" +const LogicalRouterPortState_STATE_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const LogicalRouterPortState_STATE_VM_UNDEPLOY_SUCCESSFUL = "VM_UNDEPLOY_SUCCESSFUL" +const LogicalRouterPortState_STATE_EDGE_CONFIG_ERROR = "EDGE_CONFIG_ERROR" +const LogicalRouterPortState_STATE_VM_DEPLOYMENT_RESTARTED = "VM_DEPLOYMENT_RESTARTED" +const LogicalRouterPortState_STATE_REGISTRATION_FAILED = "REGISTRATION_FAILED" +const LogicalRouterPortState_STATE_TRANSPORT_NODE_SYNC_PENDING = "TRANSPORT_NODE_SYNC_PENDING" +const LogicalRouterPortState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING = "TRANSPORT_NODE_CONFIGURATION_MISSING" +const LogicalRouterPortState_STATE_EDGE_HARDWARE_NOT_SUPPORTED = "EDGE_HARDWARE_NOT_SUPPORTED" +const LogicalRouterPortState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED = "MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED" +const LogicalRouterPortState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER = "TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER" +const LogicalRouterPortState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED = "TZ_ENDPOINTS_NOT_SPECIFIED" +const LogicalRouterPortState_STATE_NO_PNIC_PREPARED_IN_EDGE = "NO_PNIC_PREPARED_IN_EDGE" +const LogicalRouterPortState_STATE_APPLIANCE_INTERNAL_ERROR = "APPLIANCE_INTERNAL_ERROR" +const LogicalRouterPortState_STATE_VTEP_DHCP_NOT_SUPPORTED = "VTEP_DHCP_NOT_SUPPORTED" +const LogicalRouterPortState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE = "UNSUPPORTED_HOST_SWITCH_PROFILE" +const LogicalRouterPortState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED = "UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED" +const LogicalRouterPortState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND = "HOSTSWITCH_PROFILE_NOT_FOUND" +const LogicalRouterPortState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED = "LLDP_SEND_ENABLED_NOT_SUPPORTED" +const LogicalRouterPortState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY = "UNSUPPORTED_NAMED_TEAMING_POLICY" +const LogicalRouterPortState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM = "LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM" +const LogicalRouterPortState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM = "LACP_NOT_SUPPORTED_FOR_EDGE_VM" +const LogicalRouterPortState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM = "STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM" +const LogicalRouterPortState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE = "MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE" +const LogicalRouterPortState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE = "UNSUPPORTED_LACP_LB_ALGO_FOR_NODE" +const LogicalRouterPortState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED = "EDGE_NODE_VERSION_NOT_SUPPORTED" +const LogicalRouterPortState_STATE_NO_PNIC_SPECIFIED_IN_TN = "NO_PNIC_SPECIFIED_IN_TN" +const LogicalRouterPortState_STATE_INVALID_PNIC_DEVICE_NAME = "INVALID_PNIC_DEVICE_NAME" +const LogicalRouterPortState_STATE_TRANSPORT_NODE_READY = "TRANSPORT_NODE_READY" +const LogicalRouterPortState_STATE_VM_NETWORK_EDIT_PENDING = "VM_NETWORK_EDIT_PENDING" +const LogicalRouterPortState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY = "UNSUPPORTED_DEFAULT_TEAMING_POLICY" +const LogicalRouterPortState_STATE_MPA_DISCONNECTED = "MPA_DISCONNECTED" +const LogicalRouterPortState_STATE_VM_RENAME_PENDING = "VM_RENAME_PENDING" +const LogicalRouterPortState_STATE_VM_CONFIG_EDIT_PENDING = "VM_CONFIG_EDIT_PENDING" +const LogicalRouterPortState_STATE_VM_NETWORK_EDIT_FAILED = "VM_NETWORK_EDIT_FAILED" +const LogicalRouterPortState_STATE_VM_RENAME_FAILED = "VM_RENAME_FAILED" +const LogicalRouterPortState_STATE_VM_CONFIG_EDIT_FAILED = "VM_CONFIG_EDIT_FAILED" +const LogicalRouterPortState_STATE_VM_CONFIG_DISCREPANCY = "VM_CONFIG_DISCREPANCY" +const LogicalRouterPortState_STATE_VM_NODE_REFRESH_FAILED = "VM_NODE_REFRESH_FAILED" +const LogicalRouterPortState_STATE_VM_PLACEMENT_REFRESH_FAILED = "VM_PLACEMENT_REFRESH_FAILED" +const LogicalRouterPortState_STATE_REGISTRATION_TIMEDOUT = "REGISTRATION_TIMEDOUT" +const LogicalRouterPortState_STATE_REPLACE_FAILED = "REPLACE_FAILED" +const LogicalRouterPortState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED = "UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED" +const LogicalRouterPortState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING = "LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING" +const LogicalRouterPortState_STATE_DELETE_VM_IN_REDEPLOY_FAILED = "DELETE_VM_IN_REDEPLOY_FAILED" +const LogicalRouterPortState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED = "DEPLOY_VM_IN_REDEPLOY_FAILED" +const LogicalRouterPortState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE = "INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE" +const LogicalRouterPortState_STATE_VM_RESOURCE_RESERVATION_FAILED = "VM_RESOURCE_RESERVATION_FAILED" +const LogicalRouterPortState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER = "DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER" +const LogicalRouterPortState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING = "DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING" +const LogicalRouterPortState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE = "EDGE_NODE_SETTINGS_MISMATCH_RESOLVE" +const LogicalRouterPortState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE = "EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE" +const LogicalRouterPortState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE = "EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE" +const LogicalRouterPortState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE = "EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE" +const LogicalRouterPortState_STATE_COMPUTE_MANAGER_NOT_FOUND = "COMPUTE_MANAGER_NOT_FOUND" +const LogicalRouterPortState_STATE_DELETE_IN_PROGRESS = "DELETE_IN_PROGRESS" + +func (s *LogicalRouterPortState) GetType__() bindings.BindingType { + return LogicalRouterPortStateBindingType() +} + +func (s *LogicalRouterPortState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterPortState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalRouterPortStatistics struct { + // The ID of the logical router port + LogicalRouterPortId *string + // Per Node Statistics + PerNodeStatistics []LogicalRouterPortStatisticsPerNode +} + +func (s *LogicalRouterPortStatistics) GetType__() bindings.BindingType { + return LogicalRouterPortStatisticsBindingType() +} + +func (s *LogicalRouterPortStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterPortStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalRouterPortStatisticsPerNode struct { + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + Rx *LogicalRouterPortCounters + Tx *LogicalRouterPortCounters + // The ID of the TransportNode + TransportNodeId *string +} + +func (s *LogicalRouterPortStatisticsPerNode) GetType__() bindings.BindingType { + return LogicalRouterPortStatisticsPerNodeBindingType() +} + +func (s *LogicalRouterPortStatisticsPerNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterPortStatisticsPerNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalRouterPortStatisticsSummary struct { + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + Rx *LogicalRouterPortCounters + Tx *LogicalRouterPortCounters + // The ID of the logical router port + LogicalRouterPortId *string +} + +func (s *LogicalRouterPortStatisticsSummary) GetType__() bindings.BindingType { + return LogicalRouterPortStatisticsSummaryBindingType() +} + +func (s *LogicalRouterPortStatisticsSummary) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterPortStatisticsSummary._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalRouterRouteCsvRecord struct { + // The admin distance of the next hop format: int64 + AdminDistance *int64 + // The id of the logical router port which is used as the next hop + LogicalRouterPortId *string + // Logical router component(Service Router/Distributed Router) id + LrComponentId *string + // Logical router component(Service Router/Distributed Router) type + LrComponentType *string + // CIDR network address format: ip-cidr-block + Network *string + // The IP of the next hop format: ip + NextHop *string + // Route type (USER, CONNECTED, NSX_INTERNAL,..) + RouteType *string +} + +func (s *LogicalRouterRouteCsvRecord) GetType__() bindings.BindingType { + return LogicalRouterRouteCsvRecordBindingType() +} + +func (s *LogicalRouterRouteCsvRecord) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterRouteCsvRecord._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalRouterRouteEntry struct { + // The admin distance of the next hop format: int64 + AdminDistance *int64 + // The id of the logical router port which is used as the next hop + LogicalRouterPortId *string + // Logical router component(Service Router/Distributed Router) id + LrComponentId *string + // Logical router component(Service Router/Distributed Router) type + LrComponentType *string + // CIDR network address format: ip-cidr-block + Network *string + // The IP address of the next hop format: ip + NextHop *string + // Route type (USER, CONNECTED, NSX_INTERNAL,..) + RouteType *string +} + +func (s *LogicalRouterRouteEntry) GetType__() bindings.BindingType { + return LogicalRouterRouteEntryBindingType() +} + +func (s *LogicalRouterRouteEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterRouteEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalRouterRouteTable struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // The id of the logical router + LogicalRouterId *string + // Name of the logical router + LogicalRouterName *string + Results []LogicalRouterRouteEntry +} + +func (s *LogicalRouterRouteTable) GetType__() bindings.BindingType { + return LogicalRouterRouteTableBindingType() +} + +func (s *LogicalRouterRouteTable) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterRouteTable._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalRouterRouteTableInCsvFormat struct { + // File name set by HTTP server if API returns CSV result as a file. + FileName *string + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + Results []LogicalRouterRouteCsvRecord +} + +func (s *LogicalRouterRouteTableInCsvFormat) GetType__() bindings.BindingType { + return LogicalRouterRouteTableInCsvFormatBindingType() +} + +func (s *LogicalRouterRouteTableInCsvFormat) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterRouteTableInCsvFormat._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This holds the state of Logical Router. If there are errors in realizing LR outside of MP, it gives details of the components and specific errors. +type LogicalRouterState struct { + // Array of configuration state of various sub systems + Details []ConfigurationStateElement + // Error code format: int64 + FailureCode *int64 + // Error message in case of failure + FailureMessage *string + // Possible values are: + // + // * LogicalRouterState#LogicalRouterState_STATE_PENDING + // * LogicalRouterState#LogicalRouterState_STATE_IN_PROGRESS + // * LogicalRouterState#LogicalRouterState_STATE_SUCCESS + // * LogicalRouterState#LogicalRouterState_STATE_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_PARTIAL_SUCCESS + // * LogicalRouterState#LogicalRouterState_STATE_ORPHANED + // * LogicalRouterState#LogicalRouterState_STATE_UNKNOWN + // * LogicalRouterState#LogicalRouterState_STATE_ERROR + // * LogicalRouterState#LogicalRouterState_STATE_IN_SYNC + // * LogicalRouterState#LogicalRouterState_STATE_NOT_AVAILABLE + // * LogicalRouterState#LogicalRouterState_STATE_VM_DEPLOYMENT_QUEUED + // * LogicalRouterState#LogicalRouterState_STATE_VM_DEPLOYMENT_IN_PROGRESS + // * LogicalRouterState#LogicalRouterState_STATE_VM_DEPLOYMENT_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_VM_POWER_ON_IN_PROGRESS + // * LogicalRouterState#LogicalRouterState_STATE_VM_POWER_ON_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_REGISTRATION_PENDING + // * LogicalRouterState#LogicalRouterState_STATE_NODE_NOT_READY + // * LogicalRouterState#LogicalRouterState_STATE_NODE_READY + // * LogicalRouterState#LogicalRouterState_STATE_VM_POWER_OFF_IN_PROGRESS + // * LogicalRouterState#LogicalRouterState_STATE_VM_POWER_OFF_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_VM_UNDEPLOY_IN_PROGRESS + // * LogicalRouterState#LogicalRouterState_STATE_VM_UNDEPLOY_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_VM_UNDEPLOY_SUCCESSFUL + // * LogicalRouterState#LogicalRouterState_STATE_EDGE_CONFIG_ERROR + // * LogicalRouterState#LogicalRouterState_STATE_VM_DEPLOYMENT_RESTARTED + // * LogicalRouterState#LogicalRouterState_STATE_REGISTRATION_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_TRANSPORT_NODE_SYNC_PENDING + // * LogicalRouterState#LogicalRouterState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING + // * LogicalRouterState#LogicalRouterState_STATE_EDGE_HARDWARE_NOT_SUPPORTED + // * LogicalRouterState#LogicalRouterState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED + // * LogicalRouterState#LogicalRouterState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER + // * LogicalRouterState#LogicalRouterState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED + // * LogicalRouterState#LogicalRouterState_STATE_NO_PNIC_PREPARED_IN_EDGE + // * LogicalRouterState#LogicalRouterState_STATE_APPLIANCE_INTERNAL_ERROR + // * LogicalRouterState#LogicalRouterState_STATE_VTEP_DHCP_NOT_SUPPORTED + // * LogicalRouterState#LogicalRouterState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE + // * LogicalRouterState#LogicalRouterState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED + // * LogicalRouterState#LogicalRouterState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND + // * LogicalRouterState#LogicalRouterState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED + // * LogicalRouterState#LogicalRouterState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY + // * LogicalRouterState#LogicalRouterState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM + // * LogicalRouterState#LogicalRouterState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM + // * LogicalRouterState#LogicalRouterState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM + // * LogicalRouterState#LogicalRouterState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE + // * LogicalRouterState#LogicalRouterState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE + // * LogicalRouterState#LogicalRouterState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED + // * LogicalRouterState#LogicalRouterState_STATE_NO_PNIC_SPECIFIED_IN_TN + // * LogicalRouterState#LogicalRouterState_STATE_INVALID_PNIC_DEVICE_NAME + // * LogicalRouterState#LogicalRouterState_STATE_TRANSPORT_NODE_READY + // * LogicalRouterState#LogicalRouterState_STATE_VM_NETWORK_EDIT_PENDING + // * LogicalRouterState#LogicalRouterState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY + // * LogicalRouterState#LogicalRouterState_STATE_MPA_DISCONNECTED + // * LogicalRouterState#LogicalRouterState_STATE_VM_RENAME_PENDING + // * LogicalRouterState#LogicalRouterState_STATE_VM_CONFIG_EDIT_PENDING + // * LogicalRouterState#LogicalRouterState_STATE_VM_NETWORK_EDIT_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_VM_RENAME_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_VM_CONFIG_EDIT_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_VM_CONFIG_DISCREPANCY + // * LogicalRouterState#LogicalRouterState_STATE_VM_NODE_REFRESH_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_VM_PLACEMENT_REFRESH_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_REGISTRATION_TIMEDOUT + // * LogicalRouterState#LogicalRouterState_STATE_REPLACE_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED + // * LogicalRouterState#LogicalRouterState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING + // * LogicalRouterState#LogicalRouterState_STATE_DELETE_VM_IN_REDEPLOY_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE + // * LogicalRouterState#LogicalRouterState_STATE_VM_RESOURCE_RESERVATION_FAILED + // * LogicalRouterState#LogicalRouterState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER + // * LogicalRouterState#LogicalRouterState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING + // * LogicalRouterState#LogicalRouterState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE + // * LogicalRouterState#LogicalRouterState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE + // * LogicalRouterState#LogicalRouterState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE + // * LogicalRouterState#LogicalRouterState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE + // * LogicalRouterState#LogicalRouterState_STATE_COMPUTE_MANAGER_NOT_FOUND + // * LogicalRouterState#LogicalRouterState_STATE_DELETE_IN_PROGRESS + // + // Gives details of state of desired configuration. Additional enums with more details on progress/success/error states are sent for edge node. The success states are NODE_READY and TRANSPORT_NODE_READY, pending states are {VM_DEPLOYMENT_QUEUED, VM_DEPLOYMENT_IN_PROGRESS, REGISTRATION_PENDING} and other values indicate failures. \"in_sync\" state indicates that the desired configuration has been received by the host to which it applies, but is not yet in effect. When the configuration is actually in effect, the state will change to \"success\". Please note, failed state is deprecated. + State *string + // Request identifier of the API which modified the entity. + PendingChangeList []string +} + +const LogicalRouterState_STATE_PENDING = "pending" +const LogicalRouterState_STATE_IN_PROGRESS = "in_progress" +const LogicalRouterState_STATE_SUCCESS = "success" +const LogicalRouterState_STATE_FAILED = "failed" +const LogicalRouterState_STATE_PARTIAL_SUCCESS = "partial_success" +const LogicalRouterState_STATE_ORPHANED = "orphaned" +const LogicalRouterState_STATE_UNKNOWN = "unknown" +const LogicalRouterState_STATE_ERROR = "error" +const LogicalRouterState_STATE_IN_SYNC = "in_sync" +const LogicalRouterState_STATE_NOT_AVAILABLE = "NOT_AVAILABLE" +const LogicalRouterState_STATE_VM_DEPLOYMENT_QUEUED = "VM_DEPLOYMENT_QUEUED" +const LogicalRouterState_STATE_VM_DEPLOYMENT_IN_PROGRESS = "VM_DEPLOYMENT_IN_PROGRESS" +const LogicalRouterState_STATE_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const LogicalRouterState_STATE_VM_POWER_ON_IN_PROGRESS = "VM_POWER_ON_IN_PROGRESS" +const LogicalRouterState_STATE_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const LogicalRouterState_STATE_REGISTRATION_PENDING = "REGISTRATION_PENDING" +const LogicalRouterState_STATE_NODE_NOT_READY = "NODE_NOT_READY" +const LogicalRouterState_STATE_NODE_READY = "NODE_READY" +const LogicalRouterState_STATE_VM_POWER_OFF_IN_PROGRESS = "VM_POWER_OFF_IN_PROGRESS" +const LogicalRouterState_STATE_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const LogicalRouterState_STATE_VM_UNDEPLOY_IN_PROGRESS = "VM_UNDEPLOY_IN_PROGRESS" +const LogicalRouterState_STATE_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const LogicalRouterState_STATE_VM_UNDEPLOY_SUCCESSFUL = "VM_UNDEPLOY_SUCCESSFUL" +const LogicalRouterState_STATE_EDGE_CONFIG_ERROR = "EDGE_CONFIG_ERROR" +const LogicalRouterState_STATE_VM_DEPLOYMENT_RESTARTED = "VM_DEPLOYMENT_RESTARTED" +const LogicalRouterState_STATE_REGISTRATION_FAILED = "REGISTRATION_FAILED" +const LogicalRouterState_STATE_TRANSPORT_NODE_SYNC_PENDING = "TRANSPORT_NODE_SYNC_PENDING" +const LogicalRouterState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING = "TRANSPORT_NODE_CONFIGURATION_MISSING" +const LogicalRouterState_STATE_EDGE_HARDWARE_NOT_SUPPORTED = "EDGE_HARDWARE_NOT_SUPPORTED" +const LogicalRouterState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED = "MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED" +const LogicalRouterState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER = "TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER" +const LogicalRouterState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED = "TZ_ENDPOINTS_NOT_SPECIFIED" +const LogicalRouterState_STATE_NO_PNIC_PREPARED_IN_EDGE = "NO_PNIC_PREPARED_IN_EDGE" +const LogicalRouterState_STATE_APPLIANCE_INTERNAL_ERROR = "APPLIANCE_INTERNAL_ERROR" +const LogicalRouterState_STATE_VTEP_DHCP_NOT_SUPPORTED = "VTEP_DHCP_NOT_SUPPORTED" +const LogicalRouterState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE = "UNSUPPORTED_HOST_SWITCH_PROFILE" +const LogicalRouterState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED = "UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED" +const LogicalRouterState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND = "HOSTSWITCH_PROFILE_NOT_FOUND" +const LogicalRouterState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED = "LLDP_SEND_ENABLED_NOT_SUPPORTED" +const LogicalRouterState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY = "UNSUPPORTED_NAMED_TEAMING_POLICY" +const LogicalRouterState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM = "LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM" +const LogicalRouterState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM = "LACP_NOT_SUPPORTED_FOR_EDGE_VM" +const LogicalRouterState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM = "STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM" +const LogicalRouterState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE = "MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE" +const LogicalRouterState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE = "UNSUPPORTED_LACP_LB_ALGO_FOR_NODE" +const LogicalRouterState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED = "EDGE_NODE_VERSION_NOT_SUPPORTED" +const LogicalRouterState_STATE_NO_PNIC_SPECIFIED_IN_TN = "NO_PNIC_SPECIFIED_IN_TN" +const LogicalRouterState_STATE_INVALID_PNIC_DEVICE_NAME = "INVALID_PNIC_DEVICE_NAME" +const LogicalRouterState_STATE_TRANSPORT_NODE_READY = "TRANSPORT_NODE_READY" +const LogicalRouterState_STATE_VM_NETWORK_EDIT_PENDING = "VM_NETWORK_EDIT_PENDING" +const LogicalRouterState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY = "UNSUPPORTED_DEFAULT_TEAMING_POLICY" +const LogicalRouterState_STATE_MPA_DISCONNECTED = "MPA_DISCONNECTED" +const LogicalRouterState_STATE_VM_RENAME_PENDING = "VM_RENAME_PENDING" +const LogicalRouterState_STATE_VM_CONFIG_EDIT_PENDING = "VM_CONFIG_EDIT_PENDING" +const LogicalRouterState_STATE_VM_NETWORK_EDIT_FAILED = "VM_NETWORK_EDIT_FAILED" +const LogicalRouterState_STATE_VM_RENAME_FAILED = "VM_RENAME_FAILED" +const LogicalRouterState_STATE_VM_CONFIG_EDIT_FAILED = "VM_CONFIG_EDIT_FAILED" +const LogicalRouterState_STATE_VM_CONFIG_DISCREPANCY = "VM_CONFIG_DISCREPANCY" +const LogicalRouterState_STATE_VM_NODE_REFRESH_FAILED = "VM_NODE_REFRESH_FAILED" +const LogicalRouterState_STATE_VM_PLACEMENT_REFRESH_FAILED = "VM_PLACEMENT_REFRESH_FAILED" +const LogicalRouterState_STATE_REGISTRATION_TIMEDOUT = "REGISTRATION_TIMEDOUT" +const LogicalRouterState_STATE_REPLACE_FAILED = "REPLACE_FAILED" +const LogicalRouterState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED = "UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED" +const LogicalRouterState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING = "LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING" +const LogicalRouterState_STATE_DELETE_VM_IN_REDEPLOY_FAILED = "DELETE_VM_IN_REDEPLOY_FAILED" +const LogicalRouterState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED = "DEPLOY_VM_IN_REDEPLOY_FAILED" +const LogicalRouterState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE = "INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE" +const LogicalRouterState_STATE_VM_RESOURCE_RESERVATION_FAILED = "VM_RESOURCE_RESERVATION_FAILED" +const LogicalRouterState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER = "DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER" +const LogicalRouterState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING = "DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING" +const LogicalRouterState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE = "EDGE_NODE_SETTINGS_MISMATCH_RESOLVE" +const LogicalRouterState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE = "EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE" +const LogicalRouterState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE = "EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE" +const LogicalRouterState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE = "EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE" +const LogicalRouterState_STATE_COMPUTE_MANAGER_NOT_FOUND = "COMPUTE_MANAGER_NOT_FOUND" +const LogicalRouterState_STATE_DELETE_IN_PROGRESS = "DELETE_IN_PROGRESS" + +func (s *LogicalRouterState) GetType__() bindings.BindingType { + return LogicalRouterStateBindingType() +} + +func (s *LogicalRouterState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalRouterStatus struct { + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // Possible values are: + // + // * LogicalRouterStatus#LogicalRouterStatus_LOCALE_OPERATION_MODE_PRIMARY_LOCATION + // * LogicalRouterStatus#LogicalRouterStatus_LOCALE_OPERATION_MODE_SECONDARY_LOCATION + // + // Egress mode for the logical router at given mode + LocaleOperationMode *string + // The id of the logical router + LogicalRouterId *string + // Per Node Status + PerNodeStatus []LogicalRouterStatusPerNode +} + +const LogicalRouterStatus_LOCALE_OPERATION_MODE_PRIMARY_LOCATION = "PRIMARY_LOCATION" +const LogicalRouterStatus_LOCALE_OPERATION_MODE_SECONDARY_LOCATION = "SECONDARY_LOCATION" + +func (s *LogicalRouterStatus) GetType__() bindings.BindingType { + return LogicalRouterStatusBindingType() +} + +func (s *LogicalRouterStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalRouterStatusPerNode struct { + // Only populated by Policy APIs + EdgePath *string + // Possible values are: + // + // * LogicalRouterStatusPerNode#LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_ACTIVE + // * LogicalRouterStatusPerNode#LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_STANDBY + // * LogicalRouterStatusPerNode#LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_DOWN + // * LogicalRouterStatusPerNode#LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_SYNC + // * LogicalRouterStatusPerNode#LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_UNKNOWN + // * LogicalRouterStatusPerNode#LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_ADMIN_DOWN + // + // A service router's HA status on an edge node + HighAvailabilityStatus *string + // id of the service router where the router status is retrieved. + ServiceRouterId *string + // This field is populated for sateful active-active mode. Runtime state is only synced among nodes in the same sub cluster. + SubClusterId *string + // id of the transport node where the router status is retrieved. + TransportNodeId *string +} + +const LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_ACTIVE = "ACTIVE" +const LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_STANDBY = "STANDBY" +const LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_DOWN = "DOWN" +const LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_SYNC = "SYNC" +const LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_UNKNOWN = "UNKNOWN" +const LogicalRouterStatusPerNode_HIGH_AVAILABILITY_STATUS_ADMIN_DOWN = "ADMIN_DOWN" + +func (s *LogicalRouterStatusPerNode) GetType__() bindings.BindingType { + return LogicalRouterStatusPerNodeBindingType() +} + +func (s *LogicalRouterStatusPerNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterStatusPerNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalRouterUpLinkPort struct { + // Member index of the edge node on the cluster format: int64 + EdgeClusterMemberIndex []int64 + IgmpConfig *InterfaceIgmpLocalGroupConfig + LinkedLogicalSwitchPortId *ResourceReference + // MAC address + MacAddress *string + // Maximum transmission unit specifies the size of the largest packet that a network protocol can transmit. If not specified, the global logical MTU set in the /api/v1/global-configs/RoutingGlobalConfig API will be used. format: int64 + Mtu *int64 + // Configuration to override the neighbor discovery router advertisement prefix time parameters at the subnet level. Note that users are allowed to override the prefix time only for IPv6 subnets which are configured on the port. + NdraPrefixConfig []NDRAPrefixConfig + // Identifier of Neighbor Discovery Router Advertisement profile associated with port. When NDRA profile id is associated at both the port level and logical router level, the profile id specified at port level takes the precedence. + NdraProfileId *string + PimConfig *InterfacePimConfig + // Logical router port subnets + Subnets []IPSubnet + // Possible values are: + // + // * LogicalRouterUpLinkPort#LogicalRouterUpLinkPort_URPF_MODE_NONE + // * LogicalRouterUpLinkPort#LogicalRouterUpLinkPort_URPF_MODE_STRICT + // + // Unicast Reverse Path Forwarding mode + UrpfMode *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERUPLINKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERDOWNLINKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLINKPORTONTIER0 + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLINKPORTONTIER1 + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERLOOPBACKPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERIPTUNNELPORT + // * LogicalRouterPort#LogicalRouterPort_RESOURCE_TYPE_LOGICALROUTERCENTRALIZEDSERVICEPORT + // + // LogicalRouterUpLinkPort is allowed only on TIER0 logical router. It is the north facing port of the logical router. LogicalRouterLinkPortOnTIER0 is allowed only on TIER0 logical router. This is the port where the LogicalRouterLinkPortOnTIER1 of TIER1 logical router connects to. LogicalRouterLinkPortOnTIER1 is allowed only on TIER1 logical router. This is the port using which the user connected to TIER1 logical router for upwards connectivity via TIER0 logical router. Connect this port to the LogicalRouterLinkPortOnTIER0 of the TIER0 logical router. LogicalRouterDownLinkPort is for the connected subnets on the logical router. LogicalRouterLoopbackPort is a loopback port for logical router component which is placed on chosen edge cluster member. LogicalRouterIPTunnelPort is a IPSec VPN tunnel port created on logical router when route based VPN session configured. LogicalRouterCentralizedServicePort is allowed only on Active/Standby TIER0 and TIER1 logical router. Port can be connected to VLAN or overlay logical switch. Unlike downlink port it does not participate in distributed routing and hosted on all edge cluster members associated with logical router. Stateful services can be applied on this port. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Identifier for logical router on which this port is created + LogicalRouterId *string + // Service Bindings + ServiceBindings []ServiceBinding +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LogicalRouterUpLinkPort__TYPE_IDENTIFIER = "LogicalRouterUpLinkPort" +const LogicalRouterUpLinkPort_URPF_MODE_NONE = "NONE" +const LogicalRouterUpLinkPort_URPF_MODE_STRICT = "STRICT" + +func (s *LogicalRouterUpLinkPort) GetType__() bindings.BindingType { + return LogicalRouterUpLinkPortBindingType() +} + +func (s *LogicalRouterUpLinkPort) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalRouterUpLinkPort._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This holds the state of Service Router. If there are errors in realizing SR outside of MP, it gives details of the components and specific errors. +type LogicalServiceRouterClusterState struct { + // Array of configuration state of various sub systems + Details []ConfigurationStateElement + // Error code format: int64 + FailureCode *int64 + // Error message in case of failure + FailureMessage *string + // Possible values are: + // + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_PENDING + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_IN_PROGRESS + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_SUCCESS + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_FAILED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_PARTIAL_SUCCESS + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_ORPHANED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_UNKNOWN + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_ERROR + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_IN_SYNC + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_NOT_AVAILABLE + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_VM_DEPLOYMENT_QUEUED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_VM_DEPLOYMENT_IN_PROGRESS + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_VM_DEPLOYMENT_FAILED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_VM_POWER_ON_IN_PROGRESS + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_VM_POWER_ON_FAILED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_REGISTRATION_PENDING + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_NODE_NOT_READY + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_NODE_READY + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_VM_POWER_OFF_IN_PROGRESS + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_VM_POWER_OFF_FAILED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_VM_UNDEPLOY_IN_PROGRESS + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_VM_UNDEPLOY_FAILED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_VM_UNDEPLOY_SUCCESSFUL + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_EDGE_CONFIG_ERROR + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_VM_DEPLOYMENT_RESTARTED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_REGISTRATION_FAILED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_TRANSPORT_NODE_SYNC_PENDING + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_EDGE_HARDWARE_NOT_SUPPORTED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_NO_PNIC_PREPARED_IN_EDGE + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_APPLIANCE_INTERNAL_ERROR + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_VTEP_DHCP_NOT_SUPPORTED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_NO_PNIC_SPECIFIED_IN_TN + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_INVALID_PNIC_DEVICE_NAME + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_TRANSPORT_NODE_READY + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_VM_NETWORK_EDIT_PENDING + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_MPA_DISCONNECTED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_VM_RENAME_PENDING + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_VM_CONFIG_EDIT_PENDING + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_VM_NETWORK_EDIT_FAILED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_VM_RENAME_FAILED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_VM_CONFIG_EDIT_FAILED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_VM_CONFIG_DISCREPANCY + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_VM_NODE_REFRESH_FAILED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_VM_PLACEMENT_REFRESH_FAILED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_REGISTRATION_TIMEDOUT + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_REPLACE_FAILED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_DELETE_VM_IN_REDEPLOY_FAILED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_VM_RESOURCE_RESERVATION_FAILED + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_COMPUTE_MANAGER_NOT_FOUND + // * LogicalServiceRouterClusterState#LogicalServiceRouterClusterState_STATE_DELETE_IN_PROGRESS + // + // Gives details of state of desired configuration. Additional enums with more details on progress/success/error states are sent for edge node. The success states are NODE_READY and TRANSPORT_NODE_READY, pending states are {VM_DEPLOYMENT_QUEUED, VM_DEPLOYMENT_IN_PROGRESS, REGISTRATION_PENDING} and other values indicate failures. \"in_sync\" state indicates that the desired configuration has been received by the host to which it applies, but is not yet in effect. When the configuration is actually in effect, the state will change to \"success\". Please note, failed state is deprecated. + State *string + // Request identifier of the API which modified the entity. + PendingChangeList []string +} + +const LogicalServiceRouterClusterState_STATE_PENDING = "pending" +const LogicalServiceRouterClusterState_STATE_IN_PROGRESS = "in_progress" +const LogicalServiceRouterClusterState_STATE_SUCCESS = "success" +const LogicalServiceRouterClusterState_STATE_FAILED = "failed" +const LogicalServiceRouterClusterState_STATE_PARTIAL_SUCCESS = "partial_success" +const LogicalServiceRouterClusterState_STATE_ORPHANED = "orphaned" +const LogicalServiceRouterClusterState_STATE_UNKNOWN = "unknown" +const LogicalServiceRouterClusterState_STATE_ERROR = "error" +const LogicalServiceRouterClusterState_STATE_IN_SYNC = "in_sync" +const LogicalServiceRouterClusterState_STATE_NOT_AVAILABLE = "NOT_AVAILABLE" +const LogicalServiceRouterClusterState_STATE_VM_DEPLOYMENT_QUEUED = "VM_DEPLOYMENT_QUEUED" +const LogicalServiceRouterClusterState_STATE_VM_DEPLOYMENT_IN_PROGRESS = "VM_DEPLOYMENT_IN_PROGRESS" +const LogicalServiceRouterClusterState_STATE_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const LogicalServiceRouterClusterState_STATE_VM_POWER_ON_IN_PROGRESS = "VM_POWER_ON_IN_PROGRESS" +const LogicalServiceRouterClusterState_STATE_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const LogicalServiceRouterClusterState_STATE_REGISTRATION_PENDING = "REGISTRATION_PENDING" +const LogicalServiceRouterClusterState_STATE_NODE_NOT_READY = "NODE_NOT_READY" +const LogicalServiceRouterClusterState_STATE_NODE_READY = "NODE_READY" +const LogicalServiceRouterClusterState_STATE_VM_POWER_OFF_IN_PROGRESS = "VM_POWER_OFF_IN_PROGRESS" +const LogicalServiceRouterClusterState_STATE_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const LogicalServiceRouterClusterState_STATE_VM_UNDEPLOY_IN_PROGRESS = "VM_UNDEPLOY_IN_PROGRESS" +const LogicalServiceRouterClusterState_STATE_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const LogicalServiceRouterClusterState_STATE_VM_UNDEPLOY_SUCCESSFUL = "VM_UNDEPLOY_SUCCESSFUL" +const LogicalServiceRouterClusterState_STATE_EDGE_CONFIG_ERROR = "EDGE_CONFIG_ERROR" +const LogicalServiceRouterClusterState_STATE_VM_DEPLOYMENT_RESTARTED = "VM_DEPLOYMENT_RESTARTED" +const LogicalServiceRouterClusterState_STATE_REGISTRATION_FAILED = "REGISTRATION_FAILED" +const LogicalServiceRouterClusterState_STATE_TRANSPORT_NODE_SYNC_PENDING = "TRANSPORT_NODE_SYNC_PENDING" +const LogicalServiceRouterClusterState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING = "TRANSPORT_NODE_CONFIGURATION_MISSING" +const LogicalServiceRouterClusterState_STATE_EDGE_HARDWARE_NOT_SUPPORTED = "EDGE_HARDWARE_NOT_SUPPORTED" +const LogicalServiceRouterClusterState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED = "MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED" +const LogicalServiceRouterClusterState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER = "TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER" +const LogicalServiceRouterClusterState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED = "TZ_ENDPOINTS_NOT_SPECIFIED" +const LogicalServiceRouterClusterState_STATE_NO_PNIC_PREPARED_IN_EDGE = "NO_PNIC_PREPARED_IN_EDGE" +const LogicalServiceRouterClusterState_STATE_APPLIANCE_INTERNAL_ERROR = "APPLIANCE_INTERNAL_ERROR" +const LogicalServiceRouterClusterState_STATE_VTEP_DHCP_NOT_SUPPORTED = "VTEP_DHCP_NOT_SUPPORTED" +const LogicalServiceRouterClusterState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE = "UNSUPPORTED_HOST_SWITCH_PROFILE" +const LogicalServiceRouterClusterState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED = "UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED" +const LogicalServiceRouterClusterState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND = "HOSTSWITCH_PROFILE_NOT_FOUND" +const LogicalServiceRouterClusterState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED = "LLDP_SEND_ENABLED_NOT_SUPPORTED" +const LogicalServiceRouterClusterState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY = "UNSUPPORTED_NAMED_TEAMING_POLICY" +const LogicalServiceRouterClusterState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM = "LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM" +const LogicalServiceRouterClusterState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM = "LACP_NOT_SUPPORTED_FOR_EDGE_VM" +const LogicalServiceRouterClusterState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM = "STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM" +const LogicalServiceRouterClusterState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE = "MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE" +const LogicalServiceRouterClusterState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE = "UNSUPPORTED_LACP_LB_ALGO_FOR_NODE" +const LogicalServiceRouterClusterState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED = "EDGE_NODE_VERSION_NOT_SUPPORTED" +const LogicalServiceRouterClusterState_STATE_NO_PNIC_SPECIFIED_IN_TN = "NO_PNIC_SPECIFIED_IN_TN" +const LogicalServiceRouterClusterState_STATE_INVALID_PNIC_DEVICE_NAME = "INVALID_PNIC_DEVICE_NAME" +const LogicalServiceRouterClusterState_STATE_TRANSPORT_NODE_READY = "TRANSPORT_NODE_READY" +const LogicalServiceRouterClusterState_STATE_VM_NETWORK_EDIT_PENDING = "VM_NETWORK_EDIT_PENDING" +const LogicalServiceRouterClusterState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY = "UNSUPPORTED_DEFAULT_TEAMING_POLICY" +const LogicalServiceRouterClusterState_STATE_MPA_DISCONNECTED = "MPA_DISCONNECTED" +const LogicalServiceRouterClusterState_STATE_VM_RENAME_PENDING = "VM_RENAME_PENDING" +const LogicalServiceRouterClusterState_STATE_VM_CONFIG_EDIT_PENDING = "VM_CONFIG_EDIT_PENDING" +const LogicalServiceRouterClusterState_STATE_VM_NETWORK_EDIT_FAILED = "VM_NETWORK_EDIT_FAILED" +const LogicalServiceRouterClusterState_STATE_VM_RENAME_FAILED = "VM_RENAME_FAILED" +const LogicalServiceRouterClusterState_STATE_VM_CONFIG_EDIT_FAILED = "VM_CONFIG_EDIT_FAILED" +const LogicalServiceRouterClusterState_STATE_VM_CONFIG_DISCREPANCY = "VM_CONFIG_DISCREPANCY" +const LogicalServiceRouterClusterState_STATE_VM_NODE_REFRESH_FAILED = "VM_NODE_REFRESH_FAILED" +const LogicalServiceRouterClusterState_STATE_VM_PLACEMENT_REFRESH_FAILED = "VM_PLACEMENT_REFRESH_FAILED" +const LogicalServiceRouterClusterState_STATE_REGISTRATION_TIMEDOUT = "REGISTRATION_TIMEDOUT" +const LogicalServiceRouterClusterState_STATE_REPLACE_FAILED = "REPLACE_FAILED" +const LogicalServiceRouterClusterState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED = "UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED" +const LogicalServiceRouterClusterState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING = "LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING" +const LogicalServiceRouterClusterState_STATE_DELETE_VM_IN_REDEPLOY_FAILED = "DELETE_VM_IN_REDEPLOY_FAILED" +const LogicalServiceRouterClusterState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED = "DEPLOY_VM_IN_REDEPLOY_FAILED" +const LogicalServiceRouterClusterState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE = "INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE" +const LogicalServiceRouterClusterState_STATE_VM_RESOURCE_RESERVATION_FAILED = "VM_RESOURCE_RESERVATION_FAILED" +const LogicalServiceRouterClusterState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER = "DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER" +const LogicalServiceRouterClusterState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING = "DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING" +const LogicalServiceRouterClusterState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE = "EDGE_NODE_SETTINGS_MISMATCH_RESOLVE" +const LogicalServiceRouterClusterState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE = "EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE" +const LogicalServiceRouterClusterState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE = "EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE" +const LogicalServiceRouterClusterState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE = "EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE" +const LogicalServiceRouterClusterState_STATE_COMPUTE_MANAGER_NOT_FOUND = "COMPUTE_MANAGER_NOT_FOUND" +const LogicalServiceRouterClusterState_STATE_DELETE_IN_PROGRESS = "DELETE_IN_PROGRESS" + +func (s *LogicalServiceRouterClusterState) GetType__() bindings.BindingType { + return LogicalServiceRouterClusterStateBindingType() +} + +func (s *LogicalServiceRouterClusterState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalServiceRouterClusterState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalSwitch struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Address bindings for the Logical switch + AddressBindings []PacketAddressClassifier + // Possible values are: + // + // * LogicalSwitch#LogicalSwitch_ADMIN_STATE_UP + // * LogicalSwitch#LogicalSwitch_ADMIN_STATE_DOWN + // + // Represents Desired state of the Logical Switch + AdminState *string + // This property could be used for vendor specific configuration in key value string pairs, the setting in extra_configs will be automatically inheritted by logical ports in the logical switch. + ExtraConfigs []ExtraConfig + // The VNI is used for intersite traffic and the global logical switch ID. The global VNI pool is agnostic of the local VNI pool, and there is no need to have an exclusive VNI range. For example, VNI x can be the global VNI for logical switch B and the local VNI for logical switch A. format: int32 + GlobalVni *int64 + // If this flag is set to true, then all the logical switch ports attached to this logical switch will behave in a hybrid fashion. The hybrid logical switch port indicates to NSX that the VM intends to operate in underlay mode, but retains the ability to forward egress traffic to the NSX overlay network. This flag can be enabled only for the logical switches in the overlay type transport zone which has host switch mode as STANDARD and also has either CrossCloud or CloudScope tag scopes. Only the NSX public cloud gateway (PCG) uses this flag, other host agents like ESX, KVM and Edge will ignore it. This property cannot be modified once the logical switch is created. + Hybrid *bool + // IP pool id that associated with a LogicalSwitch. + IpPoolId *string + // Mac pool id that associated with a LogicalSwitch. + MacPoolId *string + // A flag to prevent BUM (broadcast, unknown-unicast and multicast) traffic from reaching the other spanned edges. + NodeLocalSwitch *bool + // ID populated by NSX when NSX on DVPG is used to indicate the source DVPG. + OriginId *string + // Possible values are: + // + // * LogicalSwitch#LogicalSwitch_ORIGIN_TYPE_VCENTER + // + // The type of source from which the DVPG is discovered + OriginType *string + // Possible values are: + // + // * LogicalSwitch#LogicalSwitch_REPLICATION_MODE_MTEP + // * LogicalSwitch#LogicalSwitch_REPLICATION_MODE_SOURCE + // + // Replication mode of the Logical Switch + ReplicationMode *string + // Each manager ID represents the NSX Local Manager the logical switch connects. This will be populated by the manager. + Span []string + // Possible values are: + // + // * LogicalSwitch#LogicalSwitch_SWITCH_TYPE_DEFAULT + // * LogicalSwitch#LogicalSwitch_SWITCH_TYPE_SERVICE_PLANE + // * LogicalSwitch#LogicalSwitch_SWITCH_TYPE_DHCP_RELAY + // * LogicalSwitch#LogicalSwitch_SWITCH_TYPE_GLOBAL + // * LogicalSwitch#LogicalSwitch_SWITCH_TYPE_INTER_ROUTER + // * LogicalSwitch#LogicalSwitch_SWITCH_TYPE_EVPN + // * LogicalSwitch#LogicalSwitch_SWITCH_TYPE_DVPG + // + // This field indicates purpose of a LogicalSwitch. It is set by manager internally or user can provide this field. If not set, DEFAULT type is assigned. NSX components can use this field to create LogicalSwitch that provides component specific functionality. DEFAULT type LogicalSwitches are created for basic L2 connectivity by API users. SERVICE_PLANE type LogicalSwitches are system created service plane LogicalSwitches for Service Insertion service. User can not create SERVICE_PLANE type of LogicalSwitch. DHCP_RELAY type LogicalSwitches are created by external user like Policy with special permissions or by system and will be treated as internal LogicalSwitches. Such LogicalSwitch will not be exposed to vSphere user. GLOBAL type LogicalSwitches are created to span multiple NSX domains to connect multiple remote sites. INTER_ROUTER type LogicalSwitches are policy-created LogicalSwitches which provide inter-router connectivity. DVPG type LogicalSwitches are NSX-created based on DVPGs found in VC which are used as shadow objects in NSX on DVPG. + SwitchType *string + SwitchingProfileIds []SwitchingProfileTypeIdEntry + // Id of the TransportZone to which this LogicalSwitch is associated + TransportZoneId *string + // This name has to be one of the switching uplink teaming policy names listed inside the logical switch's TransportZone. If this field is not specified, the logical switch will not have a teaming policy associated with it and the host switch's default teaming policy will be used. + UplinkTeamingPolicyName *string + // This property is dedicated to VLAN based network, to set VLAN of logical network. It is mutually exclusive with 'vlan_trunk_spec'. format: int64 + Vlan *int64 + VlanTrunkSpec *VlanTrunkSpec + // Only for OVERLAY network. A VNI will be auto-allocated from the default VNI pool if not given; otherwise the given VNI has to be inside the default pool and not used by any other LogicalSwitch. format: int32 + Vni *int64 +} + +const LogicalSwitch_ADMIN_STATE_UP = "UP" +const LogicalSwitch_ADMIN_STATE_DOWN = "DOWN" +const LogicalSwitch_ORIGIN_TYPE_VCENTER = "VCENTER" +const LogicalSwitch_REPLICATION_MODE_MTEP = "MTEP" +const LogicalSwitch_REPLICATION_MODE_SOURCE = "SOURCE" +const LogicalSwitch_SWITCH_TYPE_DEFAULT = "DEFAULT" +const LogicalSwitch_SWITCH_TYPE_SERVICE_PLANE = "SERVICE_PLANE" +const LogicalSwitch_SWITCH_TYPE_DHCP_RELAY = "DHCP_RELAY" +const LogicalSwitch_SWITCH_TYPE_GLOBAL = "GLOBAL" +const LogicalSwitch_SWITCH_TYPE_INTER_ROUTER = "INTER_ROUTER" +const LogicalSwitch_SWITCH_TYPE_EVPN = "EVPN" +const LogicalSwitch_SWITCH_TYPE_DVPG = "DVPG" + +func (s *LogicalSwitch) GetType__() bindings.BindingType { + return LogicalSwitchBindingType() +} + +func (s *LogicalSwitch) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalSwitch._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Logical Switch queries result +type LogicalSwitchListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Logical Switch Results + Results []LogicalSwitch +} + +func (s *LogicalSwitchListResult) GetType__() bindings.BindingType { + return LogicalSwitchListResultBindingType() +} + +func (s *LogicalSwitchListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalSwitchListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalSwitchMirrorSource struct { + // Please note as logical port attached with vmk interface is unsupported as mirror source, traffic from those ports on source logical switch will not be mirrored. + SwitchId *string + // Possible values are: + // + // * MirrorSource#MirrorSource_RESOURCE_TYPE_LOGICALPORTMIRRORSOURCE + // * MirrorSource#MirrorSource_RESOURCE_TYPE_PNICMIRRORSOURCE + // * MirrorSource#MirrorSource_RESOURCE_TYPE_VLANMIRRORSOURCE + // * MirrorSource#MirrorSource_RESOURCE_TYPE_LOGICALSWITCHMIRRORSOURCE + // + // Resource types of mirror source + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LogicalSwitchMirrorSource__TYPE_IDENTIFIER = "LogicalSwitchMirrorSource" + +func (s *LogicalSwitchMirrorSource) GetType__() bindings.BindingType { + return LogicalSwitchMirrorSourceBindingType() +} + +func (s *LogicalSwitchMirrorSource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalSwitchMirrorSource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalSwitchState struct { + // Array of configuration state of various sub systems + Details []ConfigurationStateElement + // Error code format: int64 + FailureCode *int64 + // Error message in case of failure + FailureMessage *string + // Possible values are: + // + // * LogicalSwitchState#LogicalSwitchState_STATE_PENDING + // * LogicalSwitchState#LogicalSwitchState_STATE_IN_PROGRESS + // * LogicalSwitchState#LogicalSwitchState_STATE_SUCCESS + // * LogicalSwitchState#LogicalSwitchState_STATE_FAILED + // * LogicalSwitchState#LogicalSwitchState_STATE_PARTIAL_SUCCESS + // * LogicalSwitchState#LogicalSwitchState_STATE_ORPHANED + // * LogicalSwitchState#LogicalSwitchState_STATE_UNKNOWN + // * LogicalSwitchState#LogicalSwitchState_STATE_ERROR + // * LogicalSwitchState#LogicalSwitchState_STATE_IN_SYNC + // * LogicalSwitchState#LogicalSwitchState_STATE_NOT_AVAILABLE + // * LogicalSwitchState#LogicalSwitchState_STATE_VM_DEPLOYMENT_QUEUED + // * LogicalSwitchState#LogicalSwitchState_STATE_VM_DEPLOYMENT_IN_PROGRESS + // * LogicalSwitchState#LogicalSwitchState_STATE_VM_DEPLOYMENT_FAILED + // * LogicalSwitchState#LogicalSwitchState_STATE_VM_POWER_ON_IN_PROGRESS + // * LogicalSwitchState#LogicalSwitchState_STATE_VM_POWER_ON_FAILED + // * LogicalSwitchState#LogicalSwitchState_STATE_REGISTRATION_PENDING + // * LogicalSwitchState#LogicalSwitchState_STATE_NODE_NOT_READY + // * LogicalSwitchState#LogicalSwitchState_STATE_NODE_READY + // * LogicalSwitchState#LogicalSwitchState_STATE_VM_POWER_OFF_IN_PROGRESS + // * LogicalSwitchState#LogicalSwitchState_STATE_VM_POWER_OFF_FAILED + // * LogicalSwitchState#LogicalSwitchState_STATE_VM_UNDEPLOY_IN_PROGRESS + // * LogicalSwitchState#LogicalSwitchState_STATE_VM_UNDEPLOY_FAILED + // * LogicalSwitchState#LogicalSwitchState_STATE_VM_UNDEPLOY_SUCCESSFUL + // * LogicalSwitchState#LogicalSwitchState_STATE_EDGE_CONFIG_ERROR + // * LogicalSwitchState#LogicalSwitchState_STATE_VM_DEPLOYMENT_RESTARTED + // * LogicalSwitchState#LogicalSwitchState_STATE_REGISTRATION_FAILED + // * LogicalSwitchState#LogicalSwitchState_STATE_TRANSPORT_NODE_SYNC_PENDING + // * LogicalSwitchState#LogicalSwitchState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING + // * LogicalSwitchState#LogicalSwitchState_STATE_EDGE_HARDWARE_NOT_SUPPORTED + // * LogicalSwitchState#LogicalSwitchState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED + // * LogicalSwitchState#LogicalSwitchState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER + // * LogicalSwitchState#LogicalSwitchState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED + // * LogicalSwitchState#LogicalSwitchState_STATE_NO_PNIC_PREPARED_IN_EDGE + // * LogicalSwitchState#LogicalSwitchState_STATE_APPLIANCE_INTERNAL_ERROR + // * LogicalSwitchState#LogicalSwitchState_STATE_VTEP_DHCP_NOT_SUPPORTED + // * LogicalSwitchState#LogicalSwitchState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE + // * LogicalSwitchState#LogicalSwitchState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED + // * LogicalSwitchState#LogicalSwitchState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND + // * LogicalSwitchState#LogicalSwitchState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED + // * LogicalSwitchState#LogicalSwitchState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY + // * LogicalSwitchState#LogicalSwitchState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM + // * LogicalSwitchState#LogicalSwitchState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM + // * LogicalSwitchState#LogicalSwitchState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM + // * LogicalSwitchState#LogicalSwitchState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE + // * LogicalSwitchState#LogicalSwitchState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE + // * LogicalSwitchState#LogicalSwitchState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED + // * LogicalSwitchState#LogicalSwitchState_STATE_NO_PNIC_SPECIFIED_IN_TN + // * LogicalSwitchState#LogicalSwitchState_STATE_INVALID_PNIC_DEVICE_NAME + // * LogicalSwitchState#LogicalSwitchState_STATE_TRANSPORT_NODE_READY + // * LogicalSwitchState#LogicalSwitchState_STATE_VM_NETWORK_EDIT_PENDING + // * LogicalSwitchState#LogicalSwitchState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY + // * LogicalSwitchState#LogicalSwitchState_STATE_MPA_DISCONNECTED + // * LogicalSwitchState#LogicalSwitchState_STATE_VM_RENAME_PENDING + // * LogicalSwitchState#LogicalSwitchState_STATE_VM_CONFIG_EDIT_PENDING + // * LogicalSwitchState#LogicalSwitchState_STATE_VM_NETWORK_EDIT_FAILED + // * LogicalSwitchState#LogicalSwitchState_STATE_VM_RENAME_FAILED + // * LogicalSwitchState#LogicalSwitchState_STATE_VM_CONFIG_EDIT_FAILED + // * LogicalSwitchState#LogicalSwitchState_STATE_VM_CONFIG_DISCREPANCY + // * LogicalSwitchState#LogicalSwitchState_STATE_VM_NODE_REFRESH_FAILED + // * LogicalSwitchState#LogicalSwitchState_STATE_VM_PLACEMENT_REFRESH_FAILED + // * LogicalSwitchState#LogicalSwitchState_STATE_REGISTRATION_TIMEDOUT + // * LogicalSwitchState#LogicalSwitchState_STATE_REPLACE_FAILED + // * LogicalSwitchState#LogicalSwitchState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED + // * LogicalSwitchState#LogicalSwitchState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING + // * LogicalSwitchState#LogicalSwitchState_STATE_DELETE_VM_IN_REDEPLOY_FAILED + // * LogicalSwitchState#LogicalSwitchState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED + // * LogicalSwitchState#LogicalSwitchState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE + // * LogicalSwitchState#LogicalSwitchState_STATE_VM_RESOURCE_RESERVATION_FAILED + // * LogicalSwitchState#LogicalSwitchState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER + // * LogicalSwitchState#LogicalSwitchState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING + // * LogicalSwitchState#LogicalSwitchState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE + // * LogicalSwitchState#LogicalSwitchState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE + // * LogicalSwitchState#LogicalSwitchState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE + // * LogicalSwitchState#LogicalSwitchState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE + // * LogicalSwitchState#LogicalSwitchState_STATE_COMPUTE_MANAGER_NOT_FOUND + // * LogicalSwitchState#LogicalSwitchState_STATE_DELETE_IN_PROGRESS + // + // Gives details of state of desired configuration. Additional enums with more details on progress/success/error states are sent for edge node. The success states are NODE_READY and TRANSPORT_NODE_READY, pending states are {VM_DEPLOYMENT_QUEUED, VM_DEPLOYMENT_IN_PROGRESS, REGISTRATION_PENDING} and other values indicate failures. \"in_sync\" state indicates that the desired configuration has been received by the host to which it applies, but is not yet in effect. When the configuration is actually in effect, the state will change to \"success\". Please note, failed state is deprecated. + State *string + // Id of the logical switch + LogicalSwitchId *string +} + +const LogicalSwitchState_STATE_PENDING = "pending" +const LogicalSwitchState_STATE_IN_PROGRESS = "in_progress" +const LogicalSwitchState_STATE_SUCCESS = "success" +const LogicalSwitchState_STATE_FAILED = "failed" +const LogicalSwitchState_STATE_PARTIAL_SUCCESS = "partial_success" +const LogicalSwitchState_STATE_ORPHANED = "orphaned" +const LogicalSwitchState_STATE_UNKNOWN = "unknown" +const LogicalSwitchState_STATE_ERROR = "error" +const LogicalSwitchState_STATE_IN_SYNC = "in_sync" +const LogicalSwitchState_STATE_NOT_AVAILABLE = "NOT_AVAILABLE" +const LogicalSwitchState_STATE_VM_DEPLOYMENT_QUEUED = "VM_DEPLOYMENT_QUEUED" +const LogicalSwitchState_STATE_VM_DEPLOYMENT_IN_PROGRESS = "VM_DEPLOYMENT_IN_PROGRESS" +const LogicalSwitchState_STATE_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const LogicalSwitchState_STATE_VM_POWER_ON_IN_PROGRESS = "VM_POWER_ON_IN_PROGRESS" +const LogicalSwitchState_STATE_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const LogicalSwitchState_STATE_REGISTRATION_PENDING = "REGISTRATION_PENDING" +const LogicalSwitchState_STATE_NODE_NOT_READY = "NODE_NOT_READY" +const LogicalSwitchState_STATE_NODE_READY = "NODE_READY" +const LogicalSwitchState_STATE_VM_POWER_OFF_IN_PROGRESS = "VM_POWER_OFF_IN_PROGRESS" +const LogicalSwitchState_STATE_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const LogicalSwitchState_STATE_VM_UNDEPLOY_IN_PROGRESS = "VM_UNDEPLOY_IN_PROGRESS" +const LogicalSwitchState_STATE_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const LogicalSwitchState_STATE_VM_UNDEPLOY_SUCCESSFUL = "VM_UNDEPLOY_SUCCESSFUL" +const LogicalSwitchState_STATE_EDGE_CONFIG_ERROR = "EDGE_CONFIG_ERROR" +const LogicalSwitchState_STATE_VM_DEPLOYMENT_RESTARTED = "VM_DEPLOYMENT_RESTARTED" +const LogicalSwitchState_STATE_REGISTRATION_FAILED = "REGISTRATION_FAILED" +const LogicalSwitchState_STATE_TRANSPORT_NODE_SYNC_PENDING = "TRANSPORT_NODE_SYNC_PENDING" +const LogicalSwitchState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING = "TRANSPORT_NODE_CONFIGURATION_MISSING" +const LogicalSwitchState_STATE_EDGE_HARDWARE_NOT_SUPPORTED = "EDGE_HARDWARE_NOT_SUPPORTED" +const LogicalSwitchState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED = "MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED" +const LogicalSwitchState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER = "TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER" +const LogicalSwitchState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED = "TZ_ENDPOINTS_NOT_SPECIFIED" +const LogicalSwitchState_STATE_NO_PNIC_PREPARED_IN_EDGE = "NO_PNIC_PREPARED_IN_EDGE" +const LogicalSwitchState_STATE_APPLIANCE_INTERNAL_ERROR = "APPLIANCE_INTERNAL_ERROR" +const LogicalSwitchState_STATE_VTEP_DHCP_NOT_SUPPORTED = "VTEP_DHCP_NOT_SUPPORTED" +const LogicalSwitchState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE = "UNSUPPORTED_HOST_SWITCH_PROFILE" +const LogicalSwitchState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED = "UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED" +const LogicalSwitchState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND = "HOSTSWITCH_PROFILE_NOT_FOUND" +const LogicalSwitchState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED = "LLDP_SEND_ENABLED_NOT_SUPPORTED" +const LogicalSwitchState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY = "UNSUPPORTED_NAMED_TEAMING_POLICY" +const LogicalSwitchState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM = "LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM" +const LogicalSwitchState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM = "LACP_NOT_SUPPORTED_FOR_EDGE_VM" +const LogicalSwitchState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM = "STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM" +const LogicalSwitchState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE = "MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE" +const LogicalSwitchState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE = "UNSUPPORTED_LACP_LB_ALGO_FOR_NODE" +const LogicalSwitchState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED = "EDGE_NODE_VERSION_NOT_SUPPORTED" +const LogicalSwitchState_STATE_NO_PNIC_SPECIFIED_IN_TN = "NO_PNIC_SPECIFIED_IN_TN" +const LogicalSwitchState_STATE_INVALID_PNIC_DEVICE_NAME = "INVALID_PNIC_DEVICE_NAME" +const LogicalSwitchState_STATE_TRANSPORT_NODE_READY = "TRANSPORT_NODE_READY" +const LogicalSwitchState_STATE_VM_NETWORK_EDIT_PENDING = "VM_NETWORK_EDIT_PENDING" +const LogicalSwitchState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY = "UNSUPPORTED_DEFAULT_TEAMING_POLICY" +const LogicalSwitchState_STATE_MPA_DISCONNECTED = "MPA_DISCONNECTED" +const LogicalSwitchState_STATE_VM_RENAME_PENDING = "VM_RENAME_PENDING" +const LogicalSwitchState_STATE_VM_CONFIG_EDIT_PENDING = "VM_CONFIG_EDIT_PENDING" +const LogicalSwitchState_STATE_VM_NETWORK_EDIT_FAILED = "VM_NETWORK_EDIT_FAILED" +const LogicalSwitchState_STATE_VM_RENAME_FAILED = "VM_RENAME_FAILED" +const LogicalSwitchState_STATE_VM_CONFIG_EDIT_FAILED = "VM_CONFIG_EDIT_FAILED" +const LogicalSwitchState_STATE_VM_CONFIG_DISCREPANCY = "VM_CONFIG_DISCREPANCY" +const LogicalSwitchState_STATE_VM_NODE_REFRESH_FAILED = "VM_NODE_REFRESH_FAILED" +const LogicalSwitchState_STATE_VM_PLACEMENT_REFRESH_FAILED = "VM_PLACEMENT_REFRESH_FAILED" +const LogicalSwitchState_STATE_REGISTRATION_TIMEDOUT = "REGISTRATION_TIMEDOUT" +const LogicalSwitchState_STATE_REPLACE_FAILED = "REPLACE_FAILED" +const LogicalSwitchState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED = "UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED" +const LogicalSwitchState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING = "LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING" +const LogicalSwitchState_STATE_DELETE_VM_IN_REDEPLOY_FAILED = "DELETE_VM_IN_REDEPLOY_FAILED" +const LogicalSwitchState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED = "DEPLOY_VM_IN_REDEPLOY_FAILED" +const LogicalSwitchState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE = "INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE" +const LogicalSwitchState_STATE_VM_RESOURCE_RESERVATION_FAILED = "VM_RESOURCE_RESERVATION_FAILED" +const LogicalSwitchState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER = "DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER" +const LogicalSwitchState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING = "DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING" +const LogicalSwitchState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE = "EDGE_NODE_SETTINGS_MISMATCH_RESOLVE" +const LogicalSwitchState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE = "EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE" +const LogicalSwitchState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE = "EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE" +const LogicalSwitchState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE = "EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE" +const LogicalSwitchState_STATE_COMPUTE_MANAGER_NOT_FOUND = "COMPUTE_MANAGER_NOT_FOUND" +const LogicalSwitchState_STATE_DELETE_IN_PROGRESS = "DELETE_IN_PROGRESS" + +func (s *LogicalSwitchState) GetType__() bindings.BindingType { + return LogicalSwitchStateBindingType() +} + +func (s *LogicalSwitchState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalSwitchState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Logical Switch state queries result +type LogicalSwitchStateListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Logical Switch State Results + Results []LogicalSwitchState +} + +func (s *LogicalSwitchStateListResult) GetType__() bindings.BindingType { + return LogicalSwitchStateListResultBindingType() +} + +func (s *LogicalSwitchStateListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalSwitchStateListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalSwitchStatistics struct { + RxBytes *DataCounter + RxPackets *DataCounter + TxBytes *DataCounter + TxPackets *DataCounter + DroppedBySecurityPackets *PacketsDroppedBySecurity + MacLearning *MacLearningCounters + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // The id of the logical Switch + LogicalSwitchId *string +} + +func (s *LogicalSwitchStatistics) GetType__() bindings.BindingType { + return LogicalSwitchStatisticsBindingType() +} + +func (s *LogicalSwitchStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalSwitchStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalSwitchStatus struct { + // Unique ID identifying the the Logical Switch + LogicalSwitchId *string + // Count of Logical Ports belonging to this switch format: int32 + NumLogicalPorts *int64 +} + +func (s *LogicalSwitchStatus) GetType__() bindings.BindingType { + return LogicalSwitchStatusBindingType() +} + +func (s *LogicalSwitchStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalSwitchStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type LogicalSwitchStatusSummary struct { + // The filters used to find the logical switches- TransportZone id, LogicalSwitchProfile id or TransportType + Filters []Filter + // The number of logical switches that are realized in all transport nodes. format: int64 + FullyRealizedSwitches *int64 + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // The total number of logical switches. format: int64 + TotalSwitches *int64 +} + +func (s *LogicalSwitchStatusSummary) GetType__() bindings.BindingType { + return LogicalSwitchStatusSummaryBindingType() +} + +func (s *LogicalSwitchStatusSummary) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LogicalSwitchStatusSummary._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Base type for various login credential types +type LoginCredential struct { + // Possible values are 'UsernamePasswordLoginCredential', 'VerifiableAsymmetricLoginCredential', 'SessionLoginCredential'. + CredentialType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const LoginCredential__TYPE_IDENTIFIER = "LoginCredential" + +func (s *LoginCredential) GetType__() bindings.BindingType { + return LoginCredentialBindingType() +} + +func (s *LoginCredential) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for LoginCredential._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// MAC Address +type MACAddressElement struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // A MAC address. Must be 6 pairs of hexadecimal digits, upper or lower case, separated by colons or dashes. Examples: 01:23:45:67:89:ab, 01-23-45-67-89-AB. format: mac-address + MacAddress *string +} + +func (s *MACAddressElement) GetType__() bindings.BindingType { + return MACAddressElementBindingType() +} + +func (s *MACAddressElement) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MACAddressElement._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Collection of MAC address elements +type MACAddressElementListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // MAC address element list + Results []MACAddressElement +} + +func (s *MACAddressElementListResult) GetType__() bindings.BindingType { + return MACAddressElementListResultBindingType() +} + +func (s *MACAddressElementListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MACAddressElementListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// MACSet is used to group individual MAC addresses. MACSets can be used as sources and destinations in layer2 firewall rules. These can also be used as members of NSGroups. +type MACSet struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // MAC addresses format: mac-address + MacAddresses []string +} + +func (s *MACSet) GetType__() bindings.BindingType { + return MACSetBindingType() +} + +func (s *MACSet) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MACSet._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MACSetListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged collection of MACSets + Results []MACSet +} + +func (s *MACSetListResult) GetType__() bindings.BindingType { + return MACSetListResultBindingType() +} + +func (s *MACSetListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MACSetListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Information about the management plane this node is communciating with +type MPAConfigProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The list of messaging brokers this controller is configured with. + RmqBrokerCluster []BrokerProperties + // The shared secret to use when autnenticating to the management plane's message bus. Not returned in REST responses. + SharedSecret *string +} + +func (s *MPAConfigProperties) GetType__() bindings.BindingType { + return MPAConfigPropertiesBindingType() +} + +func (s *MPAConfigProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MPAConfigProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Contain mp to policy promotion history. +type MPPolicyPromotionHistory struct { + // Date and and time of the promotion operation. The date and time is stored in epoch time format. + DateTime *string + // Possible values are: + // + // * MPPolicyPromotionHistory#MPPolicyPromotionHistory_STATUS_INITIATED + // * MPPolicyPromotionHistory#MPPolicyPromotionHistory_STATUS_CANCELLED + // * MPPolicyPromotionHistory#MPPolicyPromotionHistory_STATUS_SUCCESS + // * MPPolicyPromotionHistory#MPPolicyPromotionHistory_STATUS_PARTIAL_SUCCESS + // + // Represents the type of operation in the mp to policy promotion life cycle. Can be INITIATED, CANCELLED, PARTIAL_SUCCESS or SUCCESS. + Status *string +} + +const MPPolicyPromotionHistory_STATUS_INITIATED = "INITIATED" +const MPPolicyPromotionHistory_STATUS_CANCELLED = "CANCELLED" +const MPPolicyPromotionHistory_STATUS_SUCCESS = "SUCCESS" +const MPPolicyPromotionHistory_STATUS_PARTIAL_SUCCESS = "PARTIAL_SUCCESS" + +func (s *MPPolicyPromotionHistory) GetType__() bindings.BindingType { + return MPPolicyPromotionHistoryBindingType() +} + +func (s *MPPolicyPromotionHistory) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MPPolicyPromotionHistory._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of MPPolicyPromotionHistory. +type MPPolicyPromotionHistoryList struct { + // Array of MPPolicyPromotionHistory. + Results []MPPolicyPromotionHistory +} + +func (s *MPPolicyPromotionHistoryList) GetType__() bindings.BindingType { + return MPPolicyPromotionHistoryListBindingType() +} + +func (s *MPPolicyPromotionHistoryList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MPPolicyPromotionHistoryList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Provides information if system is currently going under mp policy promotion. +type MPPolicyPromotionState struct { + // Possible values are: + // + // * MPPolicyPromotionState#MPPolicyPromotionState_MP_POLICY_PROMOTION_PROMOTION_IN_PROGRESS + // * MPPolicyPromotionState#MPPolicyPromotionState_MP_POLICY_PROMOTION_CANCELLING_PROMOTION + // * MPPolicyPromotionState#MPPolicyPromotionState_MP_POLICY_PROMOTION_PROMOTION_NOT_IN_PROGRESS + // * MPPolicyPromotionState#MPPolicyPromotionState_MP_POLICY_PROMOTION_CANCEL_FAILED + // + // Used to get the mp policy promotion state. If system is under mp to policy promotion, it will be PROMOTION_IN_PROGRESS else PROMOTION_NOT_IN_PROGRESS.State is CANCELLING_PROMOTION, if ongoing promotion is cancelled. + MpPolicyPromotion *string +} + +const MPPolicyPromotionState_MP_POLICY_PROMOTION_PROMOTION_IN_PROGRESS = "PROMOTION_IN_PROGRESS" +const MPPolicyPromotionState_MP_POLICY_PROMOTION_CANCELLING_PROMOTION = "CANCELLING_PROMOTION" +const MPPolicyPromotionState_MP_POLICY_PROMOTION_PROMOTION_NOT_IN_PROGRESS = "PROMOTION_NOT_IN_PROGRESS" +const MPPolicyPromotionState_MP_POLICY_PROMOTION_CANCEL_FAILED = "CANCEL_FAILED" + +func (s *MPPolicyPromotionState) GetType__() bindings.BindingType { + return MPPolicyPromotionStateBindingType() +} + +func (s *MPPolicyPromotionState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MPPolicyPromotionState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of Manager Ids to migrate. +type MPResource struct { + // Manager and policy resource id array. + ResourceIds []MPResourceDetails + // Manager resource type to migrate. + Type_ *string +} + +func (s *MPResource) GetType__() bindings.BindingType { + return MPResourceBindingType() +} + +func (s *MPResource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MPResource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Contains manager and policy resource id. +type MPResourceDetails struct { + // Linked resources. + LinkedIds []MPResourceLinkedDetails + // Manager resource id. + ManagerId *string + // Resource metadata. + Metadata []MPResourceMetadata + // Whether to skip/override the resource in case of multiple resource migration . By default. it will be skip. + Override *bool + // Policy resource id. + PolicyId *string + // Policy resource path. + PolicyPath *string + // Principle Identity to be used for MP to Policy promotion in GENERIC workflow.This is internal only. + PrincipleIdentity *string +} + +func (s *MPResourceDetails) GetType__() bindings.BindingType { + return MPResourceDetailsBindingType() +} + +func (s *MPResourceDetails) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MPResourceDetails._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Information about linked resource. +type MPResourceLinkedDetails struct { + // Associated resource type. + Key *string + // Resource id of the assocationed resource. + Value *string +} + +func (s *MPResourceLinkedDetails) GetType__() bindings.BindingType { + return MPResourceLinkedDetailsBindingType() +} + +func (s *MPResourceLinkedDetails) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MPResourceLinkedDetails._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Resource metadata. +type MPResourceMetadata struct { + // It has to be one of the attribute of targeted policy intent. + Key *string + // Resource metadata value. + Value *string +} + +func (s *MPResourceMetadata) GetType__() bindings.BindingType { + return MPResourceMetadataBindingType() +} + +func (s *MPResourceMetadata) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MPResourceMetadata._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MacAddressCsvListResult struct { + // File name set by HTTP server if API returns CSV result as a file. + FileName *string + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + Results []MacTableCsvRecord +} + +func (s *MacAddressCsvListResult) GetType__() bindings.BindingType { + return MacAddressCsvListResultBindingType() +} + +func (s *MacAddressCsvListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MacAddressCsvListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MacAddressListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // The id of the logical Switch + LogicalSwitchId *string + Results []MacTableEntry + // Transport node identifier + TransportNodeId *string +} + +func (s *MacAddressListResult) GetType__() bindings.BindingType { + return MacAddressListResultBindingType() +} + +func (s *MacAddressListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MacAddressListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MacLearningCounters struct { + // The number of packets with unknown source MAC address that are dispatched without learning the source MAC address. Applicable only when the MAC limit is reached and MAC Limit policy is MAC_LEARNING_LIMIT_POLICY_ALLOW. format: int64 + MacNotLearnedPacketsAllowed *int64 + // The number of packets with unknown source MAC address that are dropped without learning the source MAC address. Applicable only when the MAC limit is reached and MAC Limit policy is MAC_LEARNING_LIMIT_POLICY_DROP. format: int64 + MacNotLearnedPacketsDropped *int64 + // Number of MACs learned format: int64 + MacsLearned *int64 +} + +func (s *MacLearningCounters) GetType__() bindings.BindingType { + return MacLearningCountersBindingType() +} + +func (s *MacLearningCounters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MacLearningCounters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// MAC learning configuration +type MacLearningSpec struct { + // Aging time in sec for learned MAC address format: int32 + AgingTime *int64 + // Allowing source MAC address learning + Enabled *bool + // This property specifies the limit on the maximum number of MAC addresses that can be learned on a port. It is consumed by vswitch kernel module on the hypervisor while learning MACs per port for VMs that are local to the host. format: int32 + Limit *int64 + // Possible values are: + // + // * MacLearningSpec#MacLearningSpec_LIMIT_POLICY_ALLOW + // * MacLearningSpec#MacLearningSpec_LIMIT_POLICY_DROP + // + // The policy after MAC Limit is exceeded + LimitPolicy *string + // This property specifies the limit on the maximum number of MACs learned for a remote Virtual Machine's MAC to vtep binding per overlay logical switch. format: int32 + RemoteOverlayMacLimit *int64 + // Allowing flooding for unlearned MAC for ingress traffic + UnicastFloodingAllowed *bool +} + +const MacLearningSpec_LIMIT_POLICY_ALLOW = "ALLOW" +const MacLearningSpec_LIMIT_POLICY_DROP = "DROP" + +func (s *MacLearningSpec) GetType__() bindings.BindingType { + return MacLearningSpecBindingType() +} + +func (s *MacLearningSpec) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MacLearningSpec._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MacManagementSwitchingProfile struct { + // Allowing source MAC address change + MacChangeAllowed *bool + MacLearning *MacLearningSpec + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + RequiredCapabilities []string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const MacManagementSwitchingProfile__TYPE_IDENTIFIER = "MacManagementSwitchingProfile" + +func (s *MacManagementSwitchingProfile) GetType__() bindings.BindingType { + return MacManagementSwitchingProfileBindingType() +} + +func (s *MacManagementSwitchingProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MacManagementSwitchingProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A collection of ranges of MAC addresses +type MacPool struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Array of ranges for MAC addresses + Ranges []MacRange +} + +func (s *MacPool) GetType__() bindings.BindingType { + return MacPoolBindingType() +} + +func (s *MacPool) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MacPool._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MacPoolListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // MAC pool list results + Results []MacPool +} + +func (s *MacPoolListResult) GetType__() bindings.BindingType { + return MacPoolListResultBindingType() +} + +func (s *MacPoolListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MacPoolListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A range of MAC addresses with a start and end value +type MacRange struct { + // End value for MAC address range format: mac-address + End *string + // Start value for MAC address range format: mac-address + Start *string +} + +func (s *MacRange) GetType__() bindings.BindingType { + return MacRangeBindingType() +} + +func (s *MacRange) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MacRange._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MacTableCsvRecord struct { + // The MAC address + MacAddress *string + // RTEP group id is applicable when the logical switch is stretched across multiple sites. When rtep_group_id is set, mac_address represents remote mac_address. format: int64 + RtepGroupId *int64 + // VTEP group id is applicable when the logical switch is stretched across multiple sites. When vtep_group_id is set, mac_address represents remote mac_address. format: int64 + VtepGroupId *int64 + // The virtual tunnel endpoint IP address format: ip + VtepIp *string + // The virtual tunnel endpoint MAC address + VtepMacAddress *string +} + +func (s *MacTableCsvRecord) GetType__() bindings.BindingType { + return MacTableCsvRecordBindingType() +} + +func (s *MacTableCsvRecord) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MacTableCsvRecord._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MacTableEntry struct { + // The MAC address + MacAddress *string + // RTEP group id is applicable when the logical switch is stretched across multiple sites. When rtep_group_id is set, mac_address represents remote mac_address. format: int64 + RtepGroupId *int64 + // VTEP group id is applicable when the logical switch is stretched across multiple sites. When vtep_group_id is set, mac_address represents remote mac_address. format: int64 + VtepGroupId *int64 + // The virtual tunnel endpoint IP address format: ip + VtepIp *string + // The virtual tunnel endpoint MAC address + VtepMacAddress *string +} + +func (s *MacTableEntry) GetType__() bindings.BindingType { + return MacTableEntryBindingType() +} + +func (s *MacTableEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MacTableEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Base type for resources that are managed by API clients +type ManagedResource struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +func (s *ManagedResource) GetType__() bindings.BindingType { + return ManagedResourceBindingType() +} + +func (s *ManagedResource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ManagedResource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ManagementClusterNodeStatus struct { + // Possible values are: + // + // * ManagementClusterNodeStatus#ManagementClusterNodeStatus_MGMT_CLUSTER_STATUS_CONNECTED + // * ManagementClusterNodeStatus#ManagementClusterNodeStatus_MGMT_CLUSTER_STATUS_DISCONNECTED + // * ManagementClusterNodeStatus#ManagementClusterNodeStatus_MGMT_CLUSTER_STATUS_UNKNOWN + // + // Status of this node's connection to the management cluster + MgmtClusterStatus *string +} + +const ManagementClusterNodeStatus_MGMT_CLUSTER_STATUS_CONNECTED = "CONNECTED" +const ManagementClusterNodeStatus_MGMT_CLUSTER_STATUS_DISCONNECTED = "DISCONNECTED" +const ManagementClusterNodeStatus_MGMT_CLUSTER_STATUS_UNKNOWN = "UNKNOWN" + +func (s *ManagementClusterNodeStatus) GetType__() bindings.BindingType { + return ManagementClusterNodeStatusBindingType() +} + +func (s *ManagementClusterNodeStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ManagementClusterNodeStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ManagementClusterRoleConfig struct { + // Possible values are: + // + // * ManagementClusterRoleConfig#ManagementClusterRoleConfig_TYPE_MANAGEMENTCLUSTERROLECONFIG + // * ManagementClusterRoleConfig#ManagementClusterRoleConfig_TYPE_CONTROLLERCLUSTERROLECONFIG + // + // Type of this role configuration + Type_ *string + ApiListenAddr *ServiceEndpoint + ApplianceConnectionInfo *ServiceEndpoint + MgmtClusterListenAddr *ServiceEndpoint + MgmtPlaneListenAddr *ServiceEndpoint + MpaMsgClientInfo *MsgClientInfo +} + +const ManagementClusterRoleConfig_TYPE_MANAGEMENTCLUSTERROLECONFIG = "ManagementClusterRoleConfig" +const ManagementClusterRoleConfig_TYPE_CONTROLLERCLUSTERROLECONFIG = "ControllerClusterRoleConfig" + +func (s *ManagementClusterRoleConfig) GetType__() bindings.BindingType { + return ManagementClusterRoleConfigBindingType() +} + +func (s *ManagementClusterRoleConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ManagementClusterRoleConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ManagementClusterStatus struct { + // Current missing management plane nodes + OfflineNodes []ManagementPlaneBaseNodeInfo + // Current alive management plane nodes + OnlineNodes []ManagementPlaneBaseNodeInfo + // The details of the cluster nodes required for cluster initialization + RequiredMembersForInitialization []ClusterInitializationNodeInfo + // Possible values are: + // + // * ManagementClusterStatus#ManagementClusterStatus_STATUS_INITIALIZING + // * ManagementClusterStatus#ManagementClusterStatus_STATUS_UNSTABLE + // * ManagementClusterStatus#ManagementClusterStatus_STATUS_DEGRADED + // * ManagementClusterStatus#ManagementClusterStatus_STATUS_STABLE + // * ManagementClusterStatus#ManagementClusterStatus_STATUS_UNKNOWN + // + // The current status of the management cluster + Status *string +} + +const ManagementClusterStatus_STATUS_INITIALIZING = "INITIALIZING" +const ManagementClusterStatus_STATUS_UNSTABLE = "UNSTABLE" +const ManagementClusterStatus_STATUS_DEGRADED = "DEGRADED" +const ManagementClusterStatus_STATUS_STABLE = "STABLE" +const ManagementClusterStatus_STATUS_UNKNOWN = "UNKNOWN" + +func (s *ManagementClusterStatus) GetType__() bindings.BindingType { + return ManagementClusterStatusBindingType() +} + +func (s *ManagementClusterStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ManagementClusterStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ManagementConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // True if Management nodes publish their fqdns(instead of default IP addresses) across NSX for its reachability. + PublishFqdns *bool +} + +func (s *ManagementConfig) GetType__() bindings.BindingType { + return ManagementConfigBindingType() +} + +func (s *ManagementConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ManagementConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ManagementNodeAggregateInfo struct { + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Array of Node interface statistic properties + NodeInterfaceProperties []NodeInterfaceProperties + // Array of Node network interface statistic properties + NodeInterfaceStatistics []NodeInterfaceStatisticsProperties + NodeStatus *ClusterNodeStatus + // Time series of the node's system properties + NodeStatusProperties []NodeStatusProperties + RoleConfig *ManagementClusterRoleConfig + TransportNodesConnected *int64 +} + +func (s *ManagementNodeAggregateInfo) GetType__() bindings.BindingType { + return ManagementNodeAggregateInfoBindingType() +} + +func (s *ManagementNodeAggregateInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ManagementNodeAggregateInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The basic node info of management plane node +type ManagementPlaneBaseNodeInfo struct { + // The IP address of MP node + MgmtClusterListenIpAddress *string + // Management plane node UUID + Uuid *string +} + +func (s *ManagementPlaneBaseNodeInfo) GetType__() bindings.BindingType { + return ManagementPlaneBaseNodeInfoBindingType() +} + +func (s *ManagementPlaneBaseNodeInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ManagementPlaneBaseNodeInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Information about a management plane node this controller is configured to communicate with +type ManagementPlaneBrokerProperties struct { + // IP address or hostname of the message bus broker on the management plane node. format: hostname-or-ipv4 + Host *string + // Port number of the message bus broker on the management plane node. format: int64 + Port *int64 + // Certificate thumbprint of the message bus broker on the management plane node. + Thumbprint *string +} + +func (s *ManagementPlaneBrokerProperties) GetType__() bindings.BindingType { + return ManagementPlaneBrokerPropertiesBindingType() +} + +func (s *ManagementPlaneBrokerProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ManagementPlaneBrokerProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Information about the management plane this controller is communciating with +type ManagementPlaneProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The list of messaging brokers this controller is configured with. + Brokers []ManagementPlaneBrokerProperties + // The shared secret to use when autnenticating to the management plane's message bus. Not returned in REST responses. + Secret *string +} + +func (s *ManagementPlaneProperties) GetType__() bindings.BindingType { + return ManagementPlanePropertiesBindingType() +} + +func (s *ManagementPlaneProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ManagementPlaneProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Information about mandatory access control +type MandatoryAccessControlProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Enabled can be True/False + Enabled *bool + // Possible values are: + // + // * MandatoryAccessControlProperties#MandatoryAccessControlProperties_STATUS_ENABLED + // * MandatoryAccessControlProperties#MandatoryAccessControlProperties_STATUS_DISABLED + // * MandatoryAccessControlProperties#MandatoryAccessControlProperties_STATUS_ENABLED_PENDING_REBOOT + // + // current status of Mandatory Access Control + Status *string +} + +const MandatoryAccessControlProperties_STATUS_ENABLED = "ENABLED" +const MandatoryAccessControlProperties_STATUS_DISABLED = "DISABLED" +const MandatoryAccessControlProperties_STATUS_ENABLED_PENDING_REBOOT = "ENABLED_PENDING_REBOOT" + +func (s *MandatoryAccessControlProperties) GetType__() bindings.BindingType { + return MandatoryAccessControlPropertiesBindingType() +} + +func (s *MandatoryAccessControlProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MandatoryAccessControlProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Describes a manual check to evaluate the status of a transport zone. +type ManualHealthCheck struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * ManualHealthCheck#ManualHealthCheck_OPERATION_STATUS_IN_PROGRESS + // * ManualHealthCheck#ManualHealthCheck_OPERATION_STATUS_FINISHED + // + // The operation status for health check + OperationStatus *string + Result *HealthCheckResult + // The entity ID works as a filter param. Entity ID and entity type should be both provided or not at a query. + TransportZoneId *string + Vlans *HealthCheckSpecVlans +} + +const ManualHealthCheck_OPERATION_STATUS_IN_PROGRESS = "IN_PROGRESS" +const ManualHealthCheck_OPERATION_STATUS_FINISHED = "FINISHED" + +func (s *ManualHealthCheck) GetType__() bindings.BindingType { + return ManualHealthCheckBindingType() +} + +func (s *ManualHealthCheck) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ManualHealthCheck._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Manual health check list result for query with list parameters. +type ManualHealthCheckListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Manual Health Check List + Results []ManualHealthCheck +} + +func (s *ManualHealthCheckListResult) GetType__() bindings.BindingType { + return ManualHealthCheckListResultBindingType() +} + +func (s *ManualHealthCheckListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ManualHealthCheckListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Relative to the form factor pre-defined reservation value. To reduce reservation of a VM to 50 percent, a user may specify 50 instead of the absolute number relevant for the edge form factor. +type MemoryReservation struct { + // Memory reserved relative to the default reservation of 100 percent. For example, take an edge virtual machine of medium form factor. By default, an edge of medium form factor is configured with 8 GB of memory and with reservation of 100 percent. So, 8 GB of memory is reserved. If you specify reservation_percentage value as 50 percent, then 4 GB of memory will be reserved. format: int32 + ReservationPercentage *int64 +} + +func (s *MemoryReservation) GetType__() bindings.BindingType { + return MemoryReservationBindingType() +} + +func (s *MemoryReservation) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MemoryReservation._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MessagingClientInfo struct { + // Account name in messaging client + AccountName *string + // Possible values are: + // + // * MessagingClientInfo#MessagingClientInfo_CLIENT_TYPE_MPA + // * MessagingClientInfo#MessagingClientInfo_CLIENT_TYPE_HOST + // + // Type of messaging client + ClientType *string +} + +const MessagingClientInfo_CLIENT_TYPE_MPA = "MPA" +const MessagingClientInfo_CLIENT_TYPE_HOST = "HOST" + +func (s *MessagingClientInfo) GetType__() bindings.BindingType { + return MessagingClientInfoBindingType() +} + +func (s *MessagingClientInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MessagingClientInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MetadataProxy struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // id of attached logical port + AttachedLogicalPortId *string + // Possible values are: + // + // * MetadataProxy#MetadataProxy_CRYPTO_PROTOCOLS_V1 + // * MetadataProxy#MetadataProxy_CRYPTO_PROTOCOLS_V1_1 + // * MetadataProxy#MetadataProxy_CRYPTO_PROTOCOLS_V1_2 + // + // The cryptographic protocols listed here are supported by the metadata proxy. The TLSv1.1 and TLSv1.2 are supported by default. + CryptoProtocols []string + // edge cluster uuid + EdgeClusterId *string + // If none is provided, the NSX will auto-select two edge-nodes from the given edge cluster. If user provides only one edge node, there will be no HA support. format: int64 + EdgeClusterMemberIndexes []int64 + // Flag to enable the auto-relocation of standby Metadata Proxy in case of edge node failure. Only tier 1 and auto placed Metadata Proxy are considered for the relocation. + EnableStandbyRelocation *bool + // The CAs referenced here must be uploaded to the truststore using the API POST /api/v1/trust-management/certificates?action=import. User needs to ensure a correct CA for this metedata server is used. The REST API can not detect a wrong CA which was used to verify a different server. If the Metadata Proxy reports an ERROR or NO_BACKUP status, user can check the metadata proxy log at transport node for a possible CA issue. + MetadataServerCaIds []string + // The URL in format scheme://host:port/path. Please note, the scheme supports only http and https as of now, port supports range 3000 - 9000, inclusive. + MetadataServerUrl *string + // secret to access metadata server + Secret *string +} + +const MetadataProxy_CRYPTO_PROTOCOLS_V1 = "TLS_V1" +const MetadataProxy_CRYPTO_PROTOCOLS_V1_1 = "TLS_V1_1" +const MetadataProxy_CRYPTO_PROTOCOLS_V1_2 = "TLS_V1_2" + +func (s *MetadataProxy) GetType__() bindings.BindingType { + return MetadataProxyBindingType() +} + +func (s *MetadataProxy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MetadataProxy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MetadataProxyListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // paginated list of metadata proxies + Results []MetadataProxy +} + +func (s *MetadataProxyListResult) GetType__() bindings.BindingType { + return MetadataProxyListResultBindingType() +} + +func (s *MetadataProxyListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MetadataProxyListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MetadataProxyStatistics struct { + // metadata proxy uuid + MetadataProxyId *string + // metadata proxy statistics per logical switch + Statistics []MetadataProxyStatisticsPerLogicalSwitch + // timestamp of the statistics format: int64 + Timestamp *int64 +} + +func (s *MetadataProxyStatistics) GetType__() bindings.BindingType { + return MetadataProxyStatisticsBindingType() +} + +func (s *MetadataProxyStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MetadataProxyStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MetadataProxyStatisticsPerLogicalSwitch struct { + // error responses from nova server format: int64 + ErrorResponsesFromNovaServer *int64 + // uuid of attached logical switch + LogicalSwitchId *string + // requests from clients format: int64 + RequestsFromClients *int64 + // requests to nova server format: int64 + RequestsToNovaServer *int64 + // responses to clients format: int64 + ResponsesToClients *int64 + // succeeded responses from nova server format: int64 + SucceededResponsesFromNovaServer *int64 +} + +func (s *MetadataProxyStatisticsPerLogicalSwitch) GetType__() bindings.BindingType { + return MetadataProxyStatisticsPerLogicalSwitchBindingType() +} + +func (s *MetadataProxyStatisticsPerLogicalSwitch) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MetadataProxyStatisticsPerLogicalSwitch._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MetadataProxyStatus struct { + // Error message, if available + ErrorMessage *string + // Possible values are: + // + // * MetadataProxyStatus#MetadataProxyStatus_PROXY_STATUS_UP + // * MetadataProxyStatus#MetadataProxyStatus_PROXY_STATUS_DOWN + // * MetadataProxyStatus#MetadataProxyStatus_PROXY_STATUS_ERROR + // * MetadataProxyStatus#MetadataProxyStatus_PROXY_STATUS_NO_BACKUP + // + // UP means the metadata proxy is working fine on both transport-nodes(if have); DOWN means the metadata proxy is is down on both transport-nodes(if have), hence the metadata proxy will not repsonse any metadata request; Error means error happens on transport-node(s) or no status is reported from transport-node(s). The metadata proxy may be working (or not working); NO_BACK means metadata proxy is working in one of the transport node while not in the other transport-node (if have). Hence if the metadata proxy in the working transport-node goes down, the metadata proxy will go down. + ProxyStatus *string + // Order of the transport nodes is insensitive because Metadata Proxy is running in Active-Active mode among target transport nodes. + TransportNodes []string +} + +const MetadataProxyStatus_PROXY_STATUS_UP = "UP" +const MetadataProxyStatus_PROXY_STATUS_DOWN = "DOWN" +const MetadataProxyStatus_PROXY_STATUS_ERROR = "ERROR" +const MetadataProxyStatus_PROXY_STATUS_NO_BACKUP = "NO_BACKUP" + +func (s *MetadataProxyStatus) GetType__() bindings.BindingType { + return MetadataProxyStatusBindingType() +} + +func (s *MetadataProxyStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MetadataProxyStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MgmtConnStatus struct { + // Possible values are: + // + // * MgmtConnStatus#MgmtConnStatus_CONNECTIVITY_STATUS_CONNECTED + // * MgmtConnStatus#MgmtConnStatus_CONNECTIVITY_STATUS_DISCONNECTED + // * MgmtConnStatus#MgmtConnStatus_CONNECTIVITY_STATUS_UNKNOWN + // + // Indicates the controller node's MP channel connectivity status + ConnectivityStatus *string +} + +const MgmtConnStatus_CONNECTIVITY_STATUS_CONNECTED = "CONNECTED" +const MgmtConnStatus_CONNECTIVITY_STATUS_DISCONNECTED = "DISCONNECTED" +const MgmtConnStatus_CONNECTIVITY_STATUS_UNKNOWN = "UNKNOWN" + +func (s *MgmtConnStatus) GetType__() bindings.BindingType { + return MgmtConnStatusBindingType() +} + +func (s *MgmtConnStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MgmtConnStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Migrated resource. +type MigratedObject struct { + // Parent resource id. + ParentResourceId *string + // Parent resource type. + ParentResourceType *string + // Policy id. + PolicyId *string + // Policy path. + PolicyPath *string + // Resource id. + ResourceId *string + // Resource type. + ResourceType *string +} + +func (s *MigratedObject) GetType__() bindings.BindingType { + return MigratedObjectBindingType() +} + +func (s *MigratedObject) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigratedObject._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MigratedObjectListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Migrated resource list results. + Results []MigratedObject +} + +func (s *MigratedObjectListResult) GetType__() bindings.BindingType { + return MigratedObjectListResultBindingType() +} + +func (s *MigratedObjectListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigratedObjectListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MigrationDataDownloadRequest struct { + // Id of the site in NSX-T Federation + FederationSiteId *string + // Possible values are: + // + // * MigrationDataDownloadRequest#MigrationDataDownloadRequest_FILE_TYPE_VRA_INPUT + // * MigrationDataDownloadRequest#MigrationDataDownloadRequest_FILE_TYPE_VRA_OUTPUT + // * MigrationDataDownloadRequest#MigrationDataDownloadRequest_FILE_TYPE_EDGE_CUTOVER_MAPPING + // * MigrationDataDownloadRequest#MigrationDataDownloadRequest_FILE_TYPE_BYOT_L3_MAPPING + // * MigrationDataDownloadRequest#MigrationDataDownloadRequest_FILE_TYPE_AVI_LB_MAPPING + // + // Type of the Migration data file that needs to be downloaded. + FileType *string +} + +const MigrationDataDownloadRequest_FILE_TYPE_VRA_INPUT = "VRA_INPUT" +const MigrationDataDownloadRequest_FILE_TYPE_VRA_OUTPUT = "VRA_OUTPUT" +const MigrationDataDownloadRequest_FILE_TYPE_EDGE_CUTOVER_MAPPING = "EDGE_CUTOVER_MAPPING" +const MigrationDataDownloadRequest_FILE_TYPE_BYOT_L3_MAPPING = "BYOT_L3_MAPPING" +const MigrationDataDownloadRequest_FILE_TYPE_AVI_LB_MAPPING = "AVI_LB_MAPPING" + +func (s *MigrationDataDownloadRequest) GetType__() bindings.BindingType { + return MigrationDataDownloadRequestBindingType() +} + +func (s *MigrationDataDownloadRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationDataDownloadRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MigrationDataInfo struct { + // Id of the site in NSX-T Federation + FederationSiteId *string + // Absolute location of the file. + FileLocation *string + // Possible values are: + // + // * MigrationDataInfo#MigrationDataInfo_FILE_TYPE_VRA_INPUT + // * MigrationDataInfo#MigrationDataInfo_FILE_TYPE_VRA_OUTPUT + // * MigrationDataInfo#MigrationDataInfo_FILE_TYPE_EDGE_CUTOVER_MAPPING + // * MigrationDataInfo#MigrationDataInfo_FILE_TYPE_BYOT_L3_MAPPING + // * MigrationDataInfo#MigrationDataInfo_FILE_TYPE_AVI_LB_MAPPING + // + // Type of the Migration data file for which info is requested. + FileType *string + // Indicates if the file is present. + IsPresent *bool +} + +const MigrationDataInfo_FILE_TYPE_VRA_INPUT = "VRA_INPUT" +const MigrationDataInfo_FILE_TYPE_VRA_OUTPUT = "VRA_OUTPUT" +const MigrationDataInfo_FILE_TYPE_EDGE_CUTOVER_MAPPING = "EDGE_CUTOVER_MAPPING" +const MigrationDataInfo_FILE_TYPE_BYOT_L3_MAPPING = "BYOT_L3_MAPPING" +const MigrationDataInfo_FILE_TYPE_AVI_LB_MAPPING = "AVI_LB_MAPPING" + +func (s *MigrationDataInfo) GetType__() bindings.BindingType { + return MigrationDataInfoBindingType() +} + +func (s *MigrationDataInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationDataInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Categorization of feedback requests from the migration tool where user input is required. +type MigrationFeedbackCategory struct { + // List of acceptable values for this feedback request. + AcceptedValues []string + // Functional area that this query falls into. + Category *string + // Total number of feedback requests for this functional area. format: int32 + Count *int64 + // Total number of resolved feedback requests for this functional area. format: int32 + Resolved *int64 +} + +func (s *MigrationFeedbackCategory) GetType__() bindings.BindingType { + return MigrationFeedbackCategoryBindingType() +} + +func (s *MigrationFeedbackCategory) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationFeedbackCategory._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Detailed feedback requests from the migration tool where user input is required. +type MigrationFeedbackRequest struct { + // List of acceptable actions for this feedback request. + AcceptedActions []string + // Data type of the items listed in acceptable values list. + AcceptedValueType *string + // List of acceptable values for this feedback request. + AcceptedValues []string + // Id of the site in NSX-T Federation + FederationSiteId *string + // Identify a feedback request type across objects. This can be used to group together objects with similar feedback request and resolve them in one go. + Hash *string + // Identifier of the feedback request. + Id *string + // Detailed feedback request with options. + Message *string + // Indicates if multiple values can be selected as response from the list of acceptable value. + MultiValue *bool + // Identifier of the object for which feedback is requested. + ObjectId *string + // Indicates if previous response was invalid. Please provide a valid response. + Rejected *bool + // If the feedback request was resolved earlier, provides details about the previous resolution. + Resolution *string + // Indicates if a valid response already exist for this feedback request. + Resolved *bool + // Functional sub-area that this query falls into. + SubVertical *string + // The suggested action to resolve this feedback request. + SuggestedAction *string + // The suggested value to resolve this feedback request. + SuggestedValue *string + // Identifier for this object in the source NSX endpoint. + VObjectId *string + // Name of this object in the source NSX endpoint. + VObjectName *string + // Functional area that this query falls into. + Vertical *string +} + +func (s *MigrationFeedbackRequest) GetType__() bindings.BindingType { + return MigrationFeedbackRequestBindingType() +} + +func (s *MigrationFeedbackRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationFeedbackRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of detailed feedback requests from the migration tool where user input is required. +type MigrationFeedbackRequestListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged Collection of feedback requests + Results []MigrationFeedbackRequest +} + +func (s *MigrationFeedbackRequestListResult) GetType__() bindings.BindingType { + return MigrationFeedbackRequestListResultBindingType() +} + +func (s *MigrationFeedbackRequestListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationFeedbackRequestListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Detailed feedback requests from the migration tool where user input is required. +type MigrationFeedbackResponse struct { + // Action selected in response to the feedback request. + Action *string + // Identifier of the feedback request. + Id *string + // User input provided in response to the feedback request. + Value *string + // User input provided in the form of a list of values in response to the feedback request. + Values []string +} + +func (s *MigrationFeedbackResponse) GetType__() bindings.BindingType { + return MigrationFeedbackResponseBindingType() +} + +func (s *MigrationFeedbackResponse) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationFeedbackResponse._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of detailed feedback response for the migration tool. +type MigrationFeedbackResponseList struct { + // List of feedback responses. + ResponseList []MigrationFeedbackResponse +} + +func (s *MigrationFeedbackResponseList) GetType__() bindings.BindingType { + return MigrationFeedbackResponseListBindingType() +} + +func (s *MigrationFeedbackResponseList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationFeedbackResponseList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of feedback categories and count of requests in each category. +type MigrationFeedbackSummaryListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Possible values are: + // + // * MigrationFeedbackSummaryListResult#MigrationFeedbackSummaryListResult_FEEDBACK_RESOLUTION_JOB_STATUS_RUNNING + // * MigrationFeedbackSummaryListResult#MigrationFeedbackSummaryListResult_FEEDBACK_RESOLUTION_JOB_STATUS_NOT_RUNNING + // + // Feedback resolution job status + FeedbackResolutionJobStatus *string + // Paged Collection of feedback categories + Results []MigrationFeedbackCategory +} + +const MigrationFeedbackSummaryListResult_FEEDBACK_RESOLUTION_JOB_STATUS_RUNNING = "RUNNING" +const MigrationFeedbackSummaryListResult_FEEDBACK_RESOLUTION_JOB_STATUS_NOT_RUNNING = "NOT_RUNNING" + +func (s *MigrationFeedbackSummaryListResult) GetType__() bindings.BindingType { + return MigrationFeedbackSummaryListResultBindingType() +} + +func (s *MigrationFeedbackSummaryListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationFeedbackSummaryListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MigrationPlanSettings struct { + // Migration Method to specify whether the migration is to be performed serially or in parallel + Parallel *bool + // Flag to indicate whether to pause the migration after migration of each group is completed + PauseAfterEachGroup *bool + // Flag to indicate whether to pause the migration plan execution when an error occurs + PauseOnError *bool +} + +func (s *MigrationPlanSettings) GetType__() bindings.BindingType { + return MigrationPlanSettingsBindingType() +} + +func (s *MigrationPlanSettings) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationPlanSettings._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Details about source and destination NSX setup to be migrated +type MigrationSetupInfo struct { + AviLbEndpoint *AviEndPoint + // Flag to indicate whether to create missing segment ports + CreateSegmentPorts *bool + DestinationNsx *DestinationNsxApiEndpoint + // Possible values are: + // + // * MigrationSetupInfo#MigrationSetupInfo_ESG_TO_ROUTER_MAPPING_OPTION_UI + // * MigrationSetupInfo#MigrationSetupInfo_ESG_TO_ROUTER_MAPPING_OPTION_FILE_UPLOAD + // * MigrationSetupInfo#MigrationSetupInfo_ESG_TO_ROUTER_MAPPING_OPTION_NO_MAPPING + // + // Mapping option can be - - UI - FILE_UPLOAD - NO_MAPPING + EsgToRouterMappingOption *string + // Possible values are: + // + // * MigrationSetupInfo#MigrationSetupInfo_MIGRATION_MODE_VMC_V2T + // * MigrationSetupInfo#MigrationSetupInfo_MIGRATION_MODE_ONPREMISE_VSPHERE2T + // * MigrationSetupInfo#MigrationSetupInfo_MIGRATION_MODE_ONPREMISE_V2T + // * MigrationSetupInfo#MigrationSetupInfo_MIGRATION_MODE_CMP_VRA + // * MigrationSetupInfo#MigrationSetupInfo_MIGRATION_MODE_FULL_MIGRATION_WITH_BYOT + // * MigrationSetupInfo#MigrationSetupInfo_MIGRATION_MODE_FULL_MIGRATION_WITH_BYOT_ON_FEDERATION + // * MigrationSetupInfo#MigrationSetupInfo_MIGRATION_MODE_FULL_MIGRATION_WITH_BYOT_AND_VRA + // * MigrationSetupInfo#MigrationSetupInfo_MIGRATION_MODE_FULL_MIGRATION_WITH_BYOT_AND_VRA_ON_FEDERATION + // * MigrationSetupInfo#MigrationSetupInfo_MIGRATION_MODE_CONFIG_MIGRATION_ONLY_WITH_BYOT + // * MigrationSetupInfo#MigrationSetupInfo_MIGRATION_MODE_CONFIG_MIGRATION_ONLY_WITH_BYOT_ON_FEDERATION + // * MigrationSetupInfo#MigrationSetupInfo_MIGRATION_MODE_EDGE_CUTOVER + // * MigrationSetupInfo#MigrationSetupInfo_MIGRATION_MODE_DFW_ONLY + // * MigrationSetupInfo#MigrationSetupInfo_MIGRATION_MODE_DFW_WITH_BRIDGED_SEG + // * MigrationSetupInfo#MigrationSetupInfo_MIGRATION_MODE_DFW_AND_HOST_AND_WORKLOAD + // * MigrationSetupInfo#MigrationSetupInfo_MIGRATION_MODE_DFW_AND_HOST_AND_WORKLOAD_WITH_BRIDGED_SEG + // + // Migration mode can be - - VMC_V2T - ONPREMISE_VSPHERE2T - ONPREMISE_V2T - CMP_VRA - FULL_MIGRATION_WITH_BYOT - FULL_MIGRATION_WITH_BYOT_ON_FEDERATION - FULL_MIGRATION_WITH_BYOT_AND_VRA - FULL_MIGRATION_WITH_BYOT_AND_VRA_ON_FEDERATION - CONFIG_MIGRATION_ONLY_WITH_BYOT - CONFIG_MIGRATION_ONLY_WITH_BYOT_ON_FEDERATION - EDGE_CUTOVER - DFW_ONLY - DFW_WITH_BRIDGED_SEG - DFW_AND_HOST_AND_WORKLOAD - DFW_AND_HOST_AND_WORKLOAD_WITH_BRIDGED_SEG + MigrationMode *string + // List of mappings between NSX-T site and Avi. This will be populated only when the migration is executed on a cross VC setup. + NsxtSiteToAviMappings []NsxtSiteToAviMapping + // Comprehensive information about NSX-T multi site setup. This will be populated only when the migration is executed on a cross VC setup. + NsxtSites []NsxtSite + // Comprehensive information about NSX-V multi site setup. This will be populated only when the migration is executed on a cross VC setup. + NsxvSites []SourceNsxApiEndpoint + // List of source NSX manager endpoints. + SourceNsx []SourceNsxApiEndpoint + // List of site mappings between NSX-V and NSX-T. This will be populated only when the migration is executed on a cross VC setup. + V2tSiteMappings []V2tSiteMapping +} + +const MigrationSetupInfo_ESG_TO_ROUTER_MAPPING_OPTION_UI = "UI" +const MigrationSetupInfo_ESG_TO_ROUTER_MAPPING_OPTION_FILE_UPLOAD = "FILE_UPLOAD" +const MigrationSetupInfo_ESG_TO_ROUTER_MAPPING_OPTION_NO_MAPPING = "NO_MAPPING" +const MigrationSetupInfo_MIGRATION_MODE_VMC_V2T = "VMC_V2T" +const MigrationSetupInfo_MIGRATION_MODE_ONPREMISE_VSPHERE2T = "ONPREMISE_VSPHERE2T" +const MigrationSetupInfo_MIGRATION_MODE_ONPREMISE_V2T = "ONPREMISE_V2T" +const MigrationSetupInfo_MIGRATION_MODE_CMP_VRA = "CMP_VRA" +const MigrationSetupInfo_MIGRATION_MODE_FULL_MIGRATION_WITH_BYOT = "FULL_MIGRATION_WITH_BYOT" +const MigrationSetupInfo_MIGRATION_MODE_FULL_MIGRATION_WITH_BYOT_ON_FEDERATION = "FULL_MIGRATION_WITH_BYOT_ON_FEDERATION" +const MigrationSetupInfo_MIGRATION_MODE_FULL_MIGRATION_WITH_BYOT_AND_VRA = "FULL_MIGRATION_WITH_BYOT_AND_VRA" +const MigrationSetupInfo_MIGRATION_MODE_FULL_MIGRATION_WITH_BYOT_AND_VRA_ON_FEDERATION = "FULL_MIGRATION_WITH_BYOT_AND_VRA_ON_FEDERATION" +const MigrationSetupInfo_MIGRATION_MODE_CONFIG_MIGRATION_ONLY_WITH_BYOT = "CONFIG_MIGRATION_ONLY_WITH_BYOT" +const MigrationSetupInfo_MIGRATION_MODE_CONFIG_MIGRATION_ONLY_WITH_BYOT_ON_FEDERATION = "CONFIG_MIGRATION_ONLY_WITH_BYOT_ON_FEDERATION" +const MigrationSetupInfo_MIGRATION_MODE_EDGE_CUTOVER = "EDGE_CUTOVER" +const MigrationSetupInfo_MIGRATION_MODE_DFW_ONLY = "DFW_ONLY" +const MigrationSetupInfo_MIGRATION_MODE_DFW_WITH_BRIDGED_SEG = "DFW_WITH_BRIDGED_SEG" +const MigrationSetupInfo_MIGRATION_MODE_DFW_AND_HOST_AND_WORKLOAD = "DFW_AND_HOST_AND_WORKLOAD" +const MigrationSetupInfo_MIGRATION_MODE_DFW_AND_HOST_AND_WORKLOAD_WITH_BRIDGED_SEG = "DFW_AND_HOST_AND_WORKLOAD_WITH_BRIDGED_SEG" + +func (s *MigrationSetupInfo) GetType__() bindings.BindingType { + return MigrationSetupInfoBindingType() +} + +func (s *MigrationSetupInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationSetupInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Provide stats about ongoing MP2Policy promotion. +type MigrationStats struct { + // failed mp resource count + FailedObjectsCount *string + // promoted mp resource count + PromotedObjectsCount *string + // Possible values are: + // + // * MigrationStats#MigrationStats_PROMOTION_STATUS_NOT_STARTED + // * MigrationStats#MigrationStats_PROMOTION_STATUS_IN_PROGRESS + // * MigrationStats#MigrationStats_PROMOTION_STATUS_PROCESSING + // * MigrationStats#MigrationStats_PROMOTION_STATUS_DONE + // + // Promotion status + PromotionStatus *string + // Resource type + ResourceType *string + // Total mp resource count + TotalCount *string +} + +const MigrationStats_PROMOTION_STATUS_NOT_STARTED = "NOT_STARTED" +const MigrationStats_PROMOTION_STATUS_IN_PROGRESS = "IN_PROGRESS" +const MigrationStats_PROMOTION_STATUS_PROCESSING = "PROCESSING" +const MigrationStats_PROMOTION_STATUS_DONE = "DONE" + +func (s *MigrationStats) GetType__() bindings.BindingType { + return MigrationStatsBindingType() +} + +func (s *MigrationStats) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationStats._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MigrationStatsResult struct { + // This field used by UI which highlights the current resource type in promotion. + CurrentResourceTypeInPromotion *string + // Promotion stats list results. + MigrationStats []MigrationStats + // Count of all objects being promoted. It is equal to sum of total_count for each resource type. format: int64 + TotalCount *int64 +} + +func (s *MigrationStatsResult) GetType__() bindings.BindingType { + return MigrationStatsResultBindingType() +} + +func (s *MigrationStatsResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationStatsResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MigrationStatus struct { + // List of component statuses + ComponentStatus []ComponentMigrationStatus + // Possible values are: + // + // * MigrationStatus#MigrationStatus_OVERALL_MIGRATION_STATUS_SUCCESS + // * MigrationStatus#MigrationStatus_OVERALL_MIGRATION_STATUS_FAILED + // * MigrationStatus#MigrationStatus_OVERALL_MIGRATION_STATUS_IN_PROGRESS + // * MigrationStatus#MigrationStatus_OVERALL_MIGRATION_STATUS_NOT_STARTED + // * MigrationStatus#MigrationStatus_OVERALL_MIGRATION_STATUS_PAUSING + // * MigrationStatus#MigrationStatus_OVERALL_MIGRATION_STATUS_PAUSED + // + // Status of migration + OverallMigrationStatus *string +} + +const MigrationStatus_OVERALL_MIGRATION_STATUS_SUCCESS = "SUCCESS" +const MigrationStatus_OVERALL_MIGRATION_STATUS_FAILED = "FAILED" +const MigrationStatus_OVERALL_MIGRATION_STATUS_IN_PROGRESS = "IN_PROGRESS" +const MigrationStatus_OVERALL_MIGRATION_STATUS_NOT_STARTED = "NOT_STARTED" +const MigrationStatus_OVERALL_MIGRATION_STATUS_PAUSING = "PAUSING" +const MigrationStatus_OVERALL_MIGRATION_STATUS_PAUSED = "PAUSED" + +func (s *MigrationStatus) GetType__() bindings.BindingType { + return MigrationStatusBindingType() +} + +func (s *MigrationStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MigrationSummary struct { + ComponentTargetVersions []ComponentTargetVersion + // Current version of migration coordinator + MigrationCoordinatorVersion *string + // Possible values are: + // + // * MigrationSummary#MigrationSummary_MIGRATION_STATUS_SUCCESS + // * MigrationSummary#MigrationSummary_MIGRATION_STATUS_FAILED + // * MigrationSummary#MigrationSummary_MIGRATION_STATUS_IN_PROGRESS + // * MigrationSummary#MigrationSummary_MIGRATION_STATUS_NOT_STARTED + // * MigrationSummary#MigrationSummary_MIGRATION_STATUS_PAUSING + // * MigrationSummary#MigrationSummary_MIGRATION_STATUS_PAUSED + // + // Status of migration + MigrationStatus *string + // Current system version + SystemVersion *string + // Target system version + TargetVersion *string +} + +const MigrationSummary_MIGRATION_STATUS_SUCCESS = "SUCCESS" +const MigrationSummary_MIGRATION_STATUS_FAILED = "FAILED" +const MigrationSummary_MIGRATION_STATUS_IN_PROGRESS = "IN_PROGRESS" +const MigrationSummary_MIGRATION_STATUS_NOT_STARTED = "NOT_STARTED" +const MigrationSummary_MIGRATION_STATUS_PAUSING = "PAUSING" +const MigrationSummary_MIGRATION_STATUS_PAUSED = "PAUSED" + +func (s *MigrationSummary) GetType__() bindings.BindingType { + return MigrationSummaryBindingType() +} + +func (s *MigrationSummary) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationSummary._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Details about switch to be migrated +type MigrationSwitchInfo struct { + // Switch Identifier. + Id *string + // Possible values are: + // + // * MigrationSwitchInfo#MigrationSwitchInfo_KIND_DVS + // * MigrationSwitchInfo#MigrationSwitchInfo_KIND_VSS + // + // Kind of switch, can be DVS, VSS. + Kind *string + // Name of the switch. + Name *string + // Number of PNICs associated with this switch. format: int32 + PnicCount *int64 + // Version of the switch to be migrated. + Version *string +} + +const MigrationSwitchInfo_KIND_DVS = "DVS" +const MigrationSwitchInfo_KIND_VSS = "VSS" + +func (s *MigrationSwitchInfo) GetType__() bindings.BindingType { + return MigrationSwitchInfoBindingType() +} + +func (s *MigrationSwitchInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationSwitchInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Details about all the DVS and VSS present on the VC +type MigrationSwitchListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // A paginated list of DVS/VSS present on the VC. + Results []MigrationSwitchInfo +} + +func (s *MigrationSwitchListResult) GetType__() bindings.BindingType { + return MigrationSwitchListResultBindingType() +} + +func (s *MigrationSwitchListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationSwitchListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MigrationUnit struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // This is component version e.g. if migration unit is of type HOST, then this is host version. + CurrentVersion *string + // Name of the migration unit + DisplayName *string + Group *ResourceReference + // Identifier of the migration unit + Id *string + // Metadata about migration unit + Metadata []KeyValuePair + // Migration unit type + Type_ *string + // List of warnings indicating issues with the migration unit that may result in migration failure + Warnings []string +} + +func (s *MigrationUnit) GetType__() bindings.BindingType { + return MigrationUnitBindingType() +} + +func (s *MigrationUnit) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationUnit._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MigrationUnitAggregateInfo struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // List of errors occurred during migration of this migration unit + Errors []string + // Indicator of migration progress in percentage + PercentComplete *float64 + // Possible values are: + // + // * MigrationUnitAggregateInfo#MigrationUnitAggregateInfo_STATUS_SUCCESS + // * MigrationUnitAggregateInfo#MigrationUnitAggregateInfo_STATUS_FAILED + // * MigrationUnitAggregateInfo#MigrationUnitAggregateInfo_STATUS_IN_PROGRESS + // * MigrationUnitAggregateInfo#MigrationUnitAggregateInfo_STATUS_NOT_STARTED + // * MigrationUnitAggregateInfo#MigrationUnitAggregateInfo_STATUS_PAUSING + // * MigrationUnitAggregateInfo#MigrationUnitAggregateInfo_STATUS_PAUSED + // + // Status of migration unit + Status *string + Unit *MigrationUnit +} + +const MigrationUnitAggregateInfo_STATUS_SUCCESS = "SUCCESS" +const MigrationUnitAggregateInfo_STATUS_FAILED = "FAILED" +const MigrationUnitAggregateInfo_STATUS_IN_PROGRESS = "IN_PROGRESS" +const MigrationUnitAggregateInfo_STATUS_NOT_STARTED = "NOT_STARTED" +const MigrationUnitAggregateInfo_STATUS_PAUSING = "PAUSING" +const MigrationUnitAggregateInfo_STATUS_PAUSED = "PAUSED" + +func (s *MigrationUnitAggregateInfo) GetType__() bindings.BindingType { + return MigrationUnitAggregateInfoBindingType() +} + +func (s *MigrationUnitAggregateInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationUnitAggregateInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MigrationUnitAggregateInfoListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged collection of MigrationUnit AggregateInfo + Results []MigrationUnitAggregateInfo +} + +func (s *MigrationUnitAggregateInfoListResult) GetType__() bindings.BindingType { + return MigrationUnitAggregateInfoListResultBindingType() +} + +func (s *MigrationUnitAggregateInfoListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationUnitAggregateInfoListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MigrationUnitGroup struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Flag to indicate whether migration of this group is enabled or not + Enabled *bool + // Extended configuration for the group + ExtendedConfiguration []KeyValuePair + // Number of migration units in the group format: int32 + MigrationUnitCount *int64 + // List of migration units in the group + MigrationUnits []MigrationUnit + // Migration method to specify whether the migration is to be performed in parallel or serially + Parallel *bool + // Component type + Type_ *string +} + +func (s *MigrationUnitGroup) GetType__() bindings.BindingType { + return MigrationUnitGroupBindingType() +} + +func (s *MigrationUnitGroup) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationUnitGroup._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MigrationUnitGroupAggregateInfo struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Number of nodes in the migration unit group that failed migration format: int32 + FailedCount *int64 + Group *MigrationUnitGroup + // Indicator of migration progress in percentage + PercentComplete *float64 + // Possible values are: + // + // * MigrationUnitGroupAggregateInfo#MigrationUnitGroupAggregateInfo_STATUS_SUCCESS + // * MigrationUnitGroupAggregateInfo#MigrationUnitGroupAggregateInfo_STATUS_FAILED + // * MigrationUnitGroupAggregateInfo#MigrationUnitGroupAggregateInfo_STATUS_IN_PROGRESS + // * MigrationUnitGroupAggregateInfo#MigrationUnitGroupAggregateInfo_STATUS_NOT_STARTED + // * MigrationUnitGroupAggregateInfo#MigrationUnitGroupAggregateInfo_STATUS_PAUSING + // * MigrationUnitGroupAggregateInfo#MigrationUnitGroupAggregateInfo_STATUS_PAUSED + // + // Migration status of migration unit group + Status *string +} + +const MigrationUnitGroupAggregateInfo_STATUS_SUCCESS = "SUCCESS" +const MigrationUnitGroupAggregateInfo_STATUS_FAILED = "FAILED" +const MigrationUnitGroupAggregateInfo_STATUS_IN_PROGRESS = "IN_PROGRESS" +const MigrationUnitGroupAggregateInfo_STATUS_NOT_STARTED = "NOT_STARTED" +const MigrationUnitGroupAggregateInfo_STATUS_PAUSING = "PAUSING" +const MigrationUnitGroupAggregateInfo_STATUS_PAUSED = "PAUSED" + +func (s *MigrationUnitGroupAggregateInfo) GetType__() bindings.BindingType { + return MigrationUnitGroupAggregateInfoBindingType() +} + +func (s *MigrationUnitGroupAggregateInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationUnitGroupAggregateInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MigrationUnitGroupAggregateInfoListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged collection of migration status for migration unit groups + Results []MigrationUnitGroupAggregateInfo +} + +func (s *MigrationUnitGroupAggregateInfoListResult) GetType__() bindings.BindingType { + return MigrationUnitGroupAggregateInfoListResultBindingType() +} + +func (s *MigrationUnitGroupAggregateInfoListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationUnitGroupAggregateInfoListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MigrationUnitGroupListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged Collection of Migration unit groups + Results []MigrationUnitGroup +} + +func (s *MigrationUnitGroupListResult) GetType__() bindings.BindingType { + return MigrationUnitGroupListResultBindingType() +} + +func (s *MigrationUnitGroupListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationUnitGroupListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MigrationUnitGroupStatus struct { + // Number of nodes in the migration unit group that failed migration format: int32 + FailedCount *int64 + // Identifier for migration unit group + GroupId *string + // Name of the migration unit group + GroupName *string + // Number of migration units in the group format: int32 + MigrationUnitCount *int64 + // Indicator of migration progress in percentage + PercentComplete *float64 + // Possible values are: + // + // * MigrationUnitGroupStatus#MigrationUnitGroupStatus_STATUS_SUCCESS + // * MigrationUnitGroupStatus#MigrationUnitGroupStatus_STATUS_FAILED + // * MigrationUnitGroupStatus#MigrationUnitGroupStatus_STATUS_IN_PROGRESS + // * MigrationUnitGroupStatus#MigrationUnitGroupStatus_STATUS_NOT_STARTED + // * MigrationUnitGroupStatus#MigrationUnitGroupStatus_STATUS_PAUSING + // * MigrationUnitGroupStatus#MigrationUnitGroupStatus_STATUS_PAUSED + // + // Migration status of migration unit group + Status *string +} + +const MigrationUnitGroupStatus_STATUS_SUCCESS = "SUCCESS" +const MigrationUnitGroupStatus_STATUS_FAILED = "FAILED" +const MigrationUnitGroupStatus_STATUS_IN_PROGRESS = "IN_PROGRESS" +const MigrationUnitGroupStatus_STATUS_NOT_STARTED = "NOT_STARTED" +const MigrationUnitGroupStatus_STATUS_PAUSING = "PAUSING" +const MigrationUnitGroupStatus_STATUS_PAUSED = "PAUSED" + +func (s *MigrationUnitGroupStatus) GetType__() bindings.BindingType { + return MigrationUnitGroupStatusBindingType() +} + +func (s *MigrationUnitGroupStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationUnitGroupStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MigrationUnitGroupStatusListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged collection of migration status for migration unit groups + Results []MigrationUnitGroupStatus +} + +func (s *MigrationUnitGroupStatusListResult) GetType__() bindings.BindingType { + return MigrationUnitGroupStatusListResultBindingType() +} + +func (s *MigrationUnitGroupStatusListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationUnitGroupStatusListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MigrationUnitList struct { + // Collection of Migration units + List []MigrationUnit +} + +func (s *MigrationUnitList) GetType__() bindings.BindingType { + return MigrationUnitListBindingType() +} + +func (s *MigrationUnitList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationUnitList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MigrationUnitListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged Collection of Migration units + Results []MigrationUnit +} + +func (s *MigrationUnitListResult) GetType__() bindings.BindingType { + return MigrationUnitListResultBindingType() +} + +func (s *MigrationUnitListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationUnitListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MigrationUnitStatus struct { + // Name of migration unit + DisplayName *string + // List of errors occurred during migration of this migration unit + Errors []string + // Identifier of migration unit + Id *string + // Indicator of migration progress in percentage + PercentComplete *float64 + // Possible values are: + // + // * MigrationUnitStatus#MigrationUnitStatus_STATUS_SUCCESS + // * MigrationUnitStatus#MigrationUnitStatus_STATUS_FAILED + // * MigrationUnitStatus#MigrationUnitStatus_STATUS_IN_PROGRESS + // * MigrationUnitStatus#MigrationUnitStatus_STATUS_NOT_STARTED + // * MigrationUnitStatus#MigrationUnitStatus_STATUS_PAUSING + // * MigrationUnitStatus#MigrationUnitStatus_STATUS_PAUSED + // + // Status of migration unit + Status *string +} + +const MigrationUnitStatus_STATUS_SUCCESS = "SUCCESS" +const MigrationUnitStatus_STATUS_FAILED = "FAILED" +const MigrationUnitStatus_STATUS_IN_PROGRESS = "IN_PROGRESS" +const MigrationUnitStatus_STATUS_NOT_STARTED = "NOT_STARTED" +const MigrationUnitStatus_STATUS_PAUSING = "PAUSING" +const MigrationUnitStatus_STATUS_PAUSED = "PAUSED" + +func (s *MigrationUnitStatus) GetType__() bindings.BindingType { + return MigrationUnitStatusBindingType() +} + +func (s *MigrationUnitStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationUnitStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MigrationUnitStatusListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged Collection of migration units status + Results []MigrationUnitStatus +} + +func (s *MigrationUnitStatusListResult) GetType__() bindings.BindingType { + return MigrationUnitStatusListResultBindingType() +} + +func (s *MigrationUnitStatusListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationUnitStatusListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MigrationUnitTypeStats struct { + // Number of nodes format: int32 + NodeCount *int64 + // Number of nodes with issues that may cause migration failure format: int32 + NodeWithIssuesCount *int64 + // Type of migration unit + Type_ *string + // Version of the migration unit + Version *string +} + +func (s *MigrationUnitTypeStats) GetType__() bindings.BindingType { + return MigrationUnitTypeStatsBindingType() +} + +func (s *MigrationUnitTypeStats) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationUnitTypeStats._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MigrationUnitTypeStatsList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of migration unit type stats + Results []MigrationUnitTypeStats +} + +func (s *MigrationUnitTypeStatsList) GetType__() bindings.BindingType { + return MigrationUnitTypeStatsListBindingType() +} + +func (s *MigrationUnitTypeStatsList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MigrationUnitTypeStatsList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MirrorDestination struct { + // Possible values are: + // + // * MirrorDestination#MirrorDestination_RESOURCE_TYPE_LOGICALPORTMIRRORDESTINATION + // * MirrorDestination#MirrorDestination_RESOURCE_TYPE_PNICMIRRORDESTINATION + // * MirrorDestination#MirrorDestination_RESOURCE_TYPE_IPMIRRORDESTINATION + // + // Resource types of mirror destination + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const MirrorDestination__TYPE_IDENTIFIER = "MirrorDestination" +const MirrorDestination_RESOURCE_TYPE_LOGICALPORTMIRRORDESTINATION = "LogicalPortMirrorDestination" +const MirrorDestination_RESOURCE_TYPE_PNICMIRRORDESTINATION = "PnicMirrorDestination" +const MirrorDestination_RESOURCE_TYPE_IPMIRRORDESTINATION = "IPMirrorDestination" + +func (s *MirrorDestination) GetType__() bindings.BindingType { + return MirrorDestinationBindingType() +} + +func (s *MirrorDestination) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MirrorDestination._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MirrorSource struct { + // Possible values are: + // + // * MirrorSource#MirrorSource_RESOURCE_TYPE_LOGICALPORTMIRRORSOURCE + // * MirrorSource#MirrorSource_RESOURCE_TYPE_PNICMIRRORSOURCE + // * MirrorSource#MirrorSource_RESOURCE_TYPE_VLANMIRRORSOURCE + // * MirrorSource#MirrorSource_RESOURCE_TYPE_LOGICALSWITCHMIRRORSOURCE + // + // Resource types of mirror source + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const MirrorSource__TYPE_IDENTIFIER = "MirrorSource" +const MirrorSource_RESOURCE_TYPE_LOGICALPORTMIRRORSOURCE = "LogicalPortMirrorSource" +const MirrorSource_RESOURCE_TYPE_PNICMIRRORSOURCE = "PnicMirrorSource" +const MirrorSource_RESOURCE_TYPE_VLANMIRRORSOURCE = "VlanMirrorSource" +const MirrorSource_RESOURCE_TYPE_LOGICALSWITCHMIRRORSOURCE = "LogicalSwitchMirrorSource" + +func (s *MirrorSource) GetType__() bindings.BindingType { + return MirrorSourceBindingType() +} + +func (s *MirrorSource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MirrorSource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MirrorStackStatusListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Possible values are: + // + // * MirrorStackStatusListResult#MirrorStackStatusListResult_OVERALL_STATUS_UNKNOWN + // * MirrorStackStatusListResult#MirrorStackStatusListResult_OVERALL_STATUS_SUCCESS + // * MirrorStackStatusListResult#MirrorStackStatusListResult_OVERALL_STATUS_FAILED + // + // SUCCESS if all the TN's stack status are SUCCESS, FAILED if some of the TN's stack status are FAILED. + OverallStatus *string + // List all TN nodes which spaned in remote L3 mirror session mirror stack health status detailed info, including mirror stack status, vmknic status, TN node ID, TN node name and last updated status timestamp. + Results []TnNodeStackSpanStatus +} + +const MirrorStackStatusListResult_OVERALL_STATUS_UNKNOWN = "UNKNOWN" +const MirrorStackStatusListResult_OVERALL_STATUS_SUCCESS = "SUCCESS" +const MirrorStackStatusListResult_OVERALL_STATUS_FAILED = "FAILED" + +func (s *MirrorStackStatusListResult) GetType__() bindings.BindingType { + return MirrorStackStatusListResultBindingType() +} + +func (s *MirrorStackStatusListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MirrorStackStatusListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MonitoringEvent struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Detailed description of the event. + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier in the form of feature_name.event_type. + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Description of Event when an Event instance transitions from True to False. + DescriptionOnClear *string + // Resource Type of entity where this event is applicable eg. LogicalSwitch, LogicalPort etc. + EntityResourceType *string + // Optional field containing OID for SNMP trap sent when Event instance is False. This value is null if suppress_snmp_trap or suppress_clear_oid is True. + EventFalseSnmpOid *string + // Optional field containing OID for SNMP trap sent when Event instance is True. This value is null if suppress_snmp_trap is True. + EventTrueSnmpOid *string + // Name of Event, e.g. manager_cpu_usage_high, certificate_expired. + EventType *string + // Display name of Event type. + EventTypeDisplayName *string + // Display name of feature defining this Event. + FeatureDisplayName *string + // Feature defining this Event, e.g. manager_health, certificates. + FeatureName *string + // Flag to indicate whether sampling for this Event is off or on. + IsDisabled *bool + // Indicates if the sensitivity property is configurable via the API. + IsSensitivityFixed *bool + // Indicates if the threshold property is configurable via the API. + IsThresholdFixed *bool + // Flag to indicate if the threshold for this Event is a floating point number. If this value is true, the threshold_floating_point property is used to indicate the threshold at runtime; otherwise, the threshold property is used. + IsThresholdFloatingPoint *bool + // Maximum allowed threshold value if the threshold is configurable and a maximum value is applicable. format: int64 + MaxThreshold *int64 + // Minimum allowed threshold value if the threshold is configurable and a minimum value is applicable. format: int64 + MinThreshold *int64 + // Possible values are: + // + // * MonitoringEvent#MonitoringEvent_NODE_TYPES_AUTONOMOUS_EDGE + // * MonitoringEvent#MonitoringEvent_NODE_TYPES_BMS + // * MonitoringEvent#MonitoringEvent_NODE_TYPES_EDGE + // * MonitoringEvent#MonitoringEvent_NODE_TYPES_ESX + // * MonitoringEvent#MonitoringEvent_NODE_TYPES_GLOBAL_MANAGER + // * MonitoringEvent#MonitoringEvent_NODE_TYPES_INTELLIGENCE + // * MonitoringEvent#MonitoringEvent_NODE_TYPES_KVM + // * MonitoringEvent#MonitoringEvent_NODE_TYPES_MANAGER + // * MonitoringEvent#MonitoringEvent_NODE_TYPES_PUBLIC_CLOUD_GATEWAY + // + // Array identifying the nodes on which this Event is applicable. Can be one or more of the following values - nsx_public_cloud_gateway, nsx_edge, nsx_esx, nsx_kvm, nsx_manager. + NodeTypes []string + // Recommended action for the alarm condition. + RecommendedAction *string + // Percentage of samples to consider and used in combination with threshold when determining whether an Event instance status is True or False. Event evaluation uses sampling to determine Event instance status. A higher sensitivity value specifies that more samples are used to ensure accuracy and ignore infrequent or rare spikes in sampled data. format: int64 + Sensitivity *int64 + // Possible values are: + // + // * MonitoringEvent#MonitoringEvent_SEVERITY_CRITICAL + // * MonitoringEvent#MonitoringEvent_SEVERITY_HIGH + // * MonitoringEvent#MonitoringEvent_SEVERITY_MEDIUM + // * MonitoringEvent#MonitoringEvent_SEVERITY_LOW + // + // Severity of the Event.Can be one of - CRITICAL, HIGH, MEDIUM, LOW. + Severity *string + // Summary description of the event. + Summary *string + // Flag to suppress Alarm generation. Alarms are not generated for this Event when this is set to True. + SuppressAlarm *bool + // Flag to suppress SNMP trap generation. SNMP traps are not sent for this Event when this is set to True. + SuppressSnmpTrap *bool + // Threshold to determine if a single sample is True. For example, if the configured threshold is 95% and the current CPU sample is 99%, then the current sample is considered True. Note, if is_threshold_floating_point is true, the threshold_floating_point property is used to indicate the threshold value. format: int64 + Threshold *int64 + // Floating point threshold to determine if a single sample is True. For example, if the configured threshold is 66.6 percent and the sample value is 68.8 percent, the current sample is considered True. Note, if is_threshold_floating_point is false, the threshold property is used to indicate the threshold value. + ThresholdFloatingPoint *float64 + // Possible values are: + // + // * MonitoringEvent#MonitoringEvent_THRESHOLD_UNIT_TYPE_DAYS + // * MonitoringEvent#MonitoringEvent_THRESHOLD_UNIT_TYPE_PERCENT + // * MonitoringEvent#MonitoringEvent_THRESHOLD_UNIT_TYPE_SECONDS + // + // Identifies the unit type of the threshold value. + ThresholdUnitType *string +} + +const MonitoringEvent_NODE_TYPES_AUTONOMOUS_EDGE = "nsx_autonomous_edge" +const MonitoringEvent_NODE_TYPES_BMS = "nsx_bms" +const MonitoringEvent_NODE_TYPES_EDGE = "nsx_edge" +const MonitoringEvent_NODE_TYPES_ESX = "nsx_esx" +const MonitoringEvent_NODE_TYPES_GLOBAL_MANAGER = "nsx_global_manager" +const MonitoringEvent_NODE_TYPES_INTELLIGENCE = "nsx_intelligence" +const MonitoringEvent_NODE_TYPES_KVM = "nsx_kvm" +const MonitoringEvent_NODE_TYPES_MANAGER = "nsx_manager" +const MonitoringEvent_NODE_TYPES_PUBLIC_CLOUD_GATEWAY = "nsx_public_cloud_gateway" +const MonitoringEvent_SEVERITY_CRITICAL = "CRITICAL" +const MonitoringEvent_SEVERITY_HIGH = "HIGH" +const MonitoringEvent_SEVERITY_MEDIUM = "MEDIUM" +const MonitoringEvent_SEVERITY_LOW = "LOW" +const MonitoringEvent_THRESHOLD_UNIT_TYPE_DAYS = "DAYS" +const MonitoringEvent_THRESHOLD_UNIT_TYPE_PERCENT = "PERCENT" +const MonitoringEvent_THRESHOLD_UNIT_TYPE_SECONDS = "SECONDS" + +func (s *MonitoringEvent) GetType__() bindings.BindingType { + return MonitoringEventBindingType() +} + +func (s *MonitoringEvent) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MonitoringEvent._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type MonthlyTelemetrySchedule struct { + // Day of month on which data will be collected. Specify a value between 1 through 31. format: int64 + DayOfMonth *int64 + // Hour at which data will be collected. Specify a value between 0 through 23. format: int64 + HourOfDay *int64 + // Minute at which data will be collected. Specify a value between 0 through 59. format: int64 + Minutes *int64 + // Specify one of DailyTelemetrySchedule, WeeklyTelemetrySchedule, or MonthlyTelemetrySchedule. + FrequencyType string +} + +func (s *MonthlyTelemetrySchedule) GetType__() bindings.BindingType { + return MonthlyTelemetryScheduleBindingType() +} + +func (s *MonthlyTelemetrySchedule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MonthlyTelemetrySchedule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Contains manager and policy resource id. +type MpMigrationData struct { + // migration data ( resource type and Ids ). + MigrationData []MPResource + // Possible values are: + // + // * MpMigrationData#MpMigrationData_MODE_GENERIC + // * MpMigrationData#MpMigrationData_MODE_CONSUMER + // + // Mode of MP2Policy migration + Mode *string + SetupDetails *SetupDetails + // Default value is false. This value will indicate if there is error, skip the failed objects and proceed with next set of objects for MP to Policy promotion. + SkipFailedResources *bool +} + +const MpMigrationData_MODE_GENERIC = "GENERIC" +const MpMigrationData_MODE_CONSUMER = "CONSUMER" + +func (s *MpMigrationData) GetType__() bindings.BindingType { + return MpMigrationDataBindingType() +} + +func (s *MpMigrationData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MpMigrationData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Information about a messaging client +type MsgClientInfo struct { + // Account name for the messaging client. Identifies the client on the management plane message bus. + AccountName *string + // Messaging client's certificate. Used to authenticate to the control plane messaging endpoint. + Certificate *string + // Messaging client's secret. Used to authenticate to the management plane messaging broker. + SharedSecret *string + // Software version of the node. + SoftwareVersion *string +} + +func (s *MsgClientInfo) GetType__() bindings.BindingType { + return MsgClientInfoBindingType() +} + +func (s *MsgClientInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MsgClientInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Combines two or more widgetconfigurations into a multi-widget +type MultiWidgetConfiguration struct { + // Hyperlink of the specified UI page that provides details. + Navigation *string + // Array of widgets that are part of the multi-widget. + Widgets []WidgetItem + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_TIMERANGEDROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_SPACERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LEGENDWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration, CustomFilterWidgetConfiguration, TimeRangeDropdownFilterWidgetConfiguration, SpacerWidgetConfiguration, LegendWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If the condition is met then the widget will be displayed to UI. If no condition is provided, then the widget will be displayed unconditionally. + Condition *string + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + FeatureSet *FeatureSet + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. This field is deprecated instead use 'filters' property. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + // A List of filter applied to this widget configuration. This will be used to identify the filters applied to this widget. + Filters []string + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + Legend *Legend + // List of plotting configuration for a given widget. Widget plotting configurations which are common across all the widgets types should be define here. + PlotConfigs []WidgetPlotConfiguration + // Represents the vertical span of the widget / container. 1 Row span is equal to 20px. format: int32 + Rowspan *int64 + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // If the value of this field is set to true then card header will be displayed otherwise only card will be displayed without header. + ShowHeader *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const MultiWidgetConfiguration__TYPE_IDENTIFIER = "MultiWidgetConfiguration" + +func (s *MultiWidgetConfiguration) GetType__() bindings.BindingType { + return MultiWidgetConfigurationBindingType() +} + +func (s *MultiWidgetConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for MultiWidgetConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NDRAAdvertisedRoute struct { + // Lifetime of advertised route in seconds. format: int64 + RouteLifetime *int64 + // Possible values are: + // + // * NDRAAdvertisedRoute#NDRAAdvertisedRoute_ROUTE_PREFERENCE_LOW + // * NDRAAdvertisedRoute#NDRAAdvertisedRoute_ROUTE_PREFERENCE_MEDIUM + // * NDRAAdvertisedRoute#NDRAAdvertisedRoute_ROUTE_PREFERENCE_HIGH + // * NDRAAdvertisedRoute#NDRAAdvertisedRoute_ROUTE_PREFERENCE_RESERVED + // + // NDRA Route preference. Indicates preference of the router associated with a prefix over others, when multiple identical prefixes (for different routers) have been received. + RoutePreference *string + // Advertised route subnet format: ipv6-cidr-block + Subnet *string +} + +const NDRAAdvertisedRoute_ROUTE_PREFERENCE_LOW = "LOW" +const NDRAAdvertisedRoute_ROUTE_PREFERENCE_MEDIUM = "MEDIUM" +const NDRAAdvertisedRoute_ROUTE_PREFERENCE_HIGH = "HIGH" +const NDRAAdvertisedRoute_ROUTE_PREFERENCE_RESERVED = "RESERVED" + +func (s *NDRAAdvertisedRoute) GetType__() bindings.BindingType { + return NDRAAdvertisedRouteBindingType() +} + +func (s *NDRAAdvertisedRoute) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NDRAAdvertisedRoute._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Overrides the router advertisement attributes for the IPv6 prefixes. +type NDRAPrefixConfig struct { + // Override the neighbor discovery prefix preferred time and prefix valid time for the subnet on uplink port whose network matches with the network address of CIDR specified in network_prefix. format: ipv6-cidr-block + NetworkPrefix *string + // The time interval in seconds, in which the prefix is advertised as preferred. format: int64 + PrefixPreferredTime *int64 + // The time interval in seconds, in which the prefix is advertised as valid. format: int64 + PrefixValidTime *int64 +} + +func (s *NDRAPrefixConfig) GetType__() bindings.BindingType { + return NDRAPrefixConfigBindingType() +} + +func (s *NDRAPrefixConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NDRAPrefixConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NDRAProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + DnsConfig *RaDNSConfig + // Route advertised in NDRAProfile. + NdraAdvertisedRoute []NDRAAdvertisedRoute + RaConfig *RAConfig + // Possible values are: + // + // * NDRAProfile#NDRAProfile_RA_MODE_DISABLED + // * NDRAProfile#NDRAProfile_RA_MODE_SLAAC_DNS_THROUGH_RA + // * NDRAProfile#NDRAProfile_RA_MODE_SLAAC_DNS_THROUGH_DHCP + // * NDRAProfile#NDRAProfile_RA_MODE_DHCP_ADDRESS_AND_DNS_THROUGH_DHCP + // * NDRAProfile#NDRAProfile_RA_MODE_SLAAC_AND_ADDRESS_DNS_THROUGH_DHCP + // + // RA Mode + RaMode *string + // Neighbour reachable time duration in milliseconds. A value of 0 means unspecified. format: int64 + ReachableTimer *int64 + // The time, in milliseconds, between retransmitted neighbour solicitation messages. format: int64 + RetransmitInterval *int64 +} + +const NDRAProfile_RA_MODE_DISABLED = "DISABLED" +const NDRAProfile_RA_MODE_SLAAC_DNS_THROUGH_RA = "SLAAC_DNS_THROUGH_RA" +const NDRAProfile_RA_MODE_SLAAC_DNS_THROUGH_DHCP = "SLAAC_DNS_THROUGH_DHCP" +const NDRAProfile_RA_MODE_DHCP_ADDRESS_AND_DNS_THROUGH_DHCP = "DHCP_ADDRESS_AND_DNS_THROUGH_DHCP" +const NDRAProfile_RA_MODE_SLAAC_AND_ADDRESS_DNS_THROUGH_DHCP = "SLAAC_AND_ADDRESS_DNS_THROUGH_DHCP" + +func (s *NDRAProfile) GetType__() bindings.BindingType { + return NDRAProfileBindingType() +} + +func (s *NDRAProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NDRAProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NDRAProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paginated list of NDRAProfile + Results []NDRAProfile +} + +func (s *NDRAProfileListResult) GetType__() bindings.BindingType { + return NDRAProfileListResultBindingType() +} + +func (s *NDRAProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NDRAProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// NS Attributes data holder structure +type NSAttributes struct { + AttributesData *NSAttributesData + // Reference to sub attributes for the attribute + SubAttributes []NSAttributesData +} + +func (s *NSAttributes) GetType__() bindings.BindingType { + return NSAttributesBindingType() +} + +func (s *NSAttributes) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSAttributes._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Attributes/sub-attributes data holder structure for NSProfile +type NSAttributesData struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description for NSProfile attributes + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * NSAttributesData#NSAttributesData_ATTRIBUTE_SOURCE_SYSTEM + // * NSAttributesData#NSAttributesData_ATTRIBUTE_SOURCE_CUSTOM + // + // Attribute is predefined or custom + AttributeSource *string + // Possible values are: + // + // * NSAttributesData#NSAttributesData_DATATYPE_STRING + // + // Data type of attribute/sub attribute key + Datatype *string + // NSProfile attribute/sub attribute keys. + Key *string + // Multiple attribute/sub attribute values can be specified as elements of array. + Value []string +} + +const NSAttributesData_ATTRIBUTE_SOURCE_SYSTEM = "SYSTEM" +const NSAttributesData_ATTRIBUTE_SOURCE_CUSTOM = "CUSTOM" +const NSAttributesData_DATATYPE_STRING = "STRING" + +func (s *NSAttributesData) GetType__() bindings.BindingType { + return NSAttributesDataBindingType() +} + +func (s *NSAttributesData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSAttributesData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// NSGroups are recursive groupings of different NSX elements (logical and physical), typically used in policy definitions. +type NSGroup struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Count of the members added to this NSGroup format: int64 + MemberCount *int64 + // Reference to the direct/static members of the NSGroup. Can be ID based expressions only. VirtualMachine cannot be added as a static member. + Members []NSGroupSimpleExpression + // List of tag or name based expressions which define the dynamic membership criteria for this NSGroup. An object must satisfy atleast one of these expressions to qualify as a member of this group. It is not recommended to use ID based expressions in this section. ID based expression should be used in \"members\" section + MembershipCriteria []*data.StructValue +} + +func (s *NSGroup) GetType__() bindings.BindingType { + return NSGroupBindingType() +} + +func (s *NSGroup) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSGroup._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Complex expressions to represent NSGroup membership +type NSGroupComplexExpression struct { + // Represents expressions which are to be logically 'AND'ed.The array cannot contain NSGroupComplexExpression.Only NSGroupTagExpression and NSGroupSimpleExpressions are accepted. + Expressions []*data.StructValue + // Possible values are: + // + // * NSGroupExpression#NSGroupExpression_RESOURCE_TYPE_NSGROUPSIMPLEEXPRESSION + // * NSGroupExpression#NSGroupExpression_RESOURCE_TYPE_NSGROUPCOMPLEXEXPRESSION + // * NSGroupExpression#NSGroupExpression_RESOURCE_TYPE_NSGROUPTAGEXPRESSION + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const NSGroupComplexExpression__TYPE_IDENTIFIER = "NSGroupComplexExpression" + +func (s *NSGroupComplexExpression) GetType__() bindings.BindingType { + return NSGroupComplexExpressionBindingType() +} + +func (s *NSGroupComplexExpression) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSGroupComplexExpression._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Policy expression for NSGroup membership +type NSGroupExpression struct { + // Possible values are: + // + // * NSGroupExpression#NSGroupExpression_RESOURCE_TYPE_NSGROUPSIMPLEEXPRESSION + // * NSGroupExpression#NSGroupExpression_RESOURCE_TYPE_NSGROUPCOMPLEXEXPRESSION + // * NSGroupExpression#NSGroupExpression_RESOURCE_TYPE_NSGROUPTAGEXPRESSION + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const NSGroupExpression__TYPE_IDENTIFIER = "NSGroupExpression" +const NSGroupExpression_RESOURCE_TYPE_NSGROUPSIMPLEEXPRESSION = "NSGroupSimpleExpression" +const NSGroupExpression_RESOURCE_TYPE_NSGROUPCOMPLEXEXPRESSION = "NSGroupComplexExpression" +const NSGroupExpression_RESOURCE_TYPE_NSGROUPTAGEXPRESSION = "NSGroupTagExpression" + +func (s *NSGroupExpression) GetType__() bindings.BindingType { + return NSGroupExpressionBindingType() +} + +func (s *NSGroupExpression) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSGroupExpression._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of NSGroupExpressions +type NSGroupExpressionList struct { + // List of NSGroupExpressions to be passed to add and remove APIs + Members []*data.StructValue +} + +func (s *NSGroupExpressionList) GetType__() bindings.BindingType { + return NSGroupExpressionListBindingType() +} + +func (s *NSGroupExpressionList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSGroupExpressionList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// NSGroupInfo contains information about a particular NSGroup used in a SI Rule. It also contains information about policy path used to create this NSGroup. +type NSGroupInfo struct { + Nsgroup *ResourceReference + // Relative Policy path of a particular NSGroup. + NsgroupPolicyPath *string +} + +func (s *NSGroupInfo) GetType__() bindings.BindingType { + return NSGroupInfoBindingType() +} + +func (s *NSGroupInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSGroupInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Paged Collection of NSGroups +type NSGroupListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // NSGroup list results + Results []NSGroup +} + +func (s *NSGroupListResult) GetType__() bindings.BindingType { + return NSGroupListResultBindingType() +} + +func (s *NSGroupListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSGroupListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Simple expressions to represent NSGroup membership +type NSGroupSimpleExpression struct { + // Possible values are: + // + // * NSGroupSimpleExpression#NSGroupSimpleExpression_OP_EQUALS + // * NSGroupSimpleExpression#NSGroupSimpleExpression_OP_CONTAINS + // * NSGroupSimpleExpression#NSGroupSimpleExpression_OP_STARTSWITH + // * NSGroupSimpleExpression#NSGroupSimpleExpression_OP_ENDSWITH + // * NSGroupSimpleExpression#NSGroupSimpleExpression_OP_NOTEQUALS + // + // All operators perform a case insensitive match. + Op *string + // Field of the resource on which this expression is evaluated + TargetProperty *string + TargetResource *ResourceReference + // Possible values are: + // + // * NSGroupSimpleExpression#NSGroupSimpleExpression_TARGET_TYPE_NSGROUP + // * NSGroupSimpleExpression#NSGroupSimpleExpression_TARGET_TYPE_IPSET + // * NSGroupSimpleExpression#NSGroupSimpleExpression_TARGET_TYPE_MACSET + // * NSGroupSimpleExpression#NSGroupSimpleExpression_TARGET_TYPE_LOGICALSWITCH + // * NSGroupSimpleExpression#NSGroupSimpleExpression_TARGET_TYPE_LOGICALPORT + // * NSGroupSimpleExpression#NSGroupSimpleExpression_TARGET_TYPE_VIRTUALMACHINE + // * NSGroupSimpleExpression#NSGroupSimpleExpression_TARGET_TYPE_DIRECTORYGROUP + // * NSGroupSimpleExpression#NSGroupSimpleExpression_TARGET_TYPE_VIRTUALNETWORKINTERFACE + // * NSGroupSimpleExpression#NSGroupSimpleExpression_TARGET_TYPE_TRANSPORTNODE + // * NSGroupSimpleExpression#NSGroupSimpleExpression_TARGET_TYPE_CLOUDNATIVESERVICEINSTANCE + // * NSGroupSimpleExpression#NSGroupSimpleExpression_TARGET_TYPE_PHYSICALSERVER + // * NSGroupSimpleExpression#NSGroupSimpleExpression_TARGET_TYPE_LOGICALROUTER + // * NSGroupSimpleExpression#NSGroupSimpleExpression_TARGET_TYPE_LOGICALROUTERPORT + // + // Type of the resource on which this expression is evaluated + TargetType *string + // Value that satisfies this expression + Value *string + // Possible values are: + // + // * NSGroupExpression#NSGroupExpression_RESOURCE_TYPE_NSGROUPSIMPLEEXPRESSION + // * NSGroupExpression#NSGroupExpression_RESOURCE_TYPE_NSGROUPCOMPLEXEXPRESSION + // * NSGroupExpression#NSGroupExpression_RESOURCE_TYPE_NSGROUPTAGEXPRESSION + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const NSGroupSimpleExpression__TYPE_IDENTIFIER = "NSGroupSimpleExpression" +const NSGroupSimpleExpression_OP_EQUALS = "EQUALS" +const NSGroupSimpleExpression_OP_CONTAINS = "CONTAINS" +const NSGroupSimpleExpression_OP_STARTSWITH = "STARTSWITH" +const NSGroupSimpleExpression_OP_ENDSWITH = "ENDSWITH" +const NSGroupSimpleExpression_OP_NOTEQUALS = "NOTEQUALS" +const NSGroupSimpleExpression_TARGET_TYPE_NSGROUP = "NSGroup" +const NSGroupSimpleExpression_TARGET_TYPE_IPSET = "IPSet" +const NSGroupSimpleExpression_TARGET_TYPE_MACSET = "MACSet" +const NSGroupSimpleExpression_TARGET_TYPE_LOGICALSWITCH = "LogicalSwitch" +const NSGroupSimpleExpression_TARGET_TYPE_LOGICALPORT = "LogicalPort" +const NSGroupSimpleExpression_TARGET_TYPE_VIRTUALMACHINE = "VirtualMachine" +const NSGroupSimpleExpression_TARGET_TYPE_DIRECTORYGROUP = "DirectoryGroup" +const NSGroupSimpleExpression_TARGET_TYPE_VIRTUALNETWORKINTERFACE = "VirtualNetworkInterface" +const NSGroupSimpleExpression_TARGET_TYPE_TRANSPORTNODE = "TransportNode" +const NSGroupSimpleExpression_TARGET_TYPE_CLOUDNATIVESERVICEINSTANCE = "CloudNativeServiceInstance" +const NSGroupSimpleExpression_TARGET_TYPE_PHYSICALSERVER = "PhysicalServer" +const NSGroupSimpleExpression_TARGET_TYPE_LOGICALROUTER = "LogicalRouter" +const NSGroupSimpleExpression_TARGET_TYPE_LOGICALROUTERPORT = "LogicalRouterPort" + +func (s *NSGroupSimpleExpression) GetType__() bindings.BindingType { + return NSGroupSimpleExpressionBindingType() +} + +func (s *NSGroupSimpleExpression) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSGroupSimpleExpression._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Includes both scope and tag attribute of Tag. The scope and tag expressions are logically 'AND' with each other. eg- tag.scope = \"S1\" AND tag.tag = 'T1' +type NSGroupTagExpression struct { + // The tag.scope attribute of the object + Scope *string + // Possible values are: + // + // * NSGroupTagExpression#NSGroupTagExpression_SCOPE_OP_EQUALS + // + // Operator of the scope expression eg- tag.scope = \"S1\". + ScopeOp *string + // The tag.tag attribute of the object + Tag *string + // Possible values are: + // + // * NSGroupTagExpression#NSGroupTagExpression_TAG_OP_EQUALS + // * NSGroupTagExpression#NSGroupTagExpression_TAG_OP_CONTAINS + // * NSGroupTagExpression#NSGroupTagExpression_TAG_OP_STARTSWITH + // * NSGroupTagExpression#NSGroupTagExpression_TAG_OP_ENDSWITH + // + // Target_type VirtualMachine supports all specified operators for tag expression while LogicalSwitch and LogicalPort supports only EQUALS operator. All operators perform a case insensitive match. + TagOp *string + // Possible values are: + // + // * NSGroupTagExpression#NSGroupTagExpression_TARGET_TYPE_LOGICALSWITCH + // * NSGroupTagExpression#NSGroupTagExpression_TARGET_TYPE_LOGICALPORT + // * NSGroupTagExpression#NSGroupTagExpression_TARGET_TYPE_VIRTUALMACHINE + // * NSGroupTagExpression#NSGroupTagExpression_TARGET_TYPE_IPSET + // + // Type of the resource on which this expression is evaluated + TargetType *string + // Possible values are: + // + // * NSGroupExpression#NSGroupExpression_RESOURCE_TYPE_NSGROUPSIMPLEEXPRESSION + // * NSGroupExpression#NSGroupExpression_RESOURCE_TYPE_NSGROUPCOMPLEXEXPRESSION + // * NSGroupExpression#NSGroupExpression_RESOURCE_TYPE_NSGROUPTAGEXPRESSION + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const NSGroupTagExpression__TYPE_IDENTIFIER = "NSGroupTagExpression" +const NSGroupTagExpression_SCOPE_OP_EQUALS = "EQUALS" +const NSGroupTagExpression_TAG_OP_EQUALS = "EQUALS" +const NSGroupTagExpression_TAG_OP_CONTAINS = "CONTAINS" +const NSGroupTagExpression_TAG_OP_STARTSWITH = "STARTSWITH" +const NSGroupTagExpression_TAG_OP_ENDSWITH = "ENDSWITH" +const NSGroupTagExpression_TARGET_TYPE_LOGICALSWITCH = "LogicalSwitch" +const NSGroupTagExpression_TARGET_TYPE_LOGICALPORT = "LogicalPort" +const NSGroupTagExpression_TARGET_TYPE_VIRTUALMACHINE = "VirtualMachine" +const NSGroupTagExpression_TARGET_TYPE_IPSET = "IPSet" + +func (s *NSGroupTagExpression) GetType__() bindings.BindingType { + return NSGroupTagExpressionBindingType() +} + +func (s *NSGroupTagExpression) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSGroupTagExpression._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// An entity that encapsulates attributes and sub-attributes of various network services (ex. L7 services,domain name,encryption algorithm) The entity will be consumed in DFW rules and can be added in new tuple called profile in DFW rules. This entity is design to be generic and can be consumed at other places as well where attributes and sub-attributes collection can be used. To get a list of supported attributes and sub-attributes fire the following REST API GET https://<nsx-mgr>/api/v1/ns-profiles/attributes +type NSProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If set to false, the NSProfile has some app ids which are unsupported. Those were allowed to be added in previous releases but in testing in later phases found that those app ids could not be detected. + IsValid *bool + // Reference to the encapsulating object of attributes/sub-attributes for NSProfile. + NsprofileAttribute []NSAttributes +} + +func (s *NSProfile) GetType__() bindings.BindingType { + return NSProfileBindingType() +} + +func (s *NSProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List result of NSProfiles +type NSProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged collection of NSProfiles + Results []NSProfile +} + +func (s *NSProfileListResult) GetType__() bindings.BindingType { + return NSProfileListResultBindingType() +} + +func (s *NSProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A Networking and Security Service allows users to specify characteristics to use for matching network traffic. For example the user can specify port and protocol pair. +type NSService struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The default NSServices are created in the system by default. These NSServices can't be modified/deleted + DefaultService *bool + NsserviceElement *data.StructValue +} + +func (s *NSService) GetType__() bindings.BindingType { + return NSServiceBindingType() +} + +func (s *NSService) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSService._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// An NSService element that describes traffic corresponding to an NSService +type NSServiceElement struct { + // Possible values are: + // + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_ETHERTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_IPPROTOCOLNSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_IGMPTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_ICMPTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_ALGTYPENSSERVICE + // * NSServiceElement#NSServiceElement_RESOURCE_TYPE_L4PORTSETNSSERVICE + // + // The specific type of NSServiceElement + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const NSServiceElement__TYPE_IDENTIFIER = "NSServiceElement" +const NSServiceElement_RESOURCE_TYPE_ETHERTYPENSSERVICE = "EtherTypeNSService" +const NSServiceElement_RESOURCE_TYPE_IPPROTOCOLNSSERVICE = "IPProtocolNSService" +const NSServiceElement_RESOURCE_TYPE_IGMPTYPENSSERVICE = "IGMPTypeNSService" +const NSServiceElement_RESOURCE_TYPE_ICMPTYPENSSERVICE = "ICMPTypeNSService" +const NSServiceElement_RESOURCE_TYPE_ALGTYPENSSERVICE = "ALGTypeNSService" +const NSServiceElement_RESOURCE_TYPE_L4PORTSETNSSERVICE = "L4PortSetNSService" + +func (s *NSServiceElement) GetType__() bindings.BindingType { + return NSServiceElementBindingType() +} + +func (s *NSServiceElement) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSServiceElement._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A Networking and Security Service Group that represents a group of NSServices +type NSServiceGroup struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The default NSServiceGroups are created in the system by default. These NSServiceGroups can't be modified/deleted + DefaultService *bool + // List of NSService resources that can be added as members to an NSServiceGroup. + Members []ResourceReference + // Possible values are: + // + // * NSServiceGroup#NSServiceGroup_SERVICE_TYPE_ETHER + // * NSServiceGroup#NSServiceGroup_SERVICE_TYPE_NON_ETHER + // + // Type of the NSServiceGroup + ServiceType *string +} + +const NSServiceGroup_SERVICE_TYPE_ETHER = "ETHER" +const NSServiceGroup_SERVICE_TYPE_NON_ETHER = "NON_ETHER" + +func (s *NSServiceGroup) GetType__() bindings.BindingType { + return NSServiceGroupBindingType() +} + +func (s *NSServiceGroup) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSServiceGroup._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List result of NSServiceGroups +type NSServiceGroupListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged collection of NSServiceGroups + Results []NSServiceGroup +} + +func (s *NSServiceGroupListResult) GetType__() bindings.BindingType { + return NSServiceGroupListResultBindingType() +} + +func (s *NSServiceGroupListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSServiceGroupListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List result of NSservices +type NSServiceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged collection of NSServices + Results []NSService +} + +func (s *NSServiceListResult) GetType__() bindings.BindingType { + return NSServiceListResultBindingType() +} + +func (s *NSServiceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSServiceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// NSSupportedAttributes Types +type NSSupportedAttributeTypesResult struct { + // List of NSSupportedAttributes types + AttributeTypes []string +} + +func (s *NSSupportedAttributeTypesResult) GetType__() bindings.BindingType { + return NSSupportedAttributeTypesResultBindingType() +} + +func (s *NSSupportedAttributeTypesResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSSupportedAttributeTypesResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Supported attributes and sub-attributes for NSProfile +type NSSupportedAttributes struct { + // The type represent pre-defined or user defined list of supported attributes and sub-attributes that can be used while creating NSProfile + NsAttributes []NSAttributes +} + +func (s *NSSupportedAttributes) GetType__() bindings.BindingType { + return NSSupportedAttributesBindingType() +} + +func (s *NSSupportedAttributes) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSSupportedAttributes._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// NSSupportedAttributes for supported attributes and sub-attributes +type NSSupportedAttributesListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged collection of NSSupportedAttributes + Results []NSSupportedAttributes +} + +func (s *NSSupportedAttributesListResult) GetType__() bindings.BindingType { + return NSSupportedAttributesListResultBindingType() +} + +func (s *NSSupportedAttributesListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSSupportedAttributesListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// It is a reference to any NSX profile. It comprise of NSX profile type eg. DFWCPUProfile, CentralConfigProfile etc. and id of profile i.e. target_id +type NSXProfileReference struct { + // Will be set to false if the referenced NSX resource has been deleted. + IsValid *bool + // Display name of the NSX resource. + TargetDisplayName *string + // Identifier of the NSX resource. + TargetId *string + // Type of the NSX resource. + TargetType *string + // Possible values are: + // + // * NSXProfileReference#NSXProfileReference_PROFILE_TYPE_FIREWALLSESSIONTIMERPROFILE + // * NSXProfileReference#NSXProfileReference_PROFILE_TYPE_FIREWALLCPUMEMTHRESHOLDSPROFILE + // * NSXProfileReference#NSXProfileReference_PROFILE_TYPE_GISERVICEPROFILE + // * NSXProfileReference#NSXProfileReference_PROFILE_TYPE_FIREWALLFLOODPROTECTIONPROFILE + // * NSXProfileReference#NSXProfileReference_PROFILE_TYPE_FIREWALLDNSPROFILE + // * NSXProfileReference#NSXProfileReference_PROFILE_TYPE_LATENCYSTATPROFILE + // * NSXProfileReference#NSXProfileReference_PROFILE_TYPE_SHAPROFILE + // * NSXProfileReference#NSXProfileReference_PROFILE_TYPE_IPDISCOVERYSWITCHINGUPMPROFILE + // * NSXProfileReference#NSXProfileReference_PROFILE_TYPE_SYSTEMHEALTHPLUGINPROFILE + // * NSXProfileReference#NSXProfileReference_PROFILE_TYPE_GENERALSECURITYSETTINGSPROFILE + // * NSXProfileReference#NSXProfileReference_PROFILE_TYPE_IPFIXSWITCHUPMPROFILE + // * NSXProfileReference#NSXProfileReference_PROFILE_TYPE_IPFIXCOLLECTORUPMPROFILE + // * NSXProfileReference#NSXProfileReference_PROFILE_TYPE_PACEHOSTCONFIGPROFILE + // * NSXProfileReference#NSXProfileReference_PROFILE_TYPE_COMMONAGENTHOSTCONFIGPROFILE + // + // Profile type of the ServiceConfig + ProfileType *string +} + +const NSXProfileReference_PROFILE_TYPE_FIREWALLSESSIONTIMERPROFILE = "FirewallSessionTimerProfile" +const NSXProfileReference_PROFILE_TYPE_FIREWALLCPUMEMTHRESHOLDSPROFILE = "FirewallCpuMemThresholdsProfile" +const NSXProfileReference_PROFILE_TYPE_GISERVICEPROFILE = "GiServiceProfile" +const NSXProfileReference_PROFILE_TYPE_FIREWALLFLOODPROTECTIONPROFILE = "FirewallFloodProtectionProfile" +const NSXProfileReference_PROFILE_TYPE_FIREWALLDNSPROFILE = "FirewallDnsProfile" +const NSXProfileReference_PROFILE_TYPE_LATENCYSTATPROFILE = "LatencyStatProfile" +const NSXProfileReference_PROFILE_TYPE_SHAPROFILE = "SHAProfile" +const NSXProfileReference_PROFILE_TYPE_IPDISCOVERYSWITCHINGUPMPROFILE = "IpDiscoverySwitchingUpmProfile" +const NSXProfileReference_PROFILE_TYPE_SYSTEMHEALTHPLUGINPROFILE = "SystemHealthPluginProfile" +const NSXProfileReference_PROFILE_TYPE_GENERALSECURITYSETTINGSPROFILE = "GeneralSecuritySettingsProfile" +const NSXProfileReference_PROFILE_TYPE_IPFIXSWITCHUPMPROFILE = "IpfixSwitchUpmProfile" +const NSXProfileReference_PROFILE_TYPE_IPFIXCOLLECTORUPMPROFILE = "IpfixCollectorUpmProfile" +const NSXProfileReference_PROFILE_TYPE_PACEHOSTCONFIGPROFILE = "PaceHostConfigProfile" +const NSXProfileReference_PROFILE_TYPE_COMMONAGENTHOSTCONFIGPROFILE = "CommonAgentHostConfigProfile" + +func (s *NSXProfileReference) GetType__() bindings.BindingType { + return NSXProfileReferenceBindingType() +} + +func (s *NSXProfileReference) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NSXProfileReference._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Uplink Teaming Policy with a name that can be referenced by logical switches +type NamedTeamingPolicy struct { + // List of Uplinks used in active list + ActiveList []Uplink + // Possible values are: + // + // * NamedTeamingPolicy#NamedTeamingPolicy_POLICY_FAILOVER_ORDER + // * NamedTeamingPolicy#NamedTeamingPolicy_POLICY_LOADBALANCE_SRCID + // * NamedTeamingPolicy#NamedTeamingPolicy_POLICY_LOADBALANCE_SRC_MAC + // + // Teaming policy + Policy *string + // Flag for preemptive mode + RollingOrder *bool + // List of Uplinks used in standby list + StandbyList []Uplink + // An uplink teaming policy of a given name defined in UplinkHostSwitchProfile. The names of all NamedTeamingPolicies in an UplinkHostSwitchProfile must be different, but a name can be shared by different UplinkHostSwitchProfiles. Different TransportNodes can use different NamedTeamingPolicies having the same name in different UplinkHostSwitchProfiles to realize an uplink teaming policy on a logical switch. An uplink teaming policy on a logical switch can be any policy defined by a user; it does not have to be a single type of FAILOVER or LOADBALANCE. It can be a combination of types, for instance, a user can define a policy with name \"MyHybridTeamingPolicy\" as \"FAILOVER on all ESX TransportNodes and LOADBALANCE on all KVM TransportNodes\". The name is the key of the teaming policy and can not be changed once assigned. + Name *string +} + +const NamedTeamingPolicy_POLICY_FAILOVER_ORDER = "FAILOVER_ORDER" +const NamedTeamingPolicy_POLICY_LOADBALANCE_SRCID = "LOADBALANCE_SRCID" +const NamedTeamingPolicy_POLICY_LOADBALANCE_SRC_MAC = "LOADBALANCE_SRC_MAC" + +func (s *NamedTeamingPolicy) GetType__() bindings.BindingType { + return NamedTeamingPolicyBindingType() +} + +func (s *NamedTeamingPolicy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NamedTeamingPolicy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NatCounters struct { + // The number of active sessions format: int64 + ActiveSessions *int64 + // The number of bytes format: int64 + TotalBytes *int64 + // The number of packets format: int64 + TotalPackets *int64 +} + +func (s *NatCounters) GetType__() bindings.BindingType { + return NatCountersBindingType() +} + +func (s *NatCounters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NatCounters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The configuration entity to define a NAT rule. It defines how an ip packet is matched via source address or/and destination address or/and service(s), how the address (and/or) port is translated, and how the related firewall stage is involved or bypassed. +type NatRule struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * NatRule#NatRule_ACTION_SNAT + // * NatRule#NatRule_ACTION_DNAT + // * NatRule#NatRule_ACTION_REFLEXIVE + // * NatRule#NatRule_ACTION_NO_SNAT + // * NatRule#NatRule_ACTION_NO_DNAT + // * NatRule#NatRule_ACTION_NAT64 + // + // Valid actions: SNAT, DNAT, NO_SNAT, NO_DNAT, REFLEXIVE, NAT64. All rules in a logical router are either stateless or stateful. Mix is not supported. SNAT and DNAT are stateful, can NOT be supported when the logical router is running at active-active HA mode; REFLEXIVE is stateless. NO_SNAT and NO_DNAT have no translated_fields, only match fields are supported. + Action *string + // Holds the list of LogicalRouterPort Ids that a NAT rule can be applied to. The LogicalRouterPort used must belong to the same LogicalRouter for which the NAT Rule is created. As of now a NAT rule can only have a single LogicalRouterPort as applied_tos. When applied_tos is not set, the NAT rule is applied to all LogicalRouterPorts beloging to the LogicalRouter. + AppliedTos []ResourceReference + // Indicator to enable/disable the rule. + Enabled *bool + // Possible values are: + // + // * NatRule#NatRule_FIREWALL_MATCH_MATCH_EXTERNAL_ADDRESS + // * NatRule#NatRule_FIREWALL_MATCH_MATCH_INTERNAL_ADDRESS + // * NatRule#NatRule_FIREWALL_MATCH_BYPASS + // + // Indicate how firewall is applied to a traffic packet. Firewall can be bypassed, or be applied to external/internal address of NAT rule. The firewall_match will take priority over nat_pass. If the firewall_match is not provided, the nat_pass will be picked up. + FirewallMatch *string + // Internal NAT rule uuid for debug used in Controller and backend. + InternalRuleId *string + // Enable/disable the logging of rule. + Logging *bool + // The logical router id which the nat rule runs on. + LogicalRouterId *string + // IP Address | CIDR | (null implies Any) + MatchDestinationNetwork *string + MatchService *data.StructValue + // IP Address | CIDR | (null implies Any) + MatchSourceNetwork *string + // Default is true. If the nat_pass is set to true, the following firewall stage will be skipped. Please note, if action is NO_SNAT or NO_DNAT, then nat_pass must be set to true or omitted. Nat_pass was deprecated with an alternative firewall_match. Please stop using nat_pass to specify whether firewall stage is skipped. if you want to skip, please set firewall_match to BYPASS. If you do not want to skip, please set the firewall_match to MATCH_EXTERNAL_ADDRESS or MATCH_INTERNAL_ADDRESS. Please note, the firewall_match will take priority over the nat_pass. If both are provided, the nat_pass is ignored. If firewall_match is not provided while the nat_pass is specified, the nat_pass will still be picked up. In this case, if nat_pass is set to false, firewall rule will be applied on internall address of a packet, i.e. MATCH_INTERNAL_ADDRESS. + NatPass *bool + // Ascending, valid range [0-2147483647]. If multiple rules have the same priority, evaluation sequence is undefined. format: int64 + RulePriority *int64 + // The translated address for the matched IP packet. For a SNAT, it can be a single ip address, an ip range, or a CIDR block. For a DNAT and a REFLEXIVE, it can be a single ip address or a CIDR block. Translated network is not supported for NO_SNAT or NO_DNAT. + TranslatedNetwork *string + // The translated port(s) for the mtached IP packet. It can be a single port or a port range. Please note, port translating is supported only for DNAT. + TranslatedPorts *string +} + +const NatRule_ACTION_SNAT = "SNAT" +const NatRule_ACTION_DNAT = "DNAT" +const NatRule_ACTION_REFLEXIVE = "REFLEXIVE" +const NatRule_ACTION_NO_SNAT = "NO_SNAT" +const NatRule_ACTION_NO_DNAT = "NO_DNAT" +const NatRule_ACTION_NAT64 = "NAT64" +const NatRule_FIREWALL_MATCH_MATCH_EXTERNAL_ADDRESS = "MATCH_EXTERNAL_ADDRESS" +const NatRule_FIREWALL_MATCH_MATCH_INTERNAL_ADDRESS = "MATCH_INTERNAL_ADDRESS" +const NatRule_FIREWALL_MATCH_BYPASS = "BYPASS" + +func (s *NatRule) GetType__() bindings.BindingType { + return NatRuleBindingType() +} + +func (s *NatRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NatRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NatRuleList struct { + // Add new NatRules to the list in Bulk creation. + Rules []NatRule +} + +func (s *NatRuleList) GetType__() bindings.BindingType { + return NatRuleListBindingType() +} + +func (s *NatRuleList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NatRuleList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NatRuleListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // NAT rule list results + Results []NatRule +} + +func (s *NatRuleListResult) GetType__() bindings.BindingType { + return NatRuleListResultBindingType() +} + +func (s *NatRuleListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NatRuleListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NatStatisticsPerLogicalRouter struct { + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // Id for the logical router + LogicalRouterId *string + // Detailed per node statistics + PerTransportNodeStatistics []NatStatisticsPerTransportNode + StatisticsAcrossAllNodes *NatCounters +} + +func (s *NatStatisticsPerLogicalRouter) GetType__() bindings.BindingType { + return NatStatisticsPerLogicalRouterBindingType() +} + +func (s *NatStatisticsPerLogicalRouter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NatStatisticsPerLogicalRouter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NatStatisticsPerRule struct { + // The number of active sessions format: int64 + ActiveSessions *int64 + // The number of bytes format: int64 + TotalBytes *int64 + // The number of packets format: int64 + TotalPackets *int64 + // The id of the NAT rule. + Id *string + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // The id of the logical router which owns the NAT rule. + LogicalRouterId *string + // The warning message about the NAT Rule statistics. + WarningMessage *string +} + +func (s *NatStatisticsPerRule) GetType__() bindings.BindingType { + return NatStatisticsPerRuleBindingType() +} + +func (s *NatStatisticsPerRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NatStatisticsPerRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NatStatisticsPerTransportNode struct { + // The number of active sessions format: int64 + ActiveSessions *int64 + // The number of bytes format: int64 + TotalBytes *int64 + // The number of packets format: int64 + TotalPackets *int64 + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // Id for the transport node + TransportNodeId *string +} + +func (s *NatStatisticsPerTransportNode) GetType__() bindings.BindingType { + return NatStatisticsPerTransportNodeBindingType() +} + +func (s *NatStatisticsPerTransportNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NatStatisticsPerTransportNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Neighbor discovery protocol header +type NdpHeader struct { + // The IP address of the destination of the solicitation. It MUST NOT be a multicast address. format: ipv6 + DstIp *string + // Possible values are: + // + // * NdpHeader#NdpHeader_MSG_TYPE_SOLICITATION + // * NdpHeader#NdpHeader_MSG_TYPE_ADVERTISEMENT + // + // This field specifies the type of the Neighbor discover message being sent. NEIGHBOR_SOLICITATION - Neighbor Solicitation message to discover the link-layer address of an on-link IPv6 node or to confirm a previously determined link-layer address. NEIGHBOR_ADVERTISEMENT - Neighbor Advertisement message in response to a Neighbor Solicitation message. + MsgType *string +} + +const NdpHeader_MSG_TYPE_SOLICITATION = "NEIGHBOR_SOLICITATION" +const NdpHeader_MSG_TYPE_ADVERTISEMENT = "NEIGHBOR_ADVERTISEMENT" + +func (s *NdpHeader) GetType__() bindings.BindingType { + return NdpHeaderBindingType() +} + +func (s *NdpHeader) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NdpHeader._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Neighbor properties +type NeighborProperties struct { + // Capabilities + Capabilities *string + // Enabled capabilities + EnabledCapabilities *string + // Interface index format: int64 + Ifindex *int64 + // Aggregation Capability + LinkAggregationCapable *bool + // Aggregation port id + LinkAggregationPortId *string + // True if currently in aggregation + LinkAggregationStatus *bool + // Interface MAC address + Mac *string + // Management address + MgmtAddr *string + // Interface name + Name *string + // Object identifier + Oid *string + // Port description + PortDesc *string + // System description + SystemDesc *string + // System name + SystemName *string + // System port number format: int64 + SystemPortNumber *int64 +} + +func (s *NeighborProperties) GetType__() bindings.BindingType { + return NeighborPropertiesBindingType() +} + +func (s *NeighborProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NeighborProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Network error related to container objects. +type NetworkError struct { + // Error code of network related error. + ErrorCode *string + // Detailed message of network related error. + ErrorMessage *string + // Additional error information in json format. + Spec *string +} + +func (s *NetworkError) GetType__() bindings.BindingType { + return NetworkErrorBindingType() +} + +func (s *NetworkError) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NetworkError._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// New Role +type NewRole struct { + // New role description + NewRoleDescription *string + // New role id + NewRoleId *string + // New role name + NewRoleName *string +} + +func (s *NewRole) GetType__() bindings.BindingType { + return NewRoleBindingType() +} + +func (s *NewRole) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NewRole._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Next hop to prefix lists mapping. +type NextHopPrefixListsMapping struct { + // Next hop address. + NextHop *string + // Array of Prefix list UUIDs. + PrefixLists []string +} + +func (s *NextHopPrefixListsMapping) GetType__() bindings.BindingType { + return NextHopPrefixListsMappingBindingType() +} + +func (s *NextHopPrefixListsMapping) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NextHopPrefixListsMapping._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Information of a network interface present on the partner appliance that needs to be configured by the NSX Manager. +type NicInfo struct { + // Gateway address associated with the NIC metadata. + GatewayAddress *string + // IP address associated with the NIC metadata. Required only when assigning IP statically for a deployment that is for a single VM instance. + IpAddress *string + // Possible values are: + // + // * NicInfo#NicInfo_IP_ALLOCATION_TYPE_STATIC + // * NicInfo#NicInfo_IP_ALLOCATION_TYPE_DHCP + // * NicInfo#NicInfo_IP_ALLOCATION_TYPE_NONE + // + // IP allocation type with values STATIC, DHCP, or NONE indicating that IP address is not required. + IpAllocationType *string + // If the nic should get IP using a static IP pool then IP pool id should be provided here. + IpPoolId *string + // Network Id associated with the NIC metadata. It can be a moref, or a logical switch ID. If it is to be taken from 'Agent VM Settings', then it should be empty. + NetworkId *string + NicMetadata *NicMetadata + // Subnet mask associated with the NIC metadata. + SubnetMask *string +} + +const NicInfo_IP_ALLOCATION_TYPE_STATIC = "STATIC" +const NicInfo_IP_ALLOCATION_TYPE_DHCP = "DHCP" +const NicInfo_IP_ALLOCATION_TYPE_NONE = "NONE" + +func (s *NicInfo) GetType__() bindings.BindingType { + return NicInfoBindingType() +} + +func (s *NicInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NicInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Information on the Network interfaces present on the partner appliance that needs to be configured by the NSX Manager. +type NicMetadata struct { + // Network Interface index. format: int64 + InterfaceIndex *int64 + // Network Interface label. + InterfaceLabel *string + // Possible values are: + // + // * NicMetadata#NicMetadata_INTERFACE_TYPE_MANAGEMENT + // * NicMetadata#NicMetadata_INTERFACE_TYPE_DATA1 + // * NicMetadata#NicMetadata_INTERFACE_TYPE_DATA2 + // * NicMetadata#NicMetadata_INTERFACE_TYPE_HA1 + // * NicMetadata#NicMetadata_INTERFACE_TYPE_HA2 + // * NicMetadata#NicMetadata_INTERFACE_TYPE_CONTROL + // + // Interface that needs to be configured on the partner appliance. Ex. MANAGEMENT, DATA1, DATA2, HA1, HA2, CONTROL. + InterfaceType *string + // Possible values are: + // + // * NicMetadata#NicMetadata_TRANSPORTS_L2_BRIDGE + // * NicMetadata#NicMetadata_TRANSPORTS_L3_ROUTED + // * NicMetadata#NicMetadata_TRANSPORTS_NSH + // + // Transport Type of the service, which is the mechanism of redirecting the traffic to the the partner appliance. Transport type is required if Service caters to any functionality other than EPP and MPS. Here, the transports array specifies the kinds of transport where this particular NIC is user configurable. If nothing is specified, and the \"user_configurable\" flag is true, then user configuration will be allowed for all transports. If any transport is/are specified, then it will be considered as user configurable for the specified transports only.\" + Transports []string + // Used to specify if the given interface needs configuration. Management nics will always need the configuration, for others it will be use case specific. For example, a DATA NIC may be user configurable if the appliance is deployed in certain mode, such as L3_ROUTED. + UserConfigurable *bool +} + +const NicMetadata_INTERFACE_TYPE_MANAGEMENT = "MANAGEMENT" +const NicMetadata_INTERFACE_TYPE_DATA1 = "DATA1" +const NicMetadata_INTERFACE_TYPE_DATA2 = "DATA2" +const NicMetadata_INTERFACE_TYPE_HA1 = "HA1" +const NicMetadata_INTERFACE_TYPE_HA2 = "HA2" +const NicMetadata_INTERFACE_TYPE_CONTROL = "CONTROL" +const NicMetadata_TRANSPORTS_L2_BRIDGE = "L2_BRIDGE" +const NicMetadata_TRANSPORTS_L3_ROUTED = "L3_ROUTED" +const NicMetadata_TRANSPORTS_NSH = "NSH" + +func (s *NicMetadata) GetType__() bindings.BindingType { + return NicMetadataBindingType() +} + +func (s *NicMetadata) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NicMetadata._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This profile is created for Network I/O Control(NIOC). +type NiocProfile struct { + // The enabled property specifies the status of NIOC feature. When enabled is set to true, NIOC feature is turned on and the bandwidth allocations specified for the traffic resources are enforced. When enabled is set to false, NIOC feature is turned off and no bandwidth allocation is guaranteed. By default, enabled will be set to true. + Enabled *bool + // host_infra_traffic_res specifies bandwidth allocation for various traffic resources. + HostInfraTrafficRes []ResourceAllocation + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * BaseHostSwitchProfile#BaseHostSwitchProfile_RESOURCE_TYPE_UPLINKHOSTSWITCHPROFILE + // * BaseHostSwitchProfile#BaseHostSwitchProfile_RESOURCE_TYPE_LLDPHOSTSWITCHPROFILE + // * BaseHostSwitchProfile#BaseHostSwitchProfile_RESOURCE_TYPE_NIOCPROFILE + // * BaseHostSwitchProfile#BaseHostSwitchProfile_RESOURCE_TYPE_EXTRACONFIGHOSTSWITCHPROFILE + // + // Supported HostSwitch profiles. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + RequiredCapabilities []string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const NiocProfile__TYPE_IDENTIFIER = "NiocProfile" + +func (s *NiocProfile) GetType__() bindings.BindingType { + return NiocProfileBindingType() +} + +func (s *NiocProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NiocProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type Node struct { + // This field is deprecated. TransportNode field 'description' must be used instead. For EdgeNode and PublicCloudGatewayNode, this field is ignored if specified in request payload. + Description *string + // Discovered IP Addresses of the fabric node, version 4 or 6 format: ip + DiscoveredIpAddresses []string + // This field is deprecated. TransportNode field 'display_name' must be used instead. For HostNode, this field defaults to ID if not set. For EdgeNode and PublicCloudGatewayNode, this field is ignored if specified in request payload. + DisplayName *string + // ID of the Node maintained on the Node and used to recognize the Node + ExternalId *string + // Fully qualified domain name of the fabric node + Fqdn *string + // Unique identifier of this resource. + Id *string + // IP Addresses of the Node, version 4 or 6. This property is mandatory for all nodes except for automatic deployment of edge virtual machine node. For automatic deployment, the ip address from management_port_subnets property will be considered. format: ip + IpAddresses []string + // Fabric node type, for example 'HostNode', 'EdgeNode' or 'PublicCloudGatewayNode' + ResourceType string + // This field is deprecated. TransportNode field 'tags' must be used instead. For EdgeNode and PublicCloudGatewayNode, this field is ignored if specified in request payload. + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const Node__TYPE_IDENTIFIER = "Node" + +func (s *Node) GetType__() bindings.BindingType { + return NodeBindingType() +} + +func (s *Node) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Node._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node service properties +type NodeAsyncReplicatorServiceProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Service name + ServiceName *string + ServiceProperties *LoggingServiceProperties +} + +func (s *NodeAsyncReplicatorServiceProperties) GetType__() bindings.BindingType { + return NodeAsyncReplicatorServicePropertiesBindingType() +} + +func (s *NodeAsyncReplicatorServiceProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeAsyncReplicatorServiceProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node AAA provider vIDM properties +type NodeAuthProviderVidmProperties struct { + // vIDM client id + ClientId *string + // vIDM client secret + ClientSecret *string + // Fully Qualified Domain Name(FQDN) of vIDM + HostName *string + // Load Balancer enable flag + LbEnable *bool + // host name to use when creating the redirect URL for clients to follow after authenticating to vIDM + NodeHostName *string + // Hexadecimal SHA256 hash of the vIDM server's X.509 certificate + Thumbprint *string + // vIDM enable flag + VidmEnable *bool +} + +func (s *NodeAuthProviderVidmProperties) GetType__() bindings.BindingType { + return NodeAuthProviderVidmPropertiesBindingType() +} + +func (s *NodeAuthProviderVidmProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeAuthProviderVidmProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node AAA provider vIDM status +type NodeAuthProviderVidmStatus struct { + // AAA provider vIDM status + RuntimeState *string + // vIDM enable flag + VidmEnable *bool +} + +func (s *NodeAuthProviderVidmStatus) GetType__() bindings.BindingType { + return NodeAuthProviderVidmStatusBindingType() +} + +func (s *NodeAuthProviderVidmStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeAuthProviderVidmStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of capabilities of a fabric node +type NodeCapabilitiesResult struct { + // Node capability results + Capabilities []NodeCapability +} + +func (s *NodeCapabilitiesResult) GetType__() bindings.BindingType { + return NodeCapabilitiesResultBindingType() +} + +func (s *NodeCapabilitiesResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeCapabilitiesResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Capability of a fabric node +type NodeCapability struct { + // Description of this capability that can be displayed in UI + Description *string + // String that identifies the base capability for all nodes + Key *string + // Provider of this capability for the node + Provider *string + // Value of this capability + Value *string + // Version of the capability format: int32 + Version *int64 +} + +func (s *NodeCapability) GetType__() bindings.BindingType { + return NodeCapabilityBindingType() +} + +func (s *NodeCapability) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeCapability._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NodeCertificateInfo struct { + // Certificate content + Certificate *string + // SHA256 of certificate + CertificateSha256Thumbprint *string + // Possible values are: + // + // * NodeCertificateInfo#NodeCertificateInfo_ENTITY_TYPE_HTTP + // * NodeCertificateInfo#NodeCertificateInfo_ENTITY_TYPE_DATASTORE + // * NodeCertificateInfo#NodeCertificateInfo_ENTITY_TYPE_MANAGER + // * NodeCertificateInfo#NodeCertificateInfo_ENTITY_TYPE_POLICY + // * NodeCertificateInfo#NodeCertificateInfo_ENTITY_TYPE_CONTROLLER + // + // Entity type of this certificate + EntityType *string +} + +const NodeCertificateInfo_ENTITY_TYPE_HTTP = "HTTP" +const NodeCertificateInfo_ENTITY_TYPE_DATASTORE = "DATASTORE" +const NodeCertificateInfo_ENTITY_TYPE_MANAGER = "MANAGER" +const NodeCertificateInfo_ENTITY_TYPE_POLICY = "POLICY" +const NodeCertificateInfo_ENTITY_TYPE_CONTROLLER = "CONTROLLER" + +func (s *NodeCertificateInfo) GetType__() bindings.BindingType { + return NodeCertificateInfoBindingType() +} + +func (s *NodeCertificateInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeCertificateInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NodeEntityInfo struct { + // Possible values are: + // + // * NodeEntityInfo#NodeEntityInfo_ENTITY_TYPE_HTTP + // * NodeEntityInfo#NodeEntityInfo_ENTITY_TYPE_DATASTORE + // * NodeEntityInfo#NodeEntityInfo_ENTITY_TYPE_MANAGER + // * NodeEntityInfo#NodeEntityInfo_ENTITY_TYPE_POLICY + // * NodeEntityInfo#NodeEntityInfo_ENTITY_TYPE_CONTROLLER + // + // Entity type of this service endpoint + EntityType *string + // IP address of service provider + IpAddress *string + // Port number of service provider format: int64 + Port *int64 +} + +const NodeEntityInfo_ENTITY_TYPE_HTTP = "HTTP" +const NodeEntityInfo_ENTITY_TYPE_DATASTORE = "DATASTORE" +const NodeEntityInfo_ENTITY_TYPE_MANAGER = "MANAGER" +const NodeEntityInfo_ENTITY_TYPE_POLICY = "POLICY" +const NodeEntityInfo_ENTITY_TYPE_CONTROLLER = "CONTROLLER" + +func (s *NodeEntityInfo) GetType__() bindings.BindingType { + return NodeEntityInfoBindingType() +} + +func (s *NodeEntityInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeEntityInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// File system properties +type NodeFileSystemProperties struct { + // File system id + FileSystem *string + // File system mount + Mount *string + // File system size in kilobytes format: int64 + Total *int64 + // File system type + Type_ *string + // Amount of file system used in kilobytes format: int64 + Used *int64 +} + +func (s *NodeFileSystemProperties) GetType__() bindings.BindingType { + return NodeFileSystemPropertiesBindingType() +} + +func (s *NodeFileSystemProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeFileSystemProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node HTTP service properties +type NodeHttpServiceProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Service name + ServiceName *string + ServiceProperties *HttpServiceProperties +} + +func (s *NodeHttpServiceProperties) GetType__() bindings.BindingType { + return NodeHttpServicePropertiesBindingType() +} + +func (s *NodeHttpServiceProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeHttpServiceProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NodeIdServicesMap struct { + // NodeId + NodeId *string + // Possible values are: + // + // * NodeIdServicesMap#NodeIdServicesMap_SERVICE_TYPES_MGMT_CLUSTER + // * NodeIdServicesMap#NodeIdServicesMap_SERVICE_TYPES_MGMT_PLANE + // * NodeIdServicesMap#NodeIdServicesMap_SERVICE_TYPES_API + // * NodeIdServicesMap#NodeIdServicesMap_SERVICE_TYPES_NOTIFICATION_COLLECTOR + // * NodeIdServicesMap#NodeIdServicesMap_SERVICE_TYPES_SYSLOG_SERVER + // * NodeIdServicesMap#NodeIdServicesMap_SERVICE_TYPES_RSYSLOG_CLIENT + // * NodeIdServicesMap#NodeIdServicesMap_SERVICE_TYPES_APH + // * NodeIdServicesMap#NodeIdServicesMap_SERVICE_TYPES_GLOBAL_MANAGER + // * NodeIdServicesMap#NodeIdServicesMap_SERVICE_TYPES_LOCAL_MANAGER + // * NodeIdServicesMap#NodeIdServicesMap_SERVICE_TYPES_CLIENT_AUTH + // * NodeIdServicesMap#NodeIdServicesMap_SERVICE_TYPES_RMQ + // * NodeIdServicesMap#NodeIdServicesMap_SERVICE_TYPES_K8S_MSG_CLIENT + // * NodeIdServicesMap#NodeIdServicesMap_SERVICE_TYPES_WEB_PROXY + // + // List of ServiceTypes. + ServiceTypes []string +} + +const NodeIdServicesMap_SERVICE_TYPES_MGMT_CLUSTER = "MGMT_CLUSTER" +const NodeIdServicesMap_SERVICE_TYPES_MGMT_PLANE = "MGMT_PLANE" +const NodeIdServicesMap_SERVICE_TYPES_API = "API" +const NodeIdServicesMap_SERVICE_TYPES_NOTIFICATION_COLLECTOR = "NOTIFICATION_COLLECTOR" +const NodeIdServicesMap_SERVICE_TYPES_SYSLOG_SERVER = "SYSLOG_SERVER" +const NodeIdServicesMap_SERVICE_TYPES_RSYSLOG_CLIENT = "RSYSLOG_CLIENT" +const NodeIdServicesMap_SERVICE_TYPES_APH = "APH" +const NodeIdServicesMap_SERVICE_TYPES_GLOBAL_MANAGER = "GLOBAL_MANAGER" +const NodeIdServicesMap_SERVICE_TYPES_LOCAL_MANAGER = "LOCAL_MANAGER" +const NodeIdServicesMap_SERVICE_TYPES_CLIENT_AUTH = "CLIENT_AUTH" +const NodeIdServicesMap_SERVICE_TYPES_RMQ = "RMQ" +const NodeIdServicesMap_SERVICE_TYPES_K8S_MSG_CLIENT = "K8S_MSG_CLIENT" +const NodeIdServicesMap_SERVICE_TYPES_WEB_PROXY = "WEB_PROXY" + +func (s *NodeIdServicesMap) GetType__() bindings.BindingType { + return NodeIdServicesMapBindingType() +} + +func (s *NodeIdServicesMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeIdServicesMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NodeInfo struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Component version of the node + ComponentVersion *string + // Name of the node + DisplayName *string + // Identifier of the node + Id *string + // Node type + Type_ *string +} + +func (s *NodeInfo) GetType__() bindings.BindingType { + return NodeInfoBindingType() +} + +func (s *NodeInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NodeInfoListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged Collection of Nodes + Results []NodeInfo +} + +func (s *NodeInfoListResult) GetType__() bindings.BindingType { + return NodeInfoListResultBindingType() +} + +func (s *NodeInfoListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeInfoListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node install-upgrade service properties +type NodeInstallUpgradeServiceProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Service name + ServiceName *string + ServiceProperties *InstallUpgradeServiceProperties +} + +func (s *NodeInstallUpgradeServiceProperties) GetType__() bindings.BindingType { + return NodeInstallUpgradeServicePropertiesBindingType() +} + +func (s *NodeInstallUpgradeServiceProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeInstallUpgradeServiceProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NodeInterSiteStatistics struct { + // Timestamp when the remote tunnel port statistics was last updated. format: int64 + LastUpdateTimestamp *int64 + // Remote tunnel statistics per site. + StatsPerSite []RemoteTunnelStatisticsPerSite + // Edge node id whose statistics is being reported. + TransportNodeId *string +} + +func (s *NodeInterSiteStatistics) GetType__() bindings.BindingType { + return NodeInterSiteStatisticsBindingType() +} + +func (s *NodeInterSiteStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeInterSiteStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node network interface alias +type NodeInterfaceAlias struct { + // Interface broadcast address format: ip + BroadcastAddress *string + // Interface IP address format: ip + IpAddress *string + // Possible values are: + // + // * NodeInterfaceAlias#NodeInterfaceAlias_IP_CONFIGURATION_DHCP + // * NodeInterfaceAlias#NodeInterfaceAlias_IP_CONFIGURATION_STATIC + // * NodeInterfaceAlias#NodeInterfaceAlias_IP_CONFIGURATION_NOT_CONFIGURED + // + // Interface configuration + IpConfiguration *string + // Interface netmask + Netmask *string + // Interface MAC address format: mac-address + PhysicalAddress *string +} + +const NodeInterfaceAlias_IP_CONFIGURATION_DHCP = "dhcp" +const NodeInterfaceAlias_IP_CONFIGURATION_STATIC = "static" +const NodeInterfaceAlias_IP_CONFIGURATION_NOT_CONFIGURED = "not configured" + +func (s *NodeInterfaceAlias) GetType__() bindings.BindingType { + return NodeInterfaceAliasBindingType() +} + +func (s *NodeInterfaceAlias) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeInterfaceAlias._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node network interface properties +type NodeInterfaceProperties struct { + // Possible values are: + // + // * NodeInterfaceProperties#NodeInterfaceProperties_ADMIN_STATUS_UP + // * NodeInterfaceProperties#NodeInterfaceProperties_ADMIN_STATUS_DOWN + // + // Interface administration status + AdminStatus *string + // Indicates whether backing of VIRTUAL network interface is managed by NSX + BackingNsxManaged *bool + // Connected switch + ConnectedSwitch *string + // Possible values are: + // + // * NodeInterfaceProperties#NodeInterfaceProperties_CONNECTED_SWITCH_TYPE_VSS + // * NodeInterfaceProperties#NodeInterfaceProperties_CONNECTED_SWITCH_TYPE_DVS + // * NodeInterfaceProperties#NodeInterfaceProperties_CONNECTED_SWITCH_TYPE_N_VDS + // + // Type of switch associated with the interface. + ConnectedSwitchType *string + // Device name. + Device *string + // Driver name. + Driver *string + // Interface capability for Enhanced Networking Stack + EnsCapable *bool + // Indicates whether interface is enabled for Enhanced Networking Stack + EnsEnabled *bool + // This boolean property describes if network interface is capable for Enhanced Networking Stack interrupt + EnsInterruptCapable *bool + // This boolean property describes if network interface is enabled for Enhanced Networking Stack interrupt + EnsInterruptEnabled *bool + // Indicates whether interface is managed by the host + HostManaged *bool + // IP Alias + InterfaceAlias []NodeInterfaceAlias + // Interface ID + InterfaceId *string + // Possible values are: + // + // * NodeInterfaceProperties#NodeInterfaceProperties_INTERFACE_TYPE_PHYSICAL + // * NodeInterfaceProperties#NodeInterfaceProperties_INTERFACE_TYPE_VIRTUAL + // * NodeInterfaceProperties#NodeInterfaceProperties_INTERFACE_TYPE_BOND + // * NodeInterfaceProperties#NodeInterfaceProperties_INTERFACE_TYPE_TEAMING + // + // Interface Type + InterfaceType *string + // UUID of the interface + InterfaceUuid *string + // Device key. + Key *string + // Possible values are: + // + // * NodeInterfaceProperties#NodeInterfaceProperties_LINK_STATUS_UP + // * NodeInterfaceProperties#NodeInterfaceProperties_LINK_STATUS_DOWN + // + // Interface administration status + LinkStatus *string + // LPort Attachment Id assigned to VIRTUAL network interface of a node + LportAttachmentId *string + // Interface MTU format: int64 + Mtu *int64 + // PCI device. + Pci *string + // Possible values are: + // + // * NodeInterfaceProperties#NodeInterfaceProperties_SOURCE_REALTIME + // * NodeInterfaceProperties#NodeInterfaceProperties_SOURCE_CACHED + // + // Source of status data + Source *string +} + +const NodeInterfaceProperties_ADMIN_STATUS_UP = "UP" +const NodeInterfaceProperties_ADMIN_STATUS_DOWN = "DOWN" +const NodeInterfaceProperties_CONNECTED_SWITCH_TYPE_VSS = "VSS" +const NodeInterfaceProperties_CONNECTED_SWITCH_TYPE_DVS = "DVS" +const NodeInterfaceProperties_CONNECTED_SWITCH_TYPE_N_VDS = "N-VDS" +const NodeInterfaceProperties_INTERFACE_TYPE_PHYSICAL = "PHYSICAL" +const NodeInterfaceProperties_INTERFACE_TYPE_VIRTUAL = "VIRTUAL" +const NodeInterfaceProperties_INTERFACE_TYPE_BOND = "BOND" +const NodeInterfaceProperties_INTERFACE_TYPE_TEAMING = "TEAMING" +const NodeInterfaceProperties_LINK_STATUS_UP = "UP" +const NodeInterfaceProperties_LINK_STATUS_DOWN = "DOWN" +const NodeInterfaceProperties_SOURCE_REALTIME = "realtime" +const NodeInterfaceProperties_SOURCE_CACHED = "cached" + +func (s *NodeInterfaceProperties) GetType__() bindings.BindingType { + return NodeInterfacePropertiesBindingType() +} + +func (s *NodeInterfaceProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeInterfaceProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node network interface properties list results +type NodeInterfacePropertiesListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Node interface property results + Results []NodeInterfaceProperties +} + +func (s *NodeInterfacePropertiesListResult) GetType__() bindings.BindingType { + return NodeInterfacePropertiesListResultBindingType() +} + +func (s *NodeInterfacePropertiesListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeInterfacePropertiesListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node network interface statistic properties +type NodeInterfaceStatisticsProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Interface ID + InterfaceId *string + // Number of bytes received format: int64 + RxBytes *int64 + // Number of packets dropped format: int64 + RxDropped *int64 + // Number of receive errors format: int64 + RxErrors *int64 + // Number of framing errors format: int64 + RxFrame *int64 + // Number of packets received format: int64 + RxPackets *int64 + // Possible values are: + // + // * NodeInterfaceStatisticsProperties#NodeInterfaceStatisticsProperties_SOURCE_REALTIME + // * NodeInterfaceStatisticsProperties#NodeInterfaceStatisticsProperties_SOURCE_CACHED + // + // Source of status data. + Source *string + // Number of bytes transmitted format: int64 + TxBytes *int64 + // Number of carrier losses detected format: int64 + TxCarrier *int64 + // Number of collisions detected format: int64 + TxColls *int64 + // Number of packets dropped format: int64 + TxDropped *int64 + // Number of transmit errors format: int64 + TxErrors *int64 + // Number of packets transmitted format: int64 + TxPackets *int64 +} + +const NodeInterfaceStatisticsProperties_SOURCE_REALTIME = "realtime" +const NodeInterfaceStatisticsProperties_SOURCE_CACHED = "cached" + +func (s *NodeInterfaceStatisticsProperties) GetType__() bindings.BindingType { + return NodeInterfaceStatisticsPropertiesBindingType() +} + +func (s *NodeInterfaceStatisticsProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeInterfaceStatisticsProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node log properties +type NodeLogProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Last modified time expressed in milliseconds since epoch format: int64 + LastModifiedTime *int64 + // Name of log file + LogName *string + // Size of log file in bytes format: int64 + LogSize *int64 +} + +func (s *NodeLogProperties) GetType__() bindings.BindingType { + return NodeLogPropertiesBindingType() +} + +func (s *NodeLogProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeLogProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node log property query results +type NodeLogPropertiesListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Node log property results + Results []NodeLogProperties +} + +func (s *NodeLogPropertiesListResult) GetType__() bindings.BindingType { + return NodeLogPropertiesListResultBindingType() +} + +func (s *NodeLogPropertiesListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeLogPropertiesListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NodeMessagingClientInfo struct { + // A list of messaging clients owned by this entity + Clients []MessagingClientInfo + // Possible values are: + // + // * NodeMessagingClientInfo#NodeMessagingClientInfo_ENTITY_TYPE_HTTP + // * NodeMessagingClientInfo#NodeMessagingClientInfo_ENTITY_TYPE_DATASTORE + // * NodeMessagingClientInfo#NodeMessagingClientInfo_ENTITY_TYPE_MANAGER + // * NodeMessagingClientInfo#NodeMessagingClientInfo_ENTITY_TYPE_POLICY + // * NodeMessagingClientInfo#NodeMessagingClientInfo_ENTITY_TYPE_CONTROLLER + // + // Entity type of this messaging client + EntityType *string +} + +const NodeMessagingClientInfo_ENTITY_TYPE_HTTP = "HTTP" +const NodeMessagingClientInfo_ENTITY_TYPE_DATASTORE = "DATASTORE" +const NodeMessagingClientInfo_ENTITY_TYPE_MANAGER = "MANAGER" +const NodeMessagingClientInfo_ENTITY_TYPE_POLICY = "POLICY" +const NodeMessagingClientInfo_ENTITY_TYPE_CONTROLLER = "CONTROLLER" + +func (s *NodeMessagingClientInfo) GetType__() bindings.BindingType { + return NodeMessagingClientInfoBindingType() +} + +func (s *NodeMessagingClientInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeMessagingClientInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Possible values of a mode in a \"/config/nsx_appliance_mode\" file +type NodeMode struct { + // Possible values are: + // + // * NodeMode#NodeMode_MODE_ID_ON_PREM + // * NodeMode#NodeMode_MODE_ID_SERVICE + // * NodeMode#NodeMode_MODE_ID_VMC + // * NodeMode#NodeMode_MODE_ID_VMC_LOCAL + // + // Possible enum values in a \"/config/nsx_appliance_mode\" file + ModeId *string +} + +const NodeMode_MODE_ID_ON_PREM = "ON_PREM" +const NodeMode_MODE_ID_SERVICE = "SERVICE" +const NodeMode_MODE_ID_VMC = "VMC" +const NodeMode_MODE_ID_VMC_LOCAL = "VMC_LOCAL" + +func (s *NodeMode) GetType__() bindings.BindingType { + return NodeModeBindingType() +} + +func (s *NodeMode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeMode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node network name servers properties +type NodeNameServersProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Name servers + NameServers []string +} + +func (s *NodeNameServersProperties) GetType__() bindings.BindingType { + return NodeNameServersPropertiesBindingType() +} + +func (s *NodeNameServersProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeNameServersProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node network interface properties +type NodeNetworkInterfaceProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Possible values are: + // + // * NodeNetworkInterfaceProperties#NodeNetworkInterfaceProperties_ADMIN_STATUS_UP + // * NodeNetworkInterfaceProperties#NodeNetworkInterfaceProperties_ADMIN_STATUS_DOWN + // + // Interface administration status + AdminStatus *string + // Bond's currently active slave device + BondCurActiveSlave *string + // Bond's rate at which we'll ask our link partner to transmit LACPDU packets in 802.3ad mode + BondLacpRate *string + // Possible values are: + // + // * NodeNetworkInterfaceProperties#NodeNetworkInterfaceProperties_BOND_MODE_ACTIVE_BACKUP + // * NodeNetworkInterfaceProperties#NodeNetworkInterfaceProperties_BOND_MODE_802_3AD + // * NodeNetworkInterfaceProperties#NodeNetworkInterfaceProperties_BOND_MODE_ROUND_ROBIN + // * NodeNetworkInterfaceProperties#NodeNetworkInterfaceProperties_BOND_MODE_BROADCAST + // * NodeNetworkInterfaceProperties#NodeNetworkInterfaceProperties_BOND_MODE_XOR + // * NodeNetworkInterfaceProperties#NodeNetworkInterfaceProperties_BOND_MODE_TLB + // * NodeNetworkInterfaceProperties#NodeNetworkInterfaceProperties_BOND_MODE_ALB + // + // Bond mode + BondMode *string + // Bond's primary device name in active-backup bond mode + BondPrimary *string + // Bond's primary device name in active-backup bond mode + BondPrimarySlave *string + // Bond's slave devices + BondSlaves []string + // Possible values are: + // + // * NodeNetworkInterfaceProperties#NodeNetworkInterfaceProperties_BOND_XMIT_HASH_POLICY_LAYER2 + // * NodeNetworkInterfaceProperties#NodeNetworkInterfaceProperties_BOND_XMIT_HASH_POLICY_LAYER2_3 + // * NodeNetworkInterfaceProperties#NodeNetworkInterfaceProperties_BOND_XMIT_HASH_POLICY_LAYER3_4 + // * NodeNetworkInterfaceProperties#NodeNetworkInterfaceProperties_BOND_XMIT_HASH_POLICY_ENCAP2_3 + // * NodeNetworkInterfaceProperties#NodeNetworkInterfaceProperties_BOND_XMIT_HASH_POLICY_ENCAP3_4 + // + // Bond's transmit hash policy for balance-xor and 802.3ad modes + BondXmitHashPolicy *string + // Interface broadcast address + BroadcastAddress *string + // Interface's default gateway + DefaultGateway *string + // Interface ID + InterfaceId *string + // Interface IP addresses + IpAddresses []IPv4AddressProperties + // Possible values are: + // + // * NodeNetworkInterfaceProperties#NodeNetworkInterfaceProperties_IP_CONFIGURATION_DHCP + // * NodeNetworkInterfaceProperties#NodeNetworkInterfaceProperties_IP_CONFIGURATION_STATIC + // * NodeNetworkInterfaceProperties#NodeNetworkInterfaceProperties_IP_CONFIGURATION_NOT_CONFIGURED + // + // Interface configuration + IpConfiguration *string + // Interface is a KNI + IsKni *bool + // Possible values are: + // + // * NodeNetworkInterfaceProperties#NodeNetworkInterfaceProperties_LINK_STATUS_UP + // * NodeNetworkInterfaceProperties#NodeNetworkInterfaceProperties_LINK_STATUS_DOWN + // + // Interface administration status + LinkStatus *string + // Interface MTU format: int64 + Mtu *int64 + // Interface MAC address + PhysicalAddress *string + // Possible values are: + // + // * NodeNetworkInterfaceProperties#NodeNetworkInterfaceProperties_PLANE_MGMT + // * NodeNetworkInterfaceProperties#NodeNetworkInterfaceProperties_PLANE_DEBUG + // * NodeNetworkInterfaceProperties#NodeNetworkInterfaceProperties_PLANE_NONE + // + // Interface plane + Plane *string + // VLAN Id format: int64 + Vlan *int64 +} + +const NodeNetworkInterfaceProperties_ADMIN_STATUS_UP = "up" +const NodeNetworkInterfaceProperties_ADMIN_STATUS_DOWN = "down" +const NodeNetworkInterfaceProperties_BOND_MODE_ACTIVE_BACKUP = "ACTIVE_BACKUP" +const NodeNetworkInterfaceProperties_BOND_MODE_802_3AD = "802_3AD" +const NodeNetworkInterfaceProperties_BOND_MODE_ROUND_ROBIN = "ROUND_ROBIN" +const NodeNetworkInterfaceProperties_BOND_MODE_BROADCAST = "BROADCAST" +const NodeNetworkInterfaceProperties_BOND_MODE_XOR = "XOR" +const NodeNetworkInterfaceProperties_BOND_MODE_TLB = "TLB" +const NodeNetworkInterfaceProperties_BOND_MODE_ALB = "ALB" +const NodeNetworkInterfaceProperties_BOND_XMIT_HASH_POLICY_LAYER2 = "layer2" +const NodeNetworkInterfaceProperties_BOND_XMIT_HASH_POLICY_LAYER2_3 = "layer2+3" +const NodeNetworkInterfaceProperties_BOND_XMIT_HASH_POLICY_LAYER3_4 = "layer3+4" +const NodeNetworkInterfaceProperties_BOND_XMIT_HASH_POLICY_ENCAP2_3 = "encap2+3" +const NodeNetworkInterfaceProperties_BOND_XMIT_HASH_POLICY_ENCAP3_4 = "encap3+4" +const NodeNetworkInterfaceProperties_IP_CONFIGURATION_DHCP = "dhcp" +const NodeNetworkInterfaceProperties_IP_CONFIGURATION_STATIC = "static" +const NodeNetworkInterfaceProperties_IP_CONFIGURATION_NOT_CONFIGURED = "not configured" +const NodeNetworkInterfaceProperties_LINK_STATUS_UP = "up" +const NodeNetworkInterfaceProperties_LINK_STATUS_DOWN = "down" +const NodeNetworkInterfaceProperties_PLANE_MGMT = "mgmt" +const NodeNetworkInterfaceProperties_PLANE_DEBUG = "debug" +const NodeNetworkInterfaceProperties_PLANE_NONE = "none" + +func (s *NodeNetworkInterfaceProperties) GetType__() bindings.BindingType { + return NodeNetworkInterfacePropertiesBindingType() +} + +func (s *NodeNetworkInterfaceProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeNetworkInterfaceProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node network interface properties list results +type NodeNetworkInterfacePropertiesListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Node network interface property results + Results []NodeNetworkInterfaceProperties +} + +func (s *NodeNetworkInterfacePropertiesListResult) GetType__() bindings.BindingType { + return NodeNetworkInterfacePropertiesListResultBindingType() +} + +func (s *NodeNetworkInterfacePropertiesListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeNetworkInterfacePropertiesListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Network configuration properties +type NodeNetworkProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink +} + +func (s *NodeNetworkProperties) GetType__() bindings.BindingType { + return NodeNetworkPropertiesBindingType() +} + +func (s *NodeNetworkProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeNetworkProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node NTP service properties +type NodeNtpServiceProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Service name + ServiceName *string + ServiceProperties *NtpServiceProperties +} + +func (s *NodeNtpServiceProperties) GetType__() bindings.BindingType { + return NodeNtpServicePropertiesBindingType() +} + +func (s *NodeNtpServiceProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeNtpServiceProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node service properties +type NodePolicyServiceProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Service name + ServiceName *string + ServiceProperties *LoggingServiceProperties +} + +func (s *NodePolicyServiceProperties) GetType__() bindings.BindingType { + return NodePolicyServicePropertiesBindingType() +} + +func (s *NodePolicyServiceProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodePolicyServiceProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node process properties +type NodeProcessProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // CPU time (user and system) consumed by process in milliseconds format: int64 + CpuTime *int64 + // Resident set size of process in bytes format: int64 + MemResident *int64 + // Virtual memory used by process in bytes format: int64 + MemUsed *int64 + // Process id format: int64 + Pid *int64 + // Parent process id format: int64 + Ppid *int64 + // Process name + ProcessName *string + // Process start time expressed in milliseconds since epoch format: int64 + StartTime *int64 + // Milliseconds since process started format: int64 + Uptime *int64 +} + +func (s *NodeProcessProperties) GetType__() bindings.BindingType { + return NodeProcessPropertiesBindingType() +} + +func (s *NodeProcessProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeProcessProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node process property query results +type NodeProcessPropertiesListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Node process property results + Results []NodeProcessProperties +} + +func (s *NodeProcessPropertiesListResult) GetType__() bindings.BindingType { + return NodeProcessPropertiesListResultBindingType() +} + +func (s *NodeProcessPropertiesListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeProcessPropertiesListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node properties +type NodeProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // NSX CLI command history limit, set to 0 to configure no history size limit format: int64 + CliHistorySize *int64 + // NSX CLI display datetime stamp in command output + CliOutputDatetime *bool + // NSX CLI inactivity timeout, set to 0 to configure no timeout format: int64 + CliTimeout *int64 + // Possible values are: + // + // * NodeProperties#NodeProperties_EXPORT_TYPE_RESTRICTED + // * NodeProperties#NodeProperties_EXPORT_TYPE_UNRESTRICTED + // + // Export restrictions in effect, if any + ExportType *string + // Fully qualified domain name + FullyQualifiedDomainName *string + // Host name or fully qualified domain name of node + Hostname *string + // Kernel version + KernelVersion *string + // Possible values are: + // + // * NodeProperties#NodeProperties_NODE_TYPE_MANAGER + // * NodeProperties#NodeProperties_NODE_TYPE_GLOBAL_MANAGER + // * NodeProperties#NodeProperties_NODE_TYPE_EDGE + // * NodeProperties#NodeProperties_NODE_TYPE_AUTONOMOUS_EDGE + // * NodeProperties#NodeProperties_NODE_TYPE_CLOUD_SERVICE_MANAGER + // * NodeProperties#NodeProperties_NODE_TYPE_PUBLIC_CLOUD_GATEWAY + // + // Node type + NodeType *string + // Node Unique Identifier + NodeUuid *string + // Node version + NodeVersion *string + // Product version + ProductVersion *string + // System date time in UTC + SystemDatetime *string + // Current time expressed in milliseconds since epoch format: int64 + SystemTime *int64 + // Timezone + Timezone *string +} + +const NodeProperties_EXPORT_TYPE_RESTRICTED = "RESTRICTED" +const NodeProperties_EXPORT_TYPE_UNRESTRICTED = "UNRESTRICTED" +const NodeProperties_NODE_TYPE_MANAGER = "NSX Manager" +const NodeProperties_NODE_TYPE_GLOBAL_MANAGER = "NSX Global Manager" +const NodeProperties_NODE_TYPE_EDGE = "NSX Edge" +const NodeProperties_NODE_TYPE_AUTONOMOUS_EDGE = "NSX Autonomous Edge" +const NodeProperties_NODE_TYPE_CLOUD_SERVICE_MANAGER = "NSX Cloud Service Manager" +const NodeProperties_NODE_TYPE_PUBLIC_CLOUD_GATEWAY = "NSX Public Cloud Gateway" + +func (s *NodeProperties) GetType__() bindings.BindingType { + return NodePropertiesBindingType() +} + +func (s *NodeProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node service properties +type NodeProtonServiceProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Service name + ServiceName *string + ServiceProperties *LoggingServiceProperties +} + +func (s *NodeProtonServiceProperties) GetType__() bindings.BindingType { + return NodeProtonServicePropertiesBindingType() +} + +func (s *NodeProtonServiceProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeProtonServiceProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node network route properties +type NodeRouteProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Destination covered by route + Destination *string + // From address + FromAddress *string + // Address of next hop + Gateway *string + // Network interface id of route + InterfaceId *string + // Metric value of route + Metric *string + // Netmask of destination covered by route + Netmask *string + // Possible values are: + // + // * NodeRouteProperties#NodeRouteProperties_PROTO_UNSPEC + // * NodeRouteProperties#NodeRouteProperties_PROTO_REDIRECT + // * NodeRouteProperties#NodeRouteProperties_PROTO_KERNEL + // * NodeRouteProperties#NodeRouteProperties_PROTO_BOOT + // * NodeRouteProperties#NodeRouteProperties_PROTO_STATIC + // * NodeRouteProperties#NodeRouteProperties_PROTO_GATED + // * NodeRouteProperties#NodeRouteProperties_PROTO_RA + // * NodeRouteProperties#NodeRouteProperties_PROTO_MRT + // * NodeRouteProperties#NodeRouteProperties_PROTO_ZEBRA + // * NodeRouteProperties#NodeRouteProperties_PROTO_BIRD + // * NodeRouteProperties#NodeRouteProperties_PROTO_DNROUTED + // * NodeRouteProperties#NodeRouteProperties_PROTO_XORP + // * NodeRouteProperties#NodeRouteProperties_PROTO_NTK + // * NodeRouteProperties#NodeRouteProperties_PROTO_DHCP + // + // Routing protocol identifier of route + Proto *string + // Unique identifier for the route + RouteId *string + // Possible values are: + // + // * NodeRouteProperties#NodeRouteProperties_ROUTE_TYPE_DEFAULT + // * NodeRouteProperties#NodeRouteProperties_ROUTE_TYPE_STATIC + // * NodeRouteProperties#NodeRouteProperties_ROUTE_TYPE_BLACKHOLE + // * NodeRouteProperties#NodeRouteProperties_ROUTE_TYPE_PROHIBIT + // * NodeRouteProperties#NodeRouteProperties_ROUTE_TYPE_THROW + // * NodeRouteProperties#NodeRouteProperties_ROUTE_TYPE_UNREACHABLE + // + // Route type + RouteType *string + // Scope of destinations covered by route + Scope *string + // Source address to prefer when sending to destinations of route + Src *string +} + +const NodeRouteProperties_PROTO_UNSPEC = "unspec" +const NodeRouteProperties_PROTO_REDIRECT = "redirect" +const NodeRouteProperties_PROTO_KERNEL = "kernel" +const NodeRouteProperties_PROTO_BOOT = "boot" +const NodeRouteProperties_PROTO_STATIC = "static" +const NodeRouteProperties_PROTO_GATED = "gated" +const NodeRouteProperties_PROTO_RA = "ra" +const NodeRouteProperties_PROTO_MRT = "mrt" +const NodeRouteProperties_PROTO_ZEBRA = "zebra" +const NodeRouteProperties_PROTO_BIRD = "bird" +const NodeRouteProperties_PROTO_DNROUTED = "dnrouted" +const NodeRouteProperties_PROTO_XORP = "xorp" +const NodeRouteProperties_PROTO_NTK = "ntk" +const NodeRouteProperties_PROTO_DHCP = "dhcp" +const NodeRouteProperties_ROUTE_TYPE_DEFAULT = "default" +const NodeRouteProperties_ROUTE_TYPE_STATIC = "static" +const NodeRouteProperties_ROUTE_TYPE_BLACKHOLE = "blackhole" +const NodeRouteProperties_ROUTE_TYPE_PROHIBIT = "prohibit" +const NodeRouteProperties_ROUTE_TYPE_THROW = "throw" +const NodeRouteProperties_ROUTE_TYPE_UNREACHABLE = "unreachable" + +func (s *NodeRouteProperties) GetType__() bindings.BindingType { + return NodeRoutePropertiesBindingType() +} + +func (s *NodeRouteProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeRouteProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node network route properties list results +type NodeRoutePropertiesListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Node route property results + Results []NodeRouteProperties +} + +func (s *NodeRoutePropertiesListResult) GetType__() bindings.BindingType { + return NodeRoutePropertiesListResultBindingType() +} + +func (s *NodeRoutePropertiesListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeRoutePropertiesListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NodeRtepIpsConfig struct { + // System generated index for cluster member format: int32 + MemberIndex *int64 + // Remote tunnel endpoint ip address. format: ip + RtepIps []string + // Identifier of the transport node backed by an Edge node + TransportNodeId *string +} + +func (s *NodeRtepIpsConfig) GetType__() bindings.BindingType { + return NodeRtepIpsConfigBindingType() +} + +func (s *NodeRtepIpsConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeRtepIpsConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node network search domains properties +type NodeSearchDomainsProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Search domains + SearchDomains []string +} + +func (s *NodeSearchDomainsProperties) GetType__() bindings.BindingType { + return NodeSearchDomainsPropertiesBindingType() +} + +func (s *NodeSearchDomainsProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeSearchDomainsProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node service properties +type NodeServiceProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Service name + ServiceName *string +} + +func (s *NodeServiceProperties) GetType__() bindings.BindingType { + return NodeServicePropertiesBindingType() +} + +func (s *NodeServiceProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeServiceProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node service property query results +type NodeServicePropertiesListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Node service property results + Results []NodeServiceProperties +} + +func (s *NodeServicePropertiesListResult) GetType__() bindings.BindingType { + return NodeServicePropertiesListResultBindingType() +} + +func (s *NodeServicePropertiesListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeServicePropertiesListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node service status properties +type NodeServiceStatusProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Possible values are: + // + // * NodeServiceStatusProperties#NodeServiceStatusProperties_HEALTH_STABLE + // * NodeServiceStatusProperties#NodeServiceStatusProperties_HEALTH_DEGRADED + // + // Service health in addition to runtime_state + Health *string + // Service monitor process id format: int64 + MonitorPid *int64 + // Possible values are: + // + // * NodeServiceStatusProperties#NodeServiceStatusProperties_MONITOR_RUNTIME_STATE_RUNNING + // * NodeServiceStatusProperties#NodeServiceStatusProperties_MONITOR_RUNTIME_STATE_STOPPED + // + // Service monitor runtime state + MonitorRuntimeState *string + // Service process ids format: int64 + Pids []int64 + // Reason for service degradation + Reason *string + // Possible values are: + // + // * NodeServiceStatusProperties#NodeServiceStatusProperties_RUNTIME_STATE_RUNNING + // * NodeServiceStatusProperties#NodeServiceStatusProperties_RUNTIME_STATE_STOPPED + // + // Service runtime state + RuntimeState *string +} + +const NodeServiceStatusProperties_HEALTH_STABLE = "STABLE" +const NodeServiceStatusProperties_HEALTH_DEGRADED = "DEGRADED" +const NodeServiceStatusProperties_MONITOR_RUNTIME_STATE_RUNNING = "running" +const NodeServiceStatusProperties_MONITOR_RUNTIME_STATE_STOPPED = "stopped" +const NodeServiceStatusProperties_RUNTIME_STATE_RUNNING = "running" +const NodeServiceStatusProperties_RUNTIME_STATE_STOPPED = "stopped" + +func (s *NodeServiceStatusProperties) GetType__() bindings.BindingType { + return NodeServiceStatusPropertiesBindingType() +} + +func (s *NodeServiceStatusProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeServiceStatusProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node SNMP service properties +type NodeSnmpServiceProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Service name + ServiceName *string + ServiceProperties *SnmpServiceProperties +} + +func (s *NodeSnmpServiceProperties) GetType__() bindings.BindingType { + return NodeSnmpServicePropertiesBindingType() +} + +func (s *NodeSnmpServiceProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeSnmpServiceProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// SNMP V3 Engine Id +type NodeSnmpV3EngineID struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Service name + ServiceName *string + // SNMP v3 engine id + V3EngineId *string +} + +func (s *NodeSnmpV3EngineID) GetType__() bindings.BindingType { + return NodeSnmpV3EngineIDBindingType() +} + +func (s *NodeSnmpV3EngineID) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeSnmpV3EngineID._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node SSH service properties +type NodeSshServiceProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Service name + ServiceName *string + ServiceProperties *SshServiceProperties +} + +func (s *NodeSshServiceProperties) GetType__() bindings.BindingType { + return NodeSshServicePropertiesBindingType() +} + +func (s *NodeSshServiceProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeSshServiceProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Runtime status information of the fabric node. +type NodeStatus struct { + // HostNode external id + ExternalId *string + // Possible values are: + // + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_NOT_PREPARED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_INSTALL_IN_PROGRESS + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_INSTALL_FAILED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_INSTALL_SUCCESSFUL + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_INSTALL_SKIPPED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UNINSTALL_IN_PROGRESS + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UNINSTALL_FAILED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UNINSTALL_SUCCESSFUL + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UNINSTALL_SCHEDULED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UNINSTALL_SKIPPED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UPGRADE_IN_PROGRESS + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UPGRADE_FAILED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_PENDING_UPGRADE + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_NOT_AVAILABLE + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_DEPLOYMENT_QUEUED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_DEPLOYMENT_IN_PROGRESS + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_DEPLOYMENT_FAILED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_POWER_ON_IN_PROGRESS + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_POWER_ON_FAILED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_REGISTRATION_PENDING + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_NODE_NOT_READY + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_NODE_READY + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_POWER_OFF_IN_PROGRESS + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_POWER_OFF_FAILED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_UNDEPLOY_IN_PROGRESS + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_UNDEPLOY_FAILED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_UNDEPLOY_SUCCESSFUL + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_EDGE_CONFIG_ERROR + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_DEPLOYMENT_RESTARTED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_REGISTRATION_FAILED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_HOST_DISCONNECTED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_POWERED_OFF + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_TRANSPORT_NODE_SYNC_PENDING + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_TRANSPORT_NODE_CONFIGURATION_MISSING + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_EDGE_HARDWARE_NOT_SUPPORTED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_TZ_ENDPOINTS_NOT_SPECIFIED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_NO_PNIC_PREPARED_IN_EDGE + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_APPLIANCE_INTERNAL_ERROR + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VTEP_DHCP_NOT_SUPPORTED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UNSUPPORTED_HOST_SWITCH_PROFILE + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_HOSTSWITCH_PROFILE_NOT_FOUND + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_LLDP_SEND_ENABLED_NOT_SUPPORTED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UNSUPPORTED_NAMED_TEAMING_POLICY + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_MULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_LACP_NOT_SUPPORTED_FOR_EDGE_VM + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_EDGE_NODE_VERSION_NOT_SUPPORTED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_NO_PNIC_SPECIFIED_IN_TN + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_INVALID_PNIC_DEVICE_NAME + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_TRANSPORT_NODE_READY + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UNSUPPORTED_DEFAULT_TEAMING_POLICY + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_MPA_DISCONNECTED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_NETWORK_EDIT_PENDING + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_RENAME_PENDING + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_CONFIG_EDIT_PENDING + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_NETWORK_EDIT_FAILED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_RENAME_FAILED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_CONFIG_EDIT_FAILED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_CONFIG_DISCREPANCY + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_NODE_REFRESH_FAILED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_PLACEMENT_REFRESH_FAILED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_REGISTRATION_TIMEDOUT + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_REPLACE_FAILED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_DELETE_VM_IN_REDEPLOY_FAILED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_DEPLOY_VM_IN_REDEPLOY_FAILED + // * NodeStatus#NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE + // + // This enum specifies the current nsx install state for host node or current deployment and ready state for edge node. The ready status 'NODE_READY' indicates whether edge node is ready to become a transport node. The status 'EDGE_CONFIG_ERROR' indicates that edge hardware or underlying host is not supported. After all fabric level operations are done for an edge node, this value indicates transport node related configuration issues and state as relevant. + HostNodeDeploymentStatus *string + // Is true if inventory sync is paused else false + InventorySyncPaused *bool + // Inventory sync auto re-enable target time, in epoch milis format: int64 + InventorySyncReenableTime *int64 + // Timestamp of the last heartbeat status change, in epoch milliseconds. format: int64 + LastHeartbeatTimestamp *int64 + // Timestamp of the last successful update of Inventory, in epoch milliseconds. format: int64 + LastSyncTime *int64 + // Possible values are: + // + // * NodeStatus#NodeStatus_LCP_CONNECTIVITY_STATUS_UP + // * NodeStatus#NodeStatus_LCP_CONNECTIVITY_STATUS_DOWN + // * NodeStatus#NodeStatus_LCP_CONNECTIVITY_STATUS_DEGRADED + // * NodeStatus#NodeStatus_LCP_CONNECTIVITY_STATUS_UNKNOWN + // + // Indicates the fabric node's LCP<->CCP channel connectivity status, UP, DOWN, DEGRADED, UNKNOWN. + LcpConnectivityStatus *string + // Details, if any, about the current LCP<->CCP channel connectivity status of the fabric node. + LcpConnectivityStatusDetails []ControlConnStatus + // Possible values are: + // + // * NodeStatus#NodeStatus_MAINTENANCE_MODE_OFF + // * NodeStatus#NodeStatus_MAINTENANCE_MODE_ENTERING + // * NodeStatus#NodeStatus_MAINTENANCE_MODE_ON + // * NodeStatus#NodeStatus_MAINTENANCE_MODE_EXITING + // + // Indicates the fabric node's status of maintenance mode, OFF, ENTERING, ON, EXITING. + MaintenanceMode *string + // Possible values are: + // + // * NodeStatus#NodeStatus_MPA_CONNECTIVITY_STATUS_UP + // * NodeStatus#NodeStatus_MPA_CONNECTIVITY_STATUS_DOWN + // * NodeStatus#NodeStatus_MPA_CONNECTIVITY_STATUS_UNKNOWN + // + // Indicates the fabric node's MP<->MPA channel connectivity status, UP, DOWN, UNKNOWN. + MpaConnectivityStatus *string + // Details, if any, about the current MP<->MPA channel connectivity status of the fabric node. + MpaConnectivityStatusDetails *string + // Software version of the fabric node. + SoftwareVersion *string + SystemStatus *NodeStatusProperties +} + +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_NOT_PREPARED = "NOT_PREPARED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_INSTALL_IN_PROGRESS = "INSTALL_IN_PROGRESS" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_INSTALL_FAILED = "INSTALL_FAILED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_INSTALL_SUCCESSFUL = "INSTALL_SUCCESSFUL" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_INSTALL_SKIPPED = "INSTALL_SKIPPED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UNINSTALL_IN_PROGRESS = "UNINSTALL_IN_PROGRESS" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UNINSTALL_FAILED = "UNINSTALL_FAILED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UNINSTALL_SUCCESSFUL = "UNINSTALL_SUCCESSFUL" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UNINSTALL_SCHEDULED = "UNINSTALL_SCHEDULED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UNINSTALL_SKIPPED = "UNINSTALL_SKIPPED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UPGRADE_IN_PROGRESS = "UPGRADE_IN_PROGRESS" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UPGRADE_FAILED = "UPGRADE_FAILED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_PENDING_UPGRADE = "PENDING_UPGRADE" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_NOT_AVAILABLE = "NOT_AVAILABLE" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_DEPLOYMENT_QUEUED = "VM_DEPLOYMENT_QUEUED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_DEPLOYMENT_IN_PROGRESS = "VM_DEPLOYMENT_IN_PROGRESS" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_POWER_ON_IN_PROGRESS = "VM_POWER_ON_IN_PROGRESS" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_REGISTRATION_PENDING = "REGISTRATION_PENDING" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_NODE_NOT_READY = "NODE_NOT_READY" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_NODE_READY = "NODE_READY" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_POWER_OFF_IN_PROGRESS = "VM_POWER_OFF_IN_PROGRESS" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_UNDEPLOY_IN_PROGRESS = "VM_UNDEPLOY_IN_PROGRESS" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_UNDEPLOY_SUCCESSFUL = "VM_UNDEPLOY_SUCCESSFUL" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_EDGE_CONFIG_ERROR = "EDGE_CONFIG_ERROR" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_DEPLOYMENT_RESTARTED = "VM_DEPLOYMENT_RESTARTED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_REGISTRATION_FAILED = "REGISTRATION_FAILED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_HOST_DISCONNECTED = "HOST_DISCONNECTED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_POWERED_OFF = "POWERED_OFF" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_TRANSPORT_NODE_SYNC_PENDING = "TRANSPORT_NODE_SYNC_PENDING" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_TRANSPORT_NODE_CONFIGURATION_MISSING = "TRANSPORT_NODE_CONFIGURATION_MISSING" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_EDGE_HARDWARE_NOT_SUPPORTED = "EDGE_HARDWARE_NOT_SUPPORTED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED = "MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER = "TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_TZ_ENDPOINTS_NOT_SPECIFIED = "TZ_ENDPOINTS_NOT_SPECIFIED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_NO_PNIC_PREPARED_IN_EDGE = "NO_PNIC_PREPARED_IN_EDGE" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_APPLIANCE_INTERNAL_ERROR = "APPLIANCE_INTERNAL_ERROR" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VTEP_DHCP_NOT_SUPPORTED = "VTEP_DHCP_NOT_SUPPORTED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UNSUPPORTED_HOST_SWITCH_PROFILE = "UNSUPPORTED_HOST_SWITCH_PROFILE" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED = "UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_HOSTSWITCH_PROFILE_NOT_FOUND = "HOSTSWITCH_PROFILE_NOT_FOUND" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_LLDP_SEND_ENABLED_NOT_SUPPORTED = "LLDP_SEND_ENABLED_NOT_SUPPORTED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UNSUPPORTED_NAMED_TEAMING_POLICY = "UNSUPPORTED_NAMED_TEAMING_POLICY" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_MULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING = "MULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM = "LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_LACP_NOT_SUPPORTED_FOR_EDGE_VM = "LACP_NOT_SUPPORTED_FOR_EDGE_VM" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM = "STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE = "MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE = "UNSUPPORTED_LACP_LB_ALGO_FOR_NODE" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_EDGE_NODE_VERSION_NOT_SUPPORTED = "EDGE_NODE_VERSION_NOT_SUPPORTED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_NO_PNIC_SPECIFIED_IN_TN = "NO_PNIC_SPECIFIED_IN_TN" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_INVALID_PNIC_DEVICE_NAME = "INVALID_PNIC_DEVICE_NAME" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_TRANSPORT_NODE_READY = "TRANSPORT_NODE_READY" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UNSUPPORTED_DEFAULT_TEAMING_POLICY = "UNSUPPORTED_DEFAULT_TEAMING_POLICY" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_MPA_DISCONNECTED = "MPA_DISCONNECTED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_NETWORK_EDIT_PENDING = "VM_NETWORK_EDIT_PENDING" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_RENAME_PENDING = "VM_RENAME_PENDING" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_CONFIG_EDIT_PENDING = "VM_CONFIG_EDIT_PENDING" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_NETWORK_EDIT_FAILED = "VM_NETWORK_EDIT_FAILED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_RENAME_FAILED = "VM_RENAME_FAILED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_CONFIG_EDIT_FAILED = "VM_CONFIG_EDIT_FAILED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_CONFIG_DISCREPANCY = "VM_CONFIG_DISCREPANCY" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_NODE_REFRESH_FAILED = "VM_NODE_REFRESH_FAILED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_VM_PLACEMENT_REFRESH_FAILED = "VM_PLACEMENT_REFRESH_FAILED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_REGISTRATION_TIMEDOUT = "REGISTRATION_TIMEDOUT" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING = "LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED = "UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_REPLACE_FAILED = "REPLACE_FAILED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_DELETE_VM_IN_REDEPLOY_FAILED = "DELETE_VM_IN_REDEPLOY_FAILED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_DEPLOY_VM_IN_REDEPLOY_FAILED = "DEPLOY_VM_IN_REDEPLOY_FAILED" +const NodeStatus_HOST_NODE_DEPLOYMENT_STATUS_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE = "INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE" +const NodeStatus_LCP_CONNECTIVITY_STATUS_UP = "UP" +const NodeStatus_LCP_CONNECTIVITY_STATUS_DOWN = "DOWN" +const NodeStatus_LCP_CONNECTIVITY_STATUS_DEGRADED = "DEGRADED" +const NodeStatus_LCP_CONNECTIVITY_STATUS_UNKNOWN = "UNKNOWN" +const NodeStatus_MAINTENANCE_MODE_OFF = "OFF" +const NodeStatus_MAINTENANCE_MODE_ENTERING = "ENTERING" +const NodeStatus_MAINTENANCE_MODE_ON = "ON" +const NodeStatus_MAINTENANCE_MODE_EXITING = "EXITING" +const NodeStatus_MPA_CONNECTIVITY_STATUS_UP = "UP" +const NodeStatus_MPA_CONNECTIVITY_STATUS_DOWN = "DOWN" +const NodeStatus_MPA_CONNECTIVITY_STATUS_UNKNOWN = "UNKNOWN" + +func (s *NodeStatus) GetType__() bindings.BindingType { + return NodeStatusBindingType() +} + +func (s *NodeStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node status properties +type NodeStatusProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Number of CPU cores on the system format: int64 + CpuCores *int64 + CpuUsage *CpuUsage + // Amount of disk space available on the system, in kilobytes. format: int64 + DiskSpaceTotal *int64 + // Amount of disk space in use on the system, in kilobytes format: int64 + DiskSpaceUsed *int64 + // Number of DPDK cores on Edge Node which are used for packet IO processing. format: int64 + DpdkCpuCores *int64 + EdgeMemUsage *EdgeTransportNodeMemoryUsage + // File systems configured on the system + FileSystems []NodeFileSystemProperties + // Host name of the system + Hostname *string + // One, five, and fifteen minute load averages for the system + LoadAverage []float64 + // Amount of RAM on the system that can be flushed out to disk, in kilobytes format: int64 + MemCache *int64 + // Amount of RAM allocated to the system, in kilobytes format: int64 + MemTotal *int64 + // Amount of RAM in use on the system, in kilobytes format: int64 + MemUsed *int64 + // Number of non-DPDK cores on Edge Node. format: int64 + NonDpdkCpuCores *int64 + // Possible values are: + // + // * NodeStatusProperties#NodeStatusProperties_SOURCE_REALTIME + // * NodeStatusProperties#NodeStatusProperties_SOURCE_CACHED + // + // Source of status data. + Source *string + // Amount of disk available for swap, in kilobytes format: int64 + SwapTotal *int64 + // Amount of swap disk in use, in kilobytes format: int64 + SwapUsed *int64 + // Current time expressed in milliseconds since epoch format: int64 + SystemTime *int64 + // Milliseconds since system start format: int64 + Uptime *int64 +} + +const NodeStatusProperties_SOURCE_REALTIME = "realtime" +const NodeStatusProperties_SOURCE_CACHED = "cached" + +func (s *NodeStatusProperties) GetType__() bindings.BindingType { + return NodeStatusPropertiesBindingType() +} + +func (s *NodeStatusProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeStatusProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NodeSummary struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Component version + ComponentVersion *string + // Number of nodes of the type and at the component version format: int32 + NodeCount *int64 + // Node type + Type_ *string + // Possible values are: + // + // * NodeSummary#NodeSummary_UPGRADE_UNIT_SUBTYPE_RESOURCE + // * NodeSummary#NodeSummary_UPGRADE_UNIT_SUBTYPE_ACTION + // + // UpgradeUnit sub type + UpgradeUnitSubtype *string +} + +const NodeSummary_UPGRADE_UNIT_SUBTYPE_RESOURCE = "RESOURCE" +const NodeSummary_UPGRADE_UNIT_SUBTYPE_ACTION = "ACTION" + +func (s *NodeSummary) GetType__() bindings.BindingType { + return NodeSummaryBindingType() +} + +func (s *NodeSummary) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeSummary._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NodeSummaryList struct { + // List of Node Summary + Results []NodeSummary +} + +func (s *NodeSummaryList) GetType__() bindings.BindingType { + return NodeSummaryListBindingType() +} + +func (s *NodeSummaryList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeSummaryList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node syslog exporter properties +type NodeSyslogExporterProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Syslog exporter name + ExporterName *string + // Possible values are: + // + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_FACILITIES_KERN + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_FACILITIES_USER + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_FACILITIES_MAIL + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_FACILITIES_DAEMON + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_FACILITIES_AUTH + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_FACILITIES_SYSLOG + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_FACILITIES_LPR + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_FACILITIES_NEWS + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_FACILITIES_UUCP + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_FACILITIES_AUTHPRIV + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_FACILITIES_FTP + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_FACILITIES_LOGALERT + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_FACILITIES_CRON + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_FACILITIES_LOCAL0 + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_FACILITIES_LOCAL1 + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_FACILITIES_LOCAL2 + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_FACILITIES_LOCAL3 + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_FACILITIES_LOCAL4 + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_FACILITIES_LOCAL5 + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_FACILITIES_LOCAL6 + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_FACILITIES_LOCAL7 + // + // Facilities to export + Facilities []string + // Possible values are: + // + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_LEVEL_EMERG + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_LEVEL_ALERT + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_LEVEL_CRIT + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_LEVEL_ERR + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_LEVEL_WARNING + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_LEVEL_NOTICE + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_LEVEL_INFO + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_LEVEL_DEBUG + // + // Logging level to export + Level *string + // MSGIDs to export + Msgids []string + // Port to export to, defaults to 514 for TCP, TLS, UDP protocols or 9000 for LI, LI-TLS protocols format: int64 + Port *int64 + // Possible values are: + // + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_PROTOCOL_TCP + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_PROTOCOL_TLS + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_PROTOCOL_UDP + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_PROTOCOL_LI + // * NodeSyslogExporterProperties#NodeSyslogExporterProperties_PROTOCOL_LI_TLS + // + // Export protocol + Protocol *string + // IP address or hostname of server to export to format: hostname-or-ipv4 + Server *string + // Structured data to export + StructuredData []string + // CA certificate PEM of TLS server to export to + TlsCaPem *string + // Certificate PEM of the rsyslog client + TlsCertPem *string + // CA certificate PEM of the rsyslog client + TlsClientCaPem *string + // Private key PEM of the rsyslog client + TlsKeyPem *string +} + +const NodeSyslogExporterProperties_FACILITIES_KERN = "KERN" +const NodeSyslogExporterProperties_FACILITIES_USER = "USER" +const NodeSyslogExporterProperties_FACILITIES_MAIL = "MAIL" +const NodeSyslogExporterProperties_FACILITIES_DAEMON = "DAEMON" +const NodeSyslogExporterProperties_FACILITIES_AUTH = "AUTH" +const NodeSyslogExporterProperties_FACILITIES_SYSLOG = "SYSLOG" +const NodeSyslogExporterProperties_FACILITIES_LPR = "LPR" +const NodeSyslogExporterProperties_FACILITIES_NEWS = "NEWS" +const NodeSyslogExporterProperties_FACILITIES_UUCP = "UUCP" +const NodeSyslogExporterProperties_FACILITIES_AUTHPRIV = "AUTHPRIV" +const NodeSyslogExporterProperties_FACILITIES_FTP = "FTP" +const NodeSyslogExporterProperties_FACILITIES_LOGALERT = "LOGALERT" +const NodeSyslogExporterProperties_FACILITIES_CRON = "CRON" +const NodeSyslogExporterProperties_FACILITIES_LOCAL0 = "LOCAL0" +const NodeSyslogExporterProperties_FACILITIES_LOCAL1 = "LOCAL1" +const NodeSyslogExporterProperties_FACILITIES_LOCAL2 = "LOCAL2" +const NodeSyslogExporterProperties_FACILITIES_LOCAL3 = "LOCAL3" +const NodeSyslogExporterProperties_FACILITIES_LOCAL4 = "LOCAL4" +const NodeSyslogExporterProperties_FACILITIES_LOCAL5 = "LOCAL5" +const NodeSyslogExporterProperties_FACILITIES_LOCAL6 = "LOCAL6" +const NodeSyslogExporterProperties_FACILITIES_LOCAL7 = "LOCAL7" +const NodeSyslogExporterProperties_LEVEL_EMERG = "EMERG" +const NodeSyslogExporterProperties_LEVEL_ALERT = "ALERT" +const NodeSyslogExporterProperties_LEVEL_CRIT = "CRIT" +const NodeSyslogExporterProperties_LEVEL_ERR = "ERR" +const NodeSyslogExporterProperties_LEVEL_WARNING = "WARNING" +const NodeSyslogExporterProperties_LEVEL_NOTICE = "NOTICE" +const NodeSyslogExporterProperties_LEVEL_INFO = "INFO" +const NodeSyslogExporterProperties_LEVEL_DEBUG = "DEBUG" +const NodeSyslogExporterProperties_PROTOCOL_TCP = "TCP" +const NodeSyslogExporterProperties_PROTOCOL_TLS = "TLS" +const NodeSyslogExporterProperties_PROTOCOL_UDP = "UDP" +const NodeSyslogExporterProperties_PROTOCOL_LI = "LI" +const NodeSyslogExporterProperties_PROTOCOL_LI_TLS = "LI-TLS" + +func (s *NodeSyslogExporterProperties) GetType__() bindings.BindingType { + return NodeSyslogExporterPropertiesBindingType() +} + +func (s *NodeSyslogExporterProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeSyslogExporterProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node syslog exporter list results +type NodeSyslogExporterPropertiesListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Node syslog exporter results + Results []NodeSyslogExporterProperties +} + +func (s *NodeSyslogExporterPropertiesListResult) GetType__() bindings.BindingType { + return NodeSyslogExporterPropertiesListResultBindingType() +} + +func (s *NodeSyslogExporterPropertiesListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeSyslogExporterPropertiesListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node system time in UTC +type NodeTime struct { + // Datetime string in UTC + SystemDatetime *string +} + +func (s *NodeTime) GetType__() bindings.BindingType { + return NodeTimeBindingType() +} + +func (s *NodeTime) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeTime._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NodeUserPasswordProperty struct { + // The new password for user + Password *string +} + +func (s *NodeUserPasswordProperty) GetType__() bindings.BindingType { + return NodeUserPasswordPropertyBindingType() +} + +func (s *NodeUserPasswordProperty) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeUserPasswordProperty._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node user properties +type NodeUserProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Full name for the user + FullName *string + // Number of days since password was last changed format: int64 + LastPasswordChange *int64 + // Old password for the user (required on PUT if password specified) + OldPassword *string + // Password for the user (optionally specified on PUT, unspecified on GET) + Password *string + // Number of days password is valid before it must be changed. This can be set to 0 to indicate no password change is required or a positive integer up to 9999. By default local user passwords must be changed every 90 days. format: int64 + PasswordChangeFrequency *int64 + // Boolean value that states if a password reset is required + PasswordResetRequired *bool + // Possible values are: + // + // * NodeUserProperties#NodeUserProperties_STATUS_ACTIVE + // * NodeUserProperties#NodeUserProperties_STATUS_PASSWORD_EXPIRED + // * NodeUserProperties#NodeUserProperties_STATUS_NOT_ACTIVATED + // + // Status of the user. This value can be ACTIVE indicating authentication attempts will be successful if the correct credentials are specified. The value can also be PASSWORD_EXPIRED indicating authentication attempts will fail because the user's password has expired and must be changed. Or, this value can be NOT_ACTIVATED indicating the user's password has not yet been set and must be set before the user can authenticate. + Status *string + // Numeric id for the user format: int64 + Userid *int64 + // User login name (must be \"root\" if userid is 0) + Username *string +} + +const NodeUserProperties_STATUS_ACTIVE = "ACTIVE" +const NodeUserProperties_STATUS_PASSWORD_EXPIRED = "PASSWORD_EXPIRED" +const NodeUserProperties_STATUS_NOT_ACTIVATED = "NOT_ACTIVATED" + +func (s *NodeUserProperties) GetType__() bindings.BindingType { + return NodeUserPropertiesBindingType() +} + +func (s *NodeUserProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeUserProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Node users list results +type NodeUserPropertiesListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of node users + Results []NodeUserProperties +} + +func (s *NodeUserPropertiesListResult) GetType__() bindings.BindingType { + return NodeUserPropertiesListResultBindingType() +} + +func (s *NodeUserPropertiesListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeUserPropertiesListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NodeUserSettings struct { + // Password for the node audit user. For deployment, this property is required. After deployment, this property is ignored, and the node cli must be used to change the password. The password specified must be at least 12 characters in length and must contain at least one lowercase, one uppercase, one numeric character and one special character (except quotes). Passwords based on dictionary words and palindromes are invalid. + AuditPassword *string + // The default username is \"audit\". To configure username, you must provide this property together with **audit_password**. Username must contain ASCII characters only. + AuditUsername *string + // Password for the node cli user. For deployment, this property is required. After deployment, this property is ignored, and the node cli must be used to change the password. The password specified must be at least 12 characters in length and must contain at least one lowercase, one uppercase, one numeric character and one special character (except quotes). Passwords based on dictionary words and palindromes are invalid. + CliPassword *string + // To configure username, you must provide this property together with **cli_password**. Username must contain ASCII characters only. + CliUsername *string + // Password for the node root user. For deployment, this property is required. After deployment, this property is ignored, and the node cli must be used to change the password. The password specified must be at least 12 characters in length and must contain at least one lowercase, one uppercase, one numeric character and one special character (except quotes). Passwords based on dictionary words and palindromes are invalid. + RootPassword *string +} + +func (s *NodeUserSettings) GetType__() bindings.BindingType { + return NodeUserSettingsBindingType() +} + +func (s *NodeUserSettings) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeUserSettings._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NodeVersion struct { + // Node version + NodeVersion *string + // Product version + ProductVersion *string +} + +func (s *NodeVersion) GetType__() bindings.BindingType { + return NodeVersionBindingType() +} + +func (s *NodeVersion) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NodeVersion._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Paged Collection of normalized resources +type NormalizedResourceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Normalized resource list results + Results []ResourceReference +} + +func (s *NormalizedResourceListResult) GetType__() bindings.BindingType { + return NormalizedResourceListResultBindingType() +} + +func (s *NormalizedResourceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NormalizedResourceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type Notification struct { + // A string identifying feature_name.notification_name to indicate a notification watcher is interested in receiving notifications for the URI identified by the feature_name.notification_name. + NotificationId *string + // Optional list of URIs + UriFilters []string +} + +func (s *Notification) GetType__() bindings.BindingType { + return NotificationBindingType() +} + +func (s *Notification) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Notification._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// NotificationAuthenticationScheme describes how notification requests should authenticate to the server. +type NotificationAuthenticationScheme struct { + // Certificate ID with a valid certificate and private key, procured from trust-management API. + CertificateId *string + // Password to use if scheme_name is BASIC_AUTH. + Password *string + // Possible values are: + // + // * NotificationAuthenticationScheme#NotificationAuthenticationScheme_SCHEME_NAME_BASIC_AUTH + // * NotificationAuthenticationScheme#NotificationAuthenticationScheme_SCHEME_NAME_CERTIFICATE + // + // Authentication scheme to use when making notification requests to the partner/customer specified watcher. Specify one of BASIC_AUTH or CERTIFICATE. + SchemeName *string + // Username to use if scheme_name is BASIC_AUTH. + Username *string +} + +const NotificationAuthenticationScheme_SCHEME_NAME_BASIC_AUTH = "BASIC_AUTH" +const NotificationAuthenticationScheme_SCHEME_NAME_CERTIFICATE = "CERTIFICATE" + +func (s *NotificationAuthenticationScheme) GetType__() bindings.BindingType { + return NotificationAuthenticationSchemeBindingType() +} + +func (s *NotificationAuthenticationScheme) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NotificationAuthenticationScheme._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NotificationWatcher struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Optional description that can be associated with this NotificationWatcher. + Description *string + // Defaults to ID if not set + DisplayName *string + // System generated identifier to identify a notification watcher uniquely. + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + AuthenticationScheme *NotificationAuthenticationScheme + // Contains the hex-encoded SHA256 thumbprint of the HTTPS certificate. It must be specified if use_https is set to true. + CertificateSha256Thumbprint *string + // If the number of notification URIs accumulated in specified send_interval exceeds max_send_uri_count, then multiple notification requests (each with max_send_uri_count or less number of notification URIs) will be sent to this NotificationWatcher. The default value is 5000. format: int64 + MaxSendUriCount *int64 + // Possible values are: + // + // * NotificationWatcher#NotificationWatcher_METHOD_POST + // + // Type of method notification requests should be made on the specified server. The value must be set to POST. + Method *string + // Optional integer port value to specify a non-standard HTTP or HTTPS port. format: int64 + Port *int64 + // Optional time interval (in seconds) for which notification URIs will be accumulated. At the end of the time interval the accumulated notification URIs will be sent to this NotificationWatcher in the form of zero (nothing accumulated) or more notification requests as soon as possible. If it is not specified, the NotificationWatcher should expected to receive notifications at any time. format: int64 + SendInterval *int64 + // Optional time duration (in seconds) to specify request timeout to notification watcher. If the send reaches the timeout, will try to send refresh_needed as true in the next time interval. The default value is 30 seconds. format: int64 + SendTimeout *int64 + // IP address or fully qualified domain name of the partner/customer watcher. + Server *string + // URI notification requests should be made on the specified server. + Uri *string + // Optional field, when set to true indicates REST API server should use HTTPS. + UseHttps *bool +} + +const NotificationWatcher_METHOD_POST = "POST" + +func (s *NotificationWatcher) GetType__() bindings.BindingType { + return NotificationWatcherBindingType() +} + +func (s *NotificationWatcher) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NotificationWatcher._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NotificationWatcherListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of notification watchers + Results []NotificationWatcher +} + +func (s *NotificationWatcherListResult) GetType__() bindings.BindingType { + return NotificationWatcherListResultBindingType() +} + +func (s *NotificationWatcherListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NotificationWatcherListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type NotificationsList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + Notifications []Notification +} + +func (s *NotificationsList) GetType__() bindings.BindingType { + return NotificationsListBindingType() +} + +func (s *NotificationsList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NotificationsList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Role +type NsxRole struct { + // Possible values are: + // + // * NsxRole#NsxRole_PERMISSIONS_READ_API + // * NsxRole#NsxRole_PERMISSIONS_READ_WRITE_API + // * NsxRole#NsxRole_PERMISSIONS_CRUD + // * NsxRole#NsxRole_PERMISSIONS_READ + // * NsxRole#NsxRole_PERMISSIONS_EXECUTE + // * NsxRole#NsxRole_PERMISSIONS_NONE + // + // Please use the /user-info/permissions api to get the permission that the user has on each feature. + Permissions []string + // This field represents the identifier of the role. With the introduction of custom roles, this field is no longer an enum. + Role *string +} + +const NsxRole_PERMISSIONS_READ_API = "read-api" +const NsxRole_PERMISSIONS_READ_WRITE_API = "read-write-api" +const NsxRole_PERMISSIONS_CRUD = "crud" +const NsxRole_PERMISSIONS_READ = "read" +const NsxRole_PERMISSIONS_EXECUTE = "execute" +const NsxRole_PERMISSIONS_NONE = "none" + +func (s *NsxRole) GetType__() bindings.BindingType { + return NsxRoleBindingType() +} + +func (s *NsxRole) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NsxRole._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Details about NSX-T site. +type NsxtSite struct { + // Display name for the federation site. + FederationSiteDisplayName *string + // Federation site id. + FederationSiteId *string + // Possible values are: + // + // * NsxtSite#NsxtSite_FEDERATION_SITE_TYPE_GLOBALMANAGER + // * NsxtSite#NsxtSite_FEDERATION_SITE_TYPE_SITE + // + // Type of federation site. It can be GlobalManager or Site. + FederationSiteType *string + // IP address of NSX-T appliance at the site. format: hostname-or-ip + NsxtIp *string +} + +const NsxtSite_FEDERATION_SITE_TYPE_GLOBALMANAGER = "GlobalManager" +const NsxtSite_FEDERATION_SITE_TYPE_SITE = "Site" + +func (s *NsxtSite) GetType__() bindings.BindingType { + return NsxtSiteBindingType() +} + +func (s *NsxtSite) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NsxtSite._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Details about mapping of NSX-T site to AVI LB endpoint. +type NsxtSiteToAviMapping struct { + AviLbEndpoint *AviEndPoint + // Federation NSX-T site id. + FederationSiteId *string +} + +func (s *NsxtSiteToAviMapping) GetType__() bindings.BindingType { + return NsxtSiteToAviMappingBindingType() +} + +func (s *NsxtSiteToAviMapping) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NsxtSiteToAviMapping._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This object contains the list of NTP servers used by NSX nodes. +type NtpProperties struct { + // List of NTP servers. format: hostname-or-ipv4 + Servers []string +} + +func (s *NtpProperties) GetType__() bindings.BindingType { + return NtpPropertiesBindingType() +} + +func (s *NtpProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NtpProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// NTP Service properties +type NtpServiceProperties struct { + // NTP servers format: hostname-or-ipv4 + Servers []string + // Start NTP service when system boots + StartOnBoot *bool +} + +func (s *NtpServiceProperties) GetType__() bindings.BindingType { + return NtpServicePropertiesBindingType() +} + +func (s *NtpServiceProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NtpServiceProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Issues reported by upgrade readiness check +type NvdsUpgradeConfigIssue struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Name of the component/object + Component *string + // Error for the component describing precheck failure + Error_ *string + // Id of the object that generated error + Objid *string + // Recommendation to resolve the error returned for component + Recommendation *string + // Warning for the component describing precheck failure + Warning *string +} + +func (s *NvdsUpgradeConfigIssue) GetType__() bindings.BindingType { + return NvdsUpgradeConfigIssueBindingType() +} + +func (s *NvdsUpgradeConfigIssue) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NvdsUpgradeConfigIssue._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Individual host upgrade state +type NvdsUpgradeHostState struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // DiscoveredNode identifier + DnExtId *string + // TransportNode identifier + Host *string + // TransportNode ip address + IpAddress *string + // Possible values are: + // + // * NvdsUpgradeHostState#NvdsUpgradeHostState_OVERALL_STATE_UPGRADE_READY + // * NvdsUpgradeHostState#NvdsUpgradeHostState_OVERALL_STATE_UPGRADE_PROCESSING + // * NvdsUpgradeHostState#NvdsUpgradeHostState_OVERALL_STATE_UPGRADE_QUEUED + // * NvdsUpgradeHostState#NvdsUpgradeHostState_OVERALL_STATE_UPGRADE_IN_PROGRESS + // * NvdsUpgradeHostState#NvdsUpgradeHostState_OVERALL_STATE_UPGRADE_FAILED + // * NvdsUpgradeHostState#NvdsUpgradeHostState_OVERALL_STATE_SUCCESS + // + // Overall state of N-VDSes on the TransportNodes + OverallState *string + // Details of the N-VDS upgrade state on the host + StateDetails []string + // This field returns current stage of Migration task. Here is a sequence of stages the task cycles through, TN_MIGRATION_TASK_IN_QUEUE RETRIEVE_SAVED_CONFIG, TN_VALIDATE, VMS_RETRIVAL, VMS_UNREGISTRATION, TN_STATELESS_WAIT_FOR_HP, DETACH_TNP, TNP_WAIT, TN_SEND_HS_MIGRATION_MSG, TN_ADD_HOST_TO_VDS, TN_UPDATE, TN_UPDATE_WAIT, TN_DELETE, TN_DELETE_WAIT, FN_DELETE_WAIT, TN_RECONFIG_HOST, TN_CREATE, TN_CREATE_WAIT, UPDATE_TNP_AND_APPLY, TN_EXIT_MM, VMS_REGISTRATION, VMS_REGISTRATION_WAIT, TN_MIGRATION_COMPLETED Depending on the type of host (stateful, stateless, Sddc, etc.) migration task may not cycle through all stages but in will follow above sequence. If stage is TN_MIGRATION_COMPLETED refer to field overall_state for SUCCESS or UPGRADE_FAILURE and state_details for details on same. + UpgradeStage *string +} + +const NvdsUpgradeHostState_OVERALL_STATE_UPGRADE_READY = "UPGRADE_READY" +const NvdsUpgradeHostState_OVERALL_STATE_UPGRADE_PROCESSING = "UPGRADE_PROCESSING" +const NvdsUpgradeHostState_OVERALL_STATE_UPGRADE_QUEUED = "UPGRADE_QUEUED" +const NvdsUpgradeHostState_OVERALL_STATE_UPGRADE_IN_PROGRESS = "UPGRADE_IN_PROGRESS" +const NvdsUpgradeHostState_OVERALL_STATE_UPGRADE_FAILED = "UPGRADE_FAILED" +const NvdsUpgradeHostState_OVERALL_STATE_SUCCESS = "SUCCESS" + +func (s *NvdsUpgradeHostState) GetType__() bindings.BindingType { + return NvdsUpgradeHostStateBindingType() +} + +func (s *NvdsUpgradeHostState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NvdsUpgradeHostState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Nvds upgrade precheck ID +type NvdsUpgradePrecheckId struct { + // Tracking ID of nvds upgrade precheck + PrecheckId *string +} + +func (s *NvdsUpgradePrecheckId) GetType__() bindings.BindingType { + return NvdsUpgradePrecheckIdBindingType() +} + +func (s *NvdsUpgradePrecheckId) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NvdsUpgradePrecheckId._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Overall status of the upgrade readiness check +type NvdsUpgradeStatusSummary struct { + // Overall state of migration across all TransportNodes + MigrationState []NvdsUpgradeHostState + // Tracking ID of nvds upgrade precheck + PrecheckId *string + // Config issue in pre-check + PrecheckIssue []NvdsUpgradeConfigIssue + // Possible values are: + // + // * NvdsUpgradeStatusSummary#NvdsUpgradeStatusSummary_PRECHECK_STATUS_IN_PROGRESS + // * NvdsUpgradeStatusSummary#NvdsUpgradeStatusSummary_PRECHECK_STATUS_FAILED + // * NvdsUpgradeStatusSummary#NvdsUpgradeStatusSummary_PRECHECK_STATUS_PENDING_TOPOLOGY + // * NvdsUpgradeStatusSummary#NvdsUpgradeStatusSummary_PRECHECK_STATUS_APPLYING_TOPOLOGY + // * NvdsUpgradeStatusSummary#NvdsUpgradeStatusSummary_PRECHECK_STATUS_APPLY_TOPOLOGY_FAILED + // * NvdsUpgradeStatusSummary#NvdsUpgradeStatusSummary_PRECHECK_STATUS_READY + // + // Overall status of pre-check + PrecheckStatus *string +} + +const NvdsUpgradeStatusSummary_PRECHECK_STATUS_IN_PROGRESS = "IN_PROGRESS" +const NvdsUpgradeStatusSummary_PRECHECK_STATUS_FAILED = "FAILED" +const NvdsUpgradeStatusSummary_PRECHECK_STATUS_PENDING_TOPOLOGY = "PENDING_TOPOLOGY" +const NvdsUpgradeStatusSummary_PRECHECK_STATUS_APPLYING_TOPOLOGY = "APPLYING_TOPOLOGY" +const NvdsUpgradeStatusSummary_PRECHECK_STATUS_APPLY_TOPOLOGY_FAILED = "APPLY_TOPOLOGY_FAILED" +const NvdsUpgradeStatusSummary_PRECHECK_STATUS_READY = "READY" + +func (s *NvdsUpgradeStatusSummary) GetType__() bindings.BindingType { + return NvdsUpgradeStatusSummaryBindingType() +} + +func (s *NvdsUpgradeStatusSummary) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NvdsUpgradeStatusSummary._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// NVDS to VDS mappings for migration +type NvdsUpgradeTopology struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // All resultant VDS mapping for a NVDS after the migration + ComputeManagerTopology []ComputeManagerTopology + // Identifier for a NVDS + NvdsId *string + // Name of a NVDS + NvdsName *string +} + +func (s *NvdsUpgradeTopology) GetType__() bindings.BindingType { + return NvdsUpgradeTopologyBindingType() +} + +func (s *NvdsUpgradeTopology) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for NvdsUpgradeTopology._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Oauth2 Account Credentials +type Oauth2Credentials struct { + // Client ID, that will be used for authentication in AWS environment, + ClientId *string + // Client secret, that will be used for authentication in AWS environment. Can be some passphrase. + ClientSecret *string +} + +func (s *Oauth2Credentials) GetType__() bindings.BindingType { + return Oauth2CredentialsBindingType() +} + +func (s *Oauth2Credentials) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Oauth2Credentials._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// OpenID Connect end-point specifying where to fetch the JWKS document used to validate JWT tokens for TokenBasedPrincipalIdentities. +type OidcEndPoint struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The URL of the OpenID provider's authorization endpoint. + AuthorizationEndpoint *string + // The list of claims that the OpenID provider supports. + ClaimsSupported []string + // Issuer of the JWT tokens for the given type. This field is fetched from the meta-data located at the oidc_uri. + Issuer *string + // The URI where the JWKS document is located that has the key used to validate the JWT signature. + JwksUri *string + // A short, unique name for this OpenID Connect end-point. OIDC endpoint names may not contain spaces. If not provided, defaults to the ID of the OidcEndPoint. + Name *string + // Possible values are: + // + // * OidcEndPoint#OidcEndPoint_OIDC_TYPE_VCENTER + // * OidcEndPoint#OidcEndPoint_OIDC_TYPE_WS_ONE + // + // Type used to distinguish the OIDC end-points by IDP. + OidcType *string + // URI of the OpenID Connect end-point. + OidcUri *string + // When specified this role or roles are used instead of the nsx-role in the JWT + OverrideRoles []string + // Thumbprint in SHA-256 format used to verify the server certificate at the URI. + Thumbprint *string + // The URL of the OpenID provider's token endpoint. + TokenEndpoint *string + // The URL of the OpenID provider's userinfo endpoint. + UserinfoEndpoint *string +} + +const OidcEndPoint_OIDC_TYPE_VCENTER = "vcenter" +const OidcEndPoint_OIDC_TYPE_WS_ONE = "ws_one" + +func (s *OidcEndPoint) GetType__() bindings.BindingType { + return OidcEndPointBindingType() +} + +func (s *OidcEndPoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for OidcEndPoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// OidcEndPoint query result +type OidcEndPointListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // OidcEndPoint list. + Results []OidcEndPoint +} + +func (s *OidcEndPointListResult) GetType__() bindings.BindingType { + return OidcEndPointListResultBindingType() +} + +func (s *OidcEndPointListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for OidcEndPointListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The operation collector is defined to receive stats from hosts. (eg. vRNI-collector collects all the system metrics) +type OperationCollector struct { + // IP address for the operation collector. format: ip + CollectorIp *string + // Port for the operation collector. format: int32 + CollectorPort *int64 + // Possible values are: + // + // * OperationCollector#OperationCollector_COLLECTOR_TYPE_VRNI + // * OperationCollector#OperationCollector_COLLECTOR_TYPE_WAVE_FRONT + // + // Define the operation collector type. + CollectorType *string + // Port for the Wavefront tracing. format: int32 + TracingPort *int64 +} + +const OperationCollector_COLLECTOR_TYPE_VRNI = "VRNI" +const OperationCollector_COLLECTOR_TYPE_WAVE_FRONT = "WAVE_FRONT" + +func (s *OperationCollector) GetType__() bindings.BindingType { + return OperationCollectorBindingType() +} + +func (s *OperationCollector) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for OperationCollector._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// NSX global configs for operation collector +type OperationCollectorGlobalConfig struct { + // Operation Collector Config. + Collectors []OperationCollector + // Report interval for operation data in seconds. format: int32 + ReportInterval *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_SWITCHINGGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_ROUTINGGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_OPERATIONCOLLECTORGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FIREWALLGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_ESXGLOBALOPAQUECONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_SECURITYGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FIPSGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FEDERATIONGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_IDSGLOBALCONFIG + // + // Valid Global configuration types + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const OperationCollectorGlobalConfig__TYPE_IDENTIFIER = "OperationCollectorGlobalConfig" + +func (s *OperationCollectorGlobalConfig) GetType__() bindings.BindingType { + return OperationCollectorGlobalConfigBindingType() +} + +func (s *OperationCollectorGlobalConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for OperationCollectorGlobalConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Organization ID and role, predefined for a particular type of VMware support. +type OrgInfo struct { + // Organization ID, connected to a predefined role of a VMware support. + OrgId *string + // Predefined role of a VMware support. + OrgRole *string +} + +func (s *OrgInfo) GetType__() bindings.BindingType { + return OrgInfoBindingType() +} + +func (s *OrgInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for OrgInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Information related to OVF file. +type OvfInfo struct { + // Name of OVF file. + OvfName *string + // Version of the OVF. + Version *string +} + +func (s *OvfInfo) GetType__() bindings.BindingType { + return OvfInfoBindingType() +} + +func (s *OvfInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for OvfInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The server will populate this field when returing the resource. Ignored on PUT and POST. +type OwnerResourceLink struct { + // Optional action + Action *string + // Link to resource + Href *string + // Custom relation type (follows RFC 5988 where appropriate definitions exist) + Rel *string +} + +func (s *OwnerResourceLink) GetType__() bindings.BindingType { + return OwnerResourceLinkBindingType() +} + +func (s *OwnerResourceLink) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for OwnerResourceLink._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PackageLoggingLevels struct { + // Possible values are: + // + // * PackageLoggingLevels#PackageLoggingLevels_LOGGING_LEVEL_OFF + // * PackageLoggingLevels#PackageLoggingLevels_LOGGING_LEVEL_FATAL + // * PackageLoggingLevels#PackageLoggingLevels_LOGGING_LEVEL_ERROR + // * PackageLoggingLevels#PackageLoggingLevels_LOGGING_LEVEL_WARN + // * PackageLoggingLevels#PackageLoggingLevels_LOGGING_LEVEL_INFO + // * PackageLoggingLevels#PackageLoggingLevels_LOGGING_LEVEL_DEBUG + // * PackageLoggingLevels#PackageLoggingLevels_LOGGING_LEVEL_TRACE + // + // Logging levels per package + LoggingLevel *string + // Package name + PackageName *string +} + +const PackageLoggingLevels_LOGGING_LEVEL_OFF = "OFF" +const PackageLoggingLevels_LOGGING_LEVEL_FATAL = "FATAL" +const PackageLoggingLevels_LOGGING_LEVEL_ERROR = "ERROR" +const PackageLoggingLevels_LOGGING_LEVEL_WARN = "WARN" +const PackageLoggingLevels_LOGGING_LEVEL_INFO = "INFO" +const PackageLoggingLevels_LOGGING_LEVEL_DEBUG = "DEBUG" +const PackageLoggingLevels_LOGGING_LEVEL_TRACE = "TRACE" + +func (s *PackageLoggingLevels) GetType__() bindings.BindingType { + return PackageLoggingLevelsBindingType() +} + +func (s *PackageLoggingLevels) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PackageLoggingLevels._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A packet is classified to have an address binding, if its address configuration matches with all user specified properties. +type PacketAddressClassifier struct { + // A single IP address or a subnet, e.g. x.x.x.x or x.x.x.x/y format: address-or-block-or-range + IpAddress *string + // A single MAC address format: mac-address + MacAddress *string + // Virtual Local Area Network Identifier format: int64 + Vlan *int64 +} + +func (s *PacketAddressClassifier) GetType__() bindings.BindingType { + return PacketAddressClassifierBindingType() +} + +func (s *PacketAddressClassifier) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PacketAddressClassifier._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The option is used to filter data on given node. +type PacketCaptureOption struct { + // Possible values are: + // + // * PacketCaptureOption#PacketCaptureOption_NAME_ETHTYPE + // * PacketCaptureOption#PacketCaptureOption_NAME_MAC + // * PacketCaptureOption#PacketCaptureOption_NAME_SRCMAC + // * PacketCaptureOption#PacketCaptureOption_NAME_DSTMAC + // * PacketCaptureOption#PacketCaptureOption_NAME_VLAN + // * PacketCaptureOption#PacketCaptureOption_NAME_IP + // * PacketCaptureOption#PacketCaptureOption_NAME_SRCIP + // * PacketCaptureOption#PacketCaptureOption_NAME_DSTIP + // * PacketCaptureOption#PacketCaptureOption_NAME_IPPROTO + // * PacketCaptureOption#PacketCaptureOption_NAME_PORT + // * PacketCaptureOption#PacketCaptureOption_NAME_SRCPORT + // * PacketCaptureOption#PacketCaptureOption_NAME_DSTPORT + // * PacketCaptureOption#PacketCaptureOption_NAME_VNI + // * PacketCaptureOption#PacketCaptureOption_NAME_IPPROTO6 + // * PacketCaptureOption#PacketCaptureOption_NAME_IP6 + // * PacketCaptureOption#PacketCaptureOption_NAME_SRCIP6 + // * PacketCaptureOption#PacketCaptureOption_NAME_DSTIP6 + // + // The avaiable option names in the enum can be used to filter the capture data. + Name *string + // Define the capture value according to the given capture option. + Value *string +} + +const PacketCaptureOption_NAME_ETHTYPE = "ETHTYPE" +const PacketCaptureOption_NAME_MAC = "MAC" +const PacketCaptureOption_NAME_SRCMAC = "SRCMAC" +const PacketCaptureOption_NAME_DSTMAC = "DSTMAC" +const PacketCaptureOption_NAME_VLAN = "VLAN" +const PacketCaptureOption_NAME_IP = "IP" +const PacketCaptureOption_NAME_SRCIP = "SRCIP" +const PacketCaptureOption_NAME_DSTIP = "DSTIP" +const PacketCaptureOption_NAME_IPPROTO = "IPPROTO" +const PacketCaptureOption_NAME_PORT = "PORT" +const PacketCaptureOption_NAME_SRCPORT = "SRCPORT" +const PacketCaptureOption_NAME_DSTPORT = "DSTPORT" +const PacketCaptureOption_NAME_VNI = "VNI" +const PacketCaptureOption_NAME_IPPROTO6 = "IPPROTO6" +const PacketCaptureOption_NAME_IP6 = "IP6" +const PacketCaptureOption_NAME_SRCIP6 = "SRCIP6" +const PacketCaptureOption_NAME_DSTIP6 = "DSTIP6" + +func (s *PacketCaptureOption) GetType__() bindings.BindingType { + return PacketCaptureOptionBindingType() +} + +func (s *PacketCaptureOption) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PacketCaptureOption._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of packet capture options to filter data in capture process. +type PacketCaptureOptionList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Packet capture option collection + Values []PacketCaptureOption +} + +func (s *PacketCaptureOptionList) GetType__() bindings.BindingType { + return PacketCaptureOptionListBindingType() +} + +func (s *PacketCaptureOptionList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PacketCaptureOptionList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This type is used to create packet request on give node. Need to specify related parameters according to the capture point. +type PacketCaptureRequest struct { + // Define the packet capture amount size. format: int32 + Capamount *int64 + // The CPU core id on Edge node. format: int32 + Capcore *int64 + // Define the packet capture duration time. After the capture duration time, the capture process will stop working. format: int32 + Capduration *int64 + // Define the packet capture file size limit. format: int32 + Capfilesize *int64 + // Possible values are: + // + // * PacketCaptureRequest#PacketCaptureRequest_CAPMODE_STANDALONE + // * PacketCaptureRequest#PacketCaptureRequest_CAPMODE_STREAM + // + // Define the capture streaming mode. The STREAM mode will send the data to given stream address and port. And the STANDALONE mode will save the capture file in local folder. + Capmode *string + // Possible values are: + // + // * PacketCaptureRequest#PacketCaptureRequest_CAPPOINT_VNIC + // * PacketCaptureRequest#PacketCaptureRequest_CAPPOINT_VMKNIC + // * PacketCaptureRequest#PacketCaptureRequest_CAPPOINT_VMNIC + // * PacketCaptureRequest#PacketCaptureRequest_CAPPOINT_VDRPORT + // * PacketCaptureRequest#PacketCaptureRequest_CAPPOINT_DVFILTER + // * PacketCaptureRequest#PacketCaptureRequest_CAPPOINT_LOGICALPORT + // * PacketCaptureRequest#PacketCaptureRequest_CAPPOINT_FCPORT + // * PacketCaptureRequest#PacketCaptureRequest_CAPPOINT_VIF + // * PacketCaptureRequest#PacketCaptureRequest_CAPPOINT_PNIC + // + // Define the point to capture data. + Cappoint *string + // Define the rate of packet capture process. format: int32 + Caprate *int64 + // Limit the number of bytes captured from each packet. format: int32 + Capsnaplen *int64 + // Possible values are: + // + // * PacketCaptureRequest#PacketCaptureRequest_CAPSOURCE_CLI + // * PacketCaptureRequest#PacketCaptureRequest_CAPSOURCE_UI + // + // This type is used to differenite the incoming request from CLI/UI. + Capsource *string + // Define the capture value of given capture point. + Capvalue *string + // Possible values are: + // + // * PacketCaptureRequest#PacketCaptureRequest_DIRECTION_INPUT + // * PacketCaptureRequest#PacketCaptureRequest_DIRECTION_OUTPUT + // * PacketCaptureRequest#PacketCaptureRequest_DIRECTION_DUAL + // + // Define the capture direction. Support three types INPUT/OUTPUT/DUAL. + Direction *string + // Possible values are: + // + // * PacketCaptureRequest#PacketCaptureRequest_FILTERTYPE_PRE + // * PacketCaptureRequest#PacketCaptureRequest_FILTERTYPE_POST + // + // Define the capture filter type. Support PRE/POST mode. + Filtertype *string + // Define the transport node to capture data. + Node *string + // Define the transport node to capture data. format: ip + NodeIp *string + Options *PacketCaptureOptionList + // Set the stream address to receive the capture packet. + Streamaddress *string + // Set the stream port to receive the capture packet. The STREAM mode is based on GRE-in-UDP Encapsulation(RFC8086). Packets are sent to UDP port 4754. format: int32 + Streamport *int64 +} + +const PacketCaptureRequest_CAPMODE_STANDALONE = "STANDALONE" +const PacketCaptureRequest_CAPMODE_STREAM = "STREAM" +const PacketCaptureRequest_CAPPOINT_VNIC = "VNIC" +const PacketCaptureRequest_CAPPOINT_VMKNIC = "VMKNIC" +const PacketCaptureRequest_CAPPOINT_VMNIC = "VMNIC" +const PacketCaptureRequest_CAPPOINT_VDRPORT = "VDRPORT" +const PacketCaptureRequest_CAPPOINT_DVFILTER = "DVFILTER" +const PacketCaptureRequest_CAPPOINT_LOGICALPORT = "LOGICALPORT" +const PacketCaptureRequest_CAPPOINT_FCPORT = "FCPORT" +const PacketCaptureRequest_CAPPOINT_VIF = "VIF" +const PacketCaptureRequest_CAPPOINT_PNIC = "PNIC" +const PacketCaptureRequest_CAPSOURCE_CLI = "CLI" +const PacketCaptureRequest_CAPSOURCE_UI = "UI" +const PacketCaptureRequest_DIRECTION_INPUT = "INPUT" +const PacketCaptureRequest_DIRECTION_OUTPUT = "OUTPUT" +const PacketCaptureRequest_DIRECTION_DUAL = "DUAL" +const PacketCaptureRequest_FILTERTYPE_PRE = "PRE" +const PacketCaptureRequest_FILTERTYPE_POST = "POST" + +func (s *PacketCaptureRequest) GetType__() bindings.BindingType { + return PacketCaptureRequestBindingType() +} + +func (s *PacketCaptureRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PacketCaptureRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Packet capture session information. +type PacketCaptureSession struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Timestamp when session was stopped in epoch millisecond. format: int64 + Endtime *int64 + // Error messasge in capture. + Errormsg *string + // Packet capture file location. + Filelocation *string + // Packet capture file Size in bytes. format: int32 + Filesize *int64 + Request *PacketCaptureRequest + // Packet capture session id. + Sessionid *string + // Packet capture session name. + Sessionname *string + // Possible values are: + // + // * PacketCaptureSession#PacketCaptureSession_SESSIONSTATUS_CREATED + // * PacketCaptureSession#PacketCaptureSession_SESSIONSTATUS_STARTED + // * PacketCaptureSession#PacketCaptureSession_SESSIONSTATUS_STOPPED + // * PacketCaptureSession#PacketCaptureSession_SESSIONSTATUS_FINISHED + // * PacketCaptureSession#PacketCaptureSession_SESSIONSTATUS_ERROR + // + // Packet capture session status. + Sessionstatus *string + // Timestamp when session was created in epoch millisecond. format: int64 + Starttime *int64 +} + +const PacketCaptureSession_SESSIONSTATUS_CREATED = "CREATED" +const PacketCaptureSession_SESSIONSTATUS_STARTED = "STARTED" +const PacketCaptureSession_SESSIONSTATUS_STOPPED = "STOPPED" +const PacketCaptureSession_SESSIONSTATUS_FINISHED = "FINISHED" +const PacketCaptureSession_SESSIONSTATUS_ERROR = "ERROR" + +func (s *PacketCaptureSession) GetType__() bindings.BindingType { + return PacketCaptureSessionBindingType() +} + +func (s *PacketCaptureSession) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PacketCaptureSession._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PacketCaptureSessionList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Total capture session count format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Packet capture list for all sessoins + Results []PacketCaptureSession +} + +func (s *PacketCaptureSessionList) GetType__() bindings.BindingType { + return PacketCaptureSessionListBindingType() +} + +func (s *PacketCaptureSessionList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PacketCaptureSessionList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PacketData struct { + // If the requested frame_size is too small (given the payload and traceflow metadata requirement of 16 bytes), the traceflow request will fail with an appropriate message. The frame will be zero padded to the requested size. format: int64 + FrameSize *int64 + // Possible values are: + // + // * PacketData#PacketData_RESOURCE_TYPE_BINARYPACKETDATA + // * PacketData#PacketData_RESOURCE_TYPE_FIELDSPACKETDATA + // + // Packet configuration + ResourceType string + // A flag, when set true, indicates that the traceflow packet is of L3 routing. + Routed *bool + // Possible values are: + // + // * PacketData#PacketData_TRANSPORT_TYPE_BROADCAST + // * PacketData#PacketData_TRANSPORT_TYPE_UNICAST + // * PacketData#PacketData_TRANSPORT_TYPE_MULTICAST + // * PacketData#PacketData_TRANSPORT_TYPE_UNKNOWN + // + // This type takes effect only for IP packet. + TransportType *string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const PacketData__TYPE_IDENTIFIER = "PacketData" +const PacketData_RESOURCE_TYPE_BINARYPACKETDATA = "BinaryPacketData" +const PacketData_RESOURCE_TYPE_FIELDSPACKETDATA = "FieldsPacketData" +const PacketData_TRANSPORT_TYPE_BROADCAST = "BROADCAST" +const PacketData_TRANSPORT_TYPE_UNICAST = "UNICAST" +const PacketData_TRANSPORT_TYPE_MULTICAST = "MULTICAST" +const PacketData_TRANSPORT_TYPE_UNKNOWN = "UNKNOWN" + +func (s *PacketData) GetType__() bindings.BindingType { + return PacketDataBindingType() +} + +func (s *PacketData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PacketData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PacketNumberSampling struct { + // 1 out of how many packets is sampled format: int64 + SamplingRate *int64 + // Possible values are: + // + // * SamplingArgument#SamplingArgument_SAMPLING_TYPE_FIRSTNSAMPLING + // * SamplingArgument#SamplingArgument_SAMPLING_TYPE_PACKETNUMBERSAMPLING + // * SamplingArgument#SamplingArgument_SAMPLING_TYPE_INTERVALSAMPLING + // + // Sampling type + SamplingType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const PacketNumberSampling__TYPE_IDENTIFIER = "PacketNumberSampling" + +func (s *PacketNumberSampling) GetType__() bindings.BindingType { + return PacketNumberSamplingBindingType() +} + +func (s *PacketNumberSampling) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PacketNumberSampling._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PacketTypeAndCounter struct { + // The number of packets. format: int64 + Counter *int64 + // The type of the packets + PacketType *string +} + +func (s *PacketTypeAndCounter) GetType__() bindings.BindingType { + return PacketTypeAndCounterBindingType() +} + +func (s *PacketTypeAndCounter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PacketTypeAndCounter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PacketsDroppedBySecurity struct { + // The number of packets dropped by \"BPDU filter\". format: int64 + BpduFilterDropped *int64 + // The number of IPv4 packets dropped by \"DHCP client block\". format: int64 + DhcpClientDroppedIpv4 *int64 + // The number of IPv6 packets dropped by \"DHCP client block\". format: int64 + DhcpClientDroppedIpv6 *int64 + // The number of IPv4 packets dropped by \"DHCP server block\". format: int64 + DhcpServerDroppedIpv4 *int64 + // The number of IPv6 packets dropped by \"DHCP server block\". format: int64 + DhcpServerDroppedIpv6 *int64 + // The packets dropped by \"Spoof Guard\"; supported packet types are IPv4, IPv6, ARP, ND, non-IP. + SpoofGuardDropped []PacketTypeAndCounter +} + +func (s *PacketsDroppedBySecurity) GetType__() bindings.BindingType { + return PacketsDroppedBySecurityBindingType() +} + +func (s *PacketsDroppedBySecurity) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PacketsDroppedBySecurity._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PasswordAuthenticationScheme struct { + // Possible values are: + // + // * PasswordAuthenticationScheme#PasswordAuthenticationScheme_SCHEME_NAME_PASSWORD + // + // Authentication scheme name + SchemeName *string + // Password to authenticate with + Password *string + // User name to authenticate with + Username *string +} + +const PasswordAuthenticationScheme_SCHEME_NAME_PASSWORD = "password" + +func (s *PasswordAuthenticationScheme) GetType__() bindings.BindingType { + return PasswordAuthenticationSchemeBindingType() +} + +func (s *PasswordAuthenticationScheme) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PasswordAuthenticationScheme._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PendingChange struct { + // Request identifier of the API which modified the entity. + RequestId *string +} + +func (s *PendingChange) GetType__() bindings.BindingType { + return PendingChangeBindingType() +} + +func (s *PendingChange) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PendingChange._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Query statistics counters of a forwarder identified by domain names. +type PerForwarderStatistics struct { + // Domain names configured for the forwarder. Empty if this is the default forwarder. + DomainNames []string + // Statistics per upstream server. + UpstreamStatistics []PerUpstreamServerStatistics +} + +func (s *PerForwarderStatistics) GetType__() bindings.BindingType { + return PerForwarderStatisticsBindingType() +} + +func (s *PerForwarderStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PerForwarderStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The list of the failed DNS queries with entry count and timestamp. The entry count is for per active/standby transport node. +type PerNodeDnsFailedQueries struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // The Uuid of active/standby transport node. + NodeId *string + // The list of failed DNS queries. + Results []DnsFailedQuery + // Timestamp of the request, in YYYY-MM-DD HH:MM:SS.zzz format. + Timestamp *string +} + +func (s *PerNodeDnsFailedQueries) GetType__() bindings.BindingType { + return PerNodeDnsFailedQueriesBindingType() +} + +func (s *PerNodeDnsFailedQueries) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PerNodeDnsFailedQueries._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Query statistics counters of used cache from node +type PerNodeUsedCacheStatistics struct { + // The total number of cached entries format: int64 + CachedEntries *int64 + // Uuid of active/standby transport node + NodeId *string + // The memory size used in cache, in kb format: int64 + UsedCacheSize *int64 +} + +func (s *PerNodeUsedCacheStatistics) GetType__() bindings.BindingType { + return PerNodeUsedCacheStatisticsBindingType() +} + +func (s *PerNodeUsedCacheStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PerNodeUsedCacheStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Restore step status +type PerStepRestoreStatus struct { + // A description of the restore status + Description *string + // Possible values are: + // + // * PerStepRestoreStatus#PerStepRestoreStatus_VALUE_INITIAL + // * PerStepRestoreStatus#PerStepRestoreStatus_VALUE_RUNNING + // * PerStepRestoreStatus#PerStepRestoreStatus_VALUE_SUSPENDED_BY_USER + // * PerStepRestoreStatus#PerStepRestoreStatus_VALUE_SUSPENDED_FOR_USER_ACTION + // * PerStepRestoreStatus#PerStepRestoreStatus_VALUE_FAILED + // * PerStepRestoreStatus#PerStepRestoreStatus_VALUE_SUCCESS + // + // Per step restore status value + Value *string +} + +const PerStepRestoreStatus_VALUE_INITIAL = "INITIAL" +const PerStepRestoreStatus_VALUE_RUNNING = "RUNNING" +const PerStepRestoreStatus_VALUE_SUSPENDED_BY_USER = "SUSPENDED_BY_USER" +const PerStepRestoreStatus_VALUE_SUSPENDED_FOR_USER_ACTION = "SUSPENDED_FOR_USER_ACTION" +const PerStepRestoreStatus_VALUE_FAILED = "FAILED" +const PerStepRestoreStatus_VALUE_SUCCESS = "SUCCESS" + +func (s *PerStepRestoreStatus) GetType__() bindings.BindingType { + return PerStepRestoreStatusBindingType() +} + +func (s *PerStepRestoreStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PerStepRestoreStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Query statistics counters to an upstream server including successfully forwarded queries and failed queries. +type PerUpstreamServerStatistics struct { + // Queries failed to forward. format: int64 + QueriesFailed *int64 + // Queries forwarded successfully format: int64 + QueriesSucceeded *int64 + // Upstream server ip format: ip + UpstreamServer *string +} + +func (s *PerUpstreamServerStatistics) GetType__() bindings.BindingType { + return PerUpstreamServerStatisticsBindingType() +} + +func (s *PerUpstreamServerStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PerUpstreamServerStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Details of physical/bare metal server. PhysicalServer is an abstraction for TransportNode with os_type RHELSERVER, UBUNTUSERVER, CENTOSSERVER, SLESSERVER, OELSERVER or WINDOWSSERVER. This entity will be used in grouping to provide micro-segmentation to physical servers. To add any new physical servers/perform any changes, use create/update TransportNode API. +type PhysicalServer struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // IP addresses of the physical server specified by the admin while registering as Transport node in nsx. format: ip + IpAddresses []string + // Possible values are: + // + // * PhysicalServer#PhysicalServer_OS_TYPE_RHELSERVER + // * PhysicalServer#PhysicalServer_OS_TYPE_UBUNTUSERVER + // * PhysicalServer#PhysicalServer_OS_TYPE_CENTOSSERVER + // * PhysicalServer#PhysicalServer_OS_TYPE_SLESSERVER + // * PhysicalServer#PhysicalServer_OS_TYPE_WINDOWSSERVER + // * PhysicalServer#PhysicalServer_OS_TYPE_OELSERVER + // + // OS type of the physical server. + OsType *string +} + +const PhysicalServer_OS_TYPE_RHELSERVER = "RHELSERVER" +const PhysicalServer_OS_TYPE_UBUNTUSERVER = "UBUNTUSERVER" +const PhysicalServer_OS_TYPE_CENTOSSERVER = "CENTOSSERVER" +const PhysicalServer_OS_TYPE_SLESSERVER = "SLESSERVER" +const PhysicalServer_OS_TYPE_WINDOWSSERVER = "WINDOWSSERVER" +const PhysicalServer_OS_TYPE_OELSERVER = "OELSERVER" + +func (s *PhysicalServer) GetType__() bindings.BindingType { + return PhysicalServerBindingType() +} + +func (s *PhysicalServer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PhysicalServer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PhysicalServerListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of physical servers. + Results []PhysicalServer +} + +func (s *PhysicalServerListResult) GetType__() bindings.BindingType { + return PhysicalServerListResultBindingType() +} + +func (s *PhysicalServerListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PhysicalServerListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The resource of packet capture per port, such as the downloading URL of packet capture file. +type PktCapResource struct { + // Packet capture file download URL + PktcapFileDownloadUrl *string + // The ID of logical port where packet capture action is performed + PortId *string + // Type of packet capture resource + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const PktCapResource__TYPE_IDENTIFIER = "PktCapResource" + +func (s *PktCapResource) GetType__() bindings.BindingType { + return PktCapResourceBindingType() +} + +func (s *PktCapResource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PktCapResource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The packet capture result for transport nodes +type PktCapResult struct { + // The packet capture resource info for ports where packet capture action is performed + PktcapResourceList []PktCapResource + // The ID of transport node where packet capture action is deployed + TransportNodeId *string + // Possible values are: + // + // * PktCapResult#PktCapResult_TRANSPORT_NODE_TYPE_ESX + // * PktCapResult#PktCapResult_TRANSPORT_NODE_TYPE_RHELKVM + // * PktCapResult#PktCapResult_TRANSPORT_NODE_TYPE_UBUNTUKVM + // * PktCapResult#PktCapResult_TRANSPORT_NODE_TYPE_CENTOSKVM + // * PktCapResult#PktCapResult_TRANSPORT_NODE_TYPE_RHELCONTAINER + // * PktCapResult#PktCapResult_TRANSPORT_NODE_TYPE_CENTOSCONTAINER + // * PktCapResult#PktCapResult_TRANSPORT_NODE_TYPE_RHELSERVER + // * PktCapResult#PktCapResult_TRANSPORT_NODE_TYPE_UBUNTUSERVER + // * PktCapResult#PktCapResult_TRANSPORT_NODE_TYPE_CENTOSSERVER + // * PktCapResult#PktCapResult_TRANSPORT_NODE_TYPE_SLESKVM + // * PktCapResult#PktCapResult_TRANSPORT_NODE_TYPE_SLESSERVER + // * PktCapResult#PktCapResult_TRANSPORT_NODE_TYPE_WINDOWSSERVER + // * PktCapResult#PktCapResult_TRANSPORT_NODE_TYPE_RHELSMARTNIC + // * PktCapResult#PktCapResult_TRANSPORT_NODE_TYPE_OELSERVER + // * PktCapResult#PktCapResult_TRANSPORT_NODE_TYPE_UBUNTUSMARTNIC + // * PktCapResult#PktCapResult_TRANSPORT_NODE_TYPE_EDGE + // * PktCapResult#PktCapResult_TRANSPORT_NODE_TYPE_PUBLIC_CLOUD_GATEWAY_NODE + // * PktCapResult#PktCapResult_TRANSPORT_NODE_TYPE_OTHERS + // * PktCapResult#PktCapResult_TRANSPORT_NODE_TYPE_HYPERV + // + // Type of the transport node + TransportNodeType *string +} + +const PktCapResult_TRANSPORT_NODE_TYPE_ESX = "ESX" +const PktCapResult_TRANSPORT_NODE_TYPE_RHELKVM = "RHELKVM" +const PktCapResult_TRANSPORT_NODE_TYPE_UBUNTUKVM = "UBUNTUKVM" +const PktCapResult_TRANSPORT_NODE_TYPE_CENTOSKVM = "CENTOSKVM" +const PktCapResult_TRANSPORT_NODE_TYPE_RHELCONTAINER = "RHELCONTAINER" +const PktCapResult_TRANSPORT_NODE_TYPE_CENTOSCONTAINER = "CENTOSCONTAINER" +const PktCapResult_TRANSPORT_NODE_TYPE_RHELSERVER = "RHELSERVER" +const PktCapResult_TRANSPORT_NODE_TYPE_UBUNTUSERVER = "UBUNTUSERVER" +const PktCapResult_TRANSPORT_NODE_TYPE_CENTOSSERVER = "CENTOSSERVER" +const PktCapResult_TRANSPORT_NODE_TYPE_SLESKVM = "SLESKVM" +const PktCapResult_TRANSPORT_NODE_TYPE_SLESSERVER = "SLESSERVER" +const PktCapResult_TRANSPORT_NODE_TYPE_WINDOWSSERVER = "WINDOWSSERVER" +const PktCapResult_TRANSPORT_NODE_TYPE_RHELSMARTNIC = "RHELSMARTNIC" +const PktCapResult_TRANSPORT_NODE_TYPE_OELSERVER = "OELSERVER" +const PktCapResult_TRANSPORT_NODE_TYPE_UBUNTUSMARTNIC = "UBUNTUSMARTNIC" +const PktCapResult_TRANSPORT_NODE_TYPE_EDGE = "EDGE" +const PktCapResult_TRANSPORT_NODE_TYPE_PUBLIC_CLOUD_GATEWAY_NODE = "PUBLIC_CLOUD_GATEWAY_NODE" +const PktCapResult_TRANSPORT_NODE_TYPE_OTHERS = "OTHERS" +const PktCapResult_TRANSPORT_NODE_TYPE_HYPERV = "HYPERV" + +func (s *PktCapResult) GetType__() bindings.BindingType { + return PktCapResultBindingType() +} + +func (s *PktCapResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PktCapResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PktcapActionArgument struct { + // It is required only when the type of packet capture is bidirectional. Please keep this aligned with the destination logical port of trace action config when the type of trace action is bidirectional. + DestLport *string + // Possible values are: + // + // * PktcapActionArgument#PktcapActionArgument_PKTCAP_TYPE_UNI_DIRECTIONAL + // * PktcapActionArgument#PktcapActionArgument_PKTCAP_TYPE_BI_DIRECTIONAL + // + // Type of packet capture + PktcapType *string + ReverseFilter *data.StructValue +} + +const PktcapActionArgument_PKTCAP_TYPE_UNI_DIRECTIONAL = "UNI_DIRECTIONAL" +const PktcapActionArgument_PKTCAP_TYPE_BI_DIRECTIONAL = "BI_DIRECTIONAL" + +func (s *PktcapActionArgument) GetType__() bindings.BindingType { + return PktcapActionArgumentBindingType() +} + +func (s *PktcapActionArgument) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PktcapActionArgument._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PktcapActionConfig struct { + ActionArgument *PktcapActionArgument + SamplingArgument *data.StructValue +} + +func (s *PktcapActionConfig) GetType__() bindings.BindingType { + return PktcapActionConfigBindingType() +} + +func (s *PktcapActionConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PktcapActionConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PlainFilterData struct { + // Basic RCF rule for packet filter + BasicFilter *string + // Extended RCF rule for packet filter + ExtendFilter *string + // Possible values are: + // + // * LiveTraceFilterData#LiveTraceFilterData_RESOURCE_TYPE_FIELDSFILTERDATA + // * LiveTraceFilterData#LiveTraceFilterData_RESOURCE_TYPE_PLAINFILTERDATA + // + // Filter type + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const PlainFilterData__TYPE_IDENTIFIER = "PlainFilterData" + +func (s *PlainFilterData) GetType__() bindings.BindingType { + return PlainFilterDataBindingType() +} + +func (s *PlainFilterData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PlainFilterData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Plugin file properties +type PluginFileProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // File name + FileName *string + // Plugin id + PluginId *string + // Upload status + Status *string +} + +func (s *PluginFileProperties) GetType__() bindings.BindingType { + return PluginFilePropertiesBindingType() +} + +func (s *PluginFileProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PluginFileProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Describes plugin status on node +type PluginStatus struct { + // Detail information of plugin. + Detail *string + // Plugin id. + Id *string + // Plugin name. + Name *string + // Display the plugin profile content. + Profile *string + // Possible values are: + // + // * PluginStatus#PluginStatus_STATUS_UNKNOWN + // * PluginStatus#PluginStatus_STATUS_ENABLED + // * PluginStatus#PluginStatus_STATUS_DISABLED + // + // Plugin status. + Status *string +} + +const PluginStatus_STATUS_UNKNOWN = "UNKNOWN" +const PluginStatus_STATUS_ENABLED = "ENABLED" +const PluginStatus_STATUS_DISABLED = "DISABLED" + +func (s *PluginStatus) GetType__() bindings.BindingType { + return PluginStatusBindingType() +} + +func (s *PluginStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PluginStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PluginStatusList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Total plugin count format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // System Health plugin status list + Results []PluginStatus +} + +func (s *PluginStatusList) GetType__() bindings.BindingType { + return PluginStatusListBindingType() +} + +func (s *PluginStatusList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PluginStatusList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Physical NIC specification +type Pnic struct { + // device name or key + DeviceName *string + // Uplink name for this Pnic. This name will be used to reference this Pnic in other configurations. + UplinkName *string +} + +func (s *Pnic) GetType__() bindings.BindingType { + return PnicBindingType() +} + +func (s *Pnic) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Pnic._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// pNIC/bond statuses +type PnicBondStatus struct { + // Name of the pNIC/bond + Name *string + // Possible values are: + // + // * PnicBondStatus#PnicBondStatus_STATUS_UNKNOWN + // * PnicBondStatus#PnicBondStatus_STATUS_UP + // * PnicBondStatus#PnicBondStatus_STATUS_DOWN + // * PnicBondStatus#PnicBondStatus_STATUS_DEGRADED + // + // Status of pNIC/bond + Status *string + // Possible values are: + // + // * PnicBondStatus#PnicBondStatus_TYPE_UNKNOWN_TYPE + // * PnicBondStatus#PnicBondStatus_TYPE_PNIC + // * PnicBondStatus#PnicBondStatus_TYPE_BOND + // + // type, whether the object is a pNIC or a bond + Type_ *string +} + +const PnicBondStatus_STATUS_UNKNOWN = "UNKNOWN" +const PnicBondStatus_STATUS_UP = "UP" +const PnicBondStatus_STATUS_DOWN = "DOWN" +const PnicBondStatus_STATUS_DEGRADED = "DEGRADED" +const PnicBondStatus_TYPE_UNKNOWN_TYPE = "UNKNOWN_TYPE" +const PnicBondStatus_TYPE_PNIC = "PNIC" +const PnicBondStatus_TYPE_BOND = "BOND" + +func (s *PnicBondStatus) GetType__() bindings.BindingType { + return PnicBondStatusBindingType() +} + +func (s *PnicBondStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PnicBondStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This object contains reference to list of pNIC/bond statuses +type PnicBondStatusListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of pNIC statuses belonging to the transport node + Results []PnicBondStatus +} + +func (s *PnicBondStatusListResult) GetType__() bindings.BindingType { + return PnicBondStatusListResultBindingType() +} + +func (s *PnicBondStatusListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PnicBondStatusListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PnicMirrorDestination struct { + // Physical NIC device names to which to send the mirrored packets + DestPnics []string + // Transport node to which to send the mirrored packets + NodeId *string + // Possible values are: + // + // * MirrorDestination#MirrorDestination_RESOURCE_TYPE_LOGICALPORTMIRRORDESTINATION + // * MirrorDestination#MirrorDestination_RESOURCE_TYPE_PNICMIRRORDESTINATION + // * MirrorDestination#MirrorDestination_RESOURCE_TYPE_IPMIRRORDESTINATION + // + // Resource types of mirror destination + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const PnicMirrorDestination__TYPE_IDENTIFIER = "PnicMirrorDestination" + +func (s *PnicMirrorDestination) GetType__() bindings.BindingType { + return PnicMirrorDestinationBindingType() +} + +func (s *PnicMirrorDestination) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PnicMirrorDestination._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PnicMirrorSource struct { + // Whether to filter encapsulated packet. + Encapsulated *bool + // Transport node identifier for the pnic located. + NodeId *string + // Source physical NIC device names + SourcePnics []string + // Possible values are: + // + // * MirrorSource#MirrorSource_RESOURCE_TYPE_LOGICALPORTMIRRORSOURCE + // * MirrorSource#MirrorSource_RESOURCE_TYPE_PNICMIRRORSOURCE + // * MirrorSource#MirrorSource_RESOURCE_TYPE_VLANMIRRORSOURCE + // * MirrorSource#MirrorSource_RESOURCE_TYPE_LOGICALSWITCHMIRRORSOURCE + // + // Resource types of mirror source + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const PnicMirrorSource__TYPE_IDENTIFIER = "PnicMirrorSource" + +func (s *PnicMirrorSource) GetType__() bindings.BindingType { + return PnicMirrorSourceBindingType() +} + +func (s *PnicMirrorSource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PnicMirrorSource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Defines the point of a graph. +type PointDefinition struct { + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + // An expression that represents the points of the graph + Field *string + // Hyperlink of the specified UI page that provides details. + Navigation *string + // Multi-line text to be shown on tooltip while hovering over the point of a graph. + Tooltip []Tooltip + // Represents the variable for the X value of points that are plotted on the graph. + XValue *string + // Represents the variable for the Y value of points that are plotted on the graph. + YValue *string +} + +func (s *PointDefinition) GetType__() bindings.BindingType { + return PointDefinitionBindingType() +} + +func (s *PointDefinition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PointDefinition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A Policy Based VPN requires to define protect rules that match local and peer subnets. IPSec security associations is negotiated for each pair of local and peer subnet. +type PolicyBasedIPSecVPNSession struct { + // Policy rules + PolicyRules []IPSecVPNPolicyRule + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * IPSecVPNSession#IPSecVPNSession_RESOURCE_TYPE_POLICYBASEDIPSECVPNSESSION + // * IPSecVPNSession#IPSecVPNSession_RESOURCE_TYPE_ROUTEBASEDIPSECVPNSESSION + // + // A Policy Based VPN requires to define protect rules that match local and peer subnets. IPSec security associations is negotiated for each pair of local and peer subnet. A Route Based VPN is more flexible, more powerful and recommended over policy based VPN. IP Tunnel port is created and all traffic routed via tunnel port is protected. Routes can be configured statically or can be learned through BGP. A route based VPN is must for establishing redundant VPN session to remote site. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Enable/Disable IPSec VPN session. + Enabled *bool + // Identifier of VPN Service linked with local endpoint. + IpsecVpnServiceId *string + // Local endpoint identifier. + LocalEndpointId *string + // Peer endpoint identifier. + PeerEndpointId *string + TcpMssClamping *TcpMssClamping +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const PolicyBasedIPSecVPNSession__TYPE_IDENTIFIER = "PolicyBasedIPSecVPNSession" + +func (s *PolicyBasedIPSecVPNSession) GetType__() bindings.BindingType { + return PolicyBasedIPSecVPNSessionBindingType() +} + +func (s *PolicyBasedIPSecVPNSession) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyBasedIPSecVPNSession._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PolicyPktCapResource struct { + // The path of segment port or router port where the packets are captured + LogicalPortPath *string + // Packet capture file download URL + PktcapFileDownloadUrl *string + // The ID of logical port where packet capture action is performed + PortId *string + // Type of packet capture resource + ResourceType string +} + +func (s *PolicyPktCapResource) GetType__() bindings.BindingType { + return PolicyPktCapResourceBindingType() +} + +func (s *PolicyPktCapResource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyPktCapResource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PolicyTraceflowObservationDelivered struct { + // Path of gateway or gateway interface + InterfacePath *string + // The path of the segment port into which the traceflow packet was delivered. + SegmentPortPath *string + // The id of the logical port into which the traceflow packet was delivered + LportId *string + // The name of the logical port into which the traceflow packet was delivered + LportName *string + // Possible values are: + // + // * TraceflowObservationDelivered#TraceflowObservationDelivered_RESOLUTION_TYPE_UNKNOWN + // * TraceflowObservationDelivered#TraceflowObservationDelivered_RESOLUTION_TYPE_ARP_SUPPRESSION_PORT_CACHE + // * TraceflowObservationDelivered#TraceflowObservationDelivered_RESOLUTION_TYPE_ARP_SUPPRESSION_TABLE + // * TraceflowObservationDelivered#TraceflowObservationDelivered_RESOLUTION_TYPE_ARP_SUPPRESSION_CP_QUERY + // * TraceflowObservationDelivered#TraceflowObservationDelivered_RESOLUTION_TYPE_ARP_VM + // + // This field specifies the resolution type of ARP ARP_SUPPRESSION_PORT_CACHE - ARP request is suppressed by port DB ARP_SUPPRESSION_TABLE - ARP request is suppressed by ARP table ARP_SUPPRESSION_CP_QUERY - ARP request is suppressed by info derived from CP ARP_VM - No suppression and the ARP request is resolved. + ResolutionType *string + // The source MAC address of form: \"^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$\". For example: 00:00:00:00:00:00. + TargetMac *string + // VLAN on bridged network format: int64 + VlanId *int64 + // The name of the component that issued the observation. + ComponentName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER1 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_VRF_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LS_TRANSIT + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_CLASSIFIER + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_PROXY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_VDR + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_ENI + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_AWS_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_TGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_EDGE_UPLINK + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_DELL_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_UNKNOWN + // + // The sub type of the component that issued the observation. + ComponentSubType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_PHYSICAL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LR + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LS + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_HOSTSWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_FW_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_RTEP_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LOAD_BALANCER + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_NAT + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_IPSEC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SERVICE_INSERTION + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_VMC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_FW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DLB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_LB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_ROUTING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_FORWARDING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_HOST_SWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_UNKNOWN + // + // The type of the component that issued the observation. + ComponentType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDELIVERED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONREPLICATIONLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRELAYEDLOGICAL + ResourceType string + // the hop count for observations on the transport node that a traceflow packet is injected in will be 0. The hop count is incremented each time a subsequent transport node receives the traceflow packet. The sequence number of 999 indicates that the hop count could not be determined for the containing observation. format: int64 + SequenceNo *int64 + // This field contains the site path where this observation was generated. + SitePath *string + // Timestamp when the observation was created by the transport node (milliseconds epoch) format: int64 + Timestamp *int64 + // Timestamp when the observation was created by the transport node (microseconds epoch) format: int64 + TimestampMicro *int64 + // id of the transport node that observed a traceflow packet + TransportNodeId *string + // name of the transport node that observed a traceflow packet + TransportNodeName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_ESX + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_WINDOWSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_EDGE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_PUBLIC_CLOUD_GATEWAY_NODE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OTHERS + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_HYPERV + // + // type of the transport node that observed a traceflow packet + TransportNodeType *string +} + +func (s *PolicyTraceflowObservationDelivered) GetType__() bindings.BindingType { + return PolicyTraceflowObservationDeliveredBindingType() +} + +func (s *PolicyTraceflowObservationDelivered) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyTraceflowObservationDelivered._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PolicyTraceflowObservationDropped struct { + // The path of the ACL rule that was applied to forward the traceflow packet + AclRulePath *string + // Path of gateway or gateway interface + InterfacePath *string + // The path of the NAT rule that was applied to forward the traceflow packet + NatRulePath *string + // The path of the segment port into which the traceflow packet was dropped. + SegmentPortPath *string + // This field is specified when the traceflow packet matched a L3 firewall rule. format: int64 + AclRuleId *int64 + // Possible values are: + // + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_UNKNOWN + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_TIMEOUT + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_CPFAIL + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_FROMCP + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_PORTDESTROY + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_TABLEDESTROY + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_NETDESTROY + // + // This field specifies the ARP fails reason ARP_TIMEOUT - ARP failure due to query control plane timeout ARP_CPFAIL - ARP failure due post ARP query message to control plane failure ARP_FROMCP - ARP failure due to deleting ARP entry from control plane ARP_PORTDESTROY - ARP failure due to port destruction ARP_TABLEDESTROY - ARP failure due to ARP table destruction ARP_NETDESTROY - ARP failure due to overlay network destruction + ArpFailReason *string + // This field is specified when the traceflow packet matched a jump-to rule. format: int64 + JumptoRuleId *int64 + // This field is specified when the traceflow packet matched a l2 rule. format: int64 + L2RuleId *int64 + // The id of the logical port at which the traceflow packet was dropped + LportId *string + // The name of the logical port at which the traceflow packet was dropped + LportName *string + // This field is specified when the traceflow packet matched a NAT rule. format: int64 + NatRuleId *int64 + // Possible values are: + // + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_ARP_FAIL + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_BFD + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_BROADCAST + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_DHCP + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_DLB + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_FW_RULE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_GENEVE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_GRE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_IFACE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_IP + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_IP_REASS + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_IPSEC + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_IPSEC_VTI + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_L2VPN + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_L4PORT + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_LB + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_LROUTER + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_LSERVICE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_LSWITCH + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_MANAGEMENT + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_MD_PROXY + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NAT + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_RTEP_TUNNEL + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_ND_NS_FAIL + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NEIGH + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_EIP_FOUND + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_EIP_ASSOCIATION + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_ENI_FOR_IP + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_ENI_FOR_LIF + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_ROUTE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_ROUTE_TABLE_FOUND + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_UNDERLAY_ROUTE_FOUND + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NOT_VDR_DOWNLINK + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_VDR_FOUND + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_VDR_ON_HOST + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NOT_VDR_UPLINK + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_SERVICE_INSERT + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_SPOOFGUARD + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_TTL_ZERO + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_TUNNEL + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_VLAN + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_VXLAN + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_VXSTT + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_VMC_NO_RESPONSE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_WRONG_UPLINK + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_FW_STATE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_MAC + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_UNKNOWN + // + // This field specifies the drop reason of traceflow packet. ARP_FAIL - ARP request fails for some reasons, please refer arp_fail_reason for detail BFD - BFD packet is dropped because traversed by non-operative interface or encountering internal error (e.g., memory insufficient) BROADCAST - Packet is dropped during traversing the interface (e.g., Edge uplink, Edge centralized service port) which disallow ethernet broadcast DHCP - DHCP packet is malformed DLB - The packet is disallowed by distributed load balancing FW_RULE - The packet matches a drop or reject rule of DFW or Edge firewall GENEVE - GENEVE packet is malformed GRE - GRE packet is malformed or traverses a non-operative interface IFACE - Packet traverses a non-operative interface IP - Packet is dropped because of IP related causes (e.g., ICMPv4/ICMPv6 packet is malformed, or DF flag is set but fragment must be performed for the packet) or corresponding interface is not found or inoperative IP_REASS - Packet is dropped during IP reassembly IPSEC - IPsec protocol related packet is dropped IPSEC_VTI - IPsec required SA is not found or traversing inoperative interface cause packet dropped L2VPN - VLAN id of GRE packet is invalid L4PORT - Layer 4 packet (e.g., BFD, DHCP) is dropped LB - Packet is dropped by load balancing rule LROUTER - Packet is dropped by logical router LSERVICE - Packet is malformed or traverses inoperative logical service interface LSWITCH - Packet is dropped by logical switch MANAGEMENT - Packet is dropped by Edge datapath MANAGEMENT service port MD_PROXY - Packet is dropped by metadata proxy NAT - Packet is dropped by NAT rule RTEP_TUNNEL - Unused drop reason ND_NS_FAIL - Neighbor Discovery packet fails NEIGH - ARP or Neighbor Discovery packet fails NO_EIP_FOUND - Destination IP is not an elastic IP NO_EIP_ASSOCIATION - Elastic IP is not associated with active edge VDR ENI NO_ENI_FOR_IP - There is no ENI found for the destination IP NO_ENI_FOR_LIF - Cannot find an ENI associated with uplink LIF NO_ROUTE - Cannot find route for destination IP NO_ROUTE_TABLE_FOUND - Cannot find associated route table NO_UNDERLAY_ROUTE_FOUND - Cannot find AWS route to destination NOT_VDR_DOWNLINK - Packet is not forwarded to VMC unmanaged VDR downlink NO_VDR_FOUND - VMC unmanaged VDR associated with Edge uplink is not found NO_VDR_ON_HOST - Cannot find VMC unmanaged VDR list on this host NOT_VDR_UPLINK - Packet is not forwarded to VDR uplink SERVICE_INSERT - Packet from guest VM to service VM or from service VM to guest VM is dropped by firewall rule SPOOFGUARD - Packet is blocked by SpoofGuard policy TTL_ZERO - The IPv4 time to live field or the IPv6 hop limit field of packet is zero TUNNEL - Overlay tunnel management packet (VNI value of GENEVE header is 0, e.g., BFD) is dropped VLAN - VLAN id of packet is disallowed by the given port VXLAN - VXLAN packet is malformed or cannot find tunnel port for it VXSTT - Unused drop reason VMC_NO_RESPONSE - Failed to query VMC observations as no response from VMC app WRONG_UPLINK - Packet is not routed to the expected Edge uplink by VMC unmanaged VDR FW_STATE - Packet is dropped by stateful firewall + Reason *string + // The name of the component that issued the observation. + ComponentName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER1 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_VRF_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LS_TRANSIT + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_CLASSIFIER + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_PROXY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_VDR + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_ENI + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_AWS_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_TGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_EDGE_UPLINK + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_DELL_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_UNKNOWN + // + // The sub type of the component that issued the observation. + ComponentSubType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_PHYSICAL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LR + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LS + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_HOSTSWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_FW_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_RTEP_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LOAD_BALANCER + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_NAT + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_IPSEC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SERVICE_INSERTION + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_VMC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_FW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DLB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_LB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_ROUTING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_FORWARDING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_HOST_SWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_UNKNOWN + // + // The type of the component that issued the observation. + ComponentType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDELIVERED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONREPLICATIONLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRELAYEDLOGICAL + ResourceType string + // the hop count for observations on the transport node that a traceflow packet is injected in will be 0. The hop count is incremented each time a subsequent transport node receives the traceflow packet. The sequence number of 999 indicates that the hop count could not be determined for the containing observation. format: int64 + SequenceNo *int64 + // This field contains the site path where this observation was generated. + SitePath *string + // Timestamp when the observation was created by the transport node (milliseconds epoch) format: int64 + Timestamp *int64 + // Timestamp when the observation was created by the transport node (microseconds epoch) format: int64 + TimestampMicro *int64 + // id of the transport node that observed a traceflow packet + TransportNodeId *string + // name of the transport node that observed a traceflow packet + TransportNodeName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_ESX + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_WINDOWSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_EDGE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_PUBLIC_CLOUD_GATEWAY_NODE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OTHERS + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_HYPERV + // + // type of the transport node that observed a traceflow packet + TransportNodeType *string +} + +func (s *PolicyTraceflowObservationDropped) GetType__() bindings.BindingType { + return PolicyTraceflowObservationDroppedBindingType() +} + +func (s *PolicyTraceflowObservationDropped) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyTraceflowObservationDropped._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PolicyTraceflowObservationDroppedLogical struct { + // The path of the ACL rule that was applied to forward the traceflow packet + AclRulePath *string + // The path of the component that dropped the traceflow packet + ComponentPath *string + // Path of gateway or gateway interface + InterfacePath *string + // The path of the jump-to rule that was applied to the traceflow packet + JumptoRulePath *string + // The path of the l2 rule that was applied to the traceflow packet + L2RulePath *string + // The path of the NAT rule that was applied to forward the traceflow packet + NatRulePath *string + // The path of the segment port into which the traceflow packet was dropped. + SegmentPortPath *string + // The id of the component that dropped the traceflow packet. + ComponentId *string + // The index of service path that is a chain of services represents the point where the traceflow packet was dropped. format: int64 + ServicePathIndex *int64 + // This field is specified when the traceflow packet matched a L3 firewall rule. format: int64 + AclRuleId *int64 + // Possible values are: + // + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_UNKNOWN + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_TIMEOUT + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_CPFAIL + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_FROMCP + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_PORTDESTROY + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_TABLEDESTROY + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_NETDESTROY + // + // This field specifies the ARP fails reason ARP_TIMEOUT - ARP failure due to query control plane timeout ARP_CPFAIL - ARP failure due post ARP query message to control plane failure ARP_FROMCP - ARP failure due to deleting ARP entry from control plane ARP_PORTDESTROY - ARP failure due to port destruction ARP_TABLEDESTROY - ARP failure due to ARP table destruction ARP_NETDESTROY - ARP failure due to overlay network destruction + ArpFailReason *string + // This field is specified when the traceflow packet matched a jump-to rule. format: int64 + JumptoRuleId *int64 + // This field is specified when the traceflow packet matched a l2 rule. format: int64 + L2RuleId *int64 + // The id of the logical port at which the traceflow packet was dropped + LportId *string + // The name of the logical port at which the traceflow packet was dropped + LportName *string + // This field is specified when the traceflow packet matched a NAT rule. format: int64 + NatRuleId *int64 + // Possible values are: + // + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_ARP_FAIL + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_BFD + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_BROADCAST + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_DHCP + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_DLB + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_FW_RULE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_GENEVE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_GRE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_IFACE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_IP + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_IP_REASS + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_IPSEC + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_IPSEC_VTI + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_L2VPN + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_L4PORT + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_LB + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_LROUTER + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_LSERVICE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_LSWITCH + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_MANAGEMENT + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_MD_PROXY + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NAT + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_RTEP_TUNNEL + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_ND_NS_FAIL + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NEIGH + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_EIP_FOUND + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_EIP_ASSOCIATION + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_ENI_FOR_IP + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_ENI_FOR_LIF + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_ROUTE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_ROUTE_TABLE_FOUND + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_UNDERLAY_ROUTE_FOUND + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NOT_VDR_DOWNLINK + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_VDR_FOUND + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_VDR_ON_HOST + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NOT_VDR_UPLINK + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_SERVICE_INSERT + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_SPOOFGUARD + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_TTL_ZERO + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_TUNNEL + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_VLAN + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_VXLAN + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_VXSTT + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_VMC_NO_RESPONSE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_WRONG_UPLINK + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_FW_STATE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_MAC + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_UNKNOWN + // + // This field specifies the drop reason of traceflow packet. ARP_FAIL - ARP request fails for some reasons, please refer arp_fail_reason for detail BFD - BFD packet is dropped because traversed by non-operative interface or encountering internal error (e.g., memory insufficient) BROADCAST - Packet is dropped during traversing the interface (e.g., Edge uplink, Edge centralized service port) which disallow ethernet broadcast DHCP - DHCP packet is malformed DLB - The packet is disallowed by distributed load balancing FW_RULE - The packet matches a drop or reject rule of DFW or Edge firewall GENEVE - GENEVE packet is malformed GRE - GRE packet is malformed or traverses a non-operative interface IFACE - Packet traverses a non-operative interface IP - Packet is dropped because of IP related causes (e.g., ICMPv4/ICMPv6 packet is malformed, or DF flag is set but fragment must be performed for the packet) or corresponding interface is not found or inoperative IP_REASS - Packet is dropped during IP reassembly IPSEC - IPsec protocol related packet is dropped IPSEC_VTI - IPsec required SA is not found or traversing inoperative interface cause packet dropped L2VPN - VLAN id of GRE packet is invalid L4PORT - Layer 4 packet (e.g., BFD, DHCP) is dropped LB - Packet is dropped by load balancing rule LROUTER - Packet is dropped by logical router LSERVICE - Packet is malformed or traverses inoperative logical service interface LSWITCH - Packet is dropped by logical switch MANAGEMENT - Packet is dropped by Edge datapath MANAGEMENT service port MD_PROXY - Packet is dropped by metadata proxy NAT - Packet is dropped by NAT rule RTEP_TUNNEL - Unused drop reason ND_NS_FAIL - Neighbor Discovery packet fails NEIGH - ARP or Neighbor Discovery packet fails NO_EIP_FOUND - Destination IP is not an elastic IP NO_EIP_ASSOCIATION - Elastic IP is not associated with active edge VDR ENI NO_ENI_FOR_IP - There is no ENI found for the destination IP NO_ENI_FOR_LIF - Cannot find an ENI associated with uplink LIF NO_ROUTE - Cannot find route for destination IP NO_ROUTE_TABLE_FOUND - Cannot find associated route table NO_UNDERLAY_ROUTE_FOUND - Cannot find AWS route to destination NOT_VDR_DOWNLINK - Packet is not forwarded to VMC unmanaged VDR downlink NO_VDR_FOUND - VMC unmanaged VDR associated with Edge uplink is not found NO_VDR_ON_HOST - Cannot find VMC unmanaged VDR list on this host NOT_VDR_UPLINK - Packet is not forwarded to VDR uplink SERVICE_INSERT - Packet from guest VM to service VM or from service VM to guest VM is dropped by firewall rule SPOOFGUARD - Packet is blocked by SpoofGuard policy TTL_ZERO - The IPv4 time to live field or the IPv6 hop limit field of packet is zero TUNNEL - Overlay tunnel management packet (VNI value of GENEVE header is 0, e.g., BFD) is dropped VLAN - VLAN id of packet is disallowed by the given port VXLAN - VXLAN packet is malformed or cannot find tunnel port for it VXSTT - Unused drop reason VMC_NO_RESPONSE - Failed to query VMC observations as no response from VMC app WRONG_UPLINK - Packet is not routed to the expected Edge uplink by VMC unmanaged VDR FW_STATE - Packet is dropped by stateful firewall + Reason *string + // The name of the component that issued the observation. + ComponentName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER1 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_VRF_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LS_TRANSIT + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_CLASSIFIER + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_PROXY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_VDR + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_ENI + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_AWS_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_TGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_EDGE_UPLINK + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_DELL_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_UNKNOWN + // + // The sub type of the component that issued the observation. + ComponentSubType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_PHYSICAL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LR + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LS + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_HOSTSWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_FW_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_RTEP_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LOAD_BALANCER + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_NAT + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_IPSEC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SERVICE_INSERTION + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_VMC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_FW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DLB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_LB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_ROUTING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_FORWARDING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_HOST_SWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_UNKNOWN + // + // The type of the component that issued the observation. + ComponentType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDELIVERED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONREPLICATIONLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRELAYEDLOGICAL + ResourceType string + // the hop count for observations on the transport node that a traceflow packet is injected in will be 0. The hop count is incremented each time a subsequent transport node receives the traceflow packet. The sequence number of 999 indicates that the hop count could not be determined for the containing observation. format: int64 + SequenceNo *int64 + // This field contains the site path where this observation was generated. + SitePath *string + // Timestamp when the observation was created by the transport node (milliseconds epoch) format: int64 + Timestamp *int64 + // Timestamp when the observation was created by the transport node (microseconds epoch) format: int64 + TimestampMicro *int64 + // id of the transport node that observed a traceflow packet + TransportNodeId *string + // name of the transport node that observed a traceflow packet + TransportNodeName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_ESX + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_WINDOWSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_EDGE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_PUBLIC_CLOUD_GATEWAY_NODE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OTHERS + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_HYPERV + // + // type of the transport node that observed a traceflow packet + TransportNodeType *string +} + +func (s *PolicyTraceflowObservationDroppedLogical) GetType__() bindings.BindingType { + return PolicyTraceflowObservationDroppedLogicalBindingType() +} + +func (s *PolicyTraceflowObservationDroppedLogical) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyTraceflowObservationDroppedLogical._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PolicyTraceflowObservationForwardedLogical struct { + // The path of the ACL rule that was applied to forward the traceflow packet + AclRulePath *string + // The path of the component that forwarded the traceflow packet + ComponentPath *string + // The path of the destination component to which the traceflow packet was forwarded + DstComponentPath *string + // Path of gateway or gateway interface + InterfacePath *string + // The path of the jump-to rule that was applied to the traceflow packet + JumptoRulePath *string + // The path of the l2 rule that was applied to the traceflow packet + L2RulePath *string + // The path of the NAT rule that was applied to forward the traceflow packet + NatRulePath *string + // The path of the segment port into which the traceflow packet was forwared. + SegmentPortPath *string + // This field is specified when the traceflow packet matched a L3 firewall rule. format: int64 + AclRuleId *int64 + // The id of the component that forwarded the traceflow packet. + ComponentId *string + // The id of the destination component to which the traceflow packet was forwarded. + DstComponentId *string + // The name of the destination component to which the traceflow packet was forwarded. + DstComponentName *string + // Possible values are: + // + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_PHYSICAL + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_LR + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_LS + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_DFW + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_BRIDGE + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_EDGE_TUNNEL + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_EDGE_HOSTSWITCH + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_FW_BRIDGE + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_EDGE_RTEP_TUNNEL + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_LOAD_BALANCER + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_NAT + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_IPSEC + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_SERVICE_INSERTION + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_VMC + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_SPOOFGUARD + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_EDGE_FW + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_DLB + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_ANTREA_SPOOFGUARD + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_ANTREA_LB + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_ANTREA_ROUTING + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_ANTREA_DFW + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_ANTREA_FORWARDING + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_HOST_SWITCH + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_UNKNOWN + // + // The type of the destination component to which the traceflow packet was forwarded. + DstComponentType *string + // This field is specified when the traceflow packet matched a jump-to rule. format: int64 + JumptoRuleId *int64 + // This field is specified when the traceflow packet matched a l2 rule. format: int64 + L2RuleId *int64 + // The id of the logical port through which the traceflow packet was forwarded. + LportId *string + // The name of the logical port through which the traceflow packet was forwarded. + LportName *string + // This field is specified when the traceflow packet matched a NAT rule. format: int64 + NatRuleId *int64 + // Possible values are: + // + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_RESEND_TYPE_UNKNOWN + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_RESEND_TYPE_ARP_UNKNOWN_FROM_CP + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_RESEND_TYPE_ND_NS_UNKNWON_FROM_CP + // + // ARP_UNKNOWN_FROM_CP - Unknown ARP query result emitted by control plane ND_NS_UNKNOWN_FROM_CP - Unknown neighbor solicitation query result emitted by control plane UNKNOWN - Unknown resend type + ResendType *string + // The index of the service insertion component format: int64 + ServiceIndex *int64 + // The path index of the service insertion component format: int64 + ServicePathIndex *int64 + // The ttl of the service insertion component format: int64 + ServiceTtl *int64 + // This field specified the prefix IP address a traceflow packet matched in the whitelist in spoofguard. format: ip-cidr-block + SpoofguardIp *string + // The source MAC address of form: \"^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$\". For example: 00:00:00:00:00:00. format: mac-address + SpoofguardMac *string + // This field specified the VLAN id a traceflow packet matched in the whitelist in spoofguard. format: int64 + SpoofguardVlanId *int64 + // MAC address of nexthop for service insertion(SI) in service VM(SVM) where the traceflow packet was received. + SvcNhMac *string + // The translated destination IP address of VNP/NAT format: ip + TranslatedDstIp *string + // The translated source IP address of VPN/NAT format: ip + TranslatedSrcIp *string + // This field is specified when the traceflow packet was forwarded by a VLAN logical network. format: int64 + Vlan *int64 + // This field is specified when the traceflow packet was forwarded by an overlay logical network. format: int32 + Vni *int64 + // The name of the component that issued the observation. + ComponentName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER1 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_VRF_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LS_TRANSIT + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_CLASSIFIER + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_PROXY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_VDR + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_ENI + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_AWS_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_TGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_EDGE_UPLINK + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_DELL_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_UNKNOWN + // + // The sub type of the component that issued the observation. + ComponentSubType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_PHYSICAL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LR + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LS + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_HOSTSWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_FW_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_RTEP_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LOAD_BALANCER + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_NAT + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_IPSEC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SERVICE_INSERTION + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_VMC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_FW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DLB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_LB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_ROUTING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_FORWARDING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_HOST_SWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_UNKNOWN + // + // The type of the component that issued the observation. + ComponentType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDELIVERED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONREPLICATIONLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRELAYEDLOGICAL + ResourceType string + // the hop count for observations on the transport node that a traceflow packet is injected in will be 0. The hop count is incremented each time a subsequent transport node receives the traceflow packet. The sequence number of 999 indicates that the hop count could not be determined for the containing observation. format: int64 + SequenceNo *int64 + // This field contains the site path where this observation was generated. + SitePath *string + // Timestamp when the observation was created by the transport node (milliseconds epoch) format: int64 + Timestamp *int64 + // Timestamp when the observation was created by the transport node (microseconds epoch) format: int64 + TimestampMicro *int64 + // id of the transport node that observed a traceflow packet + TransportNodeId *string + // name of the transport node that observed a traceflow packet + TransportNodeName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_ESX + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_WINDOWSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_EDGE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_PUBLIC_CLOUD_GATEWAY_NODE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OTHERS + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_HYPERV + // + // type of the transport node that observed a traceflow packet + TransportNodeType *string +} + +func (s *PolicyTraceflowObservationForwardedLogical) GetType__() bindings.BindingType { + return PolicyTraceflowObservationForwardedLogicalBindingType() +} + +func (s *PolicyTraceflowObservationForwardedLogical) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyTraceflowObservationForwardedLogical._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PolicyTraceflowObservationReceivedLogical struct { + // The path of the component that received the traceflow packet + ComponentPath *string + // Path of gateway or gateway interface + InterfacePath *string + // The path of the segment port into which the traceflow packet was received. + SegmentPortPath *string + // The path of the source component from which the traceflow packet was received + SrcComponentPath *string + // The id of the component that received the traceflow packet. + ComponentId *string + // The id of the logical port at which the traceflow packet was received + LportId *string + // The name of the logical port at which the traceflow packet was received + LportName *string + // The id of the source component from which the traceflow packet was received. + SrcComponentId *string + // The name of source component from which the traceflow packet was received. + SrcComponentName *string + // Possible values are: + // + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_PHYSICAL + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_LR + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_LS + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_DFW + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_BRIDGE + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_EDGE_TUNNEL + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_EDGE_HOSTSWITCH + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_FW_BRIDGE + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_EDGE_RTEP_TUNNEL + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_LOAD_BALANCER + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_NAT + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_IPSEC + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_SERVICE_INSERTION + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_VMC + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_SPOOFGUARD + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_EDGE_FW + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_DLB + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_ANTREA_SPOOFGUARD + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_ANTREA_LB + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_ANTREA_ROUTING + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_ANTREA_DFW + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_ANTREA_FORWARDING + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_HOST_SWITCH + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_UNKNOWN + // + // The type of the source component from which the traceflow packet was received. + SrcComponentType *string + // MAC address of SAN volume controller for service insertion(SI) in service VM(SVM) where the traceflow packet was received. + SvcMac *string + // This field is specified when the traceflow packet was received by a VLAN logical network. format: int64 + Vlan *int64 + // This field is specified when the traceflow packet was received by an overlay logical network. format: int32 + Vni *int64 + // The name of the component that issued the observation. + ComponentName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER1 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_VRF_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LS_TRANSIT + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_CLASSIFIER + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_PROXY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_VDR + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_ENI + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_AWS_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_TGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_EDGE_UPLINK + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_DELL_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_UNKNOWN + // + // The sub type of the component that issued the observation. + ComponentSubType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_PHYSICAL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LR + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LS + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_HOSTSWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_FW_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_RTEP_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LOAD_BALANCER + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_NAT + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_IPSEC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SERVICE_INSERTION + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_VMC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_FW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DLB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_LB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_ROUTING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_FORWARDING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_HOST_SWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_UNKNOWN + // + // The type of the component that issued the observation. + ComponentType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDELIVERED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONREPLICATIONLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRELAYEDLOGICAL + ResourceType string + // the hop count for observations on the transport node that a traceflow packet is injected in will be 0. The hop count is incremented each time a subsequent transport node receives the traceflow packet. The sequence number of 999 indicates that the hop count could not be determined for the containing observation. format: int64 + SequenceNo *int64 + // This field contains the site path where this observation was generated. + SitePath *string + // Timestamp when the observation was created by the transport node (milliseconds epoch) format: int64 + Timestamp *int64 + // Timestamp when the observation was created by the transport node (microseconds epoch) format: int64 + TimestampMicro *int64 + // id of the transport node that observed a traceflow packet + TransportNodeId *string + // name of the transport node that observed a traceflow packet + TransportNodeName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_ESX + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_WINDOWSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_EDGE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_PUBLIC_CLOUD_GATEWAY_NODE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OTHERS + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_HYPERV + // + // type of the transport node that observed a traceflow packet + TransportNodeType *string +} + +func (s *PolicyTraceflowObservationReceivedLogical) GetType__() bindings.BindingType { + return PolicyTraceflowObservationReceivedLogicalBindingType() +} + +func (s *PolicyTraceflowObservationReceivedLogical) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyTraceflowObservationReceivedLogical._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PolicyTraceflowObservationRelayedLogical struct { + // This field specifies the logical component that relay service located on. + LogicalComponentPath *string + // This field specified the IP address of the destination which the packet will be relayed. format: ip + DstServerAddress *string + // This field specified the logical component that relay service located. + LogicalCompUuid *string + // Possible values are: + // + // * TraceflowObservationRelayedLogical#TraceflowObservationRelayedLogical_MESSAGE_TYPE_REQUEST + // * TraceflowObservationRelayedLogical#TraceflowObservationRelayedLogical_MESSAGE_TYPE_REPLY + // + // This field specified the message type of the relay service REQUEST - The relay service will relay a request message to the destination server REPLY - The relay service will relay a reply message to the client + MessageType *string + // This field specified the IP address of the relay service. format: ip + RelayServerAddress *string + // The name of the component that issued the observation. + ComponentName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER1 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_VRF_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LS_TRANSIT + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_CLASSIFIER + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_PROXY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_VDR + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_ENI + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_AWS_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_TGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_EDGE_UPLINK + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_DELL_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_UNKNOWN + // + // The sub type of the component that issued the observation. + ComponentSubType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_PHYSICAL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LR + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LS + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_HOSTSWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_FW_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_RTEP_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LOAD_BALANCER + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_NAT + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_IPSEC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SERVICE_INSERTION + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_VMC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_FW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DLB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_LB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_ROUTING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_FORWARDING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_HOST_SWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_UNKNOWN + // + // The type of the component that issued the observation. + ComponentType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDELIVERED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONREPLICATIONLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRELAYEDLOGICAL + ResourceType string + // the hop count for observations on the transport node that a traceflow packet is injected in will be 0. The hop count is incremented each time a subsequent transport node receives the traceflow packet. The sequence number of 999 indicates that the hop count could not be determined for the containing observation. format: int64 + SequenceNo *int64 + // This field contains the site path where this observation was generated. + SitePath *string + // Timestamp when the observation was created by the transport node (milliseconds epoch) format: int64 + Timestamp *int64 + // Timestamp when the observation was created by the transport node (microseconds epoch) format: int64 + TimestampMicro *int64 + // id of the transport node that observed a traceflow packet + TransportNodeId *string + // name of the transport node that observed a traceflow packet + TransportNodeName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_ESX + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_WINDOWSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_EDGE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_PUBLIC_CLOUD_GATEWAY_NODE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OTHERS + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_HYPERV + // + // type of the transport node that observed a traceflow packet + TransportNodeType *string +} + +func (s *PolicyTraceflowObservationRelayedLogical) GetType__() bindings.BindingType { + return PolicyTraceflowObservationRelayedLogicalBindingType() +} + +func (s *PolicyTraceflowObservationRelayedLogical) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PolicyTraceflowObservationRelayedLogical._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PoolMember struct { + // Possible values are: + // + // * PoolMember#PoolMember_ADMIN_STATE_ENABLED + // * PoolMember#PoolMember_ADMIN_STATE_DISABLED + // * PoolMember#PoolMember_ADMIN_STATE_GRACEFUL_DISABLED + // + // member admin state + AdminState *string + // Backup servers are typically configured with a sorry page indicating to the user that the application is currently unavailable. While the pool is active (a specified minimum number of pool members are active) BACKUP members are skipped during server selection. When the pool is inactive, incoming connections are sent to only the BACKUP member(s). + BackupMember *bool + // pool member name + DisplayName *string + // pool member IP address format: ip + IpAddress *string + // To ensure members are not overloaded, connections to a member can be capped by the load balancer. When a member reaches this limit, it is skipped during server selection. If it is not specified, it means that connections are unlimited. format: int64 + MaxConcurrentConnections *int64 + // If port is specified, all connections will be sent to this port. Only single port is supported. If unset, the same port the client connected to will be used, it could be overrode by default_pool_member_port setting in virtual server. The port should not specified for port range case. format: port-or-range + Port *string + // Pool member weight is used for WEIGHTED_ROUND_ROBIN balancing algorithm. The weight value would be ignored in other algorithms. format: int64 + Weight *int64 +} + +const PoolMember_ADMIN_STATE_ENABLED = "ENABLED" +const PoolMember_ADMIN_STATE_DISABLED = "DISABLED" +const PoolMember_ADMIN_STATE_GRACEFUL_DISABLED = "GRACEFUL_DISABLED" + +func (s *PoolMember) GetType__() bindings.BindingType { + return PoolMemberBindingType() +} + +func (s *PoolMember) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PoolMember._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PoolMemberGroup struct { + // The list is used to show the customized pool member settings. User can only user pool member action API to update the admin state for a specific IP address. + CustomizedMembers []PoolMemberSetting + GroupingObject *ResourceReference + // Possible values are: + // + // * PoolMemberGroup#PoolMemberGroup_IP_REVISION_FILTER_IPV4 + // * PoolMemberGroup#PoolMemberGroup_IP_REVISION_FILTER_IPV6 + // * PoolMemberGroup#PoolMemberGroup_IP_REVISION_FILTER_IPV4_IPV6 + // + // Ip revision filter is used to filter IPv4 or IPv6 addresses from the grouping object. If the filter is not specified, both IPv4 and IPv6 addresses would be used as server IPs. The link local and loopback addresses would be always filtered out. + IpRevisionFilter *string + // The size is used to define the maximum number of grouping object IP address list. These IP addresses would be used as pool members. If the grouping object includes more than certain number of IP addresses, the redundant parts would be ignored and those IP addresses would not be treated as pool members. If the size is not specified, one member is budgeted for this dynamic pool so that the pool has at least one member even if some other dynamic pools grow beyond the capacity of load balancer service. Other members are picked according to available dynamic capacity. The unused members would be set to DISABLED so that the load balancer system itself is not overloaded during runtime. format: int64 + MaxIpListSize *int64 + // If port is specified, all connections will be sent to this port. If unset, the same port the client connected to will be used, it could be overridden by default_pool_member_ports setting in virtual server. The port should not specified for multiple ports case. format: int32 + Port *int64 +} + +const PoolMemberGroup_IP_REVISION_FILTER_IPV4 = "IPV4" +const PoolMemberGroup_IP_REVISION_FILTER_IPV6 = "IPV6" +const PoolMemberGroup_IP_REVISION_FILTER_IPV4_IPV6 = "IPV4_IPV6" + +func (s *PoolMemberGroup) GetType__() bindings.BindingType { + return PoolMemberGroupBindingType() +} + +func (s *PoolMemberGroup) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PoolMemberGroup._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The setting is used to add, update or remove pool members from pool. For static pool members, admin_state, display_name and weight can be updated. For dynamic pool members, only admin_state can be updated. +type PoolMemberSetting struct { + // Possible values are: + // + // * PoolMemberSetting#PoolMemberSetting_ADMIN_STATE_ENABLED + // * PoolMemberSetting#PoolMemberSetting_ADMIN_STATE_DISABLED + // * PoolMemberSetting#PoolMemberSetting_ADMIN_STATE_GRACEFUL_DISABLED + // + // Member admin state + AdminState *string + // Only applicable to static pool members. If supplied for a pool defined by a grouping object, update API would fail. + DisplayName *string + // Pool member IP address format: ip + IpAddress *string + // Pool member port number format: port-or-range + Port *string + // Only applicable to static pool members. If supplied for a pool defined by a grouping object, update API would fail. format: int64 + Weight *int64 +} + +const PoolMemberSetting_ADMIN_STATE_ENABLED = "ENABLED" +const PoolMemberSetting_ADMIN_STATE_DISABLED = "DISABLED" +const PoolMemberSetting_ADMIN_STATE_GRACEFUL_DISABLED = "GRACEFUL_DISABLED" + +func (s *PoolMemberSetting) GetType__() bindings.BindingType { + return PoolMemberSettingBindingType() +} + +func (s *PoolMemberSetting) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PoolMemberSetting._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of PoolMemberSetting +type PoolMemberSettingList struct { + // List of pool member settings to be passed to add, update and remove APIs + Members []PoolMemberSetting +} + +func (s *PoolMemberSettingList) GetType__() bindings.BindingType { + return PoolMemberSettingListBindingType() +} + +func (s *PoolMemberSettingList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PoolMemberSettingList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Pool usage statistics in a pool. +type PoolUsage struct { + // Total number of allocated IDs in a pool format: int64 + AllocatedIds *int64 + // Total number of free IDs in a pool format: int64 + FreeIds *int64 + // Total number of IDs in a pool format: int64 + TotalIds *int64 +} + +func (s *PoolUsage) GetType__() bindings.BindingType { + return PoolUsageBindingType() +} + +func (s *PoolUsage) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PoolUsage._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// VM or vmknic entity attached to LogicalPort +type PortAttacher struct { + // This is a vmknic name if the attacher is vmknic. Otherwise, it is full path of the attached VM's config file + Entity *string + // TransportNode on which the attacher resides + Host *string +} + +func (s *PortAttacher) GetType__() bindings.BindingType { + return PortAttacherBindingType() +} + +func (s *PortAttacher) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortAttacher._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Port Connection Bare Metal Entities +type PortConnectionBMEntities struct { + DstPort *LogicalPort + SrcPort *LogicalPort +} + +func (s *PortConnectionBMEntities) GetType__() bindings.BindingType { + return PortConnectionBMEntitiesBindingType() +} + +func (s *PortConnectionBMEntities) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortConnectionBMEntities._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Port Connection Containers Entities +type PortConnectionContainersEntities struct { + LogicalPorts []LogicalPort +} + +func (s *PortConnectionContainersEntities) GetType__() bindings.BindingType { + return PortConnectionContainersEntitiesBindingType() +} + +func (s *PortConnectionContainersEntities) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortConnectionContainersEntities._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Collection of edge nodes backing a logical router +type PortConnectionEdgeNodeGroup struct { + // Resource ID is mapped to this. (ID is Generated for Edge node groups, since resource will be null) + Id *string + Resource *ManagedResource + EdgeNodes []TransportNode + // Id of the logical router + LogicalRouterId *string +} + +func (s *PortConnectionEdgeNodeGroup) GetType__() bindings.BindingType { + return PortConnectionEdgeNodeGroupBindingType() +} + +func (s *PortConnectionEdgeNodeGroup) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortConnectionEdgeNodeGroup._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Port Connection Entities (to help draw a visual picture of entities between two ports) +type PortConnectionEntities struct { + Containers *PortConnectionContainersEntities + EdgeNodeGroups []PortConnectionEdgeNodeGroup + Errors []PortConnectionError + Hypervisors []PortConnectionHypervisor + LogicalSwitches []PortConnectionLogicalSwitch + PhysicalHosts *PortConnectionBMEntities + Routers []PortConnectionRouter + Tunnels []PortConnectionTunnel + Vms []VirtualMachine +} + +func (s *PortConnectionEntities) GetType__() bindings.BindingType { + return PortConnectionEntitiesBindingType() +} + +func (s *PortConnectionEntities) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortConnectionEntities._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Port Connection Entity +type PortConnectionEntity struct { + // Resource ID is mapped to this. (ID is Generated for Edge node groups, since resource will be null) + Id *string + Resource *ManagedResource +} + +func (s *PortConnectionEntity) GetType__() bindings.BindingType { + return PortConnectionEntityBindingType() +} + +func (s *PortConnectionEntity) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortConnectionEntity._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Errors encountered while fetching entities in the forwarding path +type PortConnectionError struct { + EntityType *string + ErrorDetails *data.StructValue + ErrorSummary *string +} + +func (s *PortConnectionError) GetType__() bindings.BindingType { + return PortConnectionErrorBindingType() +} + +func (s *PortConnectionError) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortConnectionError._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Port Connection Hypervisor/Transport Node Entity +type PortConnectionHypervisor struct { + // Resource ID is mapped to this. (ID is Generated for Edge node groups, since resource will be null) + Id *string + Resource *ManagedResource + NeighborsList []InterfaceNeighborProperties + Pnics []Pnic + PnicsList []NodeInterfaceProperties + Profiles []*data.StructValue +} + +func (s *PortConnectionHypervisor) GetType__() bindings.BindingType { + return PortConnectionHypervisorBindingType() +} + +func (s *PortConnectionHypervisor) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortConnectionHypervisor._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Port Connection Logical Switch Entity +type PortConnectionLogicalSwitch struct { + // Resource ID is mapped to this. (ID is Generated for Edge node groups, since resource will be null) + Id *string + Resource *ManagedResource + // Logical Ports that are attached to a router + RouterPorts []LogicalPort + // Logical Ports that are attached to a VIF/VM + VmPorts []LogicalPort + // States of Logical Ports that are attached to a VIF/VM + VmPortsStates []LogicalPortState + // Virutal Network Interfaces that are attached to the Logical Ports + VmVnics []VirtualNetworkInterface +} + +func (s *PortConnectionLogicalSwitch) GetType__() bindings.BindingType { + return PortConnectionLogicalSwitchBindingType() +} + +func (s *PortConnectionLogicalSwitch) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortConnectionLogicalSwitch._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Port Connection Logical Router Entity +type PortConnectionRouter struct { + // Resource ID is mapped to this. (ID is Generated for Edge node groups, since resource will be null) + Id *string + Resource *ManagedResource + // Downlink ports of the Logical Router. + DownlinkPorts []*data.StructValue + // Uplink ports of the Logical Router. + UplinkPorts []*data.StructValue +} + +func (s *PortConnectionRouter) GetType__() bindings.BindingType { + return PortConnectionRouterBindingType() +} + +func (s *PortConnectionRouter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortConnectionRouter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Tunnel information between two given transport nodes +type PortConnectionTunnel struct { + // Id of the source transport node + SrcNodeId *string + TunnelProperties *TunnelProperties +} + +func (s *PortConnectionTunnel) GetType__() bindings.BindingType { + return PortConnectionTunnelBindingType() +} + +func (s *PortConnectionTunnel) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortConnectionTunnel._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PortMirroringFilter struct { + DstIps *IPAddresses + // Destination port in the form of a port or port range, used to match the destination port of a packet. If not provided, no filtering by destination port is performed. format: port-or-range + DstPorts *string + // Possible values are: + // + // * PortMirroringFilter#PortMirroringFilter_FILTER_ACTION_MIRROR + // * PortMirroringFilter#PortMirroringFilter_FILTER_ACTION_DO_NOT_MIRROR + // + // If set to MIRROR, packets will be mirrored. If set to DO_NOT_MIRROR, packets will not be mirrored. + FilterAction *string + // Possible values are: + // + // * PortMirroringFilter#PortMirroringFilter_IP_PROTOCOL_TCP + // * PortMirroringFilter#PortMirroringFilter_IP_PROTOCOL_UDP + // + // The transport protocols of TCP or UDP, used to match the transport protocol of a packet. If not provided, no filtering by IP protocols is performed. + IpProtocol *string + SrcIps *IPAddresses + // Source port in the form of a port or port range, used to match the source port of a packet. If not provided, no filtering by source port is performed. format: port-or-range + SrcPorts *string +} + +const PortMirroringFilter_FILTER_ACTION_MIRROR = "MIRROR" +const PortMirroringFilter_FILTER_ACTION_DO_NOT_MIRROR = "DO_NOT_MIRROR" +const PortMirroringFilter_IP_PROTOCOL_TCP = "TCP" +const PortMirroringFilter_IP_PROTOCOL_UDP = "UDP" + +func (s *PortMirroringFilter) GetType__() bindings.BindingType { + return PortMirroringFilterBindingType() +} + +func (s *PortMirroringFilter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortMirroringFilter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PortMirroringSession struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * PortMirroringSession#PortMirroringSession_DIRECTION_INGRESS + // * PortMirroringSession#PortMirroringSession_DIRECTION_EGRESS + // * PortMirroringSession#PortMirroringSession_DIRECTION_BIDIRECTIONAL + // + // Port mirroring session direction + Direction *string + // Only for Remote SPAN Port Mirror. format: int64 + EncapsulationVlanId *int64 + MirrorDestination *data.StructValue + // Mirror sources + MirrorSources []*data.StructValue + // An array of 5-tuples used to filter packets for the mirror session, if not provided, all the packets will be mirrored. + PortMirroringFilters []PortMirroringFilter + // Only for Remote SPAN Port Mirror. Whether to preserve original VLAN. + PreserveOriginalVlan *bool + // Possible values are: + // + // * PortMirroringSession#PortMirroringSession_SESSION_TYPE_LOGICALPORTMIRRORSESSION + // * PortMirroringSession#PortMirroringSession_SESSION_TYPE_UPLINKPORTMIRRORSESSION + // * PortMirroringSession#PortMirroringSession_SESSION_TYPE_RSPANSRCMIRRORSESSION + // * PortMirroringSession#PortMirroringSession_SESSION_TYPE_RSPANDSTMIRRORSESSION + // * PortMirroringSession#PortMirroringSession_SESSION_TYPE_LOCALPORTMIRRORSESSION + // * PortMirroringSession#PortMirroringSession_SESSION_TYPE_LOGICALLOCALPORTMIRRORSESSION + // * PortMirroringSession#PortMirroringSession_SESSION_TYPE_L3PORTMIRRORSESSION + // + // If this property is unset, this session will be treated as LocalPortMirrorSession. + SessionType *string + // If this property is set, the packet will be truncated to the provided length. If this property is unset, entire packet will be mirrored. format: int64 + SnapLength *int64 + // Possible values are: + // + // * PortMirroringSession#PortMirroringSession_TCP_IP_STACK_DEFAULT + // * PortMirroringSession#PortMirroringSession_TCP_IP_STACK_MIRROR + // + // If set to mirror, mirror packet will be sent via dedicated mirror stack to destination; If set to default, mirror packet will be sent via default stack; So far, the value mirror can only be chosen in L3PortMirrorSession. + TcpIpStack *string +} + +const PortMirroringSession_DIRECTION_INGRESS = "INGRESS" +const PortMirroringSession_DIRECTION_EGRESS = "EGRESS" +const PortMirroringSession_DIRECTION_BIDIRECTIONAL = "BIDIRECTIONAL" +const PortMirroringSession_SESSION_TYPE_LOGICALPORTMIRRORSESSION = "LogicalPortMirrorSession" +const PortMirroringSession_SESSION_TYPE_UPLINKPORTMIRRORSESSION = "UplinkPortMirrorSession" +const PortMirroringSession_SESSION_TYPE_RSPANSRCMIRRORSESSION = "RspanSrcMirrorSession" +const PortMirroringSession_SESSION_TYPE_RSPANDSTMIRRORSESSION = "RspanDstMirrorSession" +const PortMirroringSession_SESSION_TYPE_LOCALPORTMIRRORSESSION = "LocalPortMirrorSession" +const PortMirroringSession_SESSION_TYPE_LOGICALLOCALPORTMIRRORSESSION = "LogicalLocalPortMirrorSession" +const PortMirroringSession_SESSION_TYPE_L3PORTMIRRORSESSION = "L3PortMirrorSession" +const PortMirroringSession_TCP_IP_STACK_DEFAULT = "Default" +const PortMirroringSession_TCP_IP_STACK_MIRROR = "Mirror" + +func (s *PortMirroringSession) GetType__() bindings.BindingType { + return PortMirroringSessionBindingType() +} + +func (s *PortMirroringSession) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortMirroringSession._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Mirror session queries result +type PortMirroringSessionListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Port mirroring session results + Results []PortMirroringSession +} + +func (s *PortMirroringSessionListResult) GetType__() bindings.BindingType { + return PortMirroringSessionListResultBindingType() +} + +func (s *PortMirroringSessionListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PortMirroringSessionListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Migration spec for a VM group that will be used in post VM group migration step. +type PostVmGroupMigrationSpec struct { + // Flag to indicate whether to re-run the post migrate steps for the VM group if they are already run before. + AllowOverride *bool + // List of instance uuids of VMs that failed to migrate. + FailedVmInstanceIds []string + // Id of the site in NSX-T Federation + FederationSiteId *string + // User defined VM group id that must be unique among all VM groups ids and also should match the group id used in the pre VM group migrate API. + GroupId *string +} + +func (s *PostVmGroupMigrationSpec) GetType__() bindings.BindingType { + return PostVmGroupMigrationSpecBindingType() +} + +func (s *PostVmGroupMigrationSpec) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PostVmGroupMigrationSpec._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Migration spec for a VM group that will be used in pre VM group migration step. +type PreVmGroupMigrationSpec struct { + // Flag to indicate whether to re-run the pre migrate steps for the VM group if they are already run before. + AllowOverride *bool + // Id of the site in NSX-T Federation + FederationSiteId *string + // User defined VM group id that must be unique among all VM groups ids. + GroupId *string + // List of VM instance uuids that can be found in VC inventory. + VmInstanceIds []string +} + +func (s *PreVmGroupMigrationSpec) GetType__() bindings.BindingType { + return PreVmGroupMigrationSpecBindingType() +} + +func (s *PreVmGroupMigrationSpec) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PreVmGroupMigrationSpec._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Parameters for nvds upgrade precheck +type PrecheckParameters struct { + // Cluster ID list for nvds upgrade precheck + ClusterIds []string +} + +func (s *PrecheckParameters) GetType__() bindings.BindingType { + return PrecheckParametersBindingType() +} + +func (s *PrecheckParameters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PrecheckParameters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Tunnel endpoint configuration of preconfigured host switch +type PreconfiguredEndpoint struct { + // Name of the virtual tunnel endpoint + DeviceName *string +} + +func (s *PreconfiguredEndpoint) GetType__() bindings.BindingType { + return PreconfiguredEndpointBindingType() +} + +func (s *PreconfiguredEndpoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PreconfiguredEndpoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Preconfigured host switch is used for manually configured transport node. +type PreconfiguredHostSwitch struct { + // List of virtual tunnel endpoints which are preconfigured on this host switch + Endpoints []PreconfiguredEndpoint + // External Id of the preconfigured host switch. + HostSwitchId *string + // List of TransportZones that are to be associated with specified host switch. + TransportZoneEndpoints []TransportZoneEndPoint +} + +func (s *PreconfiguredHostSwitch) GetType__() bindings.BindingType { + return PreconfiguredHostSwitchBindingType() +} + +func (s *PreconfiguredHostSwitch) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PreconfiguredHostSwitch._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Preconfigured host switch specification is used for manually configured transport node. It is user's responsibility to ensure correct configuration is provided to NSX. This type is only valid for supported KVM fabric nodes. +type PreconfiguredHostSwitchSpec struct { + // Preconfigured Transport Node host switches + HostSwitches []PreconfiguredHostSwitch + // Possible values are: + // + // * HostSwitchSpec#HostSwitchSpec_RESOURCE_TYPE_STANDARDHOSTSWITCHSPEC + // * HostSwitchSpec#HostSwitchSpec_RESOURCE_TYPE_PRECONFIGUREDHOSTSWITCHSPEC + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const PreconfiguredHostSwitchSpec__TYPE_IDENTIFIER = "PreconfiguredHostSwitchSpec" + +func (s *PreconfiguredHostSwitchSpec) GetType__() bindings.BindingType { + return PreconfiguredHostSwitchSpecBindingType() +} + +func (s *PreconfiguredHostSwitchSpec) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PreconfiguredHostSwitchSpec._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PrefixConfig struct { + // Possible values are: + // + // * PrefixConfig#PrefixConfig_ACTION_PERMIT + // * PrefixConfig#PrefixConfig_ACTION_DENY + // + // Action for the IPPrefix + Action *string + // Greater than or equal to format: int64 + Ge *int64 + // Less than or equal to format: int64 + Le *int64 + // If absent, the action applies to all addresses. format: ip-cidr-block + Network *string +} + +const PrefixConfig_ACTION_PERMIT = "PERMIT" +const PrefixConfig_ACTION_DENY = "DENY" + +func (s *PrefixConfig) GetType__() bindings.BindingType { + return PrefixConfigBindingType() +} + +func (s *PrefixConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PrefixConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type Principal struct { + // Attribute list. + Attributes []KeyValue +} + +func (s *Principal) GetType__() bindings.BindingType { + return PrincipalBindingType() +} + +func (s *Principal) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Principal._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PrincipalIdentity struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Id of the stored certificate. When used with the deprecated POST /trust-management/principal-identities API this field is required. + CertificateId *string + // Indicator whether the entities created by this principal should be protected. + IsProtected *bool + // Name of the principal. + Name *string + // Unique node-id of a principal. This is used primarily in the case where a cluster of nodes is used to make calls to the NSX Manager and the same 'name' is used so that the nodes can access and modify the same data while still accessing NSX through their individual secret (certificate or JWT). In all other cases this can be any string. + NodeId *string + // The roles that are associated with this PI. + Role *string +} + +func (s *PrincipalIdentity) GetType__() bindings.BindingType { + return PrincipalIdentityBindingType() +} + +func (s *PrincipalIdentity) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PrincipalIdentity._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// PrincipalIdentity query result +type PrincipalIdentityList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // PrincipalIdentity list. + Results []PrincipalIdentity +} + +func (s *PrincipalIdentityList) GetType__() bindings.BindingType { + return PrincipalIdentityListBindingType() +} + +func (s *PrincipalIdentityList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PrincipalIdentityList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PrincipalIdentityWithCertificate struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Id of the stored certificate. When used with the deprecated POST /trust-management/principal-identities API this field is required. + CertificateId *string + // Indicator whether the entities created by this principal should be protected. + IsProtected *bool + // Name of the principal. + Name *string + // Unique node-id of a principal. This is used primarily in the case where a cluster of nodes is used to make calls to the NSX Manager and the same 'name' is used so that the nodes can access and modify the same data while still accessing NSX through their individual secret (certificate or JWT). In all other cases this can be any string. + NodeId *string + // The roles that are associated with this PI. + Role *string + // PEM encoding of the new certificate. + CertificatePem *string +} + +func (s *PrincipalIdentityWithCertificate) GetType__() bindings.BindingType { + return PrincipalIdentityWithCertificateBindingType() +} + +func (s *PrincipalIdentityWithCertificate) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PrincipalIdentityWithCertificate._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Describes a process detail informaiton. +type ProcessInformation struct { + // Display the command line used to start the process. + Command *string + // The process's share of the elapsed CPU time since the last screen update, expressed as a percentage of total CPU time. + CpuUsage *float64 + // A process's currently used share of available physical memory. + MemoryUsage *float64 + // A negative nice value means higher priority, whereas a positive nice value means lower priority. Zero in this field simply means priority will not be adjusted in determining a process's dispatch-ability. + NiceValue *string + // Display the process id. + ProcessId *string + // The non-swapped physical memoery a task is using. + ResidentMemorySize *float64 + // The amount of shared memory available to a process, not all of which is typically resident. It simply reflects memory that could be potentially shared with other processes. + SharedMemorySize *float64 + // Display the process user. + User *string + // The total amount of virtual memory used by the process. It includes all code, data and shared libraries plus pages that have been swapped out and pages that have been mapped but not used. + VirtualMemorySize *float64 +} + +func (s *ProcessInformation) GetType__() bindings.BindingType { + return ProcessInformationBindingType() +} + +func (s *ProcessInformation) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ProcessInformation._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ProgressItem struct { + // Item description + Description *string + // Name of the item + Name *string + // Finer details, usually there is only one part + Parts []ProgressItemPart +} + +func (s *ProgressItem) GetType__() bindings.BindingType { + return ProgressItemBindingType() +} + +func (s *ProgressItem) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ProgressItem._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ProgressItemPart struct { + // Description of the process + Description *string + // Error message, if ran into error + Error_ *string + // Name of the process + Name *string + // 0 - 100 of the task being completed format: int64 + Percentage *int64 + // Possible values are: + // + // * ProgressItemPart#ProgressItemPart_STATUS_RUNNING + // * ProgressItemPart#ProgressItemPart_STATUS_ERROR + // * ProgressItemPart#ProgressItemPart_STATUS_COMPLETE + // + // Status of this process + Status *string +} + +const ProgressItemPart_STATUS_RUNNING = "RUNNING" +const ProgressItemPart_STATUS_ERROR = "ERROR" +const ProgressItemPart_STATUS_COMPLETE = "COMPLETE" + +func (s *ProgressItemPart) GetType__() bindings.BindingType { + return ProgressItemPartBindingType() +} + +func (s *ProgressItemPart) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ProgressItemPart._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents a label-value pair. +type PropertyItem struct { + // If the condition is met then the property will be displayed. Examples of expression syntax are provided under 'example_request' section of 'CreateWidgetConfiguration' API. + Condition *string + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + // Represents field value of the property. + Field *string + // Set to true if the field is a heading. Default is false. + Heading *bool + Label *Label + // Label value separator used between label and value. It can be any separator like \":\" or \"-\". + LabelValueSeparator *string + // Hyperlink of the specified UI page that provides details. This will be linked with value of the property. + Navigation *string + // Render configuration to be applied, if any. + RenderConfiguration []RenderConfiguration + // Represent the vertical span of the widget / container format: int32 + Rowspan *int64 + // If true, separates this property in a widget. + Separator *bool + // Represent the horizontal span of the widget / container. format: int32 + Span *int64 + // A style object applicable for the property item. It could be the any padding, margin style sheet applicable to the property item. A 'style' property is supported in case of layout 'AUTO' only. + Style *data.StructValue + // Possible values are: + // + // * PropertyItem#PropertyItem_TYPE_STRING + // * PropertyItem#PropertyItem_TYPE_NUMBER + // * PropertyItem#PropertyItem_TYPE_DATE + // * PropertyItem#PropertyItem_TYPE_URL + // + // Data type of the field. + Type_ *string +} + +const PropertyItem_TYPE_STRING = "String" +const PropertyItem_TYPE_NUMBER = "Number" +const PropertyItem_TYPE_DATE = "Date" +const PropertyItem_TYPE_URL = "Url" + +func (s *PropertyItem) GetType__() bindings.BindingType { + return PropertyItemBindingType() +} + +func (s *PropertyItem) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PropertyItem._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type Protocol struct { + // Possible values are: + // + // * Protocol#Protocol_NAME_HTTP + // * Protocol#Protocol_NAME_HTTPS + // * Protocol#Protocol_NAME_SCP + // * Protocol#Protocol_NAME_SFTP + // + // Protocol name + Name string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const Protocol__TYPE_IDENTIFIER = "Protocol" +const Protocol_NAME_HTTP = "http" +const Protocol_NAME_HTTPS = "https" +const Protocol_NAME_SCP = "scp" +const Protocol_NAME_SFTP = "sftp" + +func (s *Protocol) GetType__() bindings.BindingType { + return ProtocolBindingType() +} + +func (s *Protocol) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Protocol._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// TLS protocol version +type ProtocolVersion struct { + // Enable status for this protocol version + Enabled *bool + // Name of the TLS protocol version + Name *string +} + +func (s *ProtocolVersion) GetType__() bindings.BindingType { + return ProtocolVersionBindingType() +} + +func (s *ProtocolVersion) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ProtocolVersion._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Type to define the Proxy configuration. +type Proxy struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Flag to indicate if proxy is enabled. When set to true, a scheme, host and port must be provided. + Enabled *bool + // Specify the fully qualified domain name, or ip address, of the proxy server. format: hostname-or-ip + Host *string + // Specify the password used to authenticate with the proxy server, if required. + Password *string + // Specify the port of the proxy server. format: int32 + Port *int64 + // Possible values are: + // + // * Proxy#Proxy_SCHEME_HTTP + // * Proxy#Proxy_SCHEME_HTTPS + // + // The scheme accepted by the proxy server. Specify one of HTTP and HTTPS. + Scheme *string + // Specify the user name used to authenticate with the proxy server, if required. + Username *string +} + +const Proxy_SCHEME_HTTP = "HTTP" +const Proxy_SCHEME_HTTPS = "HTTPS" + +func (s *Proxy) GetType__() bindings.BindingType { + return ProxyBindingType() +} + +func (s *Proxy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Proxy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Parameters needed to specify a PKCE OAuth2 client. +type PublicClientInfo struct { + // Protocol and domain name (or IP address) of CSP, for e.g., https://console.cloud.vmware.com. + BaseUrl *string + // The client-id to use with CSP, identified with base_url. + ClientId *string + // The org id for this client-id, typically a UUID. + DefaultOrgId *string + // The symbolic org id for enterprise admins. + EaOrgId *string + // The symbolic org id for GSS (Global Support Services). + GssOrgId *string + // The set of redirect URI's configured for this client_id. + RedirectUris []string + // The symbolic org id SRE (Site Reliability Engineer). + SreOrgId *string +} + +func (s *PublicClientInfo) GetType__() bindings.BindingType { + return PublicClientInfoBindingType() +} + +func (s *PublicClientInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PublicClientInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type PublicCloudGatewayNode struct { + // List of logical router ids to which this edge node is allocated. + AllocationList []string + DeploymentConfig *EdgeNodeDeploymentConfig + // Possible values are: + // + // * EdgeNode#EdgeNode_DEPLOYMENT_TYPE_VIRTUAL_MACHINE + // * EdgeNode#EdgeNode_DEPLOYMENT_TYPE_PHYSICAL_MACHINE + // * EdgeNode#EdgeNode_DEPLOYMENT_TYPE_UNKNOWN + // + // Supported edge deployment type. + DeploymentType *string + NodeSettings *EdgeNodeSettings + // This field is deprecated. TransportNode field 'description' must be used instead. For EdgeNode and PublicCloudGatewayNode, this field is ignored if specified in request payload. + Description *string + // Discovered IP Addresses of the fabric node, version 4 or 6 format: ip + DiscoveredIpAddresses []string + // This field is deprecated. TransportNode field 'display_name' must be used instead. For HostNode, this field defaults to ID if not set. For EdgeNode and PublicCloudGatewayNode, this field is ignored if specified in request payload. + DisplayName *string + // ID of the Node maintained on the Node and used to recognize the Node + ExternalId *string + // Fully qualified domain name of the fabric node + Fqdn *string + // Unique identifier of this resource. + Id *string + // IP Addresses of the Node, version 4 or 6. This property is mandatory for all nodes except for automatic deployment of edge virtual machine node. For automatic deployment, the ip address from management_port_subnets property will be considered. format: ip + IpAddresses []string + // Fabric node type, for example 'HostNode', 'EdgeNode' or 'PublicCloudGatewayNode' + ResourceType string + // This field is deprecated. TransportNode field 'tags' must be used instead. For EdgeNode and PublicCloudGatewayNode, this field is ignored if specified in request payload. + Tags []Tag +} + +func (s *PublicCloudGatewayNode) GetType__() bindings.BindingType { + return PublicCloudGatewayNodeBindingType() +} + +func (s *PublicCloudGatewayNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for PublicCloudGatewayNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A shaper configuration entry that specifies type and metrics +type QosBaseRateShaper struct { + Enabled *bool + // Possible values are: + // + // * QosBaseRateShaper#QosBaseRateShaper_RESOURCE_TYPE_INGRESSRATESHAPER + // * QosBaseRateShaper#QosBaseRateShaper_RESOURCE_TYPE_INGRESSBROADCASTRATESHAPER + // * QosBaseRateShaper#QosBaseRateShaper_RESOURCE_TYPE_EGRESSRATESHAPER + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const QosBaseRateShaper__TYPE_IDENTIFIER = "QosBaseRateShaper" +const QosBaseRateShaper_RESOURCE_TYPE_INGRESSRATESHAPER = "IngressRateShaper" +const QosBaseRateShaper_RESOURCE_TYPE_INGRESSBROADCASTRATESHAPER = "IngressBroadcastRateShaper" +const QosBaseRateShaper_RESOURCE_TYPE_EGRESSRATESHAPER = "EgressRateShaper" + +func (s *QosBaseRateShaper) GetType__() bindings.BindingType { + return QosBaseRateShaperBindingType() +} + +func (s *QosBaseRateShaper) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for QosBaseRateShaper._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type QosSwitchingProfile struct { + // Class of service format: int32 + ClassOfService *int64 + Dscp *Dscp + ShaperConfiguration []*data.StructValue + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + RequiredCapabilities []string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const QosSwitchingProfile__TYPE_IDENTIFIER = "QosSwitchingProfile" + +func (s *QosSwitchingProfile) GetType__() bindings.BindingType { + return QosSwitchingProfileBindingType() +} + +func (s *QosSwitchingProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for QosSwitchingProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type RAConfig struct { + // The maximum number of hops through which packets can pass before being discarded. format: int64 + HopLimit *int64 + // The time interval in seconds, in which the prefix is advertised as valid. format: int64 + PrefixLifetime *int64 + // The time interval in seconds, in which the prefix is advertised as preferred. format: int64 + PrefixPreferredTime *int64 + // Interval between 2 Router advertisement in seconds. format: int64 + RaInterval *int64 + // Router lifetime value in seconds. A value of 0 indicates the router is not a default router for the receiving end. Any other value in this field specifies the lifetime, in seconds, associated with this router as a default router. format: int64 + RouterLifetime *int64 + // Possible values are: + // + // * RAConfig#RAConfig_ROUTER_PREFERENCE_LOW + // * RAConfig#RAConfig_ROUTER_PREFERENCE_MEDIUM + // * RAConfig#RAConfig_ROUTER_PREFERENCE_HIGH + // * RAConfig#RAConfig_ROUTER_PREFERENCE_RESERVED + // + // NDRA Router preference value with MEDIUM as default. If the router_lifetime is 0, the preference must be set to MEDIUM. + RouterPreference *string +} + +const RAConfig_ROUTER_PREFERENCE_LOW = "LOW" +const RAConfig_ROUTER_PREFERENCE_MEDIUM = "MEDIUM" +const RAConfig_ROUTER_PREFERENCE_HIGH = "HIGH" +const RAConfig_ROUTER_PREFERENCE_RESERVED = "RESERVED" + +func (s *RAConfig) GetType__() bindings.BindingType { + return RAConfigBindingType() +} + +func (s *RAConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RAConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type RaDNSConfig struct { + // DNS server. format: ipv6 + DnsServer []string + // Lifetime of DNS server in milliseconds format: int64 + DnsServerLifetime *int64 + // Domain name in RA message. + DomainName []string + // Lifetime of Domain names in milliseconds format: int64 + DomainNameLifetime *int64 +} + +func (s *RaDNSConfig) GetType__() bindings.BindingType { + return RaDNSConfigBindingType() +} + +func (s *RaDNSConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RaDNSConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Enables traffic limit for incoming/outgoing broadcast and multicast packets. Use 0 to disable rate limiting for a specific traffic type +type RateLimits struct { + // Whether rate limiting is enabled + Enabled *bool + // Incoming broadcast traffic limit in packets per second format: int32 + RxBroadcast *int64 + // Incoming multicast traffic limit in packets per second format: int32 + RxMulticast *int64 + // Outgoing broadcast traffic limit in packets per second format: int32 + TxBroadcast *int64 + // Outgoing multicast traffic limit in packets per second format: int32 + TxMulticast *int64 +} + +func (s *RateLimits) GetType__() bindings.BindingType { + return RateLimitsBindingType() +} + +func (s *RateLimits) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RateLimits._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The configuration data for setting the global realization state barrier +type RealizationStateBarrierConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // The interval in milliseconds used for auto incrementing the barrier number format: int64 + Interval *int64 +} + +func (s *RealizationStateBarrierConfig) GetType__() bindings.BindingType { + return RealizationStateBarrierConfigBindingType() +} + +func (s *RealizationStateBarrierConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RealizationStateBarrierConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Recommended Feature Permission +type RecommendedFeaturePermission struct { + // Permission + RecommendedPermissions []string + // List of source features + SrcFeatures []string + // Feature + TargetFeature *string +} + +func (s *RecommendedFeaturePermission) GetType__() bindings.BindingType { + return RecommendedFeaturePermissionBindingType() +} + +func (s *RecommendedFeaturePermission) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RecommendedFeaturePermission._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type RecommendedFeaturePermissionListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List results + Results []RecommendedFeaturePermission +} + +func (s *RecommendedFeaturePermissionListResult) GetType__() bindings.BindingType { + return RecommendedFeaturePermissionListResultBindingType() +} + +func (s *RecommendedFeaturePermissionListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RecommendedFeaturePermissionListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type RedistributionConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Flag to enable redistribution for BGP as destination protocol + BgpEnabled *bool + // Logical router id + LogicalRouterId *string +} + +func (s *RedistributionConfig) GetType__() bindings.BindingType { + return RedistributionConfigBindingType() +} + +func (s *RedistributionConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RedistributionConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type RedistributionRule struct { + // Possible values are: + // + // * RedistributionRule#RedistributionRule_ADDRESS_FAMILY_IPV4 + // * RedistributionRule#RedistributionRule_ADDRESS_FAMILY_IPV6 + // * RedistributionRule#RedistributionRule_ADDRESS_FAMILY_IPV4_AND_IPV6 + // + // Address family for Route Redistribution + AddressFamily *string + // Description + Description *string + // Possible values are: + // + // * RedistributionRule#RedistributionRule_DESTINATION_STATIC + // * RedistributionRule#RedistributionRule_DESTINATION_T0_STATIC + // * RedistributionRule#RedistributionRule_DESTINATION_NSX_CONNECTED + // * RedistributionRule#RedistributionRule_DESTINATION_T0_CONNECTED + // * RedistributionRule#RedistributionRule_DESTINATION_NSX_STATIC + // * RedistributionRule#RedistributionRule_DESTINATION_T1_STATIC + // * RedistributionRule#RedistributionRule_DESTINATION_T0_UPLINK + // * RedistributionRule#RedistributionRule_DESTINATION_T0_DOWNLINK + // * RedistributionRule#RedistributionRule_DESTINATION_T0_ROUTER_LINK + // * RedistributionRule#RedistributionRule_DESTINATION_T0_CSP + // * RedistributionRule#RedistributionRule_DESTINATION_T0_LOOPBACK + // * RedistributionRule#RedistributionRule_DESTINATION_T0_DNS_FORWARDER_IP + // * RedistributionRule#RedistributionRule_DESTINATION_T0_IPSEC_LOCAL_IP + // * RedistributionRule#RedistributionRule_DESTINATION_TIER0_NAT + // * RedistributionRule#RedistributionRule_DESTINATION_T0_NAT + // * RedistributionRule#RedistributionRule_DESTINATION_TIER1_NAT + // * RedistributionRule#RedistributionRule_DESTINATION_T1_NAT + // * RedistributionRule#RedistributionRule_DESTINATION_TIER1_LB_VIP + // * RedistributionRule#RedistributionRule_DESTINATION_T1_LB_VIP + // * RedistributionRule#RedistributionRule_DESTINATION_TIER1_LB_SNAT + // * RedistributionRule#RedistributionRule_DESTINATION_T1_LB_SNAT + // * RedistributionRule#RedistributionRule_DESTINATION_T1_DNS_FORWARDER_IP + // * RedistributionRule#RedistributionRule_DESTINATION_T1_CONNECTED + // * RedistributionRule#RedistributionRule_DESTINATION_T1_DOWNLINK + // * RedistributionRule#RedistributionRule_DESTINATION_T1_CSP + // * RedistributionRule#RedistributionRule_DESTINATION_BGP + // * RedistributionRule#RedistributionRule_DESTINATION_T1_IPSEC_LOCAL_IP + // * RedistributionRule#RedistributionRule_DESTINATION_T0_EVPN_TEP_IP + // + // Destination redistribution protocol + Destination *string + // Display name + DisplayName *string + // RouteMap Id for the filter + RouteMapId *string + // Possible values are: + // + // * RedistributionRule#RedistributionRule_SOURCES_STATIC + // * RedistributionRule#RedistributionRule_SOURCES_T0_STATIC + // * RedistributionRule#RedistributionRule_SOURCES_NSX_CONNECTED + // * RedistributionRule#RedistributionRule_SOURCES_T0_CONNECTED + // * RedistributionRule#RedistributionRule_SOURCES_NSX_STATIC + // * RedistributionRule#RedistributionRule_SOURCES_T1_STATIC + // * RedistributionRule#RedistributionRule_SOURCES_T0_UPLINK + // * RedistributionRule#RedistributionRule_SOURCES_T0_DOWNLINK + // * RedistributionRule#RedistributionRule_SOURCES_T0_ROUTER_LINK + // * RedistributionRule#RedistributionRule_SOURCES_T0_CSP + // * RedistributionRule#RedistributionRule_SOURCES_T0_LOOPBACK + // * RedistributionRule#RedistributionRule_SOURCES_T0_DNS_FORWARDER_IP + // * RedistributionRule#RedistributionRule_SOURCES_T0_IPSEC_LOCAL_IP + // * RedistributionRule#RedistributionRule_SOURCES_TIER0_NAT + // * RedistributionRule#RedistributionRule_SOURCES_T0_NAT + // * RedistributionRule#RedistributionRule_SOURCES_TIER1_NAT + // * RedistributionRule#RedistributionRule_SOURCES_T1_NAT + // * RedistributionRule#RedistributionRule_SOURCES_TIER1_LB_VIP + // * RedistributionRule#RedistributionRule_SOURCES_T1_LB_VIP + // * RedistributionRule#RedistributionRule_SOURCES_TIER1_LB_SNAT + // * RedistributionRule#RedistributionRule_SOURCES_T1_LB_SNAT + // * RedistributionRule#RedistributionRule_SOURCES_T1_DNS_FORWARDER_IP + // * RedistributionRule#RedistributionRule_SOURCES_T1_CONNECTED + // * RedistributionRule#RedistributionRule_SOURCES_T1_DOWNLINK + // * RedistributionRule#RedistributionRule_SOURCES_T1_CSP + // * RedistributionRule#RedistributionRule_SOURCES_BGP + // * RedistributionRule#RedistributionRule_SOURCES_T1_IPSEC_LOCAL_IP + // * RedistributionRule#RedistributionRule_SOURCES_T0_EVPN_TEP_IP + // + // Array of redistribution protocols + Sources []string +} + +const RedistributionRule_ADDRESS_FAMILY_IPV4 = "IPV4" +const RedistributionRule_ADDRESS_FAMILY_IPV6 = "IPV6" +const RedistributionRule_ADDRESS_FAMILY_IPV4_AND_IPV6 = "IPV4_AND_IPV6" +const RedistributionRule_DESTINATION_STATIC = "STATIC" +const RedistributionRule_DESTINATION_T0_STATIC = "T0_STATIC" +const RedistributionRule_DESTINATION_NSX_CONNECTED = "NSX_CONNECTED" +const RedistributionRule_DESTINATION_T0_CONNECTED = "T0_CONNECTED" +const RedistributionRule_DESTINATION_NSX_STATIC = "NSX_STATIC" +const RedistributionRule_DESTINATION_T1_STATIC = "T1_STATIC" +const RedistributionRule_DESTINATION_T0_UPLINK = "T0_UPLINK" +const RedistributionRule_DESTINATION_T0_DOWNLINK = "T0_DOWNLINK" +const RedistributionRule_DESTINATION_T0_ROUTER_LINK = "T0_ROUTER_LINK" +const RedistributionRule_DESTINATION_T0_CSP = "T0_CSP" +const RedistributionRule_DESTINATION_T0_LOOPBACK = "T0_LOOPBACK" +const RedistributionRule_DESTINATION_T0_DNS_FORWARDER_IP = "T0_DNS_FORWARDER_IP" +const RedistributionRule_DESTINATION_T0_IPSEC_LOCAL_IP = "T0_IPSEC_LOCAL_IP" +const RedistributionRule_DESTINATION_TIER0_NAT = "TIER0_NAT" +const RedistributionRule_DESTINATION_T0_NAT = "T0_NAT" +const RedistributionRule_DESTINATION_TIER1_NAT = "TIER1_NAT" +const RedistributionRule_DESTINATION_T1_NAT = "T1_NAT" +const RedistributionRule_DESTINATION_TIER1_LB_VIP = "TIER1_LB_VIP" +const RedistributionRule_DESTINATION_T1_LB_VIP = "T1_LB_VIP" +const RedistributionRule_DESTINATION_TIER1_LB_SNAT = "TIER1_LB_SNAT" +const RedistributionRule_DESTINATION_T1_LB_SNAT = "T1_LB_SNAT" +const RedistributionRule_DESTINATION_T1_DNS_FORWARDER_IP = "T1_DNS_FORWARDER_IP" +const RedistributionRule_DESTINATION_T1_CONNECTED = "T1_CONNECTED" +const RedistributionRule_DESTINATION_T1_DOWNLINK = "T1_DOWNLINK" +const RedistributionRule_DESTINATION_T1_CSP = "T1_CSP" +const RedistributionRule_DESTINATION_BGP = "BGP" +const RedistributionRule_DESTINATION_T1_IPSEC_LOCAL_IP = "T1_IPSEC_LOCAL_IP" +const RedistributionRule_DESTINATION_T0_EVPN_TEP_IP = "T0_EVPN_TEP_IP" +const RedistributionRule_SOURCES_STATIC = "STATIC" +const RedistributionRule_SOURCES_T0_STATIC = "T0_STATIC" +const RedistributionRule_SOURCES_NSX_CONNECTED = "NSX_CONNECTED" +const RedistributionRule_SOURCES_T0_CONNECTED = "T0_CONNECTED" +const RedistributionRule_SOURCES_NSX_STATIC = "NSX_STATIC" +const RedistributionRule_SOURCES_T1_STATIC = "T1_STATIC" +const RedistributionRule_SOURCES_T0_UPLINK = "T0_UPLINK" +const RedistributionRule_SOURCES_T0_DOWNLINK = "T0_DOWNLINK" +const RedistributionRule_SOURCES_T0_ROUTER_LINK = "T0_ROUTER_LINK" +const RedistributionRule_SOURCES_T0_CSP = "T0_CSP" +const RedistributionRule_SOURCES_T0_LOOPBACK = "T0_LOOPBACK" +const RedistributionRule_SOURCES_T0_DNS_FORWARDER_IP = "T0_DNS_FORWARDER_IP" +const RedistributionRule_SOURCES_T0_IPSEC_LOCAL_IP = "T0_IPSEC_LOCAL_IP" +const RedistributionRule_SOURCES_TIER0_NAT = "TIER0_NAT" +const RedistributionRule_SOURCES_T0_NAT = "T0_NAT" +const RedistributionRule_SOURCES_TIER1_NAT = "TIER1_NAT" +const RedistributionRule_SOURCES_T1_NAT = "T1_NAT" +const RedistributionRule_SOURCES_TIER1_LB_VIP = "TIER1_LB_VIP" +const RedistributionRule_SOURCES_T1_LB_VIP = "T1_LB_VIP" +const RedistributionRule_SOURCES_TIER1_LB_SNAT = "TIER1_LB_SNAT" +const RedistributionRule_SOURCES_T1_LB_SNAT = "T1_LB_SNAT" +const RedistributionRule_SOURCES_T1_DNS_FORWARDER_IP = "T1_DNS_FORWARDER_IP" +const RedistributionRule_SOURCES_T1_CONNECTED = "T1_CONNECTED" +const RedistributionRule_SOURCES_T1_DOWNLINK = "T1_DOWNLINK" +const RedistributionRule_SOURCES_T1_CSP = "T1_CSP" +const RedistributionRule_SOURCES_BGP = "BGP" +const RedistributionRule_SOURCES_T1_IPSEC_LOCAL_IP = "T1_IPSEC_LOCAL_IP" +const RedistributionRule_SOURCES_T0_EVPN_TEP_IP = "T0_EVPN_TEP_IP" + +func (s *RedistributionRule) GetType__() bindings.BindingType { + return RedistributionRuleBindingType() +} + +func (s *RedistributionRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RedistributionRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type RedistributionRuleList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Logical router id + LogicalRouterId *string + // List of redistribution rules. User needs to re-order rules to change the priority. + Rules []RedistributionRule +} + +func (s *RedistributionRuleList) GetType__() bindings.BindingType { + return RedistributionRuleListBindingType() +} + +func (s *RedistributionRuleList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RedistributionRuleList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Appliance registration access token +type RegistrationToken struct { + // List results + Roles []string + // Access token + Token *string + // User delegated by token + User *string +} + +func (s *RegistrationToken) GetType__() bindings.BindingType { + return RegistrationTokenBindingType() +} + +func (s *RegistrationToken) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RegistrationToken._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Detailed information about a related API error +type RelatedApiError struct { + // Further details about the error + Details *string + // A numeric error code format: int64 + ErrorCode *int64 + // Additional data about the error + ErrorData *data.StructValue + // A description of the error + ErrorMessage *string + // The module name where the error occurred + ModuleName *string +} + +func (s *RelatedApiError) GetType__() bindings.BindingType { + return RelatedApiErrorBindingType() +} + +func (s *RelatedApiError) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RelatedApiError._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type RemainingSupportBundleNode struct { + // Display name of node + NodeDisplayName *string + // UUID of node + NodeId *string + // Possible values are: + // + // * RemainingSupportBundleNode#RemainingSupportBundleNode_STATUS_PENDING + // * RemainingSupportBundleNode#RemainingSupportBundleNode_STATUS_PROCESSING + // + // Status of node + Status *string +} + +const RemainingSupportBundleNode_STATUS_PENDING = "PENDING" +const RemainingSupportBundleNode_STATUS_PROCESSING = "PROCESSING" + +func (s *RemainingSupportBundleNode) GetType__() bindings.BindingType { + return RemainingSupportBundleNodeBindingType() +} + +func (s *RemainingSupportBundleNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RemainingSupportBundleNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// URL of remote bundle which needs to be uploaded. +type RemoteBundleUrl struct { + // URL for uploading remote bundle + Url *string +} + +func (s *RemoteBundleUrl) GetType__() bindings.BindingType { + return RemoteBundleUrlBindingType() +} + +func (s *RemoteBundleUrl) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RemoteBundleUrl._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Remote file server +type RemoteFileServer struct { + // Remote server directory to copy bundle files to + DirectoryPath *string + // Server port format: int64 + Port *int64 + Protocol *FileTransferProtocol + // Remote server hostname or IP address format: hostname-or-ip + Server *string +} + +func (s *RemoteFileServer) GetType__() bindings.BindingType { + return RemoteFileServerBindingType() +} + +func (s *RemoteFileServer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RemoteFileServer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Remote server +type RemoteServerFingerprint struct { + // Server port format: int64 + Port *int64 + // Remote server hostname or IP address format: hostname-or-ip + Server *string + // SSH fingerprint of server + SshFingerprint *string +} + +func (s *RemoteServerFingerprint) GetType__() bindings.BindingType { + return RemoteServerFingerprintBindingType() +} + +func (s *RemoteServerFingerprint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RemoteServerFingerprint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Remote server +type RemoteServerFingerprintRequest struct { + // Server port format: int64 + Port *int64 + // Remote server hostname or IP address format: hostname-or-ip + Server *string +} + +func (s *RemoteServerFingerprintRequest) GetType__() bindings.BindingType { + return RemoteServerFingerprintRequestBindingType() +} + +func (s *RemoteServerFingerprintRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RemoteServerFingerprintRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type RemoteSiteCompatibilityInfo struct { + // are the 2 sites compatible + IsCompatible *bool + LocalSite *SiteCompatibilityInfo + RemoteSite *SiteCompatibilityInfo +} + +func (s *RemoteSiteCompatibilityInfo) GetType__() bindings.BindingType { + return RemoteSiteCompatibilityInfoBindingType() +} + +func (s *RemoteSiteCompatibilityInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RemoteSiteCompatibilityInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Contains the information needed to communicate with another site. +type RemoteSiteCredential struct { + // Address of the site (IPv4:port) + Address *string + // Password of the site + Password *string + // Sha256 thumbprint of API certificate of the remote site + Thumbprint *string + // Username of the site + Username *string +} + +func (s *RemoteSiteCredential) GetType__() bindings.BindingType { + return RemoteSiteCredentialBindingType() +} + +func (s *RemoteSiteCredential) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RemoteSiteCredential._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Remote tunnel endpoint +type RemoteTunnelEndpoint struct { + // Gateway IP format: ip + DefaultGateway *string + // Name of the virtual tunnel endpoint + DeviceName *string + // Depending upon the EndpointIpConfig used in HostSwitch, IP could be allocated either from DHCP (default) or from Static IP Pool. format: ip + Ip *string + // Unique label for this Endpoint format: int32 + Label *int64 + // MAC address format: mac-address + Mac *string + // Subnet mask format: ip + SubnetMask *string + // Vlan id format: int64 + Vlan *int64 +} + +func (s *RemoteTunnelEndpoint) GetType__() bindings.BindingType { + return RemoteTunnelEndpointBindingType() +} + +func (s *RemoteTunnelEndpoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RemoteTunnelEndpoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Remote tunnel endpoint configuration state +type RemoteTunnelEndpointConfigState struct { + // List of remote tunnel endpoints which are configured on this node + Endpoints []RemoteTunnelEndpoint +} + +func (s *RemoteTunnelEndpointConfigState) GetType__() bindings.BindingType { + return RemoteTunnelEndpointConfigStateBindingType() +} + +func (s *RemoteTunnelEndpointConfigState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RemoteTunnelEndpointConfigState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type RemoteTunnelStatistics struct { + Rx *InterSitePortCounters + // Ip address of remote tunnel destination. format: ip + TunnelDestinationAddress *string + // Ip address of remote tunnel source. format: ip + TunnelSourceAddress *string + Tx *InterSitePortCounters +} + +func (s *RemoteTunnelStatistics) GetType__() bindings.BindingType { + return RemoteTunnelStatisticsBindingType() +} + +func (s *RemoteTunnelStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RemoteTunnelStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type RemoteTunnelStatisticsPerSite struct { + RemoteSite *ResourceReference + Rx *InterSitePortCounters + // Statistics per remote tunnel. + StatsPerTunnel []RemoteTunnelStatistics + Tx *InterSitePortCounters +} + +func (s *RemoteTunnelStatisticsPerSite) GetType__() bindings.BindingType { + return RemoteTunnelStatisticsPerSiteBindingType() +} + +func (s *RemoteTunnelStatisticsPerSite) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RemoteTunnelStatisticsPerSite._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Render configuration to be applied to the widget. +type RenderConfiguration struct { + // The color to use when rendering an entity. For example, set color as 'RED' to render a portion of donut in red. + Color *string + // If the condition is met then the rendering specified for the condition will be applied. Examples of expression syntax are provided under 'example_request' section of 'CreateWidgetConfiguration' API. + Condition *string + // If specified, overrides the field value. This can be used to display a meaningful value in situations where field value is not available or not configured. + DisplayValue *string + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Multi-line text to be shown on tooltip while hovering over the UI element if the condition is met. + Tooltip []Tooltip +} + +func (s *RenderConfiguration) GetType__() bindings.BindingType { + return RenderConfigurationBindingType() +} + +func (s *RenderConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RenderConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ReorderMigrationRequest struct { + // id of the migration unit group/migration unit before/after which the migration unit group/migration unit is to be placed + Id *string + // flag indicating whether the migration unit group/migration unit is to be placed before or after the specified migration unit group/migration unit + IsBefore *bool +} + +func (s *ReorderMigrationRequest) GetType__() bindings.BindingType { + return ReorderMigrationRequestBindingType() +} + +func (s *ReorderMigrationRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ReorderMigrationRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ReorderRequest struct { + // id of the upgrade unit group/upgrade unit before/after which the upgrade unit group/upgrade unit is to be placed + Id *string + // flag indicating whether the upgrade unit group/upgrade unit is to be placed before or after the specified upgrade unit group/upgrade unit + IsBefore *bool +} + +func (s *ReorderRequest) GetType__() bindings.BindingType { + return ReorderRequestBindingType() +} + +func (s *ReorderRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ReorderRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type RepoSyncStatusReport struct { + // In case of repo sync related failure, the code for the error will be stored here. format: int64 + FailureCode *int64 + // In case if repo sync fails due to some issue, an error message will be stored here. + FailureMessage *string + // Possible values are: + // + // * RepoSyncStatusReport#RepoSyncStatusReport_STATUS_NOT_STARTED + // * RepoSyncStatusReport#RepoSyncStatusReport_STATUS_IN_PROGRESS + // * RepoSyncStatusReport#RepoSyncStatusReport_STATUS_FAILED + // * RepoSyncStatusReport#RepoSyncStatusReport_STATUS_SUCCESS + // + // Status of the repo sync operation on the single nsx-manager + Status *string + // Describes the steps which repo sync operation is performing currently. + StatusMessage *string +} + +const RepoSyncStatusReport_STATUS_NOT_STARTED = "NOT_STARTED" +const RepoSyncStatusReport_STATUS_IN_PROGRESS = "IN_PROGRESS" +const RepoSyncStatusReport_STATUS_FAILED = "FAILED" +const RepoSyncStatusReport_STATUS_SUCCESS = "SUCCESS" + +func (s *RepoSyncStatusReport) GetType__() bindings.BindingType { + return RepoSyncStatusReportBindingType() +} + +func (s *RepoSyncStatusReport) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RepoSyncStatusReport._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// CPU and Memory resource configuration is defined per Edge VM form factor. These resources are reserved 100 percent by default with Normal VM importance. Resource reservation tuning provides a means to optimize resource utilization and workaround hard resource limits. This solution should be used as a temporary workaround. It is recommended to add more resources to the compute cluster and change the reservation back to 100 percent for optimal performance. +type ReservationInfo struct { + CpuReservation *CPUReservation + MemoryReservation *MemoryReservation +} + +func (s *ReservationInfo) GetType__() bindings.BindingType { + return ReservationInfoBindingType() +} + +func (s *ReservationInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ReservationInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ResetNodeUserOwnPasswordProperties struct { + // If the old_password is not given, a 400 BAD REQUEST is returned with an error message. + OldPassword *string + // The new password for user + Password *string +} + +func (s *ResetNodeUserOwnPasswordProperties) GetType__() bindings.BindingType { + return ResetNodeUserOwnPasswordPropertiesBindingType() +} + +func (s *ResetNodeUserOwnPasswordProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ResetNodeUserOwnPasswordProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Base class for resources +type Resource struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink +} + +func (s *Resource) GetType__() bindings.BindingType { + return ResourceBindingType() +} + +func (s *Resource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Resource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Specify limit, shares and reservation for all kinds of traffic. Values for limit and reservation are expressed in percentage. And for shares, the value is expressed as a number between 1-100. The overall reservation among all traffic types should not exceed 75%. Otherwise, the API request will be rejected. +type ResourceAllocation struct { + // The limit property specifies the maximum bandwidth allocation for a given traffic type and is expressed in percentage. The default value for this field is set to -1 which means the traffic is unbounded for the traffic type. All other negative values for this property is not supported and will be rejected by the API. + Limit *float64 + // Minimum guaranteed bandwidth percentage + Reservation *float64 + // Shares format: int32 + Shares *int64 + TrafficType *HostInfraTrafficType +} + +func (s *ResourceAllocation) GetType__() bindings.BindingType { + return ResourceAllocationBindingType() +} + +func (s *ResourceAllocation) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ResourceAllocation._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Amount of memory and CPU allocated to the Edge VM. +type ResourceAssignment struct { + // CPU count. format: int32 + CpuCount *int64 + // Memory allocation in MB. format: int32 + MemoryAllocationInMb *int64 +} + +func (s *ResourceAssignment) GetType__() bindings.BindingType { + return ResourceAssignmentBindingType() +} + +func (s *ResourceAssignment) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ResourceAssignment._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A link to a related resource +type ResourceLink struct { + // Optional action + Action *string + // Link to resource + Href *string + // Custom relation type (follows RFC 5988 where appropriate definitions exist) + Rel *string +} + +func (s *ResourceLink) GetType__() bindings.BindingType { + return ResourceLinkBindingType() +} + +func (s *ResourceLink) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ResourceLink._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A weak reference to an NSX resource. +type ResourceReference struct { + // Will be set to false if the referenced NSX resource has been deleted. + IsValid *bool + // Display name of the NSX resource. + TargetDisplayName *string + // Identifier of the NSX resource. + TargetId *string + // Type of the NSX resource. + TargetType *string +} + +func (s *ResourceReference) GetType__() bindings.BindingType { + return ResourceReferenceBindingType() +} + +func (s *ResourceReference) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ResourceReference._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Configuration where backup files are stored for restore +type RestoreConfiguration struct { + // Passphrase used to encrypt backup files. + Passphrase *string + RemoteFileServer *RemoteFileServer +} + +func (s *RestoreConfiguration) GetType__() bindings.BindingType { + return RestoreConfigurationBindingType() +} + +func (s *RestoreConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RestoreConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Restore step info +type RestoreStep struct { + // Restore step description + Description *string + Status *PerStepRestoreStatus + // Restore step number format: int64 + StepNumber *int64 + // Restore step value + Value *string +} + +func (s *RestoreStep) GetType__() bindings.BindingType { + return RestoreStepBindingType() +} + +func (s *RestoreStep) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RestoreStep._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A base class for types that track revisions +type RevisionedResource struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 +} + +func (s *RevisionedResource) GetType__() bindings.BindingType { + return RevisionedResourceBindingType() +} + +func (s *RevisionedResource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RevisionedResource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Role +type Role struct { + // Short identifier for the role. Must be all lower case with no spaces. + Role *string + // A short, human-friendly display name of the role. + RoleDisplayName *string +} + +func (s *Role) GetType__() bindings.BindingType { + return RoleBindingType() +} + +func (s *Role) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Role._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// User/Group's role binding +type RoleBinding struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The ID of the external identity source that holds the referenced external entity. Currently, only external LDAP and OIDC servers are allowed. + IdentitySourceId *string + // Possible values are: + // + // * RoleBinding#RoleBinding_IDENTITY_SOURCE_TYPE_VIDM + // * RoleBinding#RoleBinding_IDENTITY_SOURCE_TYPE_LDAP + // * RoleBinding#RoleBinding_IDENTITY_SOURCE_TYPE_OIDC + // + // Identity source type + IdentitySourceType *string + // User/Group's name + Name *string + // The roles of the user. + Roles []Role + // Possible values are: + // + // * RoleBinding#RoleBinding_STALE_TRUE + // * RoleBinding#RoleBinding_STALE_FALSE + // * RoleBinding#RoleBinding_STALE_UNKNOWN + // + // Property 'stale' can be considered to have these values - absent - This type of rolebinding does not support stale property TRUE - Rolebinding is stale in vIDM meaning the user is no longer present in vIDM FALSE - Rolebinding is available in vIDM UNKNOWN - Rolebinding's state of staleness in unknown Once rolebindings become stale, they can be deleted using the API POST /aaa/role-bindings?action=delete_stale_bindings + Stale *string + // Possible values are: + // + // * RoleBinding#RoleBinding_TYPE_REMOTE_USER + // * RoleBinding#RoleBinding_TYPE_REMOTE_GROUP + // * RoleBinding#RoleBinding_TYPE_LOCAL_USER + // * RoleBinding#RoleBinding_TYPE_PRINCIPAL_IDENTITY + // + // Type + Type_ *string + // Local user's numeric id on the system. + UserId *string +} + +const RoleBinding_IDENTITY_SOURCE_TYPE_VIDM = "VIDM" +const RoleBinding_IDENTITY_SOURCE_TYPE_LDAP = "LDAP" +const RoleBinding_IDENTITY_SOURCE_TYPE_OIDC = "OIDC" +const RoleBinding_STALE_TRUE = "TRUE" +const RoleBinding_STALE_FALSE = "FALSE" +const RoleBinding_STALE_UNKNOWN = "UNKNOWN" +const RoleBinding_TYPE_REMOTE_USER = "remote_user" +const RoleBinding_TYPE_REMOTE_GROUP = "remote_group" +const RoleBinding_TYPE_LOCAL_USER = "local_user" +const RoleBinding_TYPE_PRINCIPAL_IDENTITY = "principal_identity" + +func (s *RoleBinding) GetType__() bindings.BindingType { + return RoleBindingBindingType() +} + +func (s *RoleBinding) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RoleBinding._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type RoleBindingListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List results + Results []RoleBinding +} + +func (s *RoleBindingListResult) GetType__() bindings.BindingType { + return RoleBindingListResultBindingType() +} + +func (s *RoleBindingListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RoleBindingListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type RoleListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List results + Results []Role +} + +func (s *RoleListResult) GetType__() bindings.BindingType { + return RoleListResultBindingType() +} + +func (s *RoleListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RoleListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Role +type RoleWithFeatures struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Features + Features []FeaturePermission + // Short identifier for the role. Must be all lower case with no spaces. + Role *string +} + +func (s *RoleWithFeatures) GetType__() bindings.BindingType { + return RoleWithFeaturesBindingType() +} + +func (s *RoleWithFeatures) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RoleWithFeatures._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type RoleWithFeaturesListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List results + Results []RoleWithFeatures +} + +func (s *RoleWithFeaturesListResult) GetType__() bindings.BindingType { + return RoleWithFeaturesListResultBindingType() +} + +func (s *RoleWithFeaturesListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RoleWithFeaturesListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A Route Based VPN is more flexible, more powerful and recommended over policy based VPN. IP Tunnel port is created and all traffic routed via tunnel port is protected. Routes can be configured statically or can be learned through BGP. A route based VPN is must for establishing redundant VPN session to remote site. +type RouteBasedIPSecVPNSession struct { + // IP Tunnel ports. + TunnelPorts []TunnelPortConfig + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * IPSecVPNSession#IPSecVPNSession_RESOURCE_TYPE_POLICYBASEDIPSECVPNSESSION + // * IPSecVPNSession#IPSecVPNSession_RESOURCE_TYPE_ROUTEBASEDIPSECVPNSESSION + // + // A Policy Based VPN requires to define protect rules that match local and peer subnets. IPSec security associations is negotiated for each pair of local and peer subnet. A Route Based VPN is more flexible, more powerful and recommended over policy based VPN. IP Tunnel port is created and all traffic routed via tunnel port is protected. Routes can be configured statically or can be learned through BGP. A route based VPN is must for establishing redundant VPN session to remote site. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Enable/Disable IPSec VPN session. + Enabled *bool + // Identifier of VPN Service linked with local endpoint. + IpsecVpnServiceId *string + // Local endpoint identifier. + LocalEndpointId *string + // Peer endpoint identifier. + PeerEndpointId *string + TcpMssClamping *TcpMssClamping +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const RouteBasedIPSecVPNSession__TYPE_IDENTIFIER = "RouteBasedIPSecVPNSession" + +func (s *RouteBasedIPSecVPNSession) GetType__() bindings.BindingType { + return RouteBasedIPSecVPNSessionBindingType() +} + +func (s *RouteBasedIPSecVPNSession) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RouteBasedIPSecVPNSession._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// BGP route details. +type RouteDetails struct { + // BGP AS path attribute. + AsPath *string + // BGP Local Preference attribute. format: int64 + LocalPref *int64 + // BGP Multi Exit Discriminator attribute. format: int64 + Med *int64 + // CIDR network address. format: ip-cidr-block + Network *string + // Next hop IP address. format: ip + NextHop *string + // BGP Weight attribute. format: int64 + Weight *int64 +} + +func (s *RouteDetails) GetType__() bindings.BindingType { + return RouteDetailsBindingType() +} + +func (s *RouteDetails) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RouteDetails._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type RouteMap struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Logical router id + LogicalRouterId *string + // Ordered list of routeMap sequences + Sequences []RouteMapSequence +} + +func (s *RouteMap) GetType__() bindings.BindingType { + return RouteMapBindingType() +} + +func (s *RouteMap) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RouteMap._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type RouteMapListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paginated list of RouteMaps + Results []RouteMap +} + +func (s *RouteMapListResult) GetType__() bindings.BindingType { + return RouteMapListResultBindingType() +} + +func (s *RouteMapListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RouteMapListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type RouteMapSequence struct { + // Possible values are: + // + // * RouteMapSequence#RouteMapSequence_ACTION_PERMIT + // * RouteMapSequence#RouteMapSequence_ACTION_DENY + // + // Action for the Sequence + Action *string + MatchCriteria *RouteMapSequenceMatch + SetCriteria *RouteMapSequenceSet +} + +const RouteMapSequence_ACTION_PERMIT = "PERMIT" +const RouteMapSequence_ACTION_DENY = "DENY" + +func (s *RouteMapSequence) GetType__() bindings.BindingType { + return RouteMapSequenceBindingType() +} + +func (s *RouteMapSequence) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RouteMapSequence._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Match sequence in route map which is used for matching routes. IP prefix lists and match community expression are mutually exclusive fields, one of them must be provided. +type RouteMapSequenceMatch struct { + // IPPrefixList Identifiers for RouteMap Sequence Match Criteria + IpPrefixLists []string + MatchCommunityExpression *CommunityMatchExpression +} + +func (s *RouteMapSequenceMatch) GetType__() bindings.BindingType { + return RouteMapSequenceMatchBindingType() +} + +func (s *RouteMapSequenceMatch) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RouteMapSequenceMatch._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type RouteMapSequenceSet struct { + // As Path Prepending to influence path selection + AsPathPrepend *string + // Set normal BGP community either well-known community name or community value in aa:nn(2byte:2byte) format. + Community *string + // Set large BGP community, community value shoud be in aa:bb:nn format where aa, bb, nn are unsigned integers with range [1-4294967295]. + LargeCommunity *string + // Local preference indicates the degree of preference for one BGP route over other BGP routes. The path/route with highest local preference value is preferred/selected. If local preference value is not specified then it will be considered as 100 by default. format: int64 + LocalPreference *int64 + // Multi Exit Discriminator (MED) format: int64 + MultiExitDiscriminator *int64 + // For incoming and import route_maps on receiving both v6 global and v6 link-local address for the route, prefer to use the global address as the next hop. By default, it prefers the link-local next hop. + PreferGlobalV6NextHop *bool + // Weight used to select certain path format: int32 + Weight *int64 +} + +func (s *RouteMapSequenceSet) GetType__() bindings.BindingType { + return RouteMapSequenceSetBindingType() +} + +func (s *RouteMapSequenceSet) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RouteMapSequenceSet._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// BGP routes per transport node. +type RoutesPerTransportNode struct { + // Array of BGP neighbor route details for this transport node. + Routes []RouteDetails + // BGP neighbor source address. format: ip + SourceAddress *string + // Transport node id + TransportNodeId *string +} + +func (s *RoutesPerTransportNode) GetType__() bindings.BindingType { + return RoutesPerTransportNodeBindingType() +} + +func (s *RoutesPerTransportNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RoutesPerTransportNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type RoutingConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Defines the extra time the router must wait before sending the UP notification after the first BGP session is established. Default means forward immediately. For TIER0/TIER1 logical router, default is 0. VRF logical router will set it same as parent logical router. format: int64 + ForwardingUpTimer *int64 + // Logical router id + LogicalRouterId *string +} + +func (s *RoutingConfig) GetType__() bindings.BindingType { + return RoutingConfigBindingType() +} + +func (s *RoutingConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RoutingConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// NSX global configs for Routing +type RoutingGlobalConfig struct { + // When this flag is set to true, it is allowed to change the VDR MAC being used by existing transport nodes in a NSX system. The VDR MAC used by a host switch in a transport node is decided by the OVERLAY transport zone(s) which the host switch joins. If any of the OVERLAY transport zone(s) has \"nested_nsx\" property being true, the MAC in \"vdr_mac_nested\" is used; otherwise the MAC in \"vdr_mac\" is used. Thus the VDR MAC being used by a host switch in a transport node can be changed in below ways. If the host switch is not in any OVERLAY transport zone whose \"nested_nsx\" property is true but is in an OVERLAY transport zone, the first way is updating the \"vdr_mac\" property. The 2nd way is updating one of the OVERLAY tranport zones joined by the host switch to set \"nested_nsx\" property true which will make the host switch use the VDR MAC in \"vdr_mac_nested\". The third way is directly updating the transport node to add an OVERLAY transport zone whose \"nested_nsx\" property is true into the host switch which will also make the host switch use the VDR MAC in \"vdr_mac_nested\". If the host switch is in some OVERLAY transport zone(s) whose \"nested_nsx\" property is true, the first way is updating the \"vdr_mac_nested\" property. The 2nd way is updating all those OVERLAY tranport zones to set \"nested_nsx\" property false which will make the host switch use the VDR MAC in \"vdr_mac\". The third way is directly updating the transport node to remove all those OVERLAY transport zones from the host switch which will also make the host switch use the VDR MAC in \"vdr_mac\". Please note that changing the VDR MAC being used by existing transport nodes will most likely cause traffic disruption and network outage! + AllowChangingVdrMacInUse *bool + // Possible values are: + // + // * RoutingGlobalConfig#RoutingGlobalConfig_L3FORWARDING_MODE_ONLY + // * RoutingGlobalConfig#RoutingGlobalConfig_L3FORWARDING_MODE_AND_IPV6 + // + // This setting does not restrict configuration as per other modes. But the forwarding will only work as per the mode set here. + L3ForwardingMode *string + // This is the global default MTU for all the logical uplinks in a NSX domain. Currently logical uplink MTU can only be set globally and applies to the entire NSX domain. There is no option to override this value at transport zone level or transport node level. If this value is not set, the default value of 1500 will be used. format: int32 + LogicalUplinkMtu *int64 + // This is the global default MAC address for all VDRs in all transport nodes in a NSX system. When the property \"allow_changing_vdr_mac_in_use\" is false, it can not be changed if the current VDR MAC is being used by any transport node. A transport node uses this VDR MAC if any host switch in the node is in OVERLAY transport zone(s) but none of the transport zone(s) has \"nested_nsx\" property being true. format: mac-address + VdrMac *string + // This is the global default MAC address for all VDRs in all transport nodes in a NSX system nested in another NSX system. All transport zones in such a nested NSX system will have the \"nested_nsx\" property being true so that all transport nodes will use this MAC for the VDR ports to avoid conflict with the VDR MAC in the outer NSX system. When the property \"allow_changing_vdr_mac_in_use\" is false, it can not be changed if the current VDR MAC is being used by any transport node in a nested NSX environment. A transport node uses this VDR MAC if any host switch in the node is in an OVERLAY transport zone whose \"nested_nsx\" property is true. format: mac-address + VdrMacNested *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_SWITCHINGGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_ROUTINGGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_OPERATIONCOLLECTORGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FIREWALLGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_ESXGLOBALOPAQUECONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_SECURITYGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FIPSGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FEDERATIONGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_IDSGLOBALCONFIG + // + // Valid Global configuration types + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const RoutingGlobalConfig__TYPE_IDENTIFIER = "RoutingGlobalConfig" +const RoutingGlobalConfig_L3FORWARDING_MODE_ONLY = "IPV4_ONLY" +const RoutingGlobalConfig_L3FORWARDING_MODE_AND_IPV6 = "IPV4_AND_IPV6" + +func (s *RoutingGlobalConfig) GetType__() bindings.BindingType { + return RoutingGlobalConfigBindingType() +} + +func (s *RoutingGlobalConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RoutingGlobalConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Routing policy details. +type RoutingPolicy struct { + // Array of next hop to prefix lists mapping. + NextHopPrefixListsMappings []NextHopPrefixListsMapping + // Possible values are: + // + // * RoutingPolicy#RoutingPolicy_ROUTING_POLICY_TYPE_ROUTING + // + // Routing policy type. + RoutingPolicyType *string +} + +const RoutingPolicy_ROUTING_POLICY_TYPE_ROUTING = "PROXIMITY_ROUTING" + +func (s *RoutingPolicy) GetType__() bindings.BindingType { + return RoutingPolicyBindingType() +} + +func (s *RoutingPolicy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RoutingPolicy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Root of the api result set for forming rows. +type RowListField struct { + // + Alias *string + // JSON path to the root of the api result set for forming rows. + Path *string +} + +func (s *RowListField) GetType__() bindings.BindingType { + return RowListFieldBindingType() +} + +func (s *RowListField) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RowListField._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type RuleState struct { + // Array of configuration state of various sub systems + Details []ConfigurationStateElement + // Error code format: int64 + FailureCode *int64 + // Error message in case of failure + FailureMessage *string + // Possible values are: + // + // * RuleState#RuleState_STATE_PENDING + // * RuleState#RuleState_STATE_IN_PROGRESS + // * RuleState#RuleState_STATE_SUCCESS + // * RuleState#RuleState_STATE_FAILED + // * RuleState#RuleState_STATE_PARTIAL_SUCCESS + // * RuleState#RuleState_STATE_ORPHANED + // * RuleState#RuleState_STATE_UNKNOWN + // * RuleState#RuleState_STATE_ERROR + // * RuleState#RuleState_STATE_IN_SYNC + // * RuleState#RuleState_STATE_NOT_AVAILABLE + // * RuleState#RuleState_STATE_VM_DEPLOYMENT_QUEUED + // * RuleState#RuleState_STATE_VM_DEPLOYMENT_IN_PROGRESS + // * RuleState#RuleState_STATE_VM_DEPLOYMENT_FAILED + // * RuleState#RuleState_STATE_VM_POWER_ON_IN_PROGRESS + // * RuleState#RuleState_STATE_VM_POWER_ON_FAILED + // * RuleState#RuleState_STATE_REGISTRATION_PENDING + // * RuleState#RuleState_STATE_NODE_NOT_READY + // * RuleState#RuleState_STATE_NODE_READY + // * RuleState#RuleState_STATE_VM_POWER_OFF_IN_PROGRESS + // * RuleState#RuleState_STATE_VM_POWER_OFF_FAILED + // * RuleState#RuleState_STATE_VM_UNDEPLOY_IN_PROGRESS + // * RuleState#RuleState_STATE_VM_UNDEPLOY_FAILED + // * RuleState#RuleState_STATE_VM_UNDEPLOY_SUCCESSFUL + // * RuleState#RuleState_STATE_EDGE_CONFIG_ERROR + // * RuleState#RuleState_STATE_VM_DEPLOYMENT_RESTARTED + // * RuleState#RuleState_STATE_REGISTRATION_FAILED + // * RuleState#RuleState_STATE_TRANSPORT_NODE_SYNC_PENDING + // * RuleState#RuleState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING + // * RuleState#RuleState_STATE_EDGE_HARDWARE_NOT_SUPPORTED + // * RuleState#RuleState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED + // * RuleState#RuleState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER + // * RuleState#RuleState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED + // * RuleState#RuleState_STATE_NO_PNIC_PREPARED_IN_EDGE + // * RuleState#RuleState_STATE_APPLIANCE_INTERNAL_ERROR + // * RuleState#RuleState_STATE_VTEP_DHCP_NOT_SUPPORTED + // * RuleState#RuleState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE + // * RuleState#RuleState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED + // * RuleState#RuleState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND + // * RuleState#RuleState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED + // * RuleState#RuleState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY + // * RuleState#RuleState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM + // * RuleState#RuleState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM + // * RuleState#RuleState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM + // * RuleState#RuleState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE + // * RuleState#RuleState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE + // * RuleState#RuleState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED + // * RuleState#RuleState_STATE_NO_PNIC_SPECIFIED_IN_TN + // * RuleState#RuleState_STATE_INVALID_PNIC_DEVICE_NAME + // * RuleState#RuleState_STATE_TRANSPORT_NODE_READY + // * RuleState#RuleState_STATE_VM_NETWORK_EDIT_PENDING + // * RuleState#RuleState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY + // * RuleState#RuleState_STATE_MPA_DISCONNECTED + // * RuleState#RuleState_STATE_VM_RENAME_PENDING + // * RuleState#RuleState_STATE_VM_CONFIG_EDIT_PENDING + // * RuleState#RuleState_STATE_VM_NETWORK_EDIT_FAILED + // * RuleState#RuleState_STATE_VM_RENAME_FAILED + // * RuleState#RuleState_STATE_VM_CONFIG_EDIT_FAILED + // * RuleState#RuleState_STATE_VM_CONFIG_DISCREPANCY + // * RuleState#RuleState_STATE_VM_NODE_REFRESH_FAILED + // * RuleState#RuleState_STATE_VM_PLACEMENT_REFRESH_FAILED + // * RuleState#RuleState_STATE_REGISTRATION_TIMEDOUT + // * RuleState#RuleState_STATE_REPLACE_FAILED + // * RuleState#RuleState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED + // * RuleState#RuleState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING + // * RuleState#RuleState_STATE_DELETE_VM_IN_REDEPLOY_FAILED + // * RuleState#RuleState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED + // * RuleState#RuleState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE + // * RuleState#RuleState_STATE_VM_RESOURCE_RESERVATION_FAILED + // * RuleState#RuleState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER + // * RuleState#RuleState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING + // * RuleState#RuleState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE + // * RuleState#RuleState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE + // * RuleState#RuleState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE + // * RuleState#RuleState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE + // * RuleState#RuleState_STATE_COMPUTE_MANAGER_NOT_FOUND + // * RuleState#RuleState_STATE_DELETE_IN_PROGRESS + // + // Gives details of state of desired configuration. Additional enums with more details on progress/success/error states are sent for edge node. The success states are NODE_READY and TRANSPORT_NODE_READY, pending states are {VM_DEPLOYMENT_QUEUED, VM_DEPLOYMENT_IN_PROGRESS, REGISTRATION_PENDING} and other values indicate failures. \"in_sync\" state indicates that the desired configuration has been received by the host to which it applies, but is not yet in effect. When the configuration is actually in effect, the state will change to \"success\". Please note, failed state is deprecated. + State *string + // This attribute represents revision number of rule's desired state. format: int64 + RevisionDesired *int64 + // Pending changes to be realized. + PendingChangeList []PendingChange +} + +const RuleState_STATE_PENDING = "pending" +const RuleState_STATE_IN_PROGRESS = "in_progress" +const RuleState_STATE_SUCCESS = "success" +const RuleState_STATE_FAILED = "failed" +const RuleState_STATE_PARTIAL_SUCCESS = "partial_success" +const RuleState_STATE_ORPHANED = "orphaned" +const RuleState_STATE_UNKNOWN = "unknown" +const RuleState_STATE_ERROR = "error" +const RuleState_STATE_IN_SYNC = "in_sync" +const RuleState_STATE_NOT_AVAILABLE = "NOT_AVAILABLE" +const RuleState_STATE_VM_DEPLOYMENT_QUEUED = "VM_DEPLOYMENT_QUEUED" +const RuleState_STATE_VM_DEPLOYMENT_IN_PROGRESS = "VM_DEPLOYMENT_IN_PROGRESS" +const RuleState_STATE_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const RuleState_STATE_VM_POWER_ON_IN_PROGRESS = "VM_POWER_ON_IN_PROGRESS" +const RuleState_STATE_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const RuleState_STATE_REGISTRATION_PENDING = "REGISTRATION_PENDING" +const RuleState_STATE_NODE_NOT_READY = "NODE_NOT_READY" +const RuleState_STATE_NODE_READY = "NODE_READY" +const RuleState_STATE_VM_POWER_OFF_IN_PROGRESS = "VM_POWER_OFF_IN_PROGRESS" +const RuleState_STATE_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const RuleState_STATE_VM_UNDEPLOY_IN_PROGRESS = "VM_UNDEPLOY_IN_PROGRESS" +const RuleState_STATE_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const RuleState_STATE_VM_UNDEPLOY_SUCCESSFUL = "VM_UNDEPLOY_SUCCESSFUL" +const RuleState_STATE_EDGE_CONFIG_ERROR = "EDGE_CONFIG_ERROR" +const RuleState_STATE_VM_DEPLOYMENT_RESTARTED = "VM_DEPLOYMENT_RESTARTED" +const RuleState_STATE_REGISTRATION_FAILED = "REGISTRATION_FAILED" +const RuleState_STATE_TRANSPORT_NODE_SYNC_PENDING = "TRANSPORT_NODE_SYNC_PENDING" +const RuleState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING = "TRANSPORT_NODE_CONFIGURATION_MISSING" +const RuleState_STATE_EDGE_HARDWARE_NOT_SUPPORTED = "EDGE_HARDWARE_NOT_SUPPORTED" +const RuleState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED = "MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED" +const RuleState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER = "TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER" +const RuleState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED = "TZ_ENDPOINTS_NOT_SPECIFIED" +const RuleState_STATE_NO_PNIC_PREPARED_IN_EDGE = "NO_PNIC_PREPARED_IN_EDGE" +const RuleState_STATE_APPLIANCE_INTERNAL_ERROR = "APPLIANCE_INTERNAL_ERROR" +const RuleState_STATE_VTEP_DHCP_NOT_SUPPORTED = "VTEP_DHCP_NOT_SUPPORTED" +const RuleState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE = "UNSUPPORTED_HOST_SWITCH_PROFILE" +const RuleState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED = "UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED" +const RuleState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND = "HOSTSWITCH_PROFILE_NOT_FOUND" +const RuleState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED = "LLDP_SEND_ENABLED_NOT_SUPPORTED" +const RuleState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY = "UNSUPPORTED_NAMED_TEAMING_POLICY" +const RuleState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM = "LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM" +const RuleState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM = "LACP_NOT_SUPPORTED_FOR_EDGE_VM" +const RuleState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM = "STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM" +const RuleState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE = "MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE" +const RuleState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE = "UNSUPPORTED_LACP_LB_ALGO_FOR_NODE" +const RuleState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED = "EDGE_NODE_VERSION_NOT_SUPPORTED" +const RuleState_STATE_NO_PNIC_SPECIFIED_IN_TN = "NO_PNIC_SPECIFIED_IN_TN" +const RuleState_STATE_INVALID_PNIC_DEVICE_NAME = "INVALID_PNIC_DEVICE_NAME" +const RuleState_STATE_TRANSPORT_NODE_READY = "TRANSPORT_NODE_READY" +const RuleState_STATE_VM_NETWORK_EDIT_PENDING = "VM_NETWORK_EDIT_PENDING" +const RuleState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY = "UNSUPPORTED_DEFAULT_TEAMING_POLICY" +const RuleState_STATE_MPA_DISCONNECTED = "MPA_DISCONNECTED" +const RuleState_STATE_VM_RENAME_PENDING = "VM_RENAME_PENDING" +const RuleState_STATE_VM_CONFIG_EDIT_PENDING = "VM_CONFIG_EDIT_PENDING" +const RuleState_STATE_VM_NETWORK_EDIT_FAILED = "VM_NETWORK_EDIT_FAILED" +const RuleState_STATE_VM_RENAME_FAILED = "VM_RENAME_FAILED" +const RuleState_STATE_VM_CONFIG_EDIT_FAILED = "VM_CONFIG_EDIT_FAILED" +const RuleState_STATE_VM_CONFIG_DISCREPANCY = "VM_CONFIG_DISCREPANCY" +const RuleState_STATE_VM_NODE_REFRESH_FAILED = "VM_NODE_REFRESH_FAILED" +const RuleState_STATE_VM_PLACEMENT_REFRESH_FAILED = "VM_PLACEMENT_REFRESH_FAILED" +const RuleState_STATE_REGISTRATION_TIMEDOUT = "REGISTRATION_TIMEDOUT" +const RuleState_STATE_REPLACE_FAILED = "REPLACE_FAILED" +const RuleState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED = "UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED" +const RuleState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING = "LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING" +const RuleState_STATE_DELETE_VM_IN_REDEPLOY_FAILED = "DELETE_VM_IN_REDEPLOY_FAILED" +const RuleState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED = "DEPLOY_VM_IN_REDEPLOY_FAILED" +const RuleState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE = "INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE" +const RuleState_STATE_VM_RESOURCE_RESERVATION_FAILED = "VM_RESOURCE_RESERVATION_FAILED" +const RuleState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER = "DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER" +const RuleState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING = "DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING" +const RuleState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE = "EDGE_NODE_SETTINGS_MISMATCH_RESOLVE" +const RuleState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE = "EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE" +const RuleState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE = "EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE" +const RuleState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE = "EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE" +const RuleState_STATE_COMPUTE_MANAGER_NOT_FOUND = "COMPUTE_MANAGER_NOT_FOUND" +const RuleState_STATE_DELETE_IN_PROGRESS = "DELETE_IN_PROGRESS" + +func (s *RuleState) GetType__() bindings.BindingType { + return RuleStateBindingType() +} + +func (s *RuleState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RuleState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type RuntimeInterfaceOperationalStatus struct { + // Index of the interface format: int64 + InterfaceIndex *int64 + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // Possible values are: + // + // * RuntimeInterfaceOperationalStatus#RuntimeInterfaceOperationalStatus_STATUS_UP + // * RuntimeInterfaceOperationalStatus#RuntimeInterfaceOperationalStatus_STATUS_DOWN + // * RuntimeInterfaceOperationalStatus#RuntimeInterfaceOperationalStatus_STATUS_UNKNOWN + // + // The Operational status of the interface + Status *string +} + +const RuntimeInterfaceOperationalStatus_STATUS_UP = "UP" +const RuntimeInterfaceOperationalStatus_STATUS_DOWN = "DOWN" +const RuntimeInterfaceOperationalStatus_STATUS_UNKNOWN = "UNKNOWN" + +func (s *RuntimeInterfaceOperationalStatus) GetType__() bindings.BindingType { + return RuntimeInterfaceOperationalStatusBindingType() +} + +func (s *RuntimeInterfaceOperationalStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RuntimeInterfaceOperationalStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type RuntimeInterfaceStatistics struct { + RxBytes *SIDataCounter + RxPackets *SIDataCounter + TxBytes *SIDataCounter + TxPackets *SIDataCounter + DroppedBySecurityPackets *SIPacketsDroppedBySecurity + MacLearning *SIMacLearningCounters + // Index of the interface format: int64 + InterfaceIndex *int64 + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 +} + +func (s *RuntimeInterfaceStatistics) GetType__() bindings.BindingType { + return RuntimeInterfaceStatisticsBindingType() +} + +func (s *RuntimeInterfaceStatistics) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for RuntimeInterfaceStatistics._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Describes a config item for System Health profile. +type SHAPredefinedPluginProfileData struct { + // The interval of plugin to check the status. format: int64 + CheckInterval *int64 + // The interval of plugin to report the status. format: int64 + ReportInterval *int64 + // The smallest report interval if the status is changed. The value of smallest_report_interval_if_change should be less than the value of report_interval format: int64 + SmallestReportIntervalIfChange *int64 +} + +func (s *SHAPredefinedPluginProfileData) GetType__() bindings.BindingType { + return SHAPredefinedPluginProfileDataBindingType() +} + +func (s *SHAPredefinedPluginProfileData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SHAPredefinedPluginProfileData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SIAggregatedDataCounter struct { + RxBytes *SIDataCounter + RxPackets *SIDataCounter + TxBytes *SIDataCounter + TxPackets *SIDataCounter +} + +func (s *SIAggregatedDataCounter) GetType__() bindings.BindingType { + return SIAggregatedDataCounterBindingType() +} + +func (s *SIAggregatedDataCounter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SIAggregatedDataCounter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SIAggregatedDataCounterEx struct { + RxBytes *SIDataCounter + RxPackets *SIDataCounter + TxBytes *SIDataCounter + TxPackets *SIDataCounter + DroppedBySecurityPackets *SIPacketsDroppedBySecurity + MacLearning *SIMacLearningCounters +} + +func (s *SIAggregatedDataCounterEx) GetType__() bindings.BindingType { + return SIAggregatedDataCounterExBindingType() +} + +func (s *SIAggregatedDataCounterEx) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SIAggregatedDataCounterEx._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SIDataCounter struct { + // The dropped packets or bytes format: int64 + Dropped *int64 + // The multicast and broadcast packets or bytes format: int64 + MulticastBroadcast *int64 + // The total packets or bytes format: int64 + Total *int64 +} + +func (s *SIDataCounter) GetType__() bindings.BindingType { + return SIDataCounterBindingType() +} + +func (s *SIDataCounter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SIDataCounter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Error class for all the Service Insertion related errors. +type SIErrorClass struct { + ErrorId *int64 + ErrorMessage *string +} + +func (s *SIErrorClass) GetType__() bindings.BindingType { + return SIErrorClassBindingType() +} + +func (s *SIErrorClass) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SIErrorClass._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of entities where Service Insertion will not be enforced. Exclusion List can contain NSGroup(s) or LogicalPort(s) or LogicalSwitch(es). +type SIExcludeList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Total number of members present in Exclude List. format: int64 + MemberCount *int64 + // List of members in Exclusion List + Members []ResourceReference +} + +func (s *SIExcludeList) GetType__() bindings.BindingType { + return SIExcludeListBindingType() +} + +func (s *SIExcludeList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SIExcludeList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SIMacLearningCounters struct { + // The number of packets with unknown source MAC address that are dispatched without learning the source MAC address. Applicable only when the MAC limit is reached and MAC Limit policy is MAC_LEARNING_LIMIT_POLICY_ALLOW. format: int64 + MacNotLearnedPacketsAllowed *int64 + // The number of packets with unknown source MAC address that are dropped without learning the source MAC address. Applicable only when the MAC limit is reached and MAC Limit policy is MAC_LEARNING_LIMIT_POLICY_DROP. format: int64 + MacNotLearnedPacketsDropped *int64 + // Number of MACs learned format: int64 + MacsLearned *int64 +} + +func (s *SIMacLearningCounters) GetType__() bindings.BindingType { + return SIMacLearningCountersBindingType() +} + +func (s *SIMacLearningCounters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SIMacLearningCounters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SIPacketTypeAndCounter struct { + // The number of packets. format: int64 + Counter *int64 + // The type of the packets + PacketType *string +} + +func (s *SIPacketTypeAndCounter) GetType__() bindings.BindingType { + return SIPacketTypeAndCounterBindingType() +} + +func (s *SIPacketTypeAndCounter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SIPacketTypeAndCounter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SIPacketsDroppedBySecurity struct { + // The number of packets dropped by \"BPDU filter\". format: int64 + BpduFilterDropped *int64 + // The number of IPv4 packets dropped by \"DHCP client block\". format: int64 + DhcpClientDroppedIpv4 *int64 + // The number of IPv6 packets dropped by \"DHCP client block\". format: int64 + DhcpClientDroppedIpv6 *int64 + // The number of IPv4 packets dropped by \"DHCP server block\". format: int64 + DhcpServerDroppedIpv4 *int64 + // The number of IPv6 packets dropped by \"DHCP server block\". format: int64 + DhcpServerDroppedIpv6 *int64 + // The packets dropped by \"Spoof Guard\"; supported packet types are IPv4, IPv6, ARP, ND, non-IP. + SpoofGuardDropped []SIPacketTypeAndCounter +} + +func (s *SIPacketsDroppedBySecurity) GetType__() bindings.BindingType { + return SIPacketsDroppedBySecurityBindingType() +} + +func (s *SIPacketsDroppedBySecurity) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SIPacketsDroppedBySecurity._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Service Insertion Service Profile List +type SIServiceProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of the Service-Insertion Services. The list has to be homogenous. + Results []*data.StructValue +} + +func (s *SIServiceProfileListResult) GetType__() bindings.BindingType { + return SIServiceProfileListResultBindingType() +} + +func (s *SIServiceProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SIServiceProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Type of issue and detailed description of the issues in case of post-VM deployment configuration failure. +type SVMConfigureIssue struct { + // List of errors along with details like errorId and error messages. + Errors []SIErrorClass + // The ID of service instance which was deployed. + ServiceInstanceId *string +} + +func (s *SVMConfigureIssue) GetType__() bindings.BindingType { + return SVMConfigureIssueBindingType() +} + +func (s *SVMConfigureIssue) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SVMConfigureIssue._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Deployment Specs holds information required to deploy the Service-VMs.i.e. OVF url where the partner Service-VM OVF is hosted. The host type on which the OVF(Open Virtualization Format) can be deployed, Form factor to name a few. +type SVMDeploymentSpec struct { + // Possible values are: + // + // * SVMDeploymentSpec#SVMDeploymentSpec_HOST_TYPE_ESXI + // * SVMDeploymentSpec#SVMDeploymentSpec_HOST_TYPE_RHELKVM + // * SVMDeploymentSpec#SVMDeploymentSpec_HOST_TYPE_UBUNTUKVM + // + // Host Type on which the specified OVF can be deployed. + HostType *string + // Minimum host version supported by this ovf. If a host in the deployment cluster is having version less than this, then service deployment will not happen on that host. + MinHostVersion *string + // Deployment Spec name for ease of use, since multiple DeploymentSpec can be specified. + Name *string + // Location of the partner VM OVF to be deployed. + OvfUrl *string + // Possible values are: + // + // * SVMDeploymentSpec#SVMDeploymentSpec_SERVICE_FORM_FACTOR_SMALL + // * SVMDeploymentSpec#SVMDeploymentSpec_SERVICE_FORM_FACTOR_MEDIUM + // * SVMDeploymentSpec#SVMDeploymentSpec_SERVICE_FORM_FACTOR_LARGE + // + // Supported ServiceInsertion Form Factor for the OVF deployment. The default FormFactor is Medium. + ServiceFormFactor *string + // Partner needs to specify the Service VM version which will get deployed. + SvmVersion *string +} + +const SVMDeploymentSpec_HOST_TYPE_ESXI = "ESXI" +const SVMDeploymentSpec_HOST_TYPE_RHELKVM = "RHELKVM" +const SVMDeploymentSpec_HOST_TYPE_UBUNTUKVM = "UBUNTUKVM" +const SVMDeploymentSpec_SERVICE_FORM_FACTOR_SMALL = "SMALL" +const SVMDeploymentSpec_SERVICE_FORM_FACTOR_MEDIUM = "MEDIUM" +const SVMDeploymentSpec_SERVICE_FORM_FACTOR_LARGE = "LARGE" + +func (s *SVMDeploymentSpec) GetType__() bindings.BindingType { + return SVMDeploymentSpecBindingType() +} + +func (s *SVMDeploymentSpec) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SVMDeploymentSpec._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Details of saml token based credential to login to server. +type SamlTokenLoginCredential struct { + // Thumbprint of the server. + Thumbprint *string + // The saml token to login to server. + Token *string + // Possible values are 'UsernamePasswordLoginCredential', 'VerifiableAsymmetricLoginCredential', 'SessionLoginCredential'. + CredentialType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const SamlTokenLoginCredential__TYPE_IDENTIFIER = "SamlTokenLoginCredential" + +func (s *SamlTokenLoginCredential) GetType__() bindings.BindingType { + return SamlTokenLoginCredentialBindingType() +} + +func (s *SamlTokenLoginCredential) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SamlTokenLoginCredential._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SamplingArgument struct { + // Possible values are: + // + // * SamplingArgument#SamplingArgument_SAMPLING_TYPE_FIRSTNSAMPLING + // * SamplingArgument#SamplingArgument_SAMPLING_TYPE_PACKETNUMBERSAMPLING + // * SamplingArgument#SamplingArgument_SAMPLING_TYPE_INTERVALSAMPLING + // + // Sampling type + SamplingType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const SamplingArgument__TYPE_IDENTIFIER = "SamplingArgument" +const SamplingArgument_SAMPLING_TYPE_FIRSTNSAMPLING = "FirstNSampling" +const SamplingArgument_SAMPLING_TYPE_PACKETNUMBERSAMPLING = "PacketNumberSampling" +const SamplingArgument_SAMPLING_TYPE_INTERVALSAMPLING = "IntervalSampling" + +func (s *SamplingArgument) GetType__() bindings.BindingType { + return SamplingArgumentBindingType() +} + +func (s *SamplingArgument) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SamplingArgument._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ScpProtocol struct { + AuthenticationScheme *PasswordAuthenticationScheme + // SSH fingerprint of server + SshFingerprint *string + // Possible values are: + // + // * Protocol#Protocol_NAME_HTTP + // * Protocol#Protocol_NAME_HTTPS + // * Protocol#Protocol_NAME_SCP + // * Protocol#Protocol_NAME_SFTP + // + // Protocol name + Name string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ScpProtocol__TYPE_IDENTIFIER = "ScpProtocol" + +func (s *ScpProtocol) GetType__() bindings.BindingType { + return ScpProtocolBindingType() +} + +func (s *ScpProtocol) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ScpProtocol._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Search response +type SearchResponse struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of records matching the search query. + Results []*data.StructValue +} + +func (s *SearchResponse) GetType__() bindings.BindingType { + return SearchResponseBindingType() +} + +func (s *SearchResponse) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SearchResponse._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SecurityCertificate struct { + // The certificate must include the enclosing \"-----BEGIN CERTIFICATE-----\" and \"-----END CERTIFICATE-----\" + PemEncoded *string + SshPublicKey *string + // X.509 certificate in text form + Text *string + // The time when the certificate starts being valid + ValidFrom *string + // The time when the certificate stops being valid + ValidTo *string +} + +func (s *SecurityCertificate) GetType__() bindings.BindingType { + return SecurityCertificateBindingType() +} + +func (s *SecurityCertificate) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SecurityCertificate._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// NSX global configs for security purposes, like trust store and trust manager. +type SecurityGlobalConfig struct { + // When this flag is set to true (for NDcPP compliance) only ca-signed certificates will be allowed to be applied as server certificates. + CaSignedOnly *bool + // When this flag is set to true, during certificate checking the CRL is fetched and checked whether the certificate is revoked or not. + CrlCheckingEnabled *bool + // When this flag is set to true, during certificate checking the Extended Key Usage extension is expected to be present, indicating whether the certificate is to be used a client certificate or server certificate. Setting this value to false is not recommended as it leads to lower security and operational risk. + EkuCheckingEnabled *bool + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_SWITCHINGGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_ROUTINGGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_OPERATIONCOLLECTORGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FIREWALLGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_ESXGLOBALOPAQUECONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_SECURITYGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FIPSGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FEDERATIONGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_IDSGLOBALCONFIG + // + // Valid Global configuration types + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const SecurityGlobalConfig__TYPE_IDENTIFIER = "SecurityGlobalConfig" + +func (s *SecurityGlobalConfig) GetType__() bindings.BindingType { + return SecurityGlobalConfigBindingType() +} + +func (s *SecurityGlobalConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SecurityGlobalConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Resources to take action on +type SelectableResourceReference struct { + // Will be set to false if the referenced NSX resource has been deleted. + IsValid *bool + // Display name of the NSX resource. + TargetDisplayName *string + // Identifier of the NSX resource. + TargetId *string + // Type of the NSX resource. + TargetType *string + // Set to true if this resource has been selected to be acted upon + Selected *bool +} + +func (s *SelectableResourceReference) GetType__() bindings.BindingType { + return SelectableResourceReferenceBindingType() +} + +func (s *SelectableResourceReference) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SelectableResourceReference._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Directory domain selective sync settings +type SelectiveSyncSettings struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Enable or disable SelectiveSync + Enabled *bool + // If SelectiveSync is enabled, this contains 1 or more OrgUnits, which NSX will synchronize with in LDAP server. The full distiguished name (DN) should be used for OrgUnit. If SelectiveSync is disabled, do not define this or specify an empty list. + SelectedOrgUnits []string +} + +func (s *SelectiveSyncSettings) GetType__() bindings.BindingType { + return SelectiveSyncSettingsBindingType() +} + +func (s *SelectiveSyncSettings) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SelectiveSyncSettings._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The server will populate this field when returing the resource. Ignored on PUT and POST. +type SelfResourceLink struct { + // Optional action + Action *string + // Link to resource + Href *string + // Custom relation type (follows RFC 5988 where appropriate definitions exist) + Rel *string +} + +func (s *SelfResourceLink) GetType__() bindings.BindingType { + return SelfResourceLinkBindingType() +} + +func (s *SelfResourceLink) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SelfResourceLink._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ServerSslProfileBinding struct { + // authentication depth is used to set the verification depth in the server certificates chain. format: int64 + CertificateChainDepth *int64 + // To support client authentication (load balancer acting as a client authenticating to the backend server), client certificate can be specified in the server-side SSL profile binding + ClientCertificateId *string + // Possible values are: + // + // * ServerSslProfileBinding#ServerSslProfileBinding_SERVER_AUTH_REQUIRED + // * ServerSslProfileBinding#ServerSslProfileBinding_SERVER_AUTH_IGNORE + // + // server authentication mode + ServerAuth *string + // If server auth type is REQUIRED, server certificate must be signed by one of the trusted Certificate Authorities (CAs), also referred to as root CAs, whose self signed certificates are specified. + ServerAuthCaIds []string + // A Certificate Revocation List (CRL) can be specified in the server-side SSL profile binding to disallow compromised server certificates. + ServerAuthCrlIds []string + // Server SSL profile defines reusable, application-independent server side SSL properties. + SslProfileId *string +} + +const ServerSslProfileBinding_SERVER_AUTH_REQUIRED = "REQUIRED" +const ServerSslProfileBinding_SERVER_AUTH_IGNORE = "IGNORE" + +func (s *ServerSslProfileBinding) GetType__() bindings.BindingType { + return ServerSslProfileBindingBindingType() +} + +func (s *ServerSslProfileBinding) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServerSslProfileBinding._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ServiceAssociationListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Possible values are: + // + // * ServiceAssociationListResult#ServiceAssociationListResult_SERVICE_TYPE_FIREWALLSERVICEASSOCIATIONLISTRESULT + // * ServiceAssociationListResult#ServiceAssociationListResult_SERVICE_TYPE_IPFIXSERVICEASSOCIATIONLISTRESULT + ServiceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ServiceAssociationListResult__TYPE_IDENTIFIER = "ServiceAssociationListResult" +const ServiceAssociationListResult_SERVICE_TYPE_FIREWALLSERVICEASSOCIATIONLISTRESULT = "FireWallServiceAssociationListResult" +const ServiceAssociationListResult_SERVICE_TYPE_IPFIXSERVICEASSOCIATIONLISTRESULT = "IpfixServiceAssociationListResult" + +func (s *ServiceAssociationListResult) GetType__() bindings.BindingType { + return ServiceAssociationListResultBindingType() +} + +func (s *ServiceAssociationListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceAssociationListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A ServiceAttachment represents a point on NSX entity (Example - Edge Router) to which ServiceInstance can be connected through an InstanceEndpoint. Example - In VMWare Hybric Cloud Extention (HCX) use case, HCX appliances connect to this Service Attachment Point. We do not handle the lifecycle of these appliance/s. +type ServiceAttachment struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * ServiceAttachment#ServiceAttachment_ATTACHMENT_STATUS_UP + // * ServiceAttachment#ServiceAttachment_ATTACHMENT_STATUS_DOWN + // + // UP - A Service Attachment will have its Service Port - UP and with a configured IP address. DOWN - An Inactive ServiceAttachment has its Service Port - DOWN. It can be used to connect set of appliances that do not need to exchange traffic to/from/through the Edge node. + AttachmentStatus *string + DeployedTo *ResourceReference + // Local IPs associated with this Service Attachment. + LocalIps []IPInfo + // List of LogicalRouters to be connected to the ServicePlane logical switch via a ServiceLink. + LogicalRouters []ResourceReference + LogicalSwitch *ResourceReference + ServicePort *ResourceReference +} + +const ServiceAttachment_ATTACHMENT_STATUS_UP = "UP" +const ServiceAttachment_ATTACHMENT_STATUS_DOWN = "DOWN" + +func (s *ServiceAttachment) GetType__() bindings.BindingType { + return ServiceAttachmentBindingType() +} + +func (s *ServiceAttachment) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceAttachment._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of Service Attachments. +type ServiceAttachmentListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of the Service Attachments. + Results []ServiceAttachment +} + +func (s *ServiceAttachmentListResult) GetType__() bindings.BindingType { + return ServiceAttachmentListResultBindingType() +} + +func (s *ServiceAttachmentListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceAttachmentListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ServiceBinding struct { + ServiceId *ResourceReference +} + +func (s *ServiceBinding) GetType__() bindings.BindingType { + return ServiceBindingBindingType() +} + +func (s *ServiceBinding) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceBinding._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Service capabilities that will be inherited by service VMs created using a service definition that contains this service capability. +type ServiceCapability struct { + // Indicating whether service is configured to decrement SI field in NSH metadata. + CanDecrementSi *bool + // Indicating whether service supports NSH liveness detection. + NshLivenessSupportEnabled *bool +} + +func (s *ServiceCapability) GetType__() bindings.BindingType { + return ServiceCapabilityBindingType() +} + +func (s *ServiceCapability) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceCapability._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Service chain is a set of network Services. A Service chain is made up of ordered list of service profiles belonging to any same or different services. +type ServiceChain struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // List of ServiceInsertionServiceProfiles that constitutes the the service chain. The forward path service profiles are applied to ingress traffic. + ForwardPathServiceProfiles []ResourceReference + // Possible values are: + // + // * ServiceChain#ServiceChain_ON_FAILURE_POLICY_ALLOW + // * ServiceChain#ServiceChain_ON_FAILURE_POLICY_BLOCK + // + // Failure policy for the service tells datapath, the action to take i.e to allow or block traffic during failure scenarios. + OnFailurePolicy *string + // Possible values are: + // + // * ServiceChain#ServiceChain_PATH_SELECTION_POLICY_ANY + // * ServiceChain#ServiceChain_PATH_SELECTION_POLICY_LOCAL + // * ServiceChain#ServiceChain_PATH_SELECTION_POLICY_REMOTE + // + // Path selection policy can be - ANY - Service Insertion is free to redirect to any service path regardless of any load balancing considerations or flow pinning. LOCAL - means to prefer local service insances. REMOTE - preference is to redirect to the SVM co-located on the same host. + PathSelectionPolicy *string + // List of ServiceInsertionServiceProfiles id. Reverse path service profiles are applied to egress traffic and is optional. 2 different set of profiles can be defined for forward and reverse path. If not defined, the reverse of the forward path service profile is applied. + ReversePathServiceProfiles []ResourceReference + // Service attachment specifies the scope i.e Service plane at which the SVMs are deployed. + ServiceAttachments []ResourceReference + // A unique id generated for every service chain. This is not a uuid. + ServiceChainId *string +} + +const ServiceChain_ON_FAILURE_POLICY_ALLOW = "ALLOW" +const ServiceChain_ON_FAILURE_POLICY_BLOCK = "BLOCK" +const ServiceChain_PATH_SELECTION_POLICY_ANY = "ANY" +const ServiceChain_PATH_SELECTION_POLICY_LOCAL = "LOCAL" +const ServiceChain_PATH_SELECTION_POLICY_REMOTE = "REMOTE" + +func (s *ServiceChain) GetType__() bindings.BindingType { + return ServiceChainBindingType() +} + +func (s *ServiceChain) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceChain._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Service Chain List +type ServiceChainListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of the Service-Insertion Services. The list has to be homogenous. + Results []ServiceChain +} + +func (s *ServiceChainListResult) GetType__() bindings.BindingType { + return ServiceChainListResultBindingType() +} + +func (s *ServiceChainListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceChainListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A ServiceInsertionServiceProfile can be part of multiple ServiceChains. ServiceChainMapping for a particular profile will contain a list of all the ServiceChains it's part of. Each Mapping will also contain some metadata to uniquely identify a profile from other profiles. +type ServiceChainMapping struct { + // Possible values are: + // + // * ServiceChainMapping#ServiceChainMapping_DIRECTION_FORWARD + // * ServiceChainMapping#ServiceChainMapping_DIRECTION_REVERSE + // + // Each ServiceChain has forward_path_service_profiles and reverse_path_service_profiles. This property will indicate which of them being used. FORWARD - forward_path_service_profiles REVERSE - reverse_path_service_profiles + Direction *string + // A unique id generated for every ServiceChain. This is not a uuid. + ServiceChainId *string + // Service Index represents a numerical position of a ServiceInsertionServiceProfile in a ServiceChain. It will be in reverse order. Service Index can point to either forward_path_service_profiles or reverse_path_service_profiles indicated by direction property. Example - For a ServiceChain A-B-C, A will have index of 3, B will have index of 2 and C will have index of 1. format: int64 + ServiceIndex *int64 +} + +const ServiceChainMapping_DIRECTION_FORWARD = "FORWARD" +const ServiceChainMapping_DIRECTION_REVERSE = "REVERSE" + +func (s *ServiceChainMapping) GetType__() bindings.BindingType { + return ServiceChainMappingBindingType() +} + +func (s *ServiceChainMapping) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceChainMapping._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Service Chain Mapping List +type ServiceChainMappingListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of the Service Chain Mappings. The list has to be homogenous. + Results []ServiceChainMapping +} + +func (s *ServiceChainMappingListResult) GetType__() bindings.BindingType { + return ServiceChainMappingListResultBindingType() +} + +func (s *ServiceChainMappingListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceChainMappingListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Service configs are groupings of profiles (i.e switch profiles) and configurations applied to resources or collection of resources(NSGroups). +type ServiceConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The list of entities that the configurations should be applied to. This can either be a NSGroup or any other entity like TransportNode, LogicalPorts etc. + AppliedTo []ResourceReference + // Every ServiceConfig has a priority based upon its precedence value. Lower the value of precedence, higher will be its priority. If user doesnt specify the precedence, it is generated automatically by system. The precedence is generated based upon the type of profile used in ServiceConfig. Precedence are auto-generated in decreasing order with difference of 100. Automatically generated precedence value will be 100 less than the current minimum value of precedence of ServiceConfig of a given profile type in system.There cannot be duplicate precedence for ServiceConfig of same profile type. format: int64 + Precedence *int64 + // These are the NSX Profiles which will be added to service config, which will be applied to entities/groups provided to applied_to field of service config. + Profiles []NSXProfileReference +} + +func (s *ServiceConfig) GetType__() bindings.BindingType { + return ServiceConfigBindingType() +} + +func (s *ServiceConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of Service config objects that needs to be either created or updated with the respective profiles and precedence. +type ServiceConfigList struct { + // An Array of ServiceConfig objects containing details of profiles to be applied, entities on which these profiles will be applied and precedence. + ServiceConfigs []ServiceConfig +} + +func (s *ServiceConfigList) GetType__() bindings.BindingType { + return ServiceConfigListBindingType() +} + +func (s *ServiceConfigList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceConfigList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Paged Collection of service configs +type ServiceConfigListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // service config list results + Results []ServiceConfig +} + +func (s *ServiceConfigListResult) GetType__() bindings.BindingType { + return ServiceConfigListResultBindingType() +} + +func (s *ServiceConfigListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceConfigListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Registering a Service is the first step in the ServiceInsertion mechanism. A ServiceDefinition is used to create a service. +type ServiceDefinition struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * ServiceDefinition#ServiceDefinition_ATTACHMENT_POINT_TIER0_LR + // * ServiceDefinition#ServiceDefinition_ATTACHMENT_POINT_TIER1_LR + // * ServiceDefinition#ServiceDefinition_ATTACHMENT_POINT_SERVICE_PLANE + // + // The point at which the service is deployed/attached for redirecting the traffic to the the partner appliance. Attachment Point is required if Service caters to any functionality other than EPP and MPS. + AttachmentPoint []string + // Possible values are: + // + // * ServiceDefinition#ServiceDefinition_FUNCTIONALITIES_NG_FW + // * ServiceDefinition#ServiceDefinition_FUNCTIONALITIES_IDS_IPS + // * ServiceDefinition#ServiceDefinition_FUNCTIONALITIES_NET_MON + // * ServiceDefinition#ServiceDefinition_FUNCTIONALITIES_HCX + // * ServiceDefinition#ServiceDefinition_FUNCTIONALITIES_BYOD + // * ServiceDefinition#ServiceDefinition_FUNCTIONALITIES_EPP + // * ServiceDefinition#ServiceDefinition_FUNCTIONALITIES_TLB + // * ServiceDefinition#ServiceDefinition_FUNCTIONALITIES_MPS + // + // The capabilities provided by the services. Needs to be one or more of the following | NG_FW - Next Generation Firewall | IDS_IPS - Intrusion Detection System / Intrusion Prevention System | NET_MON - Network Monitoring | HCX - Hybrid Cloud Exchange | BYOD - Bring Your Own Device | TLB - Transparent Load Balancer | EPP - Endpoint Protection.(Third party AntiVirus partners using NXGI should use this functionality for the service) | MPS - Malware Prevention Solution + Functionalities []string + // Possible values are: + // + // * ServiceDefinition#ServiceDefinition_IMPLEMENTATIONS_NORTH_SOUTH + // * ServiceDefinition#ServiceDefinition_IMPLEMENTATIONS_EAST_WEST + // + // This indicates the insertion point of the service i.e whether the service will be used to protect North-South or East-West traffic in the datacenter. + Implementations []string + // Possible values are: + // + // * ServiceDefinition#ServiceDefinition_ON_FAILURE_POLICY_ALLOW + // * ServiceDefinition#ServiceDefinition_ON_FAILURE_POLICY_BLOCK + // + // Failure policy for the service tells datapath, the action to take i.e to Allow or Block traffic during failure scenarios. For north-south ServiceInsertion, failure policy in the service instance takes precedence. For east-west ServiceInsertion, failure policy in the service chain takes precedence. BLOCK is not supported for Endpoint protection (EPP) and MPS functionality. + OnFailurePolicy *string + ServiceCapability *ServiceCapability + ServiceDeploymentSpec *ServiceDeploymentSpec + // ID of the service manager to which this service is attached with. This field is not set during creation of service. This field will be set explicitly when Service Manager is created successfully using this service. + ServiceManagerId *string + // Possible values are: + // + // * ServiceDefinition#ServiceDefinition_TRANSPORTS_L2_BRIDGE + // * ServiceDefinition#ServiceDefinition_TRANSPORTS_L3_ROUTED + // * ServiceDefinition#ServiceDefinition_TRANSPORTS_NSH + // + // Transport Type of the service, which is the mechanism of redirecting the traffic to the the partner appliance. Transport type is required if Service caters to any functionality other than EPP and MPS. + Transports []string + // Id which is unique to a vendor or partner for which the service is created. + VendorId *string +} + +const ServiceDefinition_ATTACHMENT_POINT_TIER0_LR = "TIER0_LR" +const ServiceDefinition_ATTACHMENT_POINT_TIER1_LR = "TIER1_LR" +const ServiceDefinition_ATTACHMENT_POINT_SERVICE_PLANE = "SERVICE_PLANE" +const ServiceDefinition_FUNCTIONALITIES_NG_FW = "NG_FW" +const ServiceDefinition_FUNCTIONALITIES_IDS_IPS = "IDS_IPS" +const ServiceDefinition_FUNCTIONALITIES_NET_MON = "NET_MON" +const ServiceDefinition_FUNCTIONALITIES_HCX = "HCX" +const ServiceDefinition_FUNCTIONALITIES_BYOD = "BYOD" +const ServiceDefinition_FUNCTIONALITIES_EPP = "EPP" +const ServiceDefinition_FUNCTIONALITIES_TLB = "TLB" +const ServiceDefinition_FUNCTIONALITIES_MPS = "MPS" +const ServiceDefinition_IMPLEMENTATIONS_NORTH_SOUTH = "NORTH_SOUTH" +const ServiceDefinition_IMPLEMENTATIONS_EAST_WEST = "EAST_WEST" +const ServiceDefinition_ON_FAILURE_POLICY_ALLOW = "ALLOW" +const ServiceDefinition_ON_FAILURE_POLICY_BLOCK = "BLOCK" +const ServiceDefinition_TRANSPORTS_L2_BRIDGE = "L2_BRIDGE" +const ServiceDefinition_TRANSPORTS_L3_ROUTED = "L3_ROUTED" +const ServiceDefinition_TRANSPORTS_NSH = "NSH" + +func (s *ServiceDefinition) GetType__() bindings.BindingType { + return ServiceDefinitionBindingType() +} + +func (s *ServiceDefinition) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceDefinition._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Used to provide the deployment specification for the service. +type ServiceDeployment struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Number of instances in case of clustered deployment. format: int64 + ClusteredDeploymentCount *int64 + // List of resource references where service instance be deployed. Ex. Tier 0 Logical Router in case of N-S ServiceInsertion. Service Attachment in case of E-W ServiceInsertion. + DeployedTo []ResourceReference + // Possible values are: + // + // * ServiceDeployment#ServiceDeployment_DEPLOYMENT_MODE_STAND_ALONE + // * ServiceDeployment#ServiceDeployment_DEPLOYMENT_MODE_ACTIVE_STANDBY + // + // Mode of deployment. Currently, only stand alone deployment is supported. It is a single VM deployed through this deployment spec. In future, HA configurations will be supported here. + DeploymentMode *string + // Name of the deployment spec to be used for deployment, which specifies the OVF provided by the partner and the form factor. + DeploymentSpecName *string + // Possible values are: + // + // * ServiceDeployment#ServiceDeployment_DEPLOYMENT_TYPE_HOSTLOCAL + // * ServiceDeployment#ServiceDeployment_DEPLOYMENT_TYPE_CLUSTERED + // + // Specifies whether the service VM should be deployed on each host such that it provides partner service locally on the host, or whether the service VMs can be deployed as a cluster. If deployment_type is CLUSTERED, then the clustered_deployment_count should be provided. + DeploymentType *string + InstanceDeploymentTemplate *DeploymentTemplate + // Possible values are: + // + // * ServiceDeployment#ServiceDeployment_PERIMETER_CLUSTER + // * ServiceDeployment#ServiceDeployment_PERIMETER_HOST + // + // This indicates the deployment perimeter, such as a VC cluster or a host. + Perimeter *string + ServiceDeploymentConfig *ServiceDeploymentConfig + // The Service to which the service deployment is associated. + ServiceId *string +} + +const ServiceDeployment_DEPLOYMENT_MODE_STAND_ALONE = "STAND_ALONE" +const ServiceDeployment_DEPLOYMENT_MODE_ACTIVE_STANDBY = "ACTIVE_STANDBY" +const ServiceDeployment_DEPLOYMENT_TYPE_HOSTLOCAL = "HOSTLOCAL" +const ServiceDeployment_DEPLOYMENT_TYPE_CLUSTERED = "CLUSTERED" +const ServiceDeployment_PERIMETER_CLUSTER = "CLUSTER" +const ServiceDeployment_PERIMETER_HOST = "HOST" + +func (s *ServiceDeployment) GetType__() bindings.BindingType { + return ServiceDeploymentBindingType() +} + +func (s *ServiceDeployment) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceDeployment._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The Deployment Config contains settings that are applied during install time. +type ServiceDeploymentConfig struct { + // Resource Pool or cluster Id. + ComputeCollectionId *string + // Context Id or VCenter Id. + ComputeManagerId *string + // The service VM will be deployed on the specified host in the specified server within the cluster if host_id is specified. Note: You must ensure that storage and specified networks are accessible by this host. + HostId *string + // Moref of the datastore in VC. If it is to be taken from 'Agent VM Settings', then it should be empty. + StorageId *string + VmNicInfo *VmNicInfo +} + +func (s *ServiceDeploymentConfig) GetType__() bindings.BindingType { + return ServiceDeploymentConfigBindingType() +} + +func (s *ServiceDeploymentConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceDeploymentConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Type of issue and detailed description of the issue in case of deployment failure. +type ServiceDeploymentIssue struct { + // Description of issue encountered while service deployment. + IssueDescription *string + // Timestamp when issue was issue encountered while service deployment. + IssueTimestamp *string + // Type of issue encountered while service deployment. + IssueType *string +} + +func (s *ServiceDeploymentIssue) GetType__() bindings.BindingType { + return ServiceDeploymentIssueBindingType() +} + +func (s *ServiceDeploymentIssue) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceDeploymentIssue._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Result of List of ServiceDeployments +type ServiceDeploymentListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Array of existing ServiceDeployments in database + Results []ServiceDeployment +} + +func (s *ServiceDeploymentListResult) GetType__() bindings.BindingType { + return ServiceDeploymentListResultBindingType() +} + +func (s *ServiceDeploymentListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceDeploymentListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// ServiceDeployment Spec consists of information required to deploy and configure the partner appliances. viz. Deployment template, deployment spec and NIC metatdata. +type ServiceDeploymentSpec struct { + // Deployment Specs holds information required to deploy the Service-VMs. i.e. OVF url where the partner Service-VM OVF is hosted. The host type on which the OVF can be deployed, Form factor to name a few. + DeploymentSpecs []SVMDeploymentSpec + // Deployment Template holds the attributes specific to partner for which the service is created. These attributes are opaque to NSX Manager. + DeploymentTemplate []DeploymentTemplate + // NIC metadata associated with the deployment spec. + NicMetadataList []NicMetadata + // Partner needs to specify the Service VM version which will get deployed. + SvmVersion *string +} + +func (s *ServiceDeploymentSpec) GetType__() bindings.BindingType { + return ServiceDeploymentSpecBindingType() +} + +func (s *ServiceDeploymentSpec) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceDeploymentSpec._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ServiceDeploymentStatus struct { + // List of issue and detailed description of the issue in case of deployment failure. + DeploymentIssues []ServiceDeploymentIssue + // Possible values are: + // + // * ServiceDeploymentStatus#ServiceDeploymentStatus_DEPLOYMENT_STATUS_UPGRADE_IN_PROGRESS + // * ServiceDeploymentStatus#ServiceDeploymentStatus_DEPLOYMENT_STATUS_UPGRADE_FAILED + // * ServiceDeploymentStatus#ServiceDeploymentStatus_DEPLOYMENT_STATUS_DEPLOYMENT_QUEUED + // * ServiceDeploymentStatus#ServiceDeploymentStatus_DEPLOYMENT_STATUS_DEPLOYMENT_IN_PROGRESS + // * ServiceDeploymentStatus#ServiceDeploymentStatus_DEPLOYMENT_STATUS_DEPLOYMENT_FAILED + // * ServiceDeploymentStatus#ServiceDeploymentStatus_DEPLOYMENT_STATUS_DEPLOYMENT_SUCCESSFUL + // * ServiceDeploymentStatus#ServiceDeploymentStatus_DEPLOYMENT_STATUS_UNDEPLOYMENT_QUEUED + // * ServiceDeploymentStatus#ServiceDeploymentStatus_DEPLOYMENT_STATUS_UNDEPLOYMENT_IN_PROGRESS + // * ServiceDeploymentStatus#ServiceDeploymentStatus_DEPLOYMENT_STATUS_UNDEPLOYMENT_FAILED + // * ServiceDeploymentStatus#ServiceDeploymentStatus_DEPLOYMENT_STATUS_UNDEPLOYMENT_SUCCESSFUL + // * ServiceDeploymentStatus#ServiceDeploymentStatus_DEPLOYMENT_STATUS_UPGRADE_QUEUED + // + // Deployment status of NXGI Partner Service-VM on a compute collection. It shows the latest status during the process of deployment, redeploy, upgrade, and un-deployment on a compute collection such as VC cluster. + DeploymentStatus *string + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // Id of service deployment. + ServiceDeploymentId *string + // Currently deployed Service Virtual Appliance version. + SvaCurrentVersion *string + // Max available SVA version for upgrade + SvaMaxAvailableVersion *string +} + +const ServiceDeploymentStatus_DEPLOYMENT_STATUS_UPGRADE_IN_PROGRESS = "UPGRADE_IN_PROGRESS" +const ServiceDeploymentStatus_DEPLOYMENT_STATUS_UPGRADE_FAILED = "UPGRADE_FAILED" +const ServiceDeploymentStatus_DEPLOYMENT_STATUS_DEPLOYMENT_QUEUED = "DEPLOYMENT_QUEUED" +const ServiceDeploymentStatus_DEPLOYMENT_STATUS_DEPLOYMENT_IN_PROGRESS = "DEPLOYMENT_IN_PROGRESS" +const ServiceDeploymentStatus_DEPLOYMENT_STATUS_DEPLOYMENT_FAILED = "DEPLOYMENT_FAILED" +const ServiceDeploymentStatus_DEPLOYMENT_STATUS_DEPLOYMENT_SUCCESSFUL = "DEPLOYMENT_SUCCESSFUL" +const ServiceDeploymentStatus_DEPLOYMENT_STATUS_UNDEPLOYMENT_QUEUED = "UNDEPLOYMENT_QUEUED" +const ServiceDeploymentStatus_DEPLOYMENT_STATUS_UNDEPLOYMENT_IN_PROGRESS = "UNDEPLOYMENT_IN_PROGRESS" +const ServiceDeploymentStatus_DEPLOYMENT_STATUS_UNDEPLOYMENT_FAILED = "UNDEPLOYMENT_FAILED" +const ServiceDeploymentStatus_DEPLOYMENT_STATUS_UNDEPLOYMENT_SUCCESSFUL = "UNDEPLOYMENT_SUCCESSFUL" +const ServiceDeploymentStatus_DEPLOYMENT_STATUS_UPGRADE_QUEUED = "UPGRADE_QUEUED" + +func (s *ServiceDeploymentStatus) GetType__() bindings.BindingType { + return ServiceDeploymentStatusBindingType() +} + +func (s *ServiceDeploymentStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceDeploymentStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ServiceEndpoint struct { + // Certificate or certificate chain + Certificate *string + CertificateSha256Thumbprint *string + // List of entities hosted on accessible through the service endpoint + EntitiesHosted []HostedEntityInfo + Fqdn *string + // IPv4 or IPv6 address format: ip + IpAddress *string + Port *int64 + // Unique identifier of this service endpoint + ServiceEndpointUuid *string +} + +func (s *ServiceEndpoint) GetType__() bindings.BindingType { + return ServiceEndpointBindingType() +} + +func (s *ServiceEndpoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceEndpoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// ServiceInsertion Rule. +type ServiceInsertionRule struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + Owner *OwnerResourceLink + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Identifier of the resource + Id *string + // The type of this resource. + ResourceType *string + // Possible values are: + // + // * ServiceInsertionRule#ServiceInsertionRule_ACTION_ALLOW + // * ServiceInsertionRule#ServiceInsertionRule_ACTION_DROP + // * ServiceInsertionRule#ServiceInsertionRule_ACTION_REJECT + // * ServiceInsertionRule#ServiceInsertionRule_ACTION_REDIRECT + // * ServiceInsertionRule#ServiceInsertionRule_ACTION_DO_NOT_REDIRECT + // * ServiceInsertionRule#ServiceInsertionRule_ACTION_DETECT + // * ServiceInsertionRule#ServiceInsertionRule_ACTION_ALLOW_CONTINUE + // * ServiceInsertionRule#ServiceInsertionRule_ACTION_DETECT_PREVENT + // + // Action enforced on the packets which matches the distributed service rule. Currently DS Layer supports below actions. ALLOW - Forward any packet when a rule with this action gets a match (Used by Firewall). DROP - Drop any packet when a rule with this action gets a match. Packets won't go further(Used by Firewall). REJECT - Terminate TCP connection by sending TCP reset for a packet when a rule with this action gets a match (Used by Firewall). REDIRECT - Redirect any packet to a partner appliance when a rule with this action gets a match (Used by Service Insertion). DO_NOT_REDIRECT - Do not redirect any packet to a partner appliance when a rule with this action gets a match (Used by Service Insertion). DETECT - Detect IDS Signatures. ALLOW_CONTINUE - Allows rules to jump from this rule. Action on matching rules in the destination category will decide next step. Application is default destination until new categories are supported to jump to. DETECT_PREVENT - Detect and Prevent IDS Signatures. + Action *string + // List of object where rule will be enforced. The section level field overrides this one. Null will be treated as any. + AppliedTos []ResourceReference + // List of the destinations. Null will be treated as any. + Destinations []ResourceReference + // Negation of the destination. + DestinationsExcluded *bool + // Possible values are: + // + // * ServiceInsertionRule#ServiceInsertionRule_DIRECTION_IN + // * ServiceInsertionRule#ServiceInsertionRule_DIRECTION_OUT + // * ServiceInsertionRule#ServiceInsertionRule_DIRECTION_IN_OUT + // + // Rule direction in case of stateless distributed service rules. This will only considered if section level parameter is set to stateless. Default to IN_OUT if not specified. + Direction *string + // Flag to disable rule. Disabled will only be persisted but never provisioned/realized. + Disabled *bool + // Possible values are: + // + // * ServiceInsertionRule#ServiceInsertionRule_IP_PROTOCOL_IPV4 + // * ServiceInsertionRule#ServiceInsertionRule_IP_PROTOCOL_IPV6 + // * ServiceInsertionRule#ServiceInsertionRule_IP_PROTOCOL_IPV4_IPV6 + // + // Type of IP packet that should be matched while enforcing the rule. + IpProtocol *string + // Flag to indicate whether rule is default. + IsDefault *bool + // Flag to enable packet logging. Default is disabled. + Logged *bool + // User notes specific to the rule. + Notes *string + // Priority of the rule. format: int64 + Priority *int64 + // User level field which will be printed in CLI and packet logs. + RuleTag *string + // List of sources. Null will be treated as any. + Sources []ResourceReference + // Negation of the source. + SourcesExcluded *bool + // A rule can be redirected to ServiceInstance, InstanceEndpoint for North/South Traffic. A rule can be redirected to ServiceChain for East/West Traffic. For REDIRECT action, redirect_tos is mandatory. For DO_NOT_REDIRECT action, redirect_tos is optional. + RedirectTos []ResourceReference + // ID of the section to which this rule belongs. + SectionId *string + // List of the services. Null will be treated as any. + Services []ServiceInsertionService +} + +const ServiceInsertionRule_ACTION_ALLOW = "ALLOW" +const ServiceInsertionRule_ACTION_DROP = "DROP" +const ServiceInsertionRule_ACTION_REJECT = "REJECT" +const ServiceInsertionRule_ACTION_REDIRECT = "REDIRECT" +const ServiceInsertionRule_ACTION_DO_NOT_REDIRECT = "DO_NOT_REDIRECT" +const ServiceInsertionRule_ACTION_DETECT = "DETECT" +const ServiceInsertionRule_ACTION_ALLOW_CONTINUE = "ALLOW_CONTINUE" +const ServiceInsertionRule_ACTION_DETECT_PREVENT = "DETECT_PREVENT" +const ServiceInsertionRule_DIRECTION_IN = "IN" +const ServiceInsertionRule_DIRECTION_OUT = "OUT" +const ServiceInsertionRule_DIRECTION_IN_OUT = "IN_OUT" +const ServiceInsertionRule_IP_PROTOCOL_IPV4 = "IPV4" +const ServiceInsertionRule_IP_PROTOCOL_IPV6 = "IPV6" +const ServiceInsertionRule_IP_PROTOCOL_IPV4_IPV6 = "IPV4_IPV6" + +func (s *ServiceInsertionRule) GetType__() bindings.BindingType { + return ServiceInsertionRuleBindingType() +} + +func (s *ServiceInsertionRule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceInsertionRule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of ServiceInsertion Rules. +type ServiceInsertionRuleList struct { + // List of ServiceInsertion rules in the section. Only homogeneous rules are supported. + Rules []ServiceInsertionRule +} + +func (s *ServiceInsertionRuleList) GetType__() bindings.BindingType { + return ServiceInsertionRuleListBindingType() +} + +func (s *ServiceInsertionRuleList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceInsertionRuleList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of ServiceInsertion Rules. +type ServiceInsertionRuleListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // ServiceInsertion rule list result with pagination support. + Results []ServiceInsertionRule +} + +func (s *ServiceInsertionRuleListResult) GetType__() bindings.BindingType { + return ServiceInsertionRuleListResultBindingType() +} + +func (s *ServiceInsertionRuleListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceInsertionRuleListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A ServiceInsertion section composed of ServiceInsertion Rules. +type ServiceInsertionSection struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // List of objects where the rules in this section will be enforced. This will take precedence over rule level appliedTo. + AppliedTos []ResourceReference + // It is a boolean flag which reflects whether a distributed service section is default section or not. Each Layer 3 and Layer 2 section will have at least and at most one default section. + IsDefault *bool + // Number of rules in this section. format: int64 + RuleCount *int64 + // Possible values are: + // + // * ServiceInsertionSection#ServiceInsertionSection_SECTION_TYPE_LAYER2 + // * ServiceInsertionSection#ServiceInsertionSection_SECTION_TYPE_LAYER3 + // * ServiceInsertionSection#ServiceInsertionSection_SECTION_TYPE_L3REDIRECT + // * ServiceInsertionSection#ServiceInsertionSection_SECTION_TYPE_IDS + // + // Type of the rules which a section can contain. Only homogeneous sections are supported. + SectionType *string + // Stateful or Stateless nature of distributed service section is enforced on all rules inside the section. Layer3 sections can be stateful or stateless. Layer2 sections can only be stateless. + Stateful *bool + // Ensures that a three way TCP handshake is done before the data packets are sent if the value is set to be true. tcp_strict=true is supported only for stateful sections. + TcpStrict *bool +} + +const ServiceInsertionSection_SECTION_TYPE_LAYER2 = "LAYER2" +const ServiceInsertionSection_SECTION_TYPE_LAYER3 = "LAYER3" +const ServiceInsertionSection_SECTION_TYPE_L3REDIRECT = "L3REDIRECT" +const ServiceInsertionSection_SECTION_TYPE_IDS = "IDS" + +func (s *ServiceInsertionSection) GetType__() bindings.BindingType { + return ServiceInsertionSectionBindingType() +} + +func (s *ServiceInsertionSection) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceInsertionSection._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of ServiceInsertion Sections. +type ServiceInsertionSectionListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of the ServiceInsertion sections. The list has to be homogeneous. + Results []ServiceInsertionSection +} + +func (s *ServiceInsertionSectionListResult) GetType__() bindings.BindingType { + return ServiceInsertionSectionListResultBindingType() +} + +func (s *ServiceInsertionSectionListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceInsertionSectionListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of ServiceInsertion Rules. +type ServiceInsertionSectionRuleList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // List of objects where the rules in this section will be enforced. This will take precedence over rule level appliedTo. + AppliedTos []ResourceReference + // It is a boolean flag which reflects whether a distributed service section is default section or not. Each Layer 3 and Layer 2 section will have at least and at most one default section. + IsDefault *bool + // Number of rules in this section. format: int64 + RuleCount *int64 + // Possible values are: + // + // * ServiceInsertionSectionRuleList#ServiceInsertionSectionRuleList_SECTION_TYPE_LAYER2 + // * ServiceInsertionSectionRuleList#ServiceInsertionSectionRuleList_SECTION_TYPE_LAYER3 + // * ServiceInsertionSectionRuleList#ServiceInsertionSectionRuleList_SECTION_TYPE_L3REDIRECT + // * ServiceInsertionSectionRuleList#ServiceInsertionSectionRuleList_SECTION_TYPE_IDS + // + // Type of the rules which a section can contain. Only homogeneous sections are supported. + SectionType *string + // Stateful or Stateless nature of distributed service section is enforced on all rules inside the section. Layer3 sections can be stateful or stateless. Layer2 sections can only be stateless. + Stateful *bool + // Ensures that a three way TCP handshake is done before the data packets are sent if the value is set to be true. tcp_strict=true is supported only for stateful sections. + TcpStrict *bool + // List of Service Insertion rules in the section. Only homogeneous rules are supported. + Rules []ServiceInsertionRule +} + +const ServiceInsertionSectionRuleList_SECTION_TYPE_LAYER2 = "LAYER2" +const ServiceInsertionSectionRuleList_SECTION_TYPE_LAYER3 = "LAYER3" +const ServiceInsertionSectionRuleList_SECTION_TYPE_L3REDIRECT = "L3REDIRECT" +const ServiceInsertionSectionRuleList_SECTION_TYPE_IDS = "IDS" + +func (s *ServiceInsertionSectionRuleList) GetType__() bindings.BindingType { + return ServiceInsertionSectionRuleListBindingType() +} + +func (s *ServiceInsertionSectionRuleList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceInsertionSectionRuleList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Protocol on which a particular ServiceInsertion Rule should apply to. +type ServiceInsertionService struct { + // Will be set to false if the referenced NSX resource has been deleted. + IsValid *bool + // Display name of the NSX resource. + TargetDisplayName *string + // Identifier of the NSX resource. + TargetId *string + // Type of the NSX resource. + TargetType *string + Service *data.StructValue +} + +func (s *ServiceInsertionService) GetType__() bindings.BindingType { + return ServiceInsertionServiceBindingType() +} + +func (s *ServiceInsertionService) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceInsertionService._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Service List +type ServiceInsertionServiceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of the Service-Insertion Services. The list has to be homogenous. + Results []ServiceDefinition +} + +func (s *ServiceInsertionServiceListResult) GetType__() bindings.BindingType { + return ServiceInsertionServiceListResultBindingType() +} + +func (s *ServiceInsertionServiceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceInsertionServiceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Service profile represents a specialization of vendor template. +type ServiceInsertionServiceProfile struct { + // List of attributes specific to a partner for which the service is created. These attributes are passed on to the partner appliance and are opaque to the NSX Manager. If a vendor template exposes configurables, then the values are specified here. + Attributes []Attribute + // Possible values are: + // + // * ServiceInsertionServiceProfile#ServiceInsertionServiceProfile_REDIRECTION_ACTION_PUNT + // * ServiceInsertionServiceProfile#ServiceInsertionServiceProfile_REDIRECTION_ACTION_COPY + // + // The redirection action represents if the packet is exclusively redirected to the service, or if a copy is forwarded to the service. The service insertion profile inherits the redirection action if already specified at the vendor template. However the service profile cannot overide the action specified at the vendor template. + RedirectionAction *string + // The service to which the service profile belongs. + ServiceId *string + // Id of the vendor template to be used by the servive profile. + VendorTemplateId *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Service Profile type, for example 'GiServiceProfile', 'ServiceInsertionServiceProfile' + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ServiceInsertionServiceProfile__TYPE_IDENTIFIER = "ServiceInsertionServiceProfile" +const ServiceInsertionServiceProfile_REDIRECTION_ACTION_PUNT = "PUNT" +const ServiceInsertionServiceProfile_REDIRECTION_ACTION_COPY = "COPY" + +func (s *ServiceInsertionServiceProfile) GetType__() bindings.BindingType { + return ServiceInsertionServiceProfileBindingType() +} + +func (s *ServiceInsertionServiceProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceInsertionServiceProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// It represents global status of Service Insertion for a particular context type. It shows whether a service insertion is enabled or not for a type. +type ServiceInsertionStatus struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * ServiceInsertionStatus#ServiceInsertionStatus_CONTEXT_EAST_WEST + // * ServiceInsertionStatus#ServiceInsertionStatus_CONTEXT_NORTH_SOUTH + // + // Type of service insertion contexts. + Context *string + // Possible values are: + // + // * ServiceInsertionStatus#ServiceInsertionStatus_GLOBAL_STATUS_DISABLED + // * ServiceInsertionStatus#ServiceInsertionStatus_GLOBAL_STATUS_ENABLED + // + // service insertion status for a context type (e.g. east_west traffic). + GlobalStatus *string +} + +const ServiceInsertionStatus_CONTEXT_EAST_WEST = "east_west" +const ServiceInsertionStatus_CONTEXT_NORTH_SOUTH = "north_south" +const ServiceInsertionStatus_GLOBAL_STATUS_DISABLED = "DISABLED" +const ServiceInsertionStatus_GLOBAL_STATUS_ENABLED = "ENABLED" + +func (s *ServiceInsertionStatus) GetType__() bindings.BindingType { + return ServiceInsertionStatusBindingType() +} + +func (s *ServiceInsertionStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceInsertionStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List of service insertion statuses for a context or all context +type ServiceInsertionStatusListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + Results []ServiceInsertionStatus +} + +func (s *ServiceInsertionStatusListResult) GetType__() bindings.BindingType { + return ServiceInsertionStatusListResultBindingType() +} + +func (s *ServiceInsertionStatusListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceInsertionStatusListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The deployment of a registered service. Service instance is instantiation of service. It is the most used type of instance. It is a default instance to be used when NSX handles lifecycle of appliance. Deployment and appliance related all the information is necessary. +type ServiceInstance struct { + // Possible values are: + // + // * ServiceInstance#ServiceInstance_ATTACHMENT_POINT_TIER0_LR + // * ServiceInstance#ServiceInstance_ATTACHMENT_POINT_TIER1_LR + // * ServiceInstance#ServiceInstance_ATTACHMENT_POINT_SERVICE_PLANE + // * ServiceInstance#ServiceInstance_ATTACHMENT_POINT_HOST + // + // Attachment point to be used by this service instance for deploying the Service-VM. + AttachmentPoint *string + // List of resource references where service instance be deployed. Ex. Tier 0 Logical Router in case of N-S ServiceInsertion. + DeployedTo []ResourceReference + // Possible values are: + // + // * ServiceInstance#ServiceInstance_DEPLOYMENT_MODE_STAND_ALONE + // * ServiceInstance#ServiceInstance_DEPLOYMENT_MODE_ACTIVE_STANDBY + // + // Deployment mode specifies where the partner appliance will be deployed in HA or non-HA i.e standalone mode. + DeploymentMode *string + // Name of the deployment spec to be used by this service instance. + DeploymentSpecName *string + // Possible values are: + // + // * ServiceInstance#ServiceInstance_IMPLEMENTATION_TYPE_NORTH_SOUTH + // * ServiceInstance#ServiceInstance_IMPLEMENTATION_TYPE_EAST_WEST + // + // Implementation to be used by this service instance for deploying the Service-VM. + ImplementationType *string + InstanceDeploymentConfig *InstanceDeploymentConfig + InstanceDeploymentTemplate *DeploymentTemplate + // Id of the Service Deployment using which the instances were deployed. Its available only for instances that were deployed using service deployment API. + ServiceDeploymentId *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * BaseServiceInstance#BaseServiceInstance_RESOURCE_TYPE_SERVICEINSTANCE + // * BaseServiceInstance#BaseServiceInstance_RESOURCE_TYPE_BYODSERVICEINSTANCE + // * BaseServiceInstance#BaseServiceInstance_RESOURCE_TYPE_VIRTUALSERVICEINSTANCE + // + // ServiceInstance is used when NSX handles the lifecyle of appliance. Deployment and appliance related all the information is necessary. ByodServiceInstance is a custom instance to be used when NSX is not handling the lifecycles of appliance/s. User will manage their own appliance (BYOD) to connect with NSX. VirtualServiceInstance is a a custom instance to be used when NSX is not handling the lifecycle of an appliance and when the user is not bringing their own appliance. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * BaseServiceInstance#BaseServiceInstance_ON_FAILURE_POLICY_ALLOW + // * BaseServiceInstance#BaseServiceInstance_ON_FAILURE_POLICY_BLOCK + // + // Failure policy of the service instance - if it has to be different from the service. By default the service instance inherits the FailurePolicy of the service it belongs to. + OnFailurePolicy *string + // The Service to which the service instance is associated. + ServiceId *string + // Possible values are: + // + // * BaseServiceInstance#BaseServiceInstance_TRANSPORT_TYPE_L2_BRIDGE + // * BaseServiceInstance#BaseServiceInstance_TRANSPORT_TYPE_L3_ROUTED + // * BaseServiceInstance#BaseServiceInstance_TRANSPORT_TYPE_NSH + // * BaseServiceInstance#BaseServiceInstance_TRANSPORT_TYPE_NA + // + // Transport to be used by this service instance for deploying the Service-VM. This field is to be set Not Applicable(NA) if the service only caters to functionality EPP(Endpoint Protection) and MPS. + TransportType *string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const ServiceInstance__TYPE_IDENTIFIER = "ServiceInstance" +const ServiceInstance_ATTACHMENT_POINT_TIER0_LR = "TIER0_LR" +const ServiceInstance_ATTACHMENT_POINT_TIER1_LR = "TIER1_LR" +const ServiceInstance_ATTACHMENT_POINT_SERVICE_PLANE = "SERVICE_PLANE" +const ServiceInstance_ATTACHMENT_POINT_HOST = "HOST" +const ServiceInstance_DEPLOYMENT_MODE_STAND_ALONE = "STAND_ALONE" +const ServiceInstance_DEPLOYMENT_MODE_ACTIVE_STANDBY = "ACTIVE_STANDBY" +const ServiceInstance_IMPLEMENTATION_TYPE_NORTH_SOUTH = "NORTH_SOUTH" +const ServiceInstance_IMPLEMENTATION_TYPE_EAST_WEST = "EAST_WEST" + +func (s *ServiceInstance) GetType__() bindings.BindingType { + return ServiceInstanceBindingType() +} + +func (s *ServiceInstance) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceInstance._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Health Status of a third party partner VM. +type ServiceInstanceHealthStatus struct { + // Latest timestamp when mux was connected to SVA. + ConnectTimestamp *string + // The parameter is set if the last received health status is older than the predefined interval. + IsStale *bool + // Protocol version might be different in both Mux and SVA. + IsSvaMuxIncompatible *bool + // Status of multiplexer which forwards the events from guest virtual machines to the partner appliance. + MuxConnectedStatus *string + // Mux version when Mux and SVA are incompatible + MuxIncompatibleVersion *string + // Status of third party partner solution application. + SolutionStatus *string + // Version of third party partner solution application. + SolutionVersion *string + // Latest timestamp when health status is received. + SyncTime *string +} + +func (s *ServiceInstanceHealthStatus) GetType__() bindings.BindingType { + return ServiceInstanceHealthStatusBindingType() +} + +func (s *ServiceInstanceHealthStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceInstanceHealthStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Service Instance List +type ServiceInstanceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of the Service-Insertion ServicesInstances. The list has to be homogenous. + Results []*data.StructValue +} + +func (s *ServiceInstanceListResult) GetType__() bindings.BindingType { + return ServiceInstanceListResultBindingType() +} + +func (s *ServiceInstanceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceInstanceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// ServiceInstanceNSGroups contains list of NS Groups referenced in North-South Service Insertion Rules for a particular Service Instance. +type ServiceInstanceNSGroups struct { + // List of NSGroups Used in ServiceInsertion Rules. + Nsroups []NSGroupInfo +} + +func (s *ServiceInstanceNSGroups) GetType__() bindings.BindingType { + return ServiceInstanceNSGroupsBindingType() +} + +func (s *ServiceInstanceNSGroups) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceInstanceNSGroups._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ServiceInstanceStatus struct { + ConfigurationIssue *SVMConfigureIssue + InstanceDeploymentStatus *ServiceDeploymentStatus + InstanceHealthStatus *ServiceInstanceHealthStatus + // Id of an instantiation of a registered service. + ServiceInstanceId *string +} + +func (s *ServiceInstanceStatus) GetType__() bindings.BindingType { + return ServiceInstanceStatusBindingType() +} + +func (s *ServiceInstanceStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceInstanceStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Partner console endpoint information for enabling NSX to callback with events and status. +type ServiceManager struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + AuthenticationScheme *CallbackAuthenticationScheme + // Integer port value to specify a standard/non-standard HTTPS port. format: int64 + Port *int64 + // IP address or fully qualified domain name of the partner REST server. + Server *string + // The IDs of services, provided by partner. + ServiceIds []ResourceReference + // Thumbprint (SHA-256 hash represented in lower case hex) for the certificate on the partner console. This will be required to establish secure communication with the console and to avoid man-in-the-middle attacks. + Thumbprint *string + // URI on which notification requests should be made on the specified server. + Uri *string + // Id which is unique to a vendor or partner for which the service is created. + VendorId *string +} + +func (s *ServiceManager) GetType__() bindings.BindingType { + return ServiceManagerBindingType() +} + +func (s *ServiceManager) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceManager._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Service Manager List Result +type ServiceManagerListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of the Service-managers. + Results []ServiceManager +} + +func (s *ServiceManagerListResult) GetType__() bindings.BindingType { + return ServiceManagerListResultBindingType() +} + +func (s *ServiceManagerListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceManagerListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// An instance of service chain that consists of forward and reverse service paths. +type ServicePath struct { + ForwardPath *UnidirectionalServicePath + ReversePath *UnidirectionalServicePath + // A unique id of a service chain. format: int64 + ServiceChainId *int64 + // Uuid of a service chain. + ServiceChainUuid *string + // Unique identifier of a service path. format: int64 + ServicePathId *int64 +} + +func (s *ServicePath) GetType__() bindings.BindingType { + return ServicePathBindingType() +} + +func (s *ServicePath) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServicePath._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents a service VM implementing a particular service in a service chain +type ServicePathHop struct { + // Possible values are: + // + // * ServicePathHop#ServicePathHop_ACTION_SERVICE_ACTION_INVALID + // * ServicePathHop#ServicePathHop_ACTION_COPY + // * ServicePathHop#ServicePathHop_ACTION_REDIRECT + // + // Action that will be taken by the corresponding service VM of the hop. + Action *string + // Indicating whether service is configured to decrement SI field in NSH metadata. + CanDecrementSi *bool + // Indicating the maintenance mode of the corresponding service VM. + InMaintenanceMode *bool + // Indicating whether the corresponding service VM is active or not per CCP. + IsActiveFromCcp *bool + // Indicating whether the corresponding service VM is active or not per DP. + IsActiveFromDp *bool + // Indicating whether the corresponding service VM is active or not per MP. + IsActiveFromMp *bool + // MAC address of the virtual network interface. + MacAddress *string + // Indicating whether NSH liveness is supported or not by the corresponding service VM. + NshLivenessSupport *bool + // ID of the virtual network interface. + Vif *string +} + +const ServicePathHop_ACTION_SERVICE_ACTION_INVALID = "SERVICE_ACTION_INVALID" +const ServicePathHop_ACTION_COPY = "COPY" +const ServicePathHop_ACTION_REDIRECT = "REDIRECT" + +func (s *ServicePathHop) GetType__() bindings.BindingType { + return ServicePathHopBindingType() +} + +func (s *ServicePathHop) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServicePathHop._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Service path list +type ServicePathListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of homogenous service paths + Results []ServicePath +} + +func (s *ServicePathListResult) GetType__() bindings.BindingType { + return ServicePathListResultBindingType() +} + +func (s *ServicePathListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServicePathListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// ServiceProfileNSGroups contains list of NS Groups referenced in Service Insertion Rules. To be considered, Service profile must be part of a Service Chain and that Service chain must be used in a Rule. +type ServiceProfileNSGroups struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // List of NSGroups Used in ServiceInsertion Rules. + Nsroups []NSGroupInfo +} + +func (s *ServiceProfileNSGroups) GetType__() bindings.BindingType { + return ServiceProfileNSGroupsBindingType() +} + +func (s *ServiceProfileNSGroups) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceProfileNSGroups._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ServiceRouterAllocationConfig struct { + AllocationPool *data.StructValue + // To reallocate TIER1 logical router on new or existing edge cluster + EdgeClusterId *string + // For TIER 1 logical router, for manual placement of service router within the cluster, edge cluster member indices needs to be provided else same will be auto-allocated. You can provide maximum two indices for HA ACTIVE_STANDBY. format: int64 + EdgeClusterMemberIndices []int64 +} + +func (s *ServiceRouterAllocationConfig) GetType__() bindings.BindingType { + return ServiceRouterAllocationConfigBindingType() +} + +func (s *ServiceRouterAllocationConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ServiceRouterAllocationConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Details of session based login credential to login to server. +type SessionLoginCredential struct { + // The session_id to login to server. + SessionId *string + // Thumbprint of the login server. + Thumbprint *string + // Possible values are 'UsernamePasswordLoginCredential', 'VerifiableAsymmetricLoginCredential', 'SessionLoginCredential'. + CredentialType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const SessionLoginCredential__TYPE_IDENTIFIER = "SessionLoginCredential" + +func (s *SessionLoginCredential) GetType__() bindings.BindingType { + return SessionLoginCredentialBindingType() +} + +func (s *SessionLoginCredential) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SessionLoginCredential._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Data for setting Appliance Proxy certificate for inter-site communication +type SetInterSiteAphCertificateRequest struct { + // ID of the certificate that is already imported. + CertId *string + // ID of the node that this certificate is used on. + UsedById *string +} + +func (s *SetInterSiteAphCertificateRequest) GetType__() bindings.BindingType { + return SetInterSiteAphCertificateRequestBindingType() +} + +func (s *SetInterSiteAphCertificateRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SetInterSiteAphCertificateRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Data for setting a principal identity certificate +type SetPrincipalIdentityCertificateForFederationRequest struct { + // Id of the certificate + CertId *string + // Possible values are: + // + // * SetPrincipalIdentityCertificateForFederationRequest#SetPrincipalIdentityCertificateForFederationRequest_SERVICE_TYPE_LOCAL_MANAGER + // * SetPrincipalIdentityCertificateForFederationRequest#SetPrincipalIdentityCertificateForFederationRequest_SERVICE_TYPE_GLOBAL_MANAGER + // + // Service type for which the certificate should be used. + ServiceType *string +} + +const SetPrincipalIdentityCertificateForFederationRequest_SERVICE_TYPE_LOCAL_MANAGER = "LOCAL_MANAGER" +const SetPrincipalIdentityCertificateForFederationRequest_SERVICE_TYPE_GLOBAL_MANAGER = "GLOBAL_MANAGER" + +func (s *SetPrincipalIdentityCertificateForFederationRequest) GetType__() bindings.BindingType { + return SetPrincipalIdentityCertificateForFederationRequestBindingType() +} + +func (s *SetPrincipalIdentityCertificateForFederationRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SetPrincipalIdentityCertificateForFederationRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Contains Setup details of nsx appliance. +type SetupDetails struct { + // User principal. + PrincipalIdentity *string +} + +func (s *SetupDetails) GetType__() bindings.BindingType { + return SetupDetailsBindingType() +} + +func (s *SetupDetails) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SetupDetails._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SftpProtocol struct { + AuthenticationScheme *PasswordAuthenticationScheme + // SSH fingerprint of server + SshFingerprint *string + // Possible values are: + // + // * Protocol#Protocol_NAME_HTTP + // * Protocol#Protocol_NAME_HTTPS + // * Protocol#Protocol_NAME_SCP + // * Protocol#Protocol_NAME_SFTP + // + // Protocol name + Name string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const SftpProtocol__TYPE_IDENTIFIER = "SftpProtocol" + +func (s *SftpProtocol) GetType__() bindings.BindingType { + return SftpProtocolBindingType() +} + +func (s *SftpProtocol) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SftpProtocol._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SiteCompatibilityInfo struct { + // Compatibility list + CompatibilityList []string + // Site version + SiteVersion *string +} + +func (s *SiteCompatibilityInfo) GetType__() bindings.BindingType { + return SiteCompatibilityInfoBindingType() +} + +func (s *SiteCompatibilityInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SiteCompatibilityInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SiteStatus struct { + // Site name + SiteName *string + // Connection status + Stubs []StubStatus +} + +func (s *SiteStatus) GetType__() bindings.BindingType { + return SiteStatusBindingType() +} + +func (s *SiteStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SiteStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This object contains SNMP v2c and SNMP v3 properties. +type SnmpProperties struct { + V2c *Snmpv2cProperties + V3 *Snmpv3Properties +} + +func (s *SnmpProperties) GetType__() bindings.BindingType { + return SnmpPropertiesBindingType() +} + +func (s *SnmpProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SnmpProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// SNMP Service properties +type SnmpServiceProperties struct { + // SNMP v1, v2c community strings + Communities []string + // Start when system boots + StartOnBoot *bool + // SNMP v2 is configured or not + V2Configured *bool + // Possible values are: + // + // * SnmpServiceProperties#SnmpServiceProperties_V3AUTH_PROTOCOL_SHA1 + // + // SNMP v3 auth protocol + V3AuthProtocol *string + // SNMP v3 is configured or not + V3Configured *bool + // Possible values are: + // + // * SnmpServiceProperties#SnmpServiceProperties_V3PRIV_PROTOCOL_AES128 + // + // SNMP v3 private protocol + V3PrivProtocol *string + // SNMP v3 users information + V3Users []SnmpV3User +} + +const SnmpServiceProperties_V3AUTH_PROTOCOL_SHA1 = "SHA1" +const SnmpServiceProperties_V3PRIV_PROTOCOL_AES128 = "AES128" + +func (s *SnmpServiceProperties) GetType__() bindings.BindingType { + return SnmpServicePropertiesBindingType() +} + +func (s *SnmpServiceProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SnmpServiceProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// SNMP v3 user properties +type SnmpV3User struct { + // SNMP v3 user auth password + AuthPassword *string + // SNMP v3 user private password + PrivPassword *string + // SNMP v3 user ID + UserId *string +} + +func (s *SnmpV3User) GetType__() bindings.BindingType { + return SnmpV3UserBindingType() +} + +func (s *SnmpV3User) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SnmpV3User._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This object contains SNMP v2c community identifier, shared secret and access properties. +type Snmpv2cCommunity struct { + // Possible values are: + // + // * Snmpv2cCommunity#Snmpv2cCommunity_ACCESS_ONLY + // + // Access permissions for polling NSX nodes over SNMP v2c. + Access *string + // Unique, non-sensitive community name to identify community. + CommunityName *string + // Community string. This is considered a shared secret and therefore sensitive information. This field is required when adding a community. When updating a community, do not include this field in the request. If this field is present in an update request, it will be considered as a new value for community string. + CommunityString *string +} + +const Snmpv2cCommunity_ACCESS_ONLY = "READ_ONLY" + +func (s *Snmpv2cCommunity) GetType__() bindings.BindingType { + return Snmpv2cCommunityBindingType() +} + +func (s *Snmpv2cCommunity) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Snmpv2cCommunity._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This object contains list of SNMP v2c communities used to poll NSX nodes over SNMP and list of SNMP v2c targets used to receive SNMP traps/notifications from NSX nodes. +type Snmpv2cProperties struct { + // List of SNMP v2c communities allowed to poll NSX nodes over SNMP v2c. + Communities []Snmpv2cCommunity + // List of SNMP v2c targets/receivers where SNMP v2c traps/notifications will be sent from NSX nodes. + Targets []Snmpv2cTarget +} + +func (s *Snmpv2cProperties) GetType__() bindings.BindingType { + return Snmpv2cPropertiesBindingType() +} + +func (s *Snmpv2cProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Snmpv2cProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This object contains SNMP v2c target/receiver where SNMP traps/notifications will be sent. +type Snmpv2cTarget struct { + // Unique non-sensitive community name to identify community. + CommunityName *string + // Community string (shared secret). This field is required when adding a community target. When updating a community target, do not include this field in the request. If this field is present in an update request, it will be considered as a new value for community string. + CommunityString *string + // SNMP v2c target server's port number. format: int64 + Port *int64 + // SNMP v2c target server's IP or FQDN. format: hostname-or-ipv4 + Server *string +} + +func (s *Snmpv2cTarget) GetType__() bindings.BindingType { + return Snmpv2cTargetBindingType() +} + +func (s *Snmpv2cTarget) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Snmpv2cTarget._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This object contains list of SNMP v3 users used to poll NSX nodes over SNMP and list of SNMP v3 targets used to receive SNMP traps/notifications from NSX nodes. Users specified in a SNMP v3 target must exist in the list of SNMP v3 users. +type Snmpv3Properties struct { + // Possible values are: + // + // * Snmpv3Properties#Snmpv3Properties_AUTH_PROTOCOL_SHA1 + // + // Authentication protocol used for SNMP v3 communication. + AuthProtocol *string + // Possible values are: + // + // * Snmpv3Properties#Snmpv3Properties_PRIV_PROTOCOL_AES128 + // + // Privacy protocol used for SNMP v3 communication. + PrivProtocol *string + // List of SNMP v3 targets/receivers where SNMP v3 traps/notifications will be sent from NSX nodes. + Targets []Snmpv3Target + // List of SNMP v3 users allowed to poll NSX nodes over SNMP. Also, users specified in a SNMP v3 target must exist in this list. + Users []Snmpv3User +} + +const Snmpv3Properties_AUTH_PROTOCOL_SHA1 = "SHA1" +const Snmpv3Properties_PRIV_PROTOCOL_AES128 = "AES128" + +func (s *Snmpv3Properties) GetType__() bindings.BindingType { + return Snmpv3PropertiesBindingType() +} + +func (s *Snmpv3Properties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Snmpv3Properties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This object contains SNMP v3 target/receiver where SNMP traps/notifications will be sent. +type Snmpv3Target struct { + // SNMP v3 target server's port. format: int64 + Port *int64 + // Possible values are: + // + // * Snmpv3Target#Snmpv3Target_SECURITY_LEVEL_PRIV + // + // Security level indicates whether SNMP communication involves authentication and privacy protocols for this user. Value \"AUTH_PRIV\" indicates both authentication and privacy protocols will be used for SNMP communication. + SecurityLevel *string + // SNMP v3 target server's IP or FQDN. format: hostname-or-ipv4 + Server *string + // SNMP v3 user id used to notify target server. This SNMP v3 user should already be added in this profile. + UserId *string +} + +const Snmpv3Target_SECURITY_LEVEL_PRIV = "AUTH_PRIV" + +func (s *Snmpv3Target) GetType__() bindings.BindingType { + return Snmpv3TargetBindingType() +} + +func (s *Snmpv3Target) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Snmpv3Target._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This object contains properties for a SNMP v3 user that can be used to receive SNMP traps/notifications from NSX and/or poll NSX nodes over SNMP. +type Snmpv3User struct { + // Possible values are: + // + // * Snmpv3User#Snmpv3User_ACCESS_ONLY + // + // Access permissions for polling NSX nodes over SNMP v3. + Access *string + // Authentication password used for SNMP v3 communication. This field is required when adding a user. When updating a user, do not include this field in the request. If this field is present in an update request, it will be considered as a new value for authentication password. + AuthPassword *string + // Privacy password used for SNMP v3 communication. This field is required when adding a user. When updating a user, do not include this field in the request. If this field is present in an update request, it will be considered as a new value for privacy password. + PrivPassword *string + // Possible values are: + // + // * Snmpv3User#Snmpv3User_SECURITY_LEVEL_PRIV + // + // Security level indicates whether SNMP communication involves authentication and privacy protocols for this user. Value \"AUTH_PRIV\" indicates both authentication and privacy protocols will be used for SNMP communication. + SecurityLevel *string + // Unique SNMP v3 user id. + UserId *string +} + +const Snmpv3User_ACCESS_ONLY = "READ_ONLY" +const Snmpv3User_SECURITY_LEVEL_PRIV = "AUTH_PRIV" + +func (s *Snmpv3User) GetType__() bindings.BindingType { + return Snmpv3UserBindingType() +} + +func (s *Snmpv3User) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Snmpv3User._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Software module details +type SoftwareModule struct { + // Name of the module in the node + ModuleName *string + // Version of the module in the node + ModuleVersion *string +} + +func (s *SoftwareModule) GetType__() bindings.BindingType { + return SoftwareModuleBindingType() +} + +func (s *SoftwareModule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SoftwareModule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Software module result +type SoftwareModuleResult struct { + // Software module results + SoftwareModules []SoftwareModule +} + +func (s *SoftwareModuleResult) GetType__() bindings.BindingType { + return SoftwareModuleResultBindingType() +} + +func (s *SoftwareModuleResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SoftwareModuleResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Solution Config would contain Vendor specific information required for configuring the NXGI partner Service after deployment. +type SolutionConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Partner needs to specify their assigned control IP with which they have configured their OVFs. format: ipv4 + ControlIp *string + // Partner needs to specify their port on which their solution application which consumes NXGI EPSec library listens. format: int32 + ListenPort *int64 + // The service to which the solution config belongs. + ServiceId *string + // Partner needs to specify Solution Id assigned by VMware. + SolutionId *string +} + +func (s *SolutionConfig) GetType__() bindings.BindingType { + return SolutionConfigBindingType() +} + +func (s *SolutionConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SolutionConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Solution Config List +type SolutionConfigListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of the Solution Config. + Results []SolutionConfig +} + +func (s *SolutionConfigListResult) GetType__() bindings.BindingType { + return SolutionConfigListResultBindingType() +} + +func (s *SolutionConfigListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SolutionConfigListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Service insertion data path inserts unique 'source node id' value into each packet before it received by Service VM. This value can be resolved to multiple Source Entities. It represents source of the packets. +type SourceEntity struct { + // UUID of Source entity + SourceEntityId *string + // Possible values are: + // + // * SourceEntity#SourceEntity_SOURCE_ENTITY_TYPE_NETWORK_INTERFACE + // * SourceEntity#SourceEntity_SOURCE_ENTITY_TYPE_MACHINE + // + // Type of source entity. Currently source value can be resolved to VIF and Virtual Machine. + SourceEntityType *string +} + +const SourceEntity_SOURCE_ENTITY_TYPE_NETWORK_INTERFACE = "VIRTUAL_NETWORK_INTERFACE" +const SourceEntity_SOURCE_ENTITY_TYPE_MACHINE = "VIRTUAL_MACHINE" + +func (s *SourceEntity) GetType__() bindings.BindingType { + return SourceEntityBindingType() +} + +func (s *SourceEntity) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SourceEntity._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Service Entity List +type SourceEntityResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of the Service Entities + Results []SourceEntity +} + +func (s *SourceEntityResult) GetType__() bindings.BindingType { + return SourceEntityResultBindingType() +} + +func (s *SourceEntityResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SourceEntityResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Details about an existing NSX manager to be migrated +type SourceNsxApiEndpoint struct { + // Auth token used to make REST calls to the source NSX API endpoint. This field is not applicable in case of vSphere network migration. Please generate the token with a sufficiently large duration so that it does not expire in the middle of the migration. If it does expire, then the token needs to be refreshed manually by invoking this API again with a new token. Alternatively, you can provide the username/password of the source NSX. + AuthToken *string + // IP address or hostname of a source NSX API endpoint. This field is not applicable in case of vSphere network migration. format: hostname-or-ip + Ip *string + // Password for connecting to NSX manager. This field is not applicable in case of vSphere network migration. + NsxPassword *string + // Signifies Universal Sync role status (STANDALONE, PRIMARY, SECONDARY) of a source NSX API endpoint. + NsxSyncrole *string + // Username for connecting to NSX manager. This field is not applicable in case of vSphere network migration. + NsxUsername *string + // Build version (major, minor, patch) of a source NSX API endpoint. + NsxVersion *string + // IP address or host name of VC. format: hostname-or-ip + VcIp *string + // Password for connecting to VC. + VcPassword *string + // VC port that will be used to fetch details. format: int32 + VcPort *int64 + // Username for connecting to VC. + VcUsername *string + // Build version of VC. + VcVersion *string +} + +func (s *SourceNsxApiEndpoint) GetType__() bindings.BindingType { + return SourceNsxApiEndpointBindingType() +} + +func (s *SourceNsxApiEndpoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SourceNsxApiEndpoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents configuration for spacer widget. For this widget the data source is not applicable. This widget can be use to add the space inside the dashboard container. +type SpacerWidgetConfiguration struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_TIMERANGEDROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_SPACERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LEGENDWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration, CustomFilterWidgetConfiguration, TimeRangeDropdownFilterWidgetConfiguration, SpacerWidgetConfiguration, LegendWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If the condition is met then the widget will be displayed to UI. If no condition is provided, then the widget will be displayed unconditionally. + Condition *string + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + FeatureSet *FeatureSet + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. This field is deprecated instead use 'filters' property. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + // A List of filter applied to this widget configuration. This will be used to identify the filters applied to this widget. + Filters []string + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + Legend *Legend + // List of plotting configuration for a given widget. Widget plotting configurations which are common across all the widgets types should be define here. + PlotConfigs []WidgetPlotConfiguration + // Represents the vertical span of the widget / container. 1 Row span is equal to 20px. format: int32 + Rowspan *int64 + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // If the value of this field is set to true then card header will be displayed otherwise only card will be displayed without header. + ShowHeader *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const SpacerWidgetConfiguration__TYPE_IDENTIFIER = "SpacerWidgetConfiguration" + +func (s *SpacerWidgetConfiguration) GetType__() bindings.BindingType { + return SpacerWidgetConfigurationBindingType() +} + +func (s *SpacerWidgetConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SpacerWidgetConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// SpoofGuard configuration +type SpoofGuardSwitchingProfile struct { + // Possible values are: + // + // * SpoofGuardSwitchingProfile#SpoofGuardSwitchingProfile_WHITE_LIST_PROVIDERS_LPORT_BINDINGS + // * SpoofGuardSwitchingProfile#SpoofGuardSwitchingProfile_WHITE_LIST_PROVIDERS_LSWITCH_BINDINGS + // + // List of providers for white listed address bindings. + WhiteListProviders []string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + RequiredCapabilities []string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const SpoofGuardSwitchingProfile__TYPE_IDENTIFIER = "SpoofGuardSwitchingProfile" +const SpoofGuardSwitchingProfile_WHITE_LIST_PROVIDERS_LPORT_BINDINGS = "LPORT_BINDINGS" +const SpoofGuardSwitchingProfile_WHITE_LIST_PROVIDERS_LSWITCH_BINDINGS = "LSWITCH_BINDINGS" + +func (s *SpoofGuardSwitchingProfile) GetType__() bindings.BindingType { + return SpoofGuardSwitchingProfileBindingType() +} + +func (s *SpoofGuardSwitchingProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SpoofGuardSwitchingProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SshKeyBaseProperties struct { + // SSH key label (used to identify the key) + Label *string + // Current password for user (required for users root and admin) + Password *string +} + +func (s *SshKeyBaseProperties) GetType__() bindings.BindingType { + return SshKeyBasePropertiesBindingType() +} + +func (s *SshKeyBaseProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SshKeyBaseProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SshKeyProperties struct { + // SSH key label (used to identify the key) + Label *string + // Current password for user (required for users root and admin) + Password *string + // SSH key type + Type_ *string + // SSH key value + Value *string +} + +func (s *SshKeyProperties) GetType__() bindings.BindingType { + return SshKeyPropertiesBindingType() +} + +func (s *SshKeyProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SshKeyProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// SSH key properties query results +type SshKeyPropertiesListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // SSH key properties query results + Results []SshKeyProperties +} + +func (s *SshKeyPropertiesListResult) GetType__() bindings.BindingType { + return SshKeyPropertiesListResultBindingType() +} + +func (s *SshKeyPropertiesListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SshKeyPropertiesListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// SSH Service properties +type SshServiceProperties struct { + // Permit SSH Root login + RootLogin *bool + // Start service when system boots + StartOnBoot *bool +} + +func (s *SshServiceProperties) GetType__() bindings.BindingType { + return SshServicePropertiesBindingType() +} + +func (s *SshServiceProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SshServiceProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Standard host switch specification +type StandardHostSwitch struct { + // CPU configuration specifies number of Logical cpu cores (Lcores) per Non Uniform Memory Access (NUMA) node dedicated to Enhanced Networking Stack enabled HostSwitch to get the best performance. + CpuConfig []CpuCoreConfigForEnhancedNetworkingStackSwitch + // This field is writable only in case of VDS type HostSwitch and system generated for NVDS type. For VDS type host switch, This field is used to lookup a VDS from corresponding Compute Manager and then can be configured for logical networking. For NVDS type host switch, This field is system generated and if provided will be overwritten. + HostSwitchId *string + // Possible values are: + // + // * StandardHostSwitch#StandardHostSwitch_HOST_SWITCH_MODE_STANDARD + // * StandardHostSwitch#StandardHostSwitch_HOST_SWITCH_MODE_ENS + // * StandardHostSwitch#StandardHostSwitch_HOST_SWITCH_MODE_ENS_INTERRUPT + // + // STANDARD - This mode applies to all the hypervisors. ENS - This is the Enhanced Data Path switch mode. This mode provides accelerated networking performances but also introduces additional prerequisites. In order to benefit from this mode, workloads will be need to be compiled with DPDK and will use VMXNET3 for their vNIC. This mode is only available on ESX hypervisor (6.7 and above, recommended 6.7 U2 and above) and unavailable on KVM, EDGE and Public Cloud Gateway. Not all NSX features are available in this mode, please consult the documentation. ENS_INTERRUPT - This is an interrupt driven variant of the Enhanced Data Path mode. Please, consult your account representative for applicability. This mode is available only on ESX hypervisor (7.0 and above). If this property is specified, transport_zone_endpoints must be specified at StandardHostSwitch level. + HostSwitchMode *string + // This field is writable only in case of NVDS type HostSwitch and system generated for VDS type. For NVDS type host switch, If this name is unset or empty then the default host switch name will be used. The name must be unique among all host switches specified in a given transport node; unset name, empty name and the default host switch name are considered the same in terms of uniqueness. For VDS type host switch, Manager fetches VDS name from corresponding Compute Manager and populates this field. If VDS name is given (correct or incorrect) it is ignored and overwritten with correct one. + HostSwitchName *string + // Host switch profiles bound to this host switch. If a profile ID is not provided for any HostSwitchProfileType that is supported by the transport node, the corresponding default profile will be bound to the host switch. If transport node is created using Policy APIs, use policyPaths instead of UUIDs. + HostSwitchProfileIds []HostSwitchProfileTypeIdEntry + // Possible values are: + // + // * StandardHostSwitch#StandardHostSwitch_HOST_SWITCH_TYPE_NVDS + // * StandardHostSwitch#StandardHostSwitch_HOST_SWITCH_TYPE_VDS + // + // VDS represents VMware vSphere Distributed Switch from vSphere that is used as HostSwitch through TransportNode or TransportNodeProfile configuration. When VDS is used as a HostSwitch, Hosts have to be added to VDS from vSphere and VDS instance is created on Hosts. To configure NSX on such hosts, you can use this VDS as a HostSwitch from NSX manager. vCenter has the ownership of MTU, LAG, NIOC and LLDP configuration of such VDS backed HostSwitch. Remaining configuration (e.g. UplinkHostswitchProfile) will be managed by NSX. NVDS represents NSX Virtual Switch which is NSX native HostSwitch. All configurations of NVDS will be managed by NSX. HostSwitch of type NVDS has been deprecated on ESX hosts that are managed by a vCenter Server. + HostSwitchType *string + IpAssignmentSpec *data.StructValue + // If the pnics specified in the pnics field are used by a single Vsphere Standard Switch or DVS, then migrate the pnics to N-VDS. If any two pnics are not used by the same Vsphere Standard Switch or DVS, it is not supported. In such cases, please migrate them in multiple steps, one Vsphere Standard Switch or DVS at a time. + IsMigratePnics *bool + // Pnics are specified when HostSwitch is of type NVDS. When using the Quick Start workflow on 7.0 clusters, pnic information will be populated by the recommendation when providing a VDS HostSwitch based on a VSS HostSwitch. + Pnics []Pnic + // This is only supported for NVDS type of host switch. If this is specified for VDS type of host switch, an error will be returned to user. The pnics to be migrated out to a non N-VDS switch during transport node deletion. + PnicsUninstallMigration []Pnic + // A transport zone will be created for each DVS found across all hosts in a cluster that is installed for NSX on DVPG. This field, populated by NSX, is the ID of the transport zone created for the DVS this host switch represents. All discovered segments created for the DVPGs found on the DVS will have this ID specified as the transport zone id. + PortgroupTransportZoneId *string + // List of TransportZones that are to be associated with specified host switch. If this property is specified, host_switch_mode at StandardHostSwitch level must be specified. + TransportZoneEndpoints []TransportZoneEndPoint + // If VDS is used as a HostSwitch this attribute must be specified. You can associate uplinks from UplinkHostSwitchProfile to either VDS uplink or LAG. VDS uplink or LAG will inherit the global VDS level teaming policy from vSphere. NSX managed uplink or LAG will have NSX teaming policy configured through UplinkHostSwitchProfile. + Uplinks []VdsUplink + // This is only supported for NVDS type of host switch. If this is specified for VDS type of host switch, an error will be returned to user. The vmk interfaces and the associated logical switches on the host switch. The state of this field is realized on the transport node during creation and update. + VmkInstallMigration []VmknicNetwork + // This is only supported for NVDS type of host switch. If this is specified for VDS type of host switch, an error will be returned to user. The vmk interfaces and the associated portgroups on the VSS/DVS. This field is realized on the host during transport node deletion or NSX uninstallation to specify the destination for all vmks on N-VDS switches. + VmkUninstallMigration []VmknicNetwork +} + +const StandardHostSwitch_HOST_SWITCH_MODE_STANDARD = "STANDARD" +const StandardHostSwitch_HOST_SWITCH_MODE_ENS = "ENS" +const StandardHostSwitch_HOST_SWITCH_MODE_ENS_INTERRUPT = "ENS_INTERRUPT" +const StandardHostSwitch_HOST_SWITCH_TYPE_NVDS = "NVDS" +const StandardHostSwitch_HOST_SWITCH_TYPE_VDS = "VDS" + +func (s *StandardHostSwitch) GetType__() bindings.BindingType { + return StandardHostSwitchBindingType() +} + +func (s *StandardHostSwitch) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StandardHostSwitch._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Standard host switch specification is used for NSX configured transport node. +type StandardHostSwitchSpec struct { + // Transport Node host switches + HostSwitches []StandardHostSwitch + // Possible values are: + // + // * HostSwitchSpec#HostSwitchSpec_RESOURCE_TYPE_STANDARDHOSTSWITCHSPEC + // * HostSwitchSpec#HostSwitchSpec_RESOURCE_TYPE_PRECONFIGUREDHOSTSWITCHSPEC + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const StandardHostSwitchSpec__TYPE_IDENTIFIER = "StandardHostSwitchSpec" + +func (s *StandardHostSwitchSpec) GetType__() bindings.BindingType { + return StandardHostSwitchSpecBindingType() +} + +func (s *StandardHostSwitchSpec) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StandardHostSwitchSpec._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Standby service contexts relocation setting +type StandbyRelocationConfig struct { + // The time interval (in minutes) to wait before starting the standby service context relocation process. In some cases, the standby relocation trigger may take more time than what is set in threshold because of multiple different reasons, as listed below A. Standby relocation process runs as a background task which poll edge clusters at pre-defined interval of 5 minutes, to check for standby relocation. If during one cycle of standby relocation, an edge is found to be down, and the time remaining to threshold expiry in less then 5 minutes (for example 2 minute), than this relocation will be picked up in next cycle of standby relocation after 5 minutes, and not after 2 minutes. B. If edge becomes down at X time, then edge might take few seconds or minutes for all services to completely go down and report that they are down. So actual time when unified appliance knows edge is down may be X + delta. This delta time adds to the actual standby relocation threshold expiry, and once the [standby relocation threshold time + delta time] is complete for an edge node, and the edge is still down, than the standby relocation task will be performed for this edge node in the next cycle, that may be due to run anytime within next 5 minutes. format: int64 + StandbyRelocationThreshold *int64 +} + +func (s *StandbyRelocationConfig) GetType__() bindings.BindingType { + return StandbyRelocationConfigBindingType() +} + +func (s *StandbyRelocationConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StandbyRelocationConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Displayed as a single number. It can be used to show the characteristics of entities such as Logical Switches, Firewall Rules, and so on. For example, number of logical switches and their admin states. +type StatItem struct { + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. + DrilldownId *string + // Multi-line text to be shown on tooltip while hovering over the stat. + Tooltip []Tooltip + // If expression for total is specified, it evaluates it. Total can be omitted if not needed to be shown. + Total *string + // Expression for stat to be displayed. + Value *string +} + +func (s *StatItem) GetType__() bindings.BindingType { + return StatItemBindingType() +} + +func (s *StatItem) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StatItem._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Static filters +type StaticFilter struct { + // An additional key-value pair for static filter. + AdditionalValue *data.StructValue + // display name to be shown in the drop down for static filter. + DisplayName *string + // Property value is shown in the drop down input box for a filter. If the value is not provided 'display_name' property value is used. + ShortDisplayName *string + // Value of static filter inside dropdown filter. + Value *string +} + +func (s *StaticFilter) GetType__() bindings.BindingType { + return StaticFilterBindingType() +} + +func (s *StaticFilter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StaticFilter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type StaticHopBfdPeer struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + BfdConfig *BfdConfigParameters + // Indicate BFD peer is enabled or disabled. Default is true. + Enabled *bool + // IP address of BFD peer. This should be same as next hop IP address. format: ip + PeerIpAddress *string + // BFD peers will be created from all these source addresses to this neighbour. format: ip + SourceAddresses []string +} + +func (s *StaticHopBfdPeer) GetType__() bindings.BindingType { + return StaticHopBfdPeerBindingType() +} + +func (s *StaticHopBfdPeer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StaticHopBfdPeer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type StaticHopBfdPeerListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // static hop BFD peer list results + Results []StaticHopBfdPeer +} + +func (s *StaticHopBfdPeerListResult) GetType__() bindings.BindingType { + return StaticHopBfdPeerListResultBindingType() +} + +func (s *StaticHopBfdPeerListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StaticHopBfdPeerListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// IP assignment specification for Static IP List. +type StaticIpListSpec struct { + // Gateway IP format: ip + DefaultGateway *string + // List of IPs for transport node host switch virtual tunnel endpoints format: ip + IpList []string + // Subnet mask format: ip + SubnetMask *string + // Possible values are: + // + // * IpAssignmentSpec#IpAssignmentSpec_RESOURCE_TYPE_STATICIPPOOLSPEC + // * IpAssignmentSpec#IpAssignmentSpec_RESOURCE_TYPE_STATICIPLISTSPEC + // * IpAssignmentSpec#IpAssignmentSpec_RESOURCE_TYPE_ASSIGNEDBYDHCP + // * IpAssignmentSpec#IpAssignmentSpec_RESOURCE_TYPE_STATICIPMACLISTSPEC + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const StaticIpListSpec__TYPE_IDENTIFIER = "StaticIpListSpec" + +func (s *StaticIpListSpec) GetType__() bindings.BindingType { + return StaticIpListSpecBindingType() +} + +func (s *StaticIpListSpec) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StaticIpListSpec._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// IP and MAC assignment specification for Static IP List. +type StaticIpMacListSpec struct { + // Gateway IP format: ip + DefaultGateway *string + // List of IPs and MACs for transport node host switch virtual tunnel endpoints + IpMacList []IpMacPair + // Subnet mask format: ip + SubnetMask *string + // Possible values are: + // + // * IpAssignmentSpec#IpAssignmentSpec_RESOURCE_TYPE_STATICIPPOOLSPEC + // * IpAssignmentSpec#IpAssignmentSpec_RESOURCE_TYPE_STATICIPLISTSPEC + // * IpAssignmentSpec#IpAssignmentSpec_RESOURCE_TYPE_ASSIGNEDBYDHCP + // * IpAssignmentSpec#IpAssignmentSpec_RESOURCE_TYPE_STATICIPMACLISTSPEC + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const StaticIpMacListSpec__TYPE_IDENTIFIER = "StaticIpMacListSpec" + +func (s *StaticIpMacListSpec) GetType__() bindings.BindingType { + return StaticIpMacListSpecBindingType() +} + +func (s *StaticIpMacListSpec) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StaticIpMacListSpec._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// IP assignment specification for Static IP Pool. +type StaticIpPoolSpec struct { + IpPoolId *string + // Possible values are: + // + // * IpAssignmentSpec#IpAssignmentSpec_RESOURCE_TYPE_STATICIPPOOLSPEC + // * IpAssignmentSpec#IpAssignmentSpec_RESOURCE_TYPE_STATICIPLISTSPEC + // * IpAssignmentSpec#IpAssignmentSpec_RESOURCE_TYPE_ASSIGNEDBYDHCP + // * IpAssignmentSpec#IpAssignmentSpec_RESOURCE_TYPE_STATICIPMACLISTSPEC + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const StaticIpPoolSpec__TYPE_IDENTIFIER = "StaticIpPoolSpec" + +func (s *StaticIpPoolSpec) GetType__() bindings.BindingType { + return StaticIpPoolSpecBindingType() +} + +func (s *StaticIpPoolSpec) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StaticIpPoolSpec._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type StaticRoute struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Logical router id + LogicalRouterId *string + // CIDR format: ip-cidr-block + Network *string + // Next Hops + NextHops []StaticRouteNextHop +} + +func (s *StaticRoute) GetType__() bindings.BindingType { + return StaticRouteBindingType() +} + +func (s *StaticRoute) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StaticRoute._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type StaticRouteListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paginated list of static routes + Results []StaticRoute +} + +func (s *StaticRouteListResult) GetType__() bindings.BindingType { + return StaticRouteListResultBindingType() +} + +func (s *StaticRouteListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StaticRouteListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type StaticRouteNextHop struct { + // Administrative Distance for the next hop IP format: int64 + AdministrativeDistance *int64 + // Status of bfd for this next hop where bfd_enabled = true indicate bfd is enabled for this next hop and bfd_enabled = false indicate bfd peer is disabled or not configured for this next hop. + BfdEnabled *bool + // Possible values are: + // + // * StaticRouteNextHop#StaticRouteNextHop_BLACKHOLE_ACTION_DISCARD + // + // Action to be taken on matching packets for NULL routes. + BlackholeAction *string + // Next Hop IP format: ip + IpAddress *string + LogicalRouterPortId *ResourceReference +} + +const StaticRouteNextHop_BLACKHOLE_ACTION_DISCARD = "DISCARD" + +func (s *StaticRouteNextHop) GetType__() bindings.BindingType { + return StaticRouteNextHopBindingType() +} + +func (s *StaticRouteNextHop) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StaticRouteNextHop._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents configuration of a statistic for an entity. Example, number of logical switches and their admin states. +type StatsConfiguration struct { + Label *Label + // Hyperlink of the specified UI page that provides details. + Navigation *string + // Sections + Sections []DonutSection + Stat *StatItem + // Possible values are: + // + // * StatsConfiguration#StatsConfiguration_SUB_TYPE_COMPACT + // + // A sub-type of StatsConfiguration. If sub-type is not specified the parent type is rendered. The COMPACT sub_type, conserves the space for the widget. The statistic is placed on the right side on top of the status bar and the title of the widget is placed on the left side on the top of the status bar. The COMPACT style aligns itself horizontally as per the width of the container. If multiple widgets are placed insided the container then the widgets are placed one below the other to conserve the space. + SubType *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_TIMERANGEDROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_SPACERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LEGENDWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration, CustomFilterWidgetConfiguration, TimeRangeDropdownFilterWidgetConfiguration, SpacerWidgetConfiguration, LegendWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If the condition is met then the widget will be displayed to UI. If no condition is provided, then the widget will be displayed unconditionally. + Condition *string + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + FeatureSet *FeatureSet + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. This field is deprecated instead use 'filters' property. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + // A List of filter applied to this widget configuration. This will be used to identify the filters applied to this widget. + Filters []string + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + Legend *Legend + // List of plotting configuration for a given widget. Widget plotting configurations which are common across all the widgets types should be define here. + PlotConfigs []WidgetPlotConfiguration + // Represents the vertical span of the widget / container. 1 Row span is equal to 20px. format: int32 + Rowspan *int64 + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // If the value of this field is set to true then card header will be displayed otherwise only card will be displayed without header. + ShowHeader *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const StatsConfiguration__TYPE_IDENTIFIER = "StatsConfiguration" +const StatsConfiguration_SUB_TYPE_COMPACT = "COMPACT" + +func (s *StatsConfiguration) GetType__() bindings.BindingType { + return StatsConfigurationBindingType() +} + +func (s *StatsConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StatsConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type StatusCount struct { + // Degraded count format: int32 + DegradedCount *int64 + // Down count format: int32 + DownCount *int64 + // Possible values are: + // + // * StatusCount#StatusCount_STATUS_UP + // * StatusCount#StatusCount_STATUS_DOWN + // * StatusCount#StatusCount_STATUS_DEGRADED + // * StatusCount#StatusCount_STATUS_UNKNOWN + // + // Roll-up status + Status *string + // Up count format: int32 + UpCount *int64 +} + +const StatusCount_STATUS_UP = "UP" +const StatusCount_STATUS_DOWN = "DOWN" +const StatusCount_STATUS_DEGRADED = "DEGRADED" +const StatusCount_STATUS_UNKNOWN = "UNKNOWN" + +func (s *StatusCount) GetType__() bindings.BindingType { + return StatusCountBindingType() +} + +func (s *StatusCount) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StatusCount._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Structured data entry in RFC5424 log format +type StructuredData struct { + // Audit flag of the log + Audit *string + // Component value of the log + Comp *string + // Entity Id value of the log + EntId *string + // External request Id value of the log + EreqId *string + // Error Code value of the log + ErrorCode *string + // Level value of the log + Level *string + // Request Id value of the log + ReqId *string + // Sub-subcomponent value of the log + S2comp *string + // Security flag of the log + Security *string + // Subcomponent value of the log + Subcomp *string + // Username value of the log + Username *string +} + +func (s *StructuredData) GetType__() bindings.BindingType { + return StructuredDataBindingType() +} + +func (s *StructuredData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StructuredData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type StubStatus struct { + // IP/FQDN of the node + Address *string + // Is stub up + ConnectionUp *bool +} + +func (s *StubStatus) GetType__() bindings.BindingType { + return StubStatusBindingType() +} + +func (s *StubStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for StubStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SubPool struct { + // Credits remaining on the sub-pool that can be used to deploy services of corresponding sub-pool type. format: int32 + RemainingCreditNumber *int64 + // Type of the sub-pool configured on edge node. + SubPoolType *string + // Percentage utlization of sub-pool based on the number of services configured and the hard limits, if any. + UsagePercentage *float64 +} + +func (s *SubPool) GetType__() bindings.BindingType { + return SubPoolBindingType() +} + +func (s *SubPool) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SubPool._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A collection of subject alternative names +type SubjectAltNames struct { + // A list of DNS names in subject alternative names format: hostname + DnsNames []string + // A list of IP addresses in subject alternative names + IpAddresses []string +} + +func (s *SubjectAltNames) GetType__() bindings.BindingType { + return SubjectAltNamesBindingType() +} + +func (s *SubjectAltNames) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SubjectAltNames._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SubjectPublicKeyHash struct { + // List of SHA256 hashes of the Public Key of the revoked certificates with the specified subject. + PublicKeySha256Hashes []string + // Subject Distinguished Name of the revoked certificates. + Subject *string +} + +func (s *SubjectPublicKeyHash) GetType__() bindings.BindingType { + return SubjectPublicKeyHashBindingType() +} + +func (s *SubjectPublicKeyHash) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SubjectPublicKeyHash._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SuccessNodeSupportBundleResult struct { + // Name of support bundle, e.g. nsx_NODETYPE_UUID_YYYYMMDD_HHMMSS.tgz + BundleName *string + // Size of support bundle in bytes format: int64 + BundleSize *int64 + // Display name of node + NodeDisplayName *string + // UUID of node + NodeId *string + // File's SHA256 thumbprint + Sha256Thumbprint *string +} + +func (s *SuccessNodeSupportBundleResult) GetType__() bindings.BindingType { + return SuccessNodeSupportBundleResultBindingType() +} + +func (s *SuccessNodeSupportBundleResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SuccessNodeSupportBundleResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Minimal description of feedback requests. +type SummaryMigrationFeedbackRequest struct { + // Details about this specific feedback request. + Details *string + // Id of the site in NSX-T Federation + FederationSiteId *string + // Identifier of the feedback request. + Id *string + // Identifier of the object for which feedback is requested. + ObjectId *string + // Indicates if previous response was invalid. Please provide a valid response. + Rejected *bool + // If the feedback request was resolved earlier, provides details about the previous resolution. + Resolution *string + // Indicates if a valid response already exist for this feedback request. + Resolved *bool + // Identifier for this object in the source NSX endpoint. + VObjectId *string + // Name of this object in the source NSX endpoint. + VObjectName *string +} + +func (s *SummaryMigrationFeedbackRequest) GetType__() bindings.BindingType { + return SummaryMigrationFeedbackRequestBindingType() +} + +func (s *SummaryMigrationFeedbackRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SummaryMigrationFeedbackRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SupportBundleContainerNode struct { + // Possible values are: + // + // * SupportBundleContainerNode#SupportBundleContainerNode_CONTAINER_TYPE_ANTREA + // + // Support bundle container type + ContainerType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const SupportBundleContainerNode__TYPE_IDENTIFIER = "SupportBundleContainerNode" +const SupportBundleContainerNode_CONTAINER_TYPE_ANTREA = "ANTREA" + +func (s *SupportBundleContainerNode) GetType__() bindings.BindingType { + return SupportBundleContainerNodeBindingType() +} + +func (s *SupportBundleContainerNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SupportBundleContainerNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SupportBundleFileTransferAuthenticationScheme struct { + // Password to authenticate with + Password *string + // Possible values are: + // + // * SupportBundleFileTransferAuthenticationScheme#SupportBundleFileTransferAuthenticationScheme_SCHEME_NAME_PASSWORD + // + // Authentication scheme name + SchemeName *string + // User name to authenticate with + Username *string +} + +const SupportBundleFileTransferAuthenticationScheme_SCHEME_NAME_PASSWORD = "PASSWORD" + +func (s *SupportBundleFileTransferAuthenticationScheme) GetType__() bindings.BindingType { + return SupportBundleFileTransferAuthenticationSchemeBindingType() +} + +func (s *SupportBundleFileTransferAuthenticationScheme) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SupportBundleFileTransferAuthenticationScheme._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SupportBundleFileTransferProtocol struct { + AuthenticationScheme *SupportBundleFileTransferAuthenticationScheme + // Possible values are: + // + // * SupportBundleFileTransferProtocol#SupportBundleFileTransferProtocol_NAME_SCP + // * SupportBundleFileTransferProtocol#SupportBundleFileTransferProtocol_NAME_SFTP + // + // Protocol name + Name *string + // SSH fingerprint of server + SshFingerprint *string +} + +const SupportBundleFileTransferProtocol_NAME_SCP = "SCP" +const SupportBundleFileTransferProtocol_NAME_SFTP = "SFTP" + +func (s *SupportBundleFileTransferProtocol) GetType__() bindings.BindingType { + return SupportBundleFileTransferProtocolBindingType() +} + +func (s *SupportBundleFileTransferProtocol) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SupportBundleFileTransferProtocol._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SupportBundleQueryParameters struct { + // Include all files including files that may have sensitive information like core files. + All *bool +} + +func (s *SupportBundleQueryParameters) GetType__() bindings.BindingType { + return SupportBundleQueryParametersBindingType() +} + +func (s *SupportBundleQueryParameters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SupportBundleQueryParameters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Remote file server +type SupportBundleRemoteFileServer struct { + // Remote server directory to copy bundle files to + DirectoryPath *string + // Uploads to the remote file server performed by the manager + ManagerUploadOnly *bool + // Server port format: int64 + Port *int64 + Protocol *SupportBundleFileTransferProtocol + // Remote server hostname or IP address + Server *string +} + +func (s *SupportBundleRemoteFileServer) GetType__() bindings.BindingType { + return SupportBundleRemoteFileServerBindingType() +} + +func (s *SupportBundleRemoteFileServer) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SupportBundleRemoteFileServer._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SupportBundleRequest struct { + // List of container clusters and their nodes requiring support bundle collection + ContainerNodes []*data.StructValue + // Possible values are: + // + // * SupportBundleRequest#SupportBundleRequest_CONTENT_FILTERS_ALL + // * SupportBundleRequest#SupportBundleRequest_CONTENT_FILTERS_DEFAULT + // + // Bundle should include content of specified type + ContentFilters []string + // List of dynamic content filters that specify additional content to include in the support bundle. The list of available filters available depends on your NSX-T deployment and can be determined by invoking the GET /api/v1/adminstration/support-bundles/dynamic-content-filters NSX API. For example, if NSX Intelligence is deployed, filters for collecting specific information about services are available. + DynamicContentFilters []string + // Include log files with modified times not past the age limit in days format: int64 + LogAgeLimit *int64 + // List of cluster/fabric node UUIDs processed in specified order + Nodes []string + RemoteFileServer *SupportBundleRemoteFileServer +} + +const SupportBundleRequest_CONTENT_FILTERS_ALL = "ALL" +const SupportBundleRequest_CONTENT_FILTERS_DEFAULT = "DEFAULT" + +func (s *SupportBundleRequest) GetType__() bindings.BindingType { + return SupportBundleRequestBindingType() +} + +func (s *SupportBundleRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SupportBundleRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SupportBundleResult struct { + // Nodes where bundles were not generated or not copied to remote server + FailedNodes []FailedNodeSupportBundleResult + // Nodes where bundle generation is pending or in progress + RemainingNodes []RemainingSupportBundleNode + RequestProperties *SupportBundleRequest + // Nodes whose bundles were successfully copied to remote file server + SuccessNodes []SuccessNodeSupportBundleResult +} + +func (s *SupportBundleResult) GetType__() bindings.BindingType { + return SupportBundleResultBindingType() +} + +func (s *SupportBundleResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SupportBundleResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// REST interface for supported host OS types. +type SupportedHostOSListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Supported host OS list results + Results []string +} + +func (s *SupportedHostOSListResult) GetType__() bindings.BindingType { + return SupportedHostOSListResultBindingType() +} + +func (s *SupportedHostOSListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SupportedHostOSListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SvmConnectivityStatus struct { + // Connectivity status with the deployed Solution VM TRUE - VM is configured and protected by EPP/AMS Service VM. FALSE - VM is either not configured for protection or VM is disconnected from EPP/AMS Service VM. + ConnectivityStatus *bool + // Service name as provided for Anti Malware Solution or as provided for third party Endpoint Protection solution during service registration. + ServiceName *string + // Solution ID as provided for Anti Malware Solution(AMS) or as provided for third party Endpoint Protection(EPP) solution during service registration. + SolutionId *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Specifies list of scope of discovered resource. e.g. if VHC path is associated with principal identity, who owns the discovered resource, then scope id will be VHC path and scope type will be VHC. + Scope []DiscoveredResourceScope + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const SvmConnectivityStatus__TYPE_IDENTIFIER = "SvmConnectivityStatus" + +func (s *SvmConnectivityStatus) GetType__() bindings.BindingType { + return SvmConnectivityStatusBindingType() +} + +func (s *SvmConnectivityStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SvmConnectivityStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SwitchSecuritySwitchingProfile struct { + // A flag to block all traffic except IP/(G)ARP/BPDU + BlockNonIpTraffic *bool + BpduFilter *BpduFilter + DhcpFilter *DhcpFilter + // RA Guard when enabled blocks unauthorized/rogue Router Advertisement (RA) packets. + RaGuardEnabled *bool + RateLimits *RateLimits + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + RequiredCapabilities []string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const SwitchSecuritySwitchingProfile__TYPE_IDENTIFIER = "SwitchSecuritySwitchingProfile" + +func (s *SwitchSecuritySwitchingProfile) GetType__() bindings.BindingType { + return SwitchSecuritySwitchingProfileBindingType() +} + +func (s *SwitchSecuritySwitchingProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SwitchSecuritySwitchingProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// NSX global configs for switching +type SwitchingGlobalConfig struct { + // This is a global max ARP limit per logical router per transport node. It is applied to all the logical routers present on all types of transport nodes in the NSX domain. Updates to the field are allowed only through /policy/api/v1/infra/global-config API. format: int32 + ArpLimitPerLr *int64 + // When this flag is set true, certain types of BUM packets will be sent to all VTEPs in the global VTEP table, ignoring the logical switching span. + GlobalReplicationModeEnabled *bool + // This is the global default MTU for all the physical uplinks in a NSX domain. This is the default value for the optional uplink profile MTU field. When the MTU value is not specified in the uplink profile, this global value will be used. This value can be overridden by providing a value for the optional MTU field in the uplink profile. Whenever this value is updated, the updated value will only be propagated to the uplinks that don't have the MTU value in their uplink profiles. If this value is not set, the default value of 1700 will be used. The Transport Node state can be monitored to confirm if the updated MTU value has been realized. format: int32 + PhysicalUplinkMtu *int64 + // This is the global default MTU for all the physical remote tunnel endpoints in an NSX domain. Please consider intersite link MTU minus any external overhead when defining the MTU. If this value is not set, the default value of 1500 will be used. format: int32 + RemoteTunnelPhysicalMtu *int64 + // This value defines the upper threshold for the MTU value that can be configured at a physical uplink level or a logical routing uplink level in a NSX domain. All Uplink profiles validate against this value so that the MTU specified in an Uplink profile does not exceed this global upper threshold. Similarly, when this value is modified, the new value must be greater than or equal to any existing Uplink profile's MTU. This value is also validated to be greater than or equal to physical_uplink_mtu in SwitchingGlobalConfig and logical_uplink_mtu in RoutingGlobalConfig. format: int32 + UplinkMtuThreshold *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_SWITCHINGGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_ROUTINGGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_OPERATIONCOLLECTORGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FIREWALLGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_ESXGLOBALOPAQUECONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_SECURITYGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FIPSGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_FEDERATIONGLOBALCONFIG + // * GlobalConfigs#GlobalConfigs_RESOURCE_TYPE_IDSGLOBALCONFIG + // + // Valid Global configuration types + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const SwitchingGlobalConfig__TYPE_IDENTIFIER = "SwitchingGlobalConfig" + +func (s *SwitchingGlobalConfig) GetType__() bindings.BindingType { + return SwitchingGlobalConfigBindingType() +} + +func (s *SwitchingGlobalConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SwitchingGlobalConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SwitchingProfileStatus struct { + // Number of logical ports using a switching profile format: int64 + NumLogicalPorts *int64 + // Number of logical switches using a switching profile format: int64 + NumLogicalSwitches *int64 + // Identifier for the switching profile + SwitchingProfileId *string +} + +func (s *SwitchingProfileStatus) GetType__() bindings.BindingType { + return SwitchingProfileStatusBindingType() +} + +func (s *SwitchingProfileStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SwitchingProfileStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SwitchingProfileTypeIdEntry struct { + // Possible values are: + // + // * SwitchingProfileTypeIdEntry#SwitchingProfileTypeIdEntry_KEY_QOSSWITCHINGPROFILE + // * SwitchingProfileTypeIdEntry#SwitchingProfileTypeIdEntry_KEY_PORTMIRRORINGSWITCHINGPROFILE + // * SwitchingProfileTypeIdEntry#SwitchingProfileTypeIdEntry_KEY_IPDISCOVERYSWITCHINGPROFILE + // * SwitchingProfileTypeIdEntry#SwitchingProfileTypeIdEntry_KEY_SPOOFGUARDSWITCHINGPROFILE + // * SwitchingProfileTypeIdEntry#SwitchingProfileTypeIdEntry_KEY_SWITCHSECURITYSWITCHINGPROFILE + // * SwitchingProfileTypeIdEntry#SwitchingProfileTypeIdEntry_KEY_MACMANAGEMENTSWITCHINGPROFILE + // + // Supported switching profiles. 'PortMirroringSwitchingProfile' is deprecated, please turn to \"Troubleshooting And Monitoring: Portmirroring\" and use PortMirroringSession API for port mirror function. + Key *string + // key value + Value *string +} + +const SwitchingProfileTypeIdEntry_KEY_QOSSWITCHINGPROFILE = "QosSwitchingProfile" +const SwitchingProfileTypeIdEntry_KEY_PORTMIRRORINGSWITCHINGPROFILE = "PortMirroringSwitchingProfile" +const SwitchingProfileTypeIdEntry_KEY_IPDISCOVERYSWITCHINGPROFILE = "IpDiscoverySwitchingProfile" +const SwitchingProfileTypeIdEntry_KEY_SPOOFGUARDSWITCHINGPROFILE = "SpoofGuardSwitchingProfile" +const SwitchingProfileTypeIdEntry_KEY_SWITCHSECURITYSWITCHINGPROFILE = "SwitchSecuritySwitchingProfile" +const SwitchingProfileTypeIdEntry_KEY_MACMANAGEMENTSWITCHINGPROFILE = "MacManagementSwitchingProfile" + +func (s *SwitchingProfileTypeIdEntry) GetType__() bindings.BindingType { + return SwitchingProfileTypeIdEntryBindingType() +} + +func (s *SwitchingProfileTypeIdEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SwitchingProfileTypeIdEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Switching Profile queries result +type SwitchingProfilesListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Switching Profile Results + Results []*data.StructValue +} + +func (s *SwitchingProfilesListResult) GetType__() bindings.BindingType { + return SwitchingProfilesListResultBindingType() +} + +func (s *SwitchingProfilesListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SwitchingProfilesListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Possible values of a mode in a \"/config/nsx_appliance_mode\" file +type SwitchingToVmcModeParameters struct { + // Possible values are: + // + // * SwitchingToVmcModeParameters#SwitchingToVmcModeParameters_MODE_ID_ON_PREM + // * SwitchingToVmcModeParameters#SwitchingToVmcModeParameters_MODE_ID_SERVICE + // * SwitchingToVmcModeParameters#SwitchingToVmcModeParameters_MODE_ID_VMC + // * SwitchingToVmcModeParameters#SwitchingToVmcModeParameters_MODE_ID_VMC_LOCAL + // + // Possible enum values in a \"/config/nsx_appliance_mode\" file + ModeId *string + AuthCode *Oauth2Credentials + // Protocol and domain name (or IP address) of a CSP server, like \"https://console-stg.cloud.vmware.com\". + BaseUrl *string + // List of whitelist IPs for basic auth + BasicAuthWhitelistIps []string + // This CSP end-point exchanges one of the following grants - authorization_code, refresh_token, client_credentials or client_delegate for an access token. + CspAccessTokenUri *string + CspClientCredential *Oauth2Credentials + // List of incoming client IDs + CspClientIncomingCredentials []string + // This CSP end-point returns the identity provider's logout url. In order to logout, an explicit redirect to this url is needed. + CspLogoutUri *string + // Relative path on CSP server to the Org location. Can be \"/csp/gateway/am/api/orgs/\". + CspOrgUri *string + // CSP endpoint that returns a list of public keys in jwks format. These keys are used in an application to validate that the access-token is valid. + CspPublicKeyUri *string + // CSP time drift in milliseconds format: int64 + CspTimeDrift *int64 + // This endpoint is used with browser redirection only. It discovers the user's Identity Provider (IdP) and sends the user to the IdP login page. It is the starting point of the OAuth 2.0 flow to authenticate end users from an application. + CspUserAuthorizationUri *string + // This endpoint returns the content of the given access token if the token is valid. It also includes the group_ids and group_names if the client is registered with group_id, group_names scopes. It's usually /am/api/userinfo. + CspUserInfoUri *string + // Org ID of a Client - commonly UUID. + DefaultOrgId *string + EaOrg *OrgInfo + GssOrg *OrgInfo + // When this parameter is set to true, only a change of the node mode happens without any update to the auth properties. When this param is not set to true i.e. set to false or not provided, mode change and update to the auth properties will both happen. + ModeChangeOnly *bool + // IP/host of PoP (Point-of-Presence) HTTP proxy server format: hostname-or-ipv4 + ProxyHost *string + // Port of PoP (Point-of-Presence) Http proxy server format: int64 + ProxyPort *int64 + PublicClientInfo *PublicClientInfo + // Possible values are: + // + // * SwitchingToVmcModeParameters#SwitchingToVmcModeParameters_RESOURCE_TYPE_SWITCHINGTOVMCMODEPARAMETERS + // + // Node Mode type + ResourceType *string + // SDDC id + SddcId *string + // Service definition id + ServiceDefinitionId *string + SreOrg *OrgInfo +} + +const SwitchingToVmcModeParameters_MODE_ID_ON_PREM = "ON_PREM" +const SwitchingToVmcModeParameters_MODE_ID_SERVICE = "SERVICE" +const SwitchingToVmcModeParameters_MODE_ID_VMC = "VMC" +const SwitchingToVmcModeParameters_MODE_ID_VMC_LOCAL = "VMC_LOCAL" +const SwitchingToVmcModeParameters_RESOURCE_TYPE_SWITCHINGTOVMCMODEPARAMETERS = "SwitchingToVmcModeParameters" + +func (s *SwitchingToVmcModeParameters) GetType__() bindings.BindingType { + return SwitchingToVmcModeParametersBindingType() +} + +func (s *SwitchingToVmcModeParameters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SwitchingToVmcModeParameters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SwitchoverStatus struct { + CurrentStep *ProgressItem + // Current number format: int64 + CurrentStepNumber *int64 + // Special messages, most of the time this will be empty, i.e. If SM performing the operation went down, another SM will restart the progress. + Note *string + // Total number of steps format: int64 + NumberOfSteps *int64 + // Possible values are: + // + // * SwitchoverStatus#SwitchoverStatus_OVERALL_STATUS_NOT_STARTED + // * SwitchoverStatus#SwitchoverStatus_OVERALL_STATUS_RUNNING + // * SwitchoverStatus#SwitchoverStatus_OVERALL_STATUS_ERROR + // * SwitchoverStatus#SwitchoverStatus_OVERALL_STATUS_COMPLETE + // + // Status of the operation + OverallStatus *string +} + +const SwitchoverStatus_OVERALL_STATUS_NOT_STARTED = "NOT_STARTED" +const SwitchoverStatus_OVERALL_STATUS_RUNNING = "RUNNING" +const SwitchoverStatus_OVERALL_STATUS_ERROR = "ERROR" +const SwitchoverStatus_OVERALL_STATUS_COMPLETE = "COMPLETE" + +func (s *SwitchoverStatus) GetType__() bindings.BindingType { + return SwitchoverStatusBindingType() +} + +func (s *SwitchoverStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SwitchoverStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Syslog server configuration parameters +type SyslogConfiguration struct { + // Possible values are: + // + // * SyslogConfiguration#SyslogConfiguration_LOG_LEVEL_EMERGENCY + // * SyslogConfiguration#SyslogConfiguration_LOG_LEVEL_ALERT + // * SyslogConfiguration#SyslogConfiguration_LOG_LEVEL_CRITICAL + // * SyslogConfiguration#SyslogConfiguration_LOG_LEVEL_ERROR + // * SyslogConfiguration#SyslogConfiguration_LOG_LEVEL_WARNING + // * SyslogConfiguration#SyslogConfiguration_LOG_LEVEL_NOTICE + // * SyslogConfiguration#SyslogConfiguration_LOG_LEVEL_INFO + // * SyslogConfiguration#SyslogConfiguration_LOG_LEVEL_DEBUG + // + // Log level that needs to be redirected. + LogLevel *string + // Display name of the syslog server + Name *string + // Syslog server listening port. format: port-or-range + Port *string + // Possible values are: + // + // * SyslogConfiguration#SyslogConfiguration_PROTOCOL_TCP + // * SyslogConfiguration#SyslogConfiguration_PROTOCOL_UDP + // * SyslogConfiguration#SyslogConfiguration_PROTOCOL_TLS + // * SyslogConfiguration#SyslogConfiguration_PROTOCOL_LI + // * SyslogConfiguration#SyslogConfiguration_PROTOCOL_LI_TLS + // + // Supported Syslog protocol. + Protocol *string + // Syslog server Ip or fqdn. + Server *string +} + +const SyslogConfiguration_LOG_LEVEL_EMERGENCY = "EMERGENCY" +const SyslogConfiguration_LOG_LEVEL_ALERT = "ALERT" +const SyslogConfiguration_LOG_LEVEL_CRITICAL = "CRITICAL" +const SyslogConfiguration_LOG_LEVEL_ERROR = "ERROR" +const SyslogConfiguration_LOG_LEVEL_WARNING = "WARNING" +const SyslogConfiguration_LOG_LEVEL_NOTICE = "NOTICE" +const SyslogConfiguration_LOG_LEVEL_INFO = "INFO" +const SyslogConfiguration_LOG_LEVEL_DEBUG = "DEBUG" +const SyslogConfiguration_PROTOCOL_TCP = "TCP" +const SyslogConfiguration_PROTOCOL_UDP = "UDP" +const SyslogConfiguration_PROTOCOL_TLS = "TLS" +const SyslogConfiguration_PROTOCOL_LI = "LI" +const SyslogConfiguration_PROTOCOL_LI_TLS = "LI_TLS" + +func (s *SyslogConfiguration) GetType__() bindings.BindingType { + return SyslogConfigurationBindingType() +} + +func (s *SyslogConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SyslogConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This object specifies what, where and how logs on NSX nodes are forwarded. +type SyslogExporter struct { + // Possible values are: + // + // * SyslogExporter#SyslogExporter_MAX_LOG_LEVEL_EMERG + // * SyslogExporter#SyslogExporter_MAX_LOG_LEVEL_ALERT + // * SyslogExporter#SyslogExporter_MAX_LOG_LEVEL_CRIT + // * SyslogExporter#SyslogExporter_MAX_LOG_LEVEL_ERR + // * SyslogExporter#SyslogExporter_MAX_LOG_LEVEL_WARNING + // * SyslogExporter#SyslogExporter_MAX_LOG_LEVEL_NOTICE + // * SyslogExporter#SyslogExporter_MAX_LOG_LEVEL_INFO + // * SyslogExporter#SyslogExporter_MAX_LOG_LEVEL_DEBUG + // + // Maximum logging level for messages to be exported. + MaxLogLevel *string + // Server port on which syslog listener is listening. format: int64 + Port *int64 + // Possible values are: + // + // * SyslogExporter#SyslogExporter_PROTOCOL_TCP + // * SyslogExporter#SyslogExporter_PROTOCOL_UDP + // * SyslogExporter#SyslogExporter_PROTOCOL_LI + // + // Protocol to be used to export logs to syslog server. + Protocol *string + // Syslog server IP address or hostname. format: hostname-or-ipv4 + Server *string +} + +const SyslogExporter_MAX_LOG_LEVEL_EMERG = "EMERG" +const SyslogExporter_MAX_LOG_LEVEL_ALERT = "ALERT" +const SyslogExporter_MAX_LOG_LEVEL_CRIT = "CRIT" +const SyslogExporter_MAX_LOG_LEVEL_ERR = "ERR" +const SyslogExporter_MAX_LOG_LEVEL_WARNING = "WARNING" +const SyslogExporter_MAX_LOG_LEVEL_NOTICE = "NOTICE" +const SyslogExporter_MAX_LOG_LEVEL_INFO = "INFO" +const SyslogExporter_MAX_LOG_LEVEL_DEBUG = "DEBUG" +const SyslogExporter_PROTOCOL_TCP = "TCP" +const SyslogExporter_PROTOCOL_UDP = "UDP" +const SyslogExporter_PROTOCOL_LI = "LI" + +func (s *SyslogExporter) GetType__() bindings.BindingType { + return SyslogExporterBindingType() +} + +func (s *SyslogExporter) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SyslogExporter._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// This object contains list of syslog exporters used by NSX nodes. +type SyslogProperties struct { + // List of syslog exporters. + Exporters []SyslogExporter +} + +func (s *SyslogProperties) GetType__() bindings.BindingType { + return SyslogPropertiesBindingType() +} + +func (s *SyslogProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SyslogProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Describes a profile to define a kind of system health agent. +type SystemHealthAgentProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // The config content of System Health Agent + Config *string + // The on-off switch of System Health Agent + Enabled *bool + // The id of System Health Agent plugin + PluginId *string + // + Type_ *string +} + +const SystemHealthAgentProfile_TYPE_COMPUTE = "COMPUTE" +const SystemHealthAgentProfile_TYPE_STORAGE = "STORAGE" +const SystemHealthAgentProfile_TYPE_NETWORK = "NETWORK" +const SystemHealthAgentProfile_TYPE_HYPERBUS = "HYPERBUS" +const SystemHealthAgentProfile_TYPE_NCP = "NCP" +const SystemHealthAgentProfile_TYPE_NODEAGENT = "NODEAGENT" +const SystemHealthAgentProfile_TYPE_VSAN = "VSAN" +const SystemHealthAgentProfile_TYPE_TNAGENT = "TNAGENT" +const SystemHealthAgentProfile_TYPE_UPLINK = "UPLINK" + +func (s *SystemHealthAgentProfile) GetType__() bindings.BindingType { + return SystemHealthAgentProfileBindingType() +} + +func (s *SystemHealthAgentProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SystemHealthAgentProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The list result for query of system health profile entity. +type SystemHealthAgentProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // System Health Profile List + Results []SystemHealthAgentProfile +} + +func (s *SystemHealthAgentProfileListResult) GetType__() bindings.BindingType { + return SystemHealthAgentProfileListResultBindingType() +} + +func (s *SystemHealthAgentProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SystemHealthAgentProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Describes a profile to define a kind of system health plugin. +type SystemHealthPluginProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + Config *SHAPredefinedPluginProfileData + // + Enabled *bool + // + NodeTypes []string + // The publisher of System Health Agent plugin + Publisher *string + // Possible values are: + // + // * SystemHealthPluginProfile#SystemHealthPluginProfile_TYPE_COMPUTE + // * SystemHealthPluginProfile#SystemHealthPluginProfile_TYPE_STORAGE + // * SystemHealthPluginProfile#SystemHealthPluginProfile_TYPE_NETWORK + // * SystemHealthPluginProfile#SystemHealthPluginProfile_TYPE_HYPERBUS + // * SystemHealthPluginProfile#SystemHealthPluginProfile_TYPE_NCP + // * SystemHealthPluginProfile#SystemHealthPluginProfile_TYPE_NODEAGENT + // * SystemHealthPluginProfile#SystemHealthPluginProfile_TYPE_VSAN + // * SystemHealthPluginProfile#SystemHealthPluginProfile_TYPE_TNAGENT + // * SystemHealthPluginProfile#SystemHealthPluginProfile_TYPE_UPLINK + // + // The type of System Health Agent plugin + Type_ *string +} + +const SystemHealthPluginProfile_NODE_TYPES_NSX_ESX = "NSX_ESX" +const SystemHealthPluginProfile_NODE_TYPES_NSX_KVM = "NSX_KVM" +const SystemHealthPluginProfile_NODE_TYPES_NSX_BAREMETAL_SERVER = "NSX_BAREMETAL_SERVER" +const SystemHealthPluginProfile_NODE_TYPES_NSX_EDGE = "NSX_EDGE" +const SystemHealthPluginProfile_NODE_TYPES_NSX_PUBLIC_CLOUD_GATEWAY = "NSX_PUBLIC_CLOUD_GATEWAY" +const SystemHealthPluginProfile_NODE_TYPES_NSX_MANAGER = "NSX_MANAGER" +const SystemHealthPluginProfile_NODE_TYPES_NSX_POLICY_MANAGER = "NSX_POLICY_MANAGER" +const SystemHealthPluginProfile_NODE_TYPES_NSX_CONTROLLER = "NSX_CONTROLLER" +const SystemHealthPluginProfile_NODE_TYPES_GLOBAL_MANAGER = "GLOBAL_MANAGER" +const SystemHealthPluginProfile_TYPE_COMPUTE = "COMPUTE" +const SystemHealthPluginProfile_TYPE_STORAGE = "STORAGE" +const SystemHealthPluginProfile_TYPE_NETWORK = "NETWORK" +const SystemHealthPluginProfile_TYPE_HYPERBUS = "HYPERBUS" +const SystemHealthPluginProfile_TYPE_NCP = "NCP" +const SystemHealthPluginProfile_TYPE_NODEAGENT = "NODEAGENT" +const SystemHealthPluginProfile_TYPE_VSAN = "VSAN" +const SystemHealthPluginProfile_TYPE_TNAGENT = "TNAGENT" +const SystemHealthPluginProfile_TYPE_UPLINK = "UPLINK" + +func (s *SystemHealthPluginProfile) GetType__() bindings.BindingType { + return SystemHealthPluginProfileBindingType() +} + +func (s *SystemHealthPluginProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SystemHealthPluginProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type SystemHealthPluginProfileList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Total plugin count format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // System Health plugin list + Results []SystemHealthPluginProfile +} + +func (s *SystemHealthPluginProfileList) GetType__() bindings.BindingType { + return SystemHealthPluginProfileListBindingType() +} + +func (s *SystemHealthPluginProfileList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for SystemHealthPluginProfileList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Arbitrary key-value pairs that may be attached to an entity +type Tag struct { + // Tag searches may optionally be restricted by scope + Scope *string + // Identifier meaningful to user with maximum length of 256 characters + Tag *string +} + +func (s *Tag) GetType__() bindings.BindingType { + return TagBindingType() +} + +func (s *Tag) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tag._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Holds status of target resource in firewall context. +type TargetResourceStatus struct { + // Identifier of the NSX resource. + TargetId *string + // Possible values are: + // + // * TargetResourceStatus#TargetResourceStatus_TARGET_STATUS_DISABLED + // * TargetResourceStatus#TargetResourceStatus_TARGET_STATUS_ENABLED + // + // Firewall status on a target logical resource. + TargetStatus *string +} + +const TargetResourceStatus_TARGET_STATUS_DISABLED = "DISABLED" +const TargetResourceStatus_TARGET_STATUS_ENABLED = "ENABLED" + +func (s *TargetResourceStatus) GetType__() bindings.BindingType { + return TargetResourceStatusBindingType() +} + +func (s *TargetResourceStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TargetResourceStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Task query results +type TaskListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Task property results + Results []TaskProperties +} + +func (s *TaskListResult) GetType__() bindings.BindingType { + return TaskListResultBindingType() +} + +func (s *TaskListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TaskListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Task properties +type TaskProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // True if response for asynchronous request is available + AsyncResponseAvailable *bool + // True if this task can be canceled + Cancelable *bool + // Description of the task + Description *string + // The end time of the task in epoch milliseconds format: int64 + EndTime *int64 + // Identifier for this task + Id *string + // A message describing the disposition of the task + Message *string + // Task progress if known, from 0 to 100 format: int64 + Progress *int64 + // HTTP request method + RequestMethod *string + // URI of the method invocation that spawned this task + RequestUri *string + // The start time of the task in epoch milliseconds format: int64 + StartTime *int64 + // Possible values are: + // + // * TaskProperties#TaskProperties_STATUS_RUNNING + // * TaskProperties#TaskProperties_STATUS_ERROR + // * TaskProperties#TaskProperties_STATUS_SUCCESS + // * TaskProperties#TaskProperties_STATUS_CANCELING + // * TaskProperties#TaskProperties_STATUS_CANCELED + // * TaskProperties#TaskProperties_STATUS_KILLED + // + // Current status of the task + Status *string + // Name of the user who created this task + User *string +} + +const TaskProperties_STATUS_RUNNING = "running" +const TaskProperties_STATUS_ERROR = "error" +const TaskProperties_STATUS_SUCCESS = "success" +const TaskProperties_STATUS_CANCELING = "canceling" +const TaskProperties_STATUS_CANCELED = "canceled" +const TaskProperties_STATUS_KILLED = "killed" + +func (s *TaskProperties) GetType__() bindings.BindingType { + return TaskPropertiesBindingType() +} + +func (s *TaskProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TaskProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TcpHeader struct { + // Destination port of tcp header format: int64 + DstPort *int64 + // Source port of tcp header format: int64 + SrcPort *int64 + // TCP flags (9bits) format: int64 + TcpFlags *int64 +} + +func (s *TcpHeader) GetType__() bindings.BindingType { + return TcpHeaderBindingType() +} + +func (s *TcpHeader) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TcpHeader._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Tcp Mss Clamping Direction and value +type TcpMssClamping struct { + // Possible values are: + // + // * TcpMssClamping#TcpMssClamping_DIRECTION_NONE + // * TcpMssClamping#TcpMssClamping_DIRECTION_INBOUND_CONNECTION + // * TcpMssClamping#TcpMssClamping_DIRECTION_OUTBOUND_CONNECTION + // * TcpMssClamping#TcpMssClamping_DIRECTION_BOTH + // + // Specifies the traffic direction for which to apply MSS Clamping. + Direction *string + // It defines the maximum amount of data that a host is willing to accept in a single TCP segment. This field is set in TCP header during connection establishment. To avoid packet fragmentation, you can set this field depending on uplink MTU and VPN overhead. This is optional field and in case it is left unconfigured, best possible MSS value will be calculated based on effective mtu of uplink interface. Supported MSS range is 108 to 8902. format: int64 + MaxSegmentSize *int64 +} + +const TcpMssClamping_DIRECTION_NONE = "NONE" +const TcpMssClamping_DIRECTION_INBOUND_CONNECTION = "INBOUND_CONNECTION" +const TcpMssClamping_DIRECTION_OUTBOUND_CONNECTION = "OUTBOUND_CONNECTION" +const TcpMssClamping_DIRECTION_BOTH = "BOTH" + +func (s *TcpMssClamping) GetType__() bindings.BindingType { + return TcpMssClampingBindingType() +} + +func (s *TcpMssClamping) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TcpMssClamping._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Uplink Teaming Policy +type TeamingPolicy struct { + // List of Uplinks used in active list + ActiveList []Uplink + // Possible values are: + // + // * TeamingPolicy#TeamingPolicy_POLICY_FAILOVER_ORDER + // * TeamingPolicy#TeamingPolicy_POLICY_LOADBALANCE_SRCID + // * TeamingPolicy#TeamingPolicy_POLICY_LOADBALANCE_SRC_MAC + // + // Teaming policy + Policy *string + // Flag for preemptive mode + RollingOrder *bool + // List of Uplinks used in standby list + StandbyList []Uplink +} + +const TeamingPolicy_POLICY_FAILOVER_ORDER = "FAILOVER_ORDER" +const TeamingPolicy_POLICY_LOADBALANCE_SRCID = "LOADBALANCE_SRCID" +const TeamingPolicy_POLICY_LOADBALANCE_SRC_MAC = "LOADBALANCE_SRC_MAC" + +func (s *TeamingPolicy) GetType__() bindings.BindingType { + return TeamingPolicyBindingType() +} + +func (s *TeamingPolicy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TeamingPolicy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TelemetryAgreement struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Determine if telemetry agreement has been displayed. If false, the agreement text will be displayed at login time. + TelemetryAgreementDisplayed *bool +} + +func (s *TelemetryAgreement) GetType__() bindings.BindingType { + return TelemetryAgreementBindingType() +} + +func (s *TelemetryAgreement) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TelemetryAgreement._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TelemetryConfig struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Enable this flag to participate in the Customer Experience Improvement Program. + CeipAcceptance *bool + // Enable this flag to specify a proxy, and provide the proxy settings. + ProxyEnabled *bool + // Enable this to schedule data collection and upload times. If enabled, and a schedule is not provided, a default schedule (WEEKLY, Sunday at 2:00 a.m) will be applied. + ScheduleEnabled *bool + // Deployment id generated during initialization of telemetry config. + TelemetryDeploymentId *string + TelemetryProxy *TelemetryProxy + TelemetrySchedule *data.StructValue +} + +func (s *TelemetryConfig) GetType__() bindings.BindingType { + return TelemetryConfigBindingType() +} + +func (s *TelemetryConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TelemetryConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TelemetryProxy struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Specify the fully qualified domain name, or ip address, of the proxy server. format: hostname-or-ip + Hostname *string + // Specify the password used to authenticate with the proxy server, if required. A GET call on /telemetry/config returns a non-meaningful password to maintain security. To change the password to a new value, issue a PUT call after updating this field. To remove the password, issue a PUT call after emptying this field. To retain a previously set password, issue a PUT call keeping the non-meaningful value obtained from the GET call. + Password *string + // Specify the port of the proxy server. format: int32 + Port *int64 + // Possible values are: + // + // * TelemetryProxy#TelemetryProxy_SCHEME_HTTP + // * TelemetryProxy#TelemetryProxy_SCHEME_HTTPS + // + // The scheme accepted by the proxy server. Specify one of HTTP and HTTPS. + Scheme *string + // Specify the user name used to authenticate with the proxy server, if required. + Username *string +} + +const TelemetryProxy_SCHEME_HTTP = "HTTP" +const TelemetryProxy_SCHEME_HTTPS = "HTTPS" + +func (s *TelemetryProxy) GetType__() bindings.BindingType { + return TelemetryProxyBindingType() +} + +func (s *TelemetryProxy) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TelemetryProxy._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Abstract base type for telemetry schedule configuration +type TelemetrySchedule struct { + // Specify one of DailyTelemetrySchedule, WeeklyTelemetrySchedule, or MonthlyTelemetrySchedule. + FrequencyType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const TelemetrySchedule__TYPE_IDENTIFIER = "TelemetrySchedule" + +func (s *TelemetrySchedule) GetType__() bindings.BindingType { + return TelemetryScheduleBindingType() +} + +func (s *TelemetrySchedule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TelemetrySchedule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type ThreatStatus struct { + // Possible values are: + // + // * ThreatStatus#ThreatStatus_STATUS_NORMAL + // * ThreatStatus#ThreatStatus_STATUS_ABNORMAL + // + // Transport node threat status + Status *string +} + +const ThreatStatus_STATUS_NORMAL = "NORMAL" +const ThreatStatus_STATUS_ABNORMAL = "ABNORMAL" + +func (s *ThreatStatus) GetType__() bindings.BindingType { + return ThreatStatusBindingType() +} + +func (s *ThreatStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ThreatStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents configuration for dropdown filter widget for Time Range. +type TimeRangeDropdownFilterWidgetConfiguration struct { + TimeRangeFilterInfo *TimeRangeFilterInfo + // Expression to specify default value of filter. + DefaultValue *string + DropdownFilterPlotConfig *DropdownFilterPlotConfiguration + DropdownItem *DropdownItem + // Placeholder message to be displayed in dropdown filter. + PlaceholderMsg *string + // If the condition is met then the static filter will be added. If no condition is provided, then the static filters will be applied unconditionally. + StaticFilterCondition *string + // Additional static items to be added in dropdown filter. Example can be 'ALL'. + StaticFilters []StaticFilter + // Alias to be used when emitting filter value. + Alias *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_TIMERANGEDROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_SPACERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LEGENDWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration, CustomFilterWidgetConfiguration, TimeRangeDropdownFilterWidgetConfiguration, SpacerWidgetConfiguration, LegendWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If the condition is met then the widget will be displayed to UI. If no condition is provided, then the widget will be displayed unconditionally. + Condition *string + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + FeatureSet *FeatureSet + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. This field is deprecated instead use 'filters' property. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + // A List of filter applied to this widget configuration. This will be used to identify the filters applied to this widget. + Filters []string + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + Legend *Legend + // List of plotting configuration for a given widget. Widget plotting configurations which are common across all the widgets types should be define here. + PlotConfigs []WidgetPlotConfiguration + // Represents the vertical span of the widget / container. 1 Row span is equal to 20px. format: int32 + Rowspan *int64 + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // If the value of this field is set to true then card header will be displayed otherwise only card will be displayed without header. + ShowHeader *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} + +func (s *TimeRangeDropdownFilterWidgetConfiguration) GetType__() bindings.BindingType { + return TimeRangeDropdownFilterWidgetConfigurationBindingType() +} + +func (s *TimeRangeDropdownFilterWidgetConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TimeRangeDropdownFilterWidgetConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// time range filter information +type TimeRangeFilterInfo struct { + // from parameter name used for time range filter from date value. + FromParamName *string + // to parameter name used for time range filter to date value. + ToParamName *string + // Possible values are: + // + // * TimeRangeFilterInfo#TimeRangeFilterInfo_VALUE_TYPE_EPOCH + // + // type of time range filter value can be epoch, ISO date Format. + ValueType *string +} + +const TimeRangeFilterInfo_VALUE_TYPE_EPOCH = "EPOCH" + +func (s *TimeRangeFilterInfo) GetType__() bindings.BindingType { + return TimeRangeFilterInfoBindingType() +} + +func (s *TimeRangeFilterInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TimeRangeFilterInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TnHyperbusStatus struct { + // Possible values are: + // + // * TnHyperbusStatus#TnHyperbusStatus_HYPERBUS_STATUS_UNKNOWN + // * TnHyperbusStatus#TnHyperbusStatus_HYPERBUS_STATUS_HEALTHY + // * TnHyperbusStatus#TnHyperbusStatus_HYPERBUS_STATUS_UNHEALTHY + // * TnHyperbusStatus#TnHyperbusStatus_HYPERBUS_STATUS_DEGRADED + // + // Display the hyperbus status + HyperbusStatus *string + // Transport node id. + TransportNodeId *string +} + +const TnHyperbusStatus_HYPERBUS_STATUS_UNKNOWN = "UNKNOWN" +const TnHyperbusStatus_HYPERBUS_STATUS_HEALTHY = "HEALTHY" +const TnHyperbusStatus_HYPERBUS_STATUS_UNHEALTHY = "UNHEALTHY" +const TnHyperbusStatus_HYPERBUS_STATUS_DEGRADED = "DEGRADED" + +func (s *TnHyperbusStatus) GetType__() bindings.BindingType { + return TnHyperbusStatusBindingType() +} + +func (s *TnHyperbusStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TnHyperbusStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Container agent status list result +type TnNodeAgentStatusListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Container agent status + Results []TnNodeAgentstatus +} + +func (s *TnNodeAgentStatusListResult) GetType__() bindings.BindingType { + return TnNodeAgentStatusListResultBindingType() +} + +func (s *TnNodeAgentStatusListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TnNodeAgentStatusListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TnNodeAgentstatus struct { + // Possible values are: + // + // * TnNodeAgentstatus#TnNodeAgentstatus_HYPERBUS_CONNECTION_STATUS_UNKNOWN + // * TnNodeAgentstatus#TnNodeAgentstatus_HYPERBUS_CONNECTION_STATUS_HEALTHY + // * TnNodeAgentstatus#TnNodeAgentstatus_HYPERBUS_CONNECTION_STATUS_UNHEALTHY + // * TnNodeAgentstatus#TnNodeAgentstatus_HYPERBUS_CONNECTION_STATUS_DEGRADED + // + // Show the Node Agent connected VM vif status. + HyperbusConnectionStatus *string + // Connected VM vif id. + VifId *string +} + +const TnNodeAgentstatus_HYPERBUS_CONNECTION_STATUS_UNKNOWN = "UNKNOWN" +const TnNodeAgentstatus_HYPERBUS_CONNECTION_STATUS_HEALTHY = "HEALTHY" +const TnNodeAgentstatus_HYPERBUS_CONNECTION_STATUS_UNHEALTHY = "UNHEALTHY" +const TnNodeAgentstatus_HYPERBUS_CONNECTION_STATUS_DEGRADED = "DEGRADED" + +func (s *TnNodeAgentstatus) GetType__() bindings.BindingType { + return TnNodeAgentstatusBindingType() +} + +func (s *TnNodeAgentstatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TnNodeAgentstatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// List all the TNs spaned in L3PortMirrorSession mirror stack health status. +type TnNodeStackSpanStatus struct { + // Possible values are: + // + // * TnNodeStackSpanStatus#TnNodeStackSpanStatus_DEDICATED_STACK_STATUS_UNKNOWN + // * TnNodeStackSpanStatus#TnNodeStackSpanStatus_DEDICATED_STACK_STATUS_SUCCESS + // * TnNodeStackSpanStatus#TnNodeStackSpanStatus_DEDICATED_STACK_STATUS_FAILED + // + // Show the dedicated mirror stack health status, if the TN node has the mirror stack, it will show SUCCESS or it will show FAILED. + DedicatedStackStatus *string + // Give the detail info for mirror stack and vmknic health status. If the stack or vmknic is FAILED, detail info will tell user reason why the stauts is FAILED. So that user can correct their configuration. + Detail *string + // TN miror stack status will be updated periodically, this item indicates the lastest timestamp of TN node stack status is updated. format: int64 + LastUpdatedTime *int64 + // For L3PortMirrorSession configured mirror stack, show the TN node UUID which spaned in L3PortMirrorSession. + TnNodeId *string + // For L3PortMirrorSession configured mirror stack, show the TN node friendly name which spaned in L3PortMirrorSession. + TnNodeName *string + // Possible values are: + // + // * TnNodeStackSpanStatus#TnNodeStackSpanStatus_VMKNIC_STATUS_UNKNOWN + // * TnNodeStackSpanStatus#TnNodeStackSpanStatus_VMKNIC_STATUS_SUCCESS + // * TnNodeStackSpanStatus#TnNodeStackSpanStatus_VMKNIC_STATUS_FAILED + // + // Show the vmknic health status, if the vmknic has been bouned to mirror stack, it will show SUCCESS or it will show FAILED. + VmknicStatus *string +} + +const TnNodeStackSpanStatus_DEDICATED_STACK_STATUS_UNKNOWN = "UNKNOWN" +const TnNodeStackSpanStatus_DEDICATED_STACK_STATUS_SUCCESS = "SUCCESS" +const TnNodeStackSpanStatus_DEDICATED_STACK_STATUS_FAILED = "FAILED" +const TnNodeStackSpanStatus_VMKNIC_STATUS_UNKNOWN = "UNKNOWN" +const TnNodeStackSpanStatus_VMKNIC_STATUS_SUCCESS = "SUCCESS" +const TnNodeStackSpanStatus_VMKNIC_STATUS_FAILED = "FAILED" + +func (s *TnNodeStackSpanStatus) GetType__() bindings.BindingType { + return TnNodeStackSpanStatusBindingType() +} + +func (s *TnNodeStackSpanStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TnNodeStackSpanStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TokenBasedPrincipalIdentity struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Indicator whether the entities created by this principal should be protected. + IsProtected *bool + // Name of the principal. This will be matched to the name provided in the token. + Name *string + // Unique node-id of a principal. This is used primarily in the case where a cluster of nodes is used to make calls to the NSX Manager and the same 'name' is used so that the nodes can access and modify the same data while still accessing NSX through their individual secret (certificate or JWT). In all other cases this can be any string. + NodeId *string +} + +func (s *TokenBasedPrincipalIdentity) GetType__() bindings.BindingType { + return TokenBasedPrincipalIdentityBindingType() +} + +func (s *TokenBasedPrincipalIdentity) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TokenBasedPrincipalIdentity._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Token-based PrincipalIdentity query result +type TokenBasedPrincipalIdentityListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // TokenBasedPrincipalIdentity list. + Results []TokenBasedPrincipalIdentity +} + +func (s *TokenBasedPrincipalIdentityListResult) GetType__() bindings.BindingType { + return TokenBasedPrincipalIdentityListResultBindingType() +} + +func (s *TokenBasedPrincipalIdentityListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TokenBasedPrincipalIdentityListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Tooltip to be shown while hovering over the dashboard UI element. +type Tooltip struct { + // If the condition is met then the tooltip will be applied. If no condition is provided, then the tooltip will be applied unconditionally. Examples of expression syntax are provided under 'example_request' section of 'CreateWidgetConfiguration' API. + Condition *string + // If true, displays tooltip text in bold + Heading *bool + // Text to be shown on tooltip while hovering over UI element. The text would be wrapped if it exceeds 80 chars. + Text *string +} + +func (s *Tooltip) GetType__() bindings.BindingType { + return TooltipBindingType() +} + +func (s *Tooltip) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Tooltip._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TraceActionArgument struct { + // It is required only when the type of trace is bidirectional. Please keep this field aligned with the destination logical port of packet capture action config when the type of packet capture action is bidirectional. + DestLport *string + ReverseFilter *data.StructValue + // Possible values are: + // + // * TraceActionArgument#TraceActionArgument_TRACE_TYPE_UNI_DIRECTIONAL + // * TraceActionArgument#TraceActionArgument_TRACE_TYPE_BI_DIRECTIONAL + // + // Type of trace + TraceType *string +} + +const TraceActionArgument_TRACE_TYPE_UNI_DIRECTIONAL = "UNI_DIRECTIONAL" +const TraceActionArgument_TRACE_TYPE_BI_DIRECTIONAL = "BI_DIRECTIONAL" + +func (s *TraceActionArgument) GetType__() bindings.BindingType { + return TraceActionArgumentBindingType() +} + +func (s *TraceActionArgument) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TraceActionArgument._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TraceActionConfig struct { + ActionArgument *TraceActionArgument + SamplingArgument *data.StructValue +} + +func (s *TraceActionConfig) GetType__() bindings.BindingType { + return TraceActionConfigBindingType() +} + +func (s *TraceActionConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TraceActionConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TraceResult struct { + // Trace action result analysis notes + Analysis []string + Counters *TraceflowObservationCounters + // Possible values are: + // + // * TraceResult#TraceResult_DIRECTION_FORWARD + // * TraceResult#TraceResult_DIRECTION_BACKWARD + // + // Direction of a trace + Direction *string + LogicalCounters *TraceflowObservationCounters + // Trace observation list + Observations []*data.StructValue + // Packet ID in the session + PacketId *string + // Whether some observations were deleted from the result set + ResultOverflowed *bool +} + +const TraceResult_DIRECTION_FORWARD = "FORWARD" +const TraceResult_DIRECTION_BACKWARD = "BACKWARD" + +func (s *TraceResult) GetType__() bindings.BindingType { + return TraceResultBindingType() +} + +func (s *TraceResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TraceResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type Traceflow struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The id of the traceflow round + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Traceflow result analysis notes + Analysis []string + Counters *TraceflowObservationCounters + LogicalCounters *TraceflowObservationCounters + // id of the source logical port used for injecting the traceflow packet + LportId *string + // Possible values are: + // + // * Traceflow#Traceflow_OPERATION_STATE_IN_PROGRESS + // * Traceflow#Traceflow_OPERATION_STATE_FINISHED + // * Traceflow#Traceflow_OPERATION_STATE_FAILED + // + // Represents the traceflow operation state + OperationState *string + // Possible values are: + // + // * Traceflow#Traceflow_REQUEST_STATUS_SUCCESS + // * Traceflow#Traceflow_REQUEST_STATUS_TIMEOUT + // * Traceflow#Traceflow_REQUEST_STATUS_SOURCE_PORT_NOT_FOUND + // * Traceflow#Traceflow_REQUEST_STATUS_DATA_PATH_NOT_READY + // * Traceflow#Traceflow_REQUEST_STATUS_CONNECTION_ERROR + // * Traceflow#Traceflow_REQUEST_STATUS_UNKNOWN + // + // The status of the traceflow RPC request. SUCCESS - The traceflow request is sent successfully. TIMEOUT - The traceflow request gets timeout. SOURCE_PORT_NOT_FOUND - The source port of the request cannot be found. DATA_PATH_NOT_READY - The datapath component cannot be ready to receive request. CONNECTION_ERROR - There is connection error on datapath component. UNKNOWN - The status of traceflow request cannot be determined. + RequestStatus *string + // A flag, when set true, indicates some observations were deleted from the result set. + ResultOverflowed *bool + // Maximum time (in ms) the management plane will be waiting for this traceflow round. Upper limit for federation case is 90000, for non-federation case is 15000, the maximum is set to 90000 as the higher of the two cases. format: int64 + Timeout *int64 +} + +const Traceflow_OPERATION_STATE_IN_PROGRESS = "IN_PROGRESS" +const Traceflow_OPERATION_STATE_FINISHED = "FINISHED" +const Traceflow_OPERATION_STATE_FAILED = "FAILED" +const Traceflow_REQUEST_STATUS_SUCCESS = "SUCCESS" +const Traceflow_REQUEST_STATUS_TIMEOUT = "TIMEOUT" +const Traceflow_REQUEST_STATUS_SOURCE_PORT_NOT_FOUND = "SOURCE_PORT_NOT_FOUND" +const Traceflow_REQUEST_STATUS_DATA_PATH_NOT_READY = "DATA_PATH_NOT_READY" +const Traceflow_REQUEST_STATUS_CONNECTION_ERROR = "CONNECTION_ERROR" +const Traceflow_REQUEST_STATUS_UNKNOWN = "UNKNOWN" + +func (s *Traceflow) GetType__() bindings.BindingType { + return TraceflowBindingType() +} + +func (s *Traceflow) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Traceflow._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Traceflow queries result +type TraceflowListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Traceflow Results + Results []Traceflow +} + +func (s *TraceflowListResult) GetType__() bindings.BindingType { + return TraceflowListResultBindingType() +} + +func (s *TraceflowListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TraceflowListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TraceflowObservation struct { + // The name of the component that issued the observation. + ComponentName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER1 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_VRF_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LS_TRANSIT + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_CLASSIFIER + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_PROXY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_VDR + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_ENI + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_AWS_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_TGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_EDGE_UPLINK + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_DELL_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_UNKNOWN + // + // The sub type of the component that issued the observation. + ComponentSubType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_PHYSICAL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LR + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LS + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_HOSTSWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_FW_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_RTEP_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LOAD_BALANCER + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_NAT + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_IPSEC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SERVICE_INSERTION + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_VMC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_FW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DLB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_LB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_ROUTING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_FORWARDING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_HOST_SWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_UNKNOWN + // + // The type of the component that issued the observation. + ComponentType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDELIVERED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONREPLICATIONLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRELAYEDLOGICAL + ResourceType string + // the hop count for observations on the transport node that a traceflow packet is injected in will be 0. The hop count is incremented each time a subsequent transport node receives the traceflow packet. The sequence number of 999 indicates that the hop count could not be determined for the containing observation. format: int64 + SequenceNo *int64 + // This field contains the site path where this observation was generated. + SitePath *string + // Timestamp when the observation was created by the transport node (milliseconds epoch) format: int64 + Timestamp *int64 + // Timestamp when the observation was created by the transport node (microseconds epoch) format: int64 + TimestampMicro *int64 + // id of the transport node that observed a traceflow packet + TransportNodeId *string + // name of the transport node that observed a traceflow packet + TransportNodeName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_ESX + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_WINDOWSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_EDGE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_PUBLIC_CLOUD_GATEWAY_NODE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OTHERS + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_HYPERV + // + // type of the transport node that observed a traceflow packet + TransportNodeType *string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const TraceflowObservation__TYPE_IDENTIFIER = "TraceflowObservation" +const TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER0 = "LR_TIER0" +const TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER1 = "LR_TIER1" +const TraceflowObservation_COMPONENT_SUB_TYPE_LR_VRF_TIER0 = "LR_VRF_TIER0" +const TraceflowObservation_COMPONENT_SUB_TYPE_LS_TRANSIT = "LS_TRANSIT" +const TraceflowObservation_COMPONENT_SUB_TYPE_SI_CLASSIFIER = "SI_CLASSIFIER" +const TraceflowObservation_COMPONENT_SUB_TYPE_SI_PROXY = "SI_PROXY" +const TraceflowObservation_COMPONENT_SUB_TYPE_VDR = "VDR" +const TraceflowObservation_COMPONENT_SUB_TYPE_ENI = "ENI" +const TraceflowObservation_COMPONENT_SUB_TYPE_AWS_GATEWAY = "AWS_GATEWAY" +const TraceflowObservation_COMPONENT_SUB_TYPE_TGW_ROUTE = "TGW_ROUTE" +const TraceflowObservation_COMPONENT_SUB_TYPE_EDGE_UPLINK = "EDGE_UPLINK" +const TraceflowObservation_COMPONENT_SUB_TYPE_DELL_GATEWAY = "DELL_GATEWAY" +const TraceflowObservation_COMPONENT_SUB_TYPE_LGW_ROUTE = "LGW_ROUTE" +const TraceflowObservation_COMPONENT_SUB_TYPE_UNKNOWN = "UNKNOWN" +const TraceflowObservation_COMPONENT_TYPE_PHYSICAL = "PHYSICAL" +const TraceflowObservation_COMPONENT_TYPE_LR = "LR" +const TraceflowObservation_COMPONENT_TYPE_LS = "LS" +const TraceflowObservation_COMPONENT_TYPE_DFW = "DFW" +const TraceflowObservation_COMPONENT_TYPE_BRIDGE = "BRIDGE" +const TraceflowObservation_COMPONENT_TYPE_EDGE_TUNNEL = "EDGE_TUNNEL" +const TraceflowObservation_COMPONENT_TYPE_EDGE_HOSTSWITCH = "EDGE_HOSTSWITCH" +const TraceflowObservation_COMPONENT_TYPE_FW_BRIDGE = "FW_BRIDGE" +const TraceflowObservation_COMPONENT_TYPE_EDGE_RTEP_TUNNEL = "EDGE_RTEP_TUNNEL" +const TraceflowObservation_COMPONENT_TYPE_LOAD_BALANCER = "LOAD_BALANCER" +const TraceflowObservation_COMPONENT_TYPE_NAT = "NAT" +const TraceflowObservation_COMPONENT_TYPE_IPSEC = "IPSEC" +const TraceflowObservation_COMPONENT_TYPE_SERVICE_INSERTION = "SERVICE_INSERTION" +const TraceflowObservation_COMPONENT_TYPE_VMC = "VMC" +const TraceflowObservation_COMPONENT_TYPE_SPOOFGUARD = "SPOOFGUARD" +const TraceflowObservation_COMPONENT_TYPE_EDGE_FW = "EDGE_FW" +const TraceflowObservation_COMPONENT_TYPE_DLB = "DLB" +const TraceflowObservation_COMPONENT_TYPE_ANTREA_SPOOFGUARD = "ANTREA_SPOOFGUARD" +const TraceflowObservation_COMPONENT_TYPE_ANTREA_LB = "ANTREA_LB" +const TraceflowObservation_COMPONENT_TYPE_ANTREA_ROUTING = "ANTREA_ROUTING" +const TraceflowObservation_COMPONENT_TYPE_ANTREA_DFW = "ANTREA_DFW" +const TraceflowObservation_COMPONENT_TYPE_ANTREA_FORWARDING = "ANTREA_FORWARDING" +const TraceflowObservation_COMPONENT_TYPE_HOST_SWITCH = "HOST_SWITCH" +const TraceflowObservation_COMPONENT_TYPE_UNKNOWN = "UNKNOWN" +const TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDED = "TraceflowObservationForwarded" +const TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPED = "TraceflowObservationDropped" +const TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDELIVERED = "TraceflowObservationDelivered" +const TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVED = "TraceflowObservationReceived" +const TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDEDLOGICAL = "TraceflowObservationForwardedLogical" +const TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPEDLOGICAL = "TraceflowObservationDroppedLogical" +const TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVEDLOGICAL = "TraceflowObservationReceivedLogical" +const TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONREPLICATIONLOGICAL = "TraceflowObservationReplicationLogical" +const TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRELAYEDLOGICAL = "TraceflowObservationRelayedLogical" +const TraceflowObservation_TRANSPORT_NODE_TYPE_ESX = "ESX" +const TraceflowObservation_TRANSPORT_NODE_TYPE_RHELKVM = "RHELKVM" +const TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUKVM = "UBUNTUKVM" +const TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSKVM = "CENTOSKVM" +const TraceflowObservation_TRANSPORT_NODE_TYPE_RHELCONTAINER = "RHELCONTAINER" +const TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSCONTAINER = "CENTOSCONTAINER" +const TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSERVER = "RHELSERVER" +const TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSERVER = "UBUNTUSERVER" +const TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSSERVER = "CENTOSSERVER" +const TraceflowObservation_TRANSPORT_NODE_TYPE_SLESKVM = "SLESKVM" +const TraceflowObservation_TRANSPORT_NODE_TYPE_SLESSERVER = "SLESSERVER" +const TraceflowObservation_TRANSPORT_NODE_TYPE_WINDOWSSERVER = "WINDOWSSERVER" +const TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSMARTNIC = "RHELSMARTNIC" +const TraceflowObservation_TRANSPORT_NODE_TYPE_OELSERVER = "OELSERVER" +const TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSMARTNIC = "UBUNTUSMARTNIC" +const TraceflowObservation_TRANSPORT_NODE_TYPE_EDGE = "EDGE" +const TraceflowObservation_TRANSPORT_NODE_TYPE_PUBLIC_CLOUD_GATEWAY_NODE = "PUBLIC_CLOUD_GATEWAY_NODE" +const TraceflowObservation_TRANSPORT_NODE_TYPE_OTHERS = "OTHERS" +const TraceflowObservation_TRANSPORT_NODE_TYPE_HYPERV = "HYPERV" + +func (s *TraceflowObservation) GetType__() bindings.BindingType { + return TraceflowObservationBindingType() +} + +func (s *TraceflowObservation) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TraceflowObservation._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TraceflowObservationCounters struct { + // Total number of delivered observations for this traceflow round. format: int64 + DeliveredCount *int64 + // Total number of dropped observations for this round. format: int64 + DroppedCount *int64 + // Total number of forwarded observations for this traceflow round. format: int64 + ForwardedCount *int64 + // Total number of received observations for this traceflow round. format: int64 + ReceivedCount *int64 +} + +func (s *TraceflowObservationCounters) GetType__() bindings.BindingType { + return TraceflowObservationCountersBindingType() +} + +func (s *TraceflowObservationCounters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TraceflowObservationCounters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TraceflowObservationDelivered struct { + // The id of the logical port into which the traceflow packet was delivered + LportId *string + // The name of the logical port into which the traceflow packet was delivered + LportName *string + // Possible values are: + // + // * TraceflowObservationDelivered#TraceflowObservationDelivered_RESOLUTION_TYPE_UNKNOWN + // * TraceflowObservationDelivered#TraceflowObservationDelivered_RESOLUTION_TYPE_ARP_SUPPRESSION_PORT_CACHE + // * TraceflowObservationDelivered#TraceflowObservationDelivered_RESOLUTION_TYPE_ARP_SUPPRESSION_TABLE + // * TraceflowObservationDelivered#TraceflowObservationDelivered_RESOLUTION_TYPE_ARP_SUPPRESSION_CP_QUERY + // * TraceflowObservationDelivered#TraceflowObservationDelivered_RESOLUTION_TYPE_ARP_VM + // + // This field specifies the resolution type of ARP ARP_SUPPRESSION_PORT_CACHE - ARP request is suppressed by port DB ARP_SUPPRESSION_TABLE - ARP request is suppressed by ARP table ARP_SUPPRESSION_CP_QUERY - ARP request is suppressed by info derived from CP ARP_VM - No suppression and the ARP request is resolved. + ResolutionType *string + // The source MAC address of form: \"^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$\". For example: 00:00:00:00:00:00. + TargetMac *string + // VLAN on bridged network format: int64 + VlanId *int64 + // The name of the component that issued the observation. + ComponentName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER1 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_VRF_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LS_TRANSIT + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_CLASSIFIER + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_PROXY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_VDR + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_ENI + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_AWS_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_TGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_EDGE_UPLINK + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_DELL_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_UNKNOWN + // + // The sub type of the component that issued the observation. + ComponentSubType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_PHYSICAL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LR + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LS + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_HOSTSWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_FW_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_RTEP_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LOAD_BALANCER + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_NAT + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_IPSEC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SERVICE_INSERTION + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_VMC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_FW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DLB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_LB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_ROUTING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_FORWARDING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_HOST_SWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_UNKNOWN + // + // The type of the component that issued the observation. + ComponentType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDELIVERED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONREPLICATIONLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRELAYEDLOGICAL + ResourceType string + // the hop count for observations on the transport node that a traceflow packet is injected in will be 0. The hop count is incremented each time a subsequent transport node receives the traceflow packet. The sequence number of 999 indicates that the hop count could not be determined for the containing observation. format: int64 + SequenceNo *int64 + // This field contains the site path where this observation was generated. + SitePath *string + // Timestamp when the observation was created by the transport node (milliseconds epoch) format: int64 + Timestamp *int64 + // Timestamp when the observation was created by the transport node (microseconds epoch) format: int64 + TimestampMicro *int64 + // id of the transport node that observed a traceflow packet + TransportNodeId *string + // name of the transport node that observed a traceflow packet + TransportNodeName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_ESX + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_WINDOWSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_EDGE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_PUBLIC_CLOUD_GATEWAY_NODE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OTHERS + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_HYPERV + // + // type of the transport node that observed a traceflow packet + TransportNodeType *string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const TraceflowObservationDelivered__TYPE_IDENTIFIER = "TraceflowObservationDelivered" +const TraceflowObservationDelivered_RESOLUTION_TYPE_UNKNOWN = "UNKNOWN" +const TraceflowObservationDelivered_RESOLUTION_TYPE_ARP_SUPPRESSION_PORT_CACHE = "ARP_SUPPRESSION_PORT_CACHE" +const TraceflowObservationDelivered_RESOLUTION_TYPE_ARP_SUPPRESSION_TABLE = "ARP_SUPPRESSION_TABLE" +const TraceflowObservationDelivered_RESOLUTION_TYPE_ARP_SUPPRESSION_CP_QUERY = "ARP_SUPPRESSION_CP_QUERY" +const TraceflowObservationDelivered_RESOLUTION_TYPE_ARP_VM = "ARP_VM" + +func (s *TraceflowObservationDelivered) GetType__() bindings.BindingType { + return TraceflowObservationDeliveredBindingType() +} + +func (s *TraceflowObservationDelivered) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TraceflowObservationDelivered._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TraceflowObservationDropped struct { + // This field is specified when the traceflow packet matched a L3 firewall rule. format: int64 + AclRuleId *int64 + // Possible values are: + // + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_UNKNOWN + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_TIMEOUT + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_CPFAIL + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_FROMCP + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_PORTDESTROY + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_TABLEDESTROY + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_NETDESTROY + // + // This field specifies the ARP fails reason ARP_TIMEOUT - ARP failure due to query control plane timeout ARP_CPFAIL - ARP failure due post ARP query message to control plane failure ARP_FROMCP - ARP failure due to deleting ARP entry from control plane ARP_PORTDESTROY - ARP failure due to port destruction ARP_TABLEDESTROY - ARP failure due to ARP table destruction ARP_NETDESTROY - ARP failure due to overlay network destruction + ArpFailReason *string + // This field is specified when the traceflow packet matched a jump-to rule. format: int64 + JumptoRuleId *int64 + // This field is specified when the traceflow packet matched a l2 rule. format: int64 + L2RuleId *int64 + // The id of the logical port at which the traceflow packet was dropped + LportId *string + // The name of the logical port at which the traceflow packet was dropped + LportName *string + // This field is specified when the traceflow packet matched a NAT rule. format: int64 + NatRuleId *int64 + // Possible values are: + // + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_ARP_FAIL + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_BFD + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_BROADCAST + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_DHCP + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_DLB + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_FW_RULE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_GENEVE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_GRE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_IFACE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_IP + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_IP_REASS + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_IPSEC + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_IPSEC_VTI + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_L2VPN + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_L4PORT + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_LB + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_LROUTER + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_LSERVICE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_LSWITCH + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_MANAGEMENT + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_MD_PROXY + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NAT + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_RTEP_TUNNEL + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_ND_NS_FAIL + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NEIGH + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_EIP_FOUND + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_EIP_ASSOCIATION + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_ENI_FOR_IP + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_ENI_FOR_LIF + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_ROUTE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_ROUTE_TABLE_FOUND + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_UNDERLAY_ROUTE_FOUND + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NOT_VDR_DOWNLINK + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_VDR_FOUND + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_VDR_ON_HOST + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NOT_VDR_UPLINK + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_SERVICE_INSERT + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_SPOOFGUARD + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_TTL_ZERO + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_TUNNEL + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_VLAN + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_VXLAN + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_VXSTT + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_VMC_NO_RESPONSE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_WRONG_UPLINK + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_FW_STATE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_MAC + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_UNKNOWN + // + // This field specifies the drop reason of traceflow packet. ARP_FAIL - ARP request fails for some reasons, please refer arp_fail_reason for detail BFD - BFD packet is dropped because traversed by non-operative interface or encountering internal error (e.g., memory insufficient) BROADCAST - Packet is dropped during traversing the interface (e.g., Edge uplink, Edge centralized service port) which disallow ethernet broadcast DHCP - DHCP packet is malformed DLB - The packet is disallowed by distributed load balancing FW_RULE - The packet matches a drop or reject rule of DFW or Edge firewall GENEVE - GENEVE packet is malformed GRE - GRE packet is malformed or traverses a non-operative interface IFACE - Packet traverses a non-operative interface IP - Packet is dropped because of IP related causes (e.g., ICMPv4/ICMPv6 packet is malformed, or DF flag is set but fragment must be performed for the packet) or corresponding interface is not found or inoperative IP_REASS - Packet is dropped during IP reassembly IPSEC - IPsec protocol related packet is dropped IPSEC_VTI - IPsec required SA is not found or traversing inoperative interface cause packet dropped L2VPN - VLAN id of GRE packet is invalid L4PORT - Layer 4 packet (e.g., BFD, DHCP) is dropped LB - Packet is dropped by load balancing rule LROUTER - Packet is dropped by logical router LSERVICE - Packet is malformed or traverses inoperative logical service interface LSWITCH - Packet is dropped by logical switch MANAGEMENT - Packet is dropped by Edge datapath MANAGEMENT service port MD_PROXY - Packet is dropped by metadata proxy NAT - Packet is dropped by NAT rule RTEP_TUNNEL - Unused drop reason ND_NS_FAIL - Neighbor Discovery packet fails NEIGH - ARP or Neighbor Discovery packet fails NO_EIP_FOUND - Destination IP is not an elastic IP NO_EIP_ASSOCIATION - Elastic IP is not associated with active edge VDR ENI NO_ENI_FOR_IP - There is no ENI found for the destination IP NO_ENI_FOR_LIF - Cannot find an ENI associated with uplink LIF NO_ROUTE - Cannot find route for destination IP NO_ROUTE_TABLE_FOUND - Cannot find associated route table NO_UNDERLAY_ROUTE_FOUND - Cannot find AWS route to destination NOT_VDR_DOWNLINK - Packet is not forwarded to VMC unmanaged VDR downlink NO_VDR_FOUND - VMC unmanaged VDR associated with Edge uplink is not found NO_VDR_ON_HOST - Cannot find VMC unmanaged VDR list on this host NOT_VDR_UPLINK - Packet is not forwarded to VDR uplink SERVICE_INSERT - Packet from guest VM to service VM or from service VM to guest VM is dropped by firewall rule SPOOFGUARD - Packet is blocked by SpoofGuard policy TTL_ZERO - The IPv4 time to live field or the IPv6 hop limit field of packet is zero TUNNEL - Overlay tunnel management packet (VNI value of GENEVE header is 0, e.g., BFD) is dropped VLAN - VLAN id of packet is disallowed by the given port VXLAN - VXLAN packet is malformed or cannot find tunnel port for it VXSTT - Unused drop reason VMC_NO_RESPONSE - Failed to query VMC observations as no response from VMC app WRONG_UPLINK - Packet is not routed to the expected Edge uplink by VMC unmanaged VDR FW_STATE - Packet is dropped by stateful firewall + Reason *string + // The name of the component that issued the observation. + ComponentName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER1 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_VRF_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LS_TRANSIT + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_CLASSIFIER + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_PROXY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_VDR + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_ENI + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_AWS_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_TGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_EDGE_UPLINK + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_DELL_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_UNKNOWN + // + // The sub type of the component that issued the observation. + ComponentSubType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_PHYSICAL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LR + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LS + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_HOSTSWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_FW_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_RTEP_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LOAD_BALANCER + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_NAT + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_IPSEC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SERVICE_INSERTION + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_VMC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_FW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DLB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_LB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_ROUTING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_FORWARDING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_HOST_SWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_UNKNOWN + // + // The type of the component that issued the observation. + ComponentType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDELIVERED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONREPLICATIONLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRELAYEDLOGICAL + ResourceType string + // the hop count for observations on the transport node that a traceflow packet is injected in will be 0. The hop count is incremented each time a subsequent transport node receives the traceflow packet. The sequence number of 999 indicates that the hop count could not be determined for the containing observation. format: int64 + SequenceNo *int64 + // This field contains the site path where this observation was generated. + SitePath *string + // Timestamp when the observation was created by the transport node (milliseconds epoch) format: int64 + Timestamp *int64 + // Timestamp when the observation was created by the transport node (microseconds epoch) format: int64 + TimestampMicro *int64 + // id of the transport node that observed a traceflow packet + TransportNodeId *string + // name of the transport node that observed a traceflow packet + TransportNodeName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_ESX + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_WINDOWSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_EDGE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_PUBLIC_CLOUD_GATEWAY_NODE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OTHERS + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_HYPERV + // + // type of the transport node that observed a traceflow packet + TransportNodeType *string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const TraceflowObservationDropped__TYPE_IDENTIFIER = "TraceflowObservationDropped" +const TraceflowObservationDropped_ARP_FAIL_REASON_UNKNOWN = "ARP_UNKNOWN" +const TraceflowObservationDropped_ARP_FAIL_REASON_TIMEOUT = "ARP_TIMEOUT" +const TraceflowObservationDropped_ARP_FAIL_REASON_CPFAIL = "ARP_CPFAIL" +const TraceflowObservationDropped_ARP_FAIL_REASON_FROMCP = "ARP_FROMCP" +const TraceflowObservationDropped_ARP_FAIL_REASON_PORTDESTROY = "ARP_PORTDESTROY" +const TraceflowObservationDropped_ARP_FAIL_REASON_TABLEDESTROY = "ARP_TABLEDESTROY" +const TraceflowObservationDropped_ARP_FAIL_REASON_NETDESTROY = "ARP_NETDESTROY" +const TraceflowObservationDropped_REASON_ARP_FAIL = "ARP_FAIL" +const TraceflowObservationDropped_REASON_BFD = "BFD" +const TraceflowObservationDropped_REASON_BROADCAST = "BROADCAST" +const TraceflowObservationDropped_REASON_DHCP = "DHCP" +const TraceflowObservationDropped_REASON_DLB = "DLB" +const TraceflowObservationDropped_REASON_FW_RULE = "FW_RULE" +const TraceflowObservationDropped_REASON_GENEVE = "GENEVE" +const TraceflowObservationDropped_REASON_GRE = "GRE" +const TraceflowObservationDropped_REASON_IFACE = "IFACE" +const TraceflowObservationDropped_REASON_IP = "IP" +const TraceflowObservationDropped_REASON_IP_REASS = "IP_REASS" +const TraceflowObservationDropped_REASON_IPSEC = "IPSEC" +const TraceflowObservationDropped_REASON_IPSEC_VTI = "IPSEC_VTI" +const TraceflowObservationDropped_REASON_L2VPN = "L2VPN" +const TraceflowObservationDropped_REASON_L4PORT = "L4PORT" +const TraceflowObservationDropped_REASON_LB = "LB" +const TraceflowObservationDropped_REASON_LROUTER = "LROUTER" +const TraceflowObservationDropped_REASON_LSERVICE = "LSERVICE" +const TraceflowObservationDropped_REASON_LSWITCH = "LSWITCH" +const TraceflowObservationDropped_REASON_MANAGEMENT = "MANAGEMENT" +const TraceflowObservationDropped_REASON_MD_PROXY = "MD_PROXY" +const TraceflowObservationDropped_REASON_NAT = "NAT" +const TraceflowObservationDropped_REASON_RTEP_TUNNEL = "RTEP_TUNNEL" +const TraceflowObservationDropped_REASON_ND_NS_FAIL = "ND_NS_FAIL" +const TraceflowObservationDropped_REASON_NEIGH = "NEIGH" +const TraceflowObservationDropped_REASON_NO_EIP_FOUND = "NO_EIP_FOUND" +const TraceflowObservationDropped_REASON_NO_EIP_ASSOCIATION = "NO_EIP_ASSOCIATION" +const TraceflowObservationDropped_REASON_NO_ENI_FOR_IP = "NO_ENI_FOR_IP" +const TraceflowObservationDropped_REASON_NO_ENI_FOR_LIF = "NO_ENI_FOR_LIF" +const TraceflowObservationDropped_REASON_NO_ROUTE = "NO_ROUTE" +const TraceflowObservationDropped_REASON_NO_ROUTE_TABLE_FOUND = "NO_ROUTE_TABLE_FOUND" +const TraceflowObservationDropped_REASON_NO_UNDERLAY_ROUTE_FOUND = "NO_UNDERLAY_ROUTE_FOUND" +const TraceflowObservationDropped_REASON_NOT_VDR_DOWNLINK = "NOT_VDR_DOWNLINK" +const TraceflowObservationDropped_REASON_NO_VDR_FOUND = "NO_VDR_FOUND" +const TraceflowObservationDropped_REASON_NO_VDR_ON_HOST = "NO_VDR_ON_HOST" +const TraceflowObservationDropped_REASON_NOT_VDR_UPLINK = "NOT_VDR_UPLINK" +const TraceflowObservationDropped_REASON_SERVICE_INSERT = "SERVICE_INSERT" +const TraceflowObservationDropped_REASON_SPOOFGUARD = "SPOOFGUARD" +const TraceflowObservationDropped_REASON_TTL_ZERO = "TTL_ZERO" +const TraceflowObservationDropped_REASON_TUNNEL = "TUNNEL" +const TraceflowObservationDropped_REASON_VLAN = "VLAN" +const TraceflowObservationDropped_REASON_VXLAN = "VXLAN" +const TraceflowObservationDropped_REASON_VXSTT = "VXSTT" +const TraceflowObservationDropped_REASON_VMC_NO_RESPONSE = "VMC_NO_RESPONSE" +const TraceflowObservationDropped_REASON_WRONG_UPLINK = "WRONG_UPLINK" +const TraceflowObservationDropped_REASON_FW_STATE = "FW_STATE" +const TraceflowObservationDropped_REASON_NO_MAC = "NO_MAC" +const TraceflowObservationDropped_REASON_UNKNOWN = "UNKNOWN" + +func (s *TraceflowObservationDropped) GetType__() bindings.BindingType { + return TraceflowObservationDroppedBindingType() +} + +func (s *TraceflowObservationDropped) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TraceflowObservationDropped._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TraceflowObservationDroppedLogical struct { + // The id of the component that dropped the traceflow packet. + ComponentId *string + // The index of service path that is a chain of services represents the point where the traceflow packet was dropped. format: int64 + ServicePathIndex *int64 + // This field is specified when the traceflow packet matched a L3 firewall rule. format: int64 + AclRuleId *int64 + // Possible values are: + // + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_UNKNOWN + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_TIMEOUT + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_CPFAIL + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_FROMCP + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_PORTDESTROY + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_TABLEDESTROY + // * TraceflowObservationDropped#TraceflowObservationDropped_ARP_FAIL_REASON_NETDESTROY + // + // This field specifies the ARP fails reason ARP_TIMEOUT - ARP failure due to query control plane timeout ARP_CPFAIL - ARP failure due post ARP query message to control plane failure ARP_FROMCP - ARP failure due to deleting ARP entry from control plane ARP_PORTDESTROY - ARP failure due to port destruction ARP_TABLEDESTROY - ARP failure due to ARP table destruction ARP_NETDESTROY - ARP failure due to overlay network destruction + ArpFailReason *string + // This field is specified when the traceflow packet matched a jump-to rule. format: int64 + JumptoRuleId *int64 + // This field is specified when the traceflow packet matched a l2 rule. format: int64 + L2RuleId *int64 + // The id of the logical port at which the traceflow packet was dropped + LportId *string + // The name of the logical port at which the traceflow packet was dropped + LportName *string + // This field is specified when the traceflow packet matched a NAT rule. format: int64 + NatRuleId *int64 + // Possible values are: + // + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_ARP_FAIL + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_BFD + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_BROADCAST + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_DHCP + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_DLB + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_FW_RULE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_GENEVE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_GRE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_IFACE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_IP + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_IP_REASS + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_IPSEC + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_IPSEC_VTI + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_L2VPN + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_L4PORT + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_LB + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_LROUTER + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_LSERVICE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_LSWITCH + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_MANAGEMENT + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_MD_PROXY + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NAT + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_RTEP_TUNNEL + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_ND_NS_FAIL + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NEIGH + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_EIP_FOUND + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_EIP_ASSOCIATION + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_ENI_FOR_IP + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_ENI_FOR_LIF + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_ROUTE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_ROUTE_TABLE_FOUND + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_UNDERLAY_ROUTE_FOUND + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NOT_VDR_DOWNLINK + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_VDR_FOUND + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_VDR_ON_HOST + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NOT_VDR_UPLINK + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_SERVICE_INSERT + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_SPOOFGUARD + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_TTL_ZERO + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_TUNNEL + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_VLAN + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_VXLAN + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_VXSTT + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_VMC_NO_RESPONSE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_WRONG_UPLINK + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_FW_STATE + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_NO_MAC + // * TraceflowObservationDropped#TraceflowObservationDropped_REASON_UNKNOWN + // + // This field specifies the drop reason of traceflow packet. ARP_FAIL - ARP request fails for some reasons, please refer arp_fail_reason for detail BFD - BFD packet is dropped because traversed by non-operative interface or encountering internal error (e.g., memory insufficient) BROADCAST - Packet is dropped during traversing the interface (e.g., Edge uplink, Edge centralized service port) which disallow ethernet broadcast DHCP - DHCP packet is malformed DLB - The packet is disallowed by distributed load balancing FW_RULE - The packet matches a drop or reject rule of DFW or Edge firewall GENEVE - GENEVE packet is malformed GRE - GRE packet is malformed or traverses a non-operative interface IFACE - Packet traverses a non-operative interface IP - Packet is dropped because of IP related causes (e.g., ICMPv4/ICMPv6 packet is malformed, or DF flag is set but fragment must be performed for the packet) or corresponding interface is not found or inoperative IP_REASS - Packet is dropped during IP reassembly IPSEC - IPsec protocol related packet is dropped IPSEC_VTI - IPsec required SA is not found or traversing inoperative interface cause packet dropped L2VPN - VLAN id of GRE packet is invalid L4PORT - Layer 4 packet (e.g., BFD, DHCP) is dropped LB - Packet is dropped by load balancing rule LROUTER - Packet is dropped by logical router LSERVICE - Packet is malformed or traverses inoperative logical service interface LSWITCH - Packet is dropped by logical switch MANAGEMENT - Packet is dropped by Edge datapath MANAGEMENT service port MD_PROXY - Packet is dropped by metadata proxy NAT - Packet is dropped by NAT rule RTEP_TUNNEL - Unused drop reason ND_NS_FAIL - Neighbor Discovery packet fails NEIGH - ARP or Neighbor Discovery packet fails NO_EIP_FOUND - Destination IP is not an elastic IP NO_EIP_ASSOCIATION - Elastic IP is not associated with active edge VDR ENI NO_ENI_FOR_IP - There is no ENI found for the destination IP NO_ENI_FOR_LIF - Cannot find an ENI associated with uplink LIF NO_ROUTE - Cannot find route for destination IP NO_ROUTE_TABLE_FOUND - Cannot find associated route table NO_UNDERLAY_ROUTE_FOUND - Cannot find AWS route to destination NOT_VDR_DOWNLINK - Packet is not forwarded to VMC unmanaged VDR downlink NO_VDR_FOUND - VMC unmanaged VDR associated with Edge uplink is not found NO_VDR_ON_HOST - Cannot find VMC unmanaged VDR list on this host NOT_VDR_UPLINK - Packet is not forwarded to VDR uplink SERVICE_INSERT - Packet from guest VM to service VM or from service VM to guest VM is dropped by firewall rule SPOOFGUARD - Packet is blocked by SpoofGuard policy TTL_ZERO - The IPv4 time to live field or the IPv6 hop limit field of packet is zero TUNNEL - Overlay tunnel management packet (VNI value of GENEVE header is 0, e.g., BFD) is dropped VLAN - VLAN id of packet is disallowed by the given port VXLAN - VXLAN packet is malformed or cannot find tunnel port for it VXSTT - Unused drop reason VMC_NO_RESPONSE - Failed to query VMC observations as no response from VMC app WRONG_UPLINK - Packet is not routed to the expected Edge uplink by VMC unmanaged VDR FW_STATE - Packet is dropped by stateful firewall + Reason *string + // The name of the component that issued the observation. + ComponentName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER1 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_VRF_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LS_TRANSIT + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_CLASSIFIER + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_PROXY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_VDR + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_ENI + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_AWS_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_TGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_EDGE_UPLINK + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_DELL_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_UNKNOWN + // + // The sub type of the component that issued the observation. + ComponentSubType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_PHYSICAL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LR + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LS + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_HOSTSWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_FW_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_RTEP_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LOAD_BALANCER + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_NAT + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_IPSEC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SERVICE_INSERTION + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_VMC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_FW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DLB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_LB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_ROUTING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_FORWARDING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_HOST_SWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_UNKNOWN + // + // The type of the component that issued the observation. + ComponentType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDELIVERED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONREPLICATIONLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRELAYEDLOGICAL + ResourceType string + // the hop count for observations on the transport node that a traceflow packet is injected in will be 0. The hop count is incremented each time a subsequent transport node receives the traceflow packet. The sequence number of 999 indicates that the hop count could not be determined for the containing observation. format: int64 + SequenceNo *int64 + // This field contains the site path where this observation was generated. + SitePath *string + // Timestamp when the observation was created by the transport node (milliseconds epoch) format: int64 + Timestamp *int64 + // Timestamp when the observation was created by the transport node (microseconds epoch) format: int64 + TimestampMicro *int64 + // id of the transport node that observed a traceflow packet + TransportNodeId *string + // name of the transport node that observed a traceflow packet + TransportNodeName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_ESX + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_WINDOWSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_EDGE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_PUBLIC_CLOUD_GATEWAY_NODE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OTHERS + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_HYPERV + // + // type of the transport node that observed a traceflow packet + TransportNodeType *string +} + +func (s *TraceflowObservationDroppedLogical) GetType__() bindings.BindingType { + return TraceflowObservationDroppedLogicalBindingType() +} + +func (s *TraceflowObservationDroppedLogical) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TraceflowObservationDroppedLogical._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TraceflowObservationForwarded struct { + // The 64bit tunnel context carried on the wire format: int64 + Context *int64 + // This field will not be always available. Use remote_ip_address when this field is not set. + DstTransportNodeId *string + // The name of the transport node to which the traceflow packet is forwarded + DstTransportNodeName *string + // IP address of the source end of the tunnel format: ip + LocalIpAddress *string + // IP address of the destination end of the tunnel format: ip + RemoteIpAddress *string + // The name of the uplink the traceflow packet is forwarded on + UplinkName *string + // The virtual tunnel endpoint label format: int64 + VtepLabel *int64 + // The name of the component that issued the observation. + ComponentName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER1 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_VRF_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LS_TRANSIT + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_CLASSIFIER + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_PROXY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_VDR + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_ENI + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_AWS_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_TGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_EDGE_UPLINK + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_DELL_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_UNKNOWN + // + // The sub type of the component that issued the observation. + ComponentSubType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_PHYSICAL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LR + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LS + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_HOSTSWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_FW_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_RTEP_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LOAD_BALANCER + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_NAT + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_IPSEC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SERVICE_INSERTION + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_VMC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_FW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DLB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_LB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_ROUTING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_FORWARDING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_HOST_SWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_UNKNOWN + // + // The type of the component that issued the observation. + ComponentType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDELIVERED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONREPLICATIONLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRELAYEDLOGICAL + ResourceType string + // the hop count for observations on the transport node that a traceflow packet is injected in will be 0. The hop count is incremented each time a subsequent transport node receives the traceflow packet. The sequence number of 999 indicates that the hop count could not be determined for the containing observation. format: int64 + SequenceNo *int64 + // This field contains the site path where this observation was generated. + SitePath *string + // Timestamp when the observation was created by the transport node (milliseconds epoch) format: int64 + Timestamp *int64 + // Timestamp when the observation was created by the transport node (microseconds epoch) format: int64 + TimestampMicro *int64 + // id of the transport node that observed a traceflow packet + TransportNodeId *string + // name of the transport node that observed a traceflow packet + TransportNodeName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_ESX + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_WINDOWSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_EDGE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_PUBLIC_CLOUD_GATEWAY_NODE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OTHERS + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_HYPERV + // + // type of the transport node that observed a traceflow packet + TransportNodeType *string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const TraceflowObservationForwarded__TYPE_IDENTIFIER = "TraceflowObservationForwarded" + +func (s *TraceflowObservationForwarded) GetType__() bindings.BindingType { + return TraceflowObservationForwardedBindingType() +} + +func (s *TraceflowObservationForwarded) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TraceflowObservationForwarded._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TraceflowObservationForwardedLogical struct { + // This field is specified when the traceflow packet matched a L3 firewall rule. format: int64 + AclRuleId *int64 + // The id of the component that forwarded the traceflow packet. + ComponentId *string + // The id of the destination component to which the traceflow packet was forwarded. + DstComponentId *string + // The name of the destination component to which the traceflow packet was forwarded. + DstComponentName *string + // Possible values are: + // + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_PHYSICAL + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_LR + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_LS + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_DFW + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_BRIDGE + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_EDGE_TUNNEL + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_EDGE_HOSTSWITCH + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_FW_BRIDGE + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_EDGE_RTEP_TUNNEL + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_LOAD_BALANCER + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_NAT + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_IPSEC + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_SERVICE_INSERTION + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_VMC + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_SPOOFGUARD + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_EDGE_FW + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_DLB + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_ANTREA_SPOOFGUARD + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_ANTREA_LB + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_ANTREA_ROUTING + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_ANTREA_DFW + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_ANTREA_FORWARDING + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_HOST_SWITCH + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_UNKNOWN + // + // The type of the destination component to which the traceflow packet was forwarded. + DstComponentType *string + // This field is specified when the traceflow packet matched a jump-to rule. format: int64 + JumptoRuleId *int64 + // This field is specified when the traceflow packet matched a l2 rule. format: int64 + L2RuleId *int64 + // The id of the logical port through which the traceflow packet was forwarded. + LportId *string + // The name of the logical port through which the traceflow packet was forwarded. + LportName *string + // This field is specified when the traceflow packet matched a NAT rule. format: int64 + NatRuleId *int64 + // Possible values are: + // + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_RESEND_TYPE_UNKNOWN + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_RESEND_TYPE_ARP_UNKNOWN_FROM_CP + // * TraceflowObservationForwardedLogical#TraceflowObservationForwardedLogical_RESEND_TYPE_ND_NS_UNKNWON_FROM_CP + // + // ARP_UNKNOWN_FROM_CP - Unknown ARP query result emitted by control plane ND_NS_UNKNOWN_FROM_CP - Unknown neighbor solicitation query result emitted by control plane UNKNOWN - Unknown resend type + ResendType *string + // The index of the service insertion component format: int64 + ServiceIndex *int64 + // The path index of the service insertion component format: int64 + ServicePathIndex *int64 + // The ttl of the service insertion component format: int64 + ServiceTtl *int64 + // This field specified the prefix IP address a traceflow packet matched in the whitelist in spoofguard. format: ip-cidr-block + SpoofguardIp *string + // The source MAC address of form: \"^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$\". For example: 00:00:00:00:00:00. format: mac-address + SpoofguardMac *string + // This field specified the VLAN id a traceflow packet matched in the whitelist in spoofguard. format: int64 + SpoofguardVlanId *int64 + // MAC address of nexthop for service insertion(SI) in service VM(SVM) where the traceflow packet was received. + SvcNhMac *string + // The translated destination IP address of VNP/NAT format: ip + TranslatedDstIp *string + // The translated source IP address of VPN/NAT format: ip + TranslatedSrcIp *string + // This field is specified when the traceflow packet was forwarded by a VLAN logical network. format: int64 + Vlan *int64 + // This field is specified when the traceflow packet was forwarded by an overlay logical network. format: int32 + Vni *int64 + // The name of the component that issued the observation. + ComponentName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER1 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_VRF_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LS_TRANSIT + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_CLASSIFIER + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_PROXY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_VDR + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_ENI + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_AWS_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_TGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_EDGE_UPLINK + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_DELL_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_UNKNOWN + // + // The sub type of the component that issued the observation. + ComponentSubType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_PHYSICAL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LR + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LS + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_HOSTSWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_FW_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_RTEP_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LOAD_BALANCER + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_NAT + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_IPSEC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SERVICE_INSERTION + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_VMC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_FW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DLB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_LB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_ROUTING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_FORWARDING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_HOST_SWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_UNKNOWN + // + // The type of the component that issued the observation. + ComponentType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDELIVERED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONREPLICATIONLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRELAYEDLOGICAL + ResourceType string + // the hop count for observations on the transport node that a traceflow packet is injected in will be 0. The hop count is incremented each time a subsequent transport node receives the traceflow packet. The sequence number of 999 indicates that the hop count could not be determined for the containing observation. format: int64 + SequenceNo *int64 + // This field contains the site path where this observation was generated. + SitePath *string + // Timestamp when the observation was created by the transport node (milliseconds epoch) format: int64 + Timestamp *int64 + // Timestamp when the observation was created by the transport node (microseconds epoch) format: int64 + TimestampMicro *int64 + // id of the transport node that observed a traceflow packet + TransportNodeId *string + // name of the transport node that observed a traceflow packet + TransportNodeName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_ESX + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_WINDOWSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_EDGE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_PUBLIC_CLOUD_GATEWAY_NODE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OTHERS + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_HYPERV + // + // type of the transport node that observed a traceflow packet + TransportNodeType *string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const TraceflowObservationForwardedLogical__TYPE_IDENTIFIER = "TraceflowObservationForwardedLogical" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_PHYSICAL = "PHYSICAL" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_LR = "LR" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_LS = "LS" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_DFW = "DFW" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_BRIDGE = "BRIDGE" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_EDGE_TUNNEL = "EDGE_TUNNEL" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_EDGE_HOSTSWITCH = "EDGE_HOSTSWITCH" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_FW_BRIDGE = "FW_BRIDGE" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_EDGE_RTEP_TUNNEL = "EDGE_RTEP_TUNNEL" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_LOAD_BALANCER = "LOAD_BALANCER" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_NAT = "NAT" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_IPSEC = "IPSEC" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_SERVICE_INSERTION = "SERVICE_INSERTION" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_VMC = "VMC" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_SPOOFGUARD = "SPOOFGUARD" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_EDGE_FW = "EDGE_FW" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_DLB = "DLB" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_ANTREA_SPOOFGUARD = "ANTREA_SPOOFGUARD" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_ANTREA_LB = "ANTREA_LB" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_ANTREA_ROUTING = "ANTREA_ROUTING" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_ANTREA_DFW = "ANTREA_DFW" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_ANTREA_FORWARDING = "ANTREA_FORWARDING" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_HOST_SWITCH = "HOST_SWITCH" +const TraceflowObservationForwardedLogical_DST_COMPONENT_TYPE_UNKNOWN = "UNKNOWN" +const TraceflowObservationForwardedLogical_RESEND_TYPE_UNKNOWN = "UNKNOWN" +const TraceflowObservationForwardedLogical_RESEND_TYPE_ARP_UNKNOWN_FROM_CP = "ARP_UNKNOWN_FROM_CP" +const TraceflowObservationForwardedLogical_RESEND_TYPE_ND_NS_UNKNWON_FROM_CP = "ND_NS_UNKNWON_FROM_CP" + +func (s *TraceflowObservationForwardedLogical) GetType__() bindings.BindingType { + return TraceflowObservationForwardedLogicalBindingType() +} + +func (s *TraceflowObservationForwardedLogical) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TraceflowObservationForwardedLogical._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TraceflowObservationListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // TraceflowObservation list results + Results []*data.StructValue +} + +func (s *TraceflowObservationListResult) GetType__() bindings.BindingType { + return TraceflowObservationListResultBindingType() +} + +func (s *TraceflowObservationListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TraceflowObservationListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TraceflowObservationReceived struct { + // IP address of the destination end of the tunnel format: ip + LocalIpAddress *string + // IP address of the source end of the tunnel format: ip + RemoteIpAddress *string + // The name of the uplink the traceflow packet is received on + UplinkName *string + // The virtual tunnel endpoint label format: int64 + VtepLabel *int64 + // The name of the component that issued the observation. + ComponentName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER1 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_VRF_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LS_TRANSIT + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_CLASSIFIER + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_PROXY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_VDR + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_ENI + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_AWS_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_TGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_EDGE_UPLINK + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_DELL_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_UNKNOWN + // + // The sub type of the component that issued the observation. + ComponentSubType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_PHYSICAL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LR + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LS + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_HOSTSWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_FW_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_RTEP_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LOAD_BALANCER + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_NAT + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_IPSEC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SERVICE_INSERTION + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_VMC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_FW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DLB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_LB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_ROUTING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_FORWARDING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_HOST_SWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_UNKNOWN + // + // The type of the component that issued the observation. + ComponentType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDELIVERED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONREPLICATIONLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRELAYEDLOGICAL + ResourceType string + // the hop count for observations on the transport node that a traceflow packet is injected in will be 0. The hop count is incremented each time a subsequent transport node receives the traceflow packet. The sequence number of 999 indicates that the hop count could not be determined for the containing observation. format: int64 + SequenceNo *int64 + // This field contains the site path where this observation was generated. + SitePath *string + // Timestamp when the observation was created by the transport node (milliseconds epoch) format: int64 + Timestamp *int64 + // Timestamp when the observation was created by the transport node (microseconds epoch) format: int64 + TimestampMicro *int64 + // id of the transport node that observed a traceflow packet + TransportNodeId *string + // name of the transport node that observed a traceflow packet + TransportNodeName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_ESX + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_WINDOWSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_EDGE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_PUBLIC_CLOUD_GATEWAY_NODE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OTHERS + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_HYPERV + // + // type of the transport node that observed a traceflow packet + TransportNodeType *string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const TraceflowObservationReceived__TYPE_IDENTIFIER = "TraceflowObservationReceived" + +func (s *TraceflowObservationReceived) GetType__() bindings.BindingType { + return TraceflowObservationReceivedBindingType() +} + +func (s *TraceflowObservationReceived) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TraceflowObservationReceived._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TraceflowObservationReceivedLogical struct { + // The id of the component that received the traceflow packet. + ComponentId *string + // The id of the logical port at which the traceflow packet was received + LportId *string + // The name of the logical port at which the traceflow packet was received + LportName *string + // The id of the source component from which the traceflow packet was received. + SrcComponentId *string + // The name of source component from which the traceflow packet was received. + SrcComponentName *string + // Possible values are: + // + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_PHYSICAL + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_LR + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_LS + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_DFW + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_BRIDGE + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_EDGE_TUNNEL + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_EDGE_HOSTSWITCH + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_FW_BRIDGE + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_EDGE_RTEP_TUNNEL + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_LOAD_BALANCER + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_NAT + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_IPSEC + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_SERVICE_INSERTION + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_VMC + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_SPOOFGUARD + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_EDGE_FW + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_DLB + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_ANTREA_SPOOFGUARD + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_ANTREA_LB + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_ANTREA_ROUTING + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_ANTREA_DFW + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_ANTREA_FORWARDING + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_HOST_SWITCH + // * TraceflowObservationReceivedLogical#TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_UNKNOWN + // + // The type of the source component from which the traceflow packet was received. + SrcComponentType *string + // MAC address of SAN volume controller for service insertion(SI) in service VM(SVM) where the traceflow packet was received. + SvcMac *string + // This field is specified when the traceflow packet was received by a VLAN logical network. format: int64 + Vlan *int64 + // This field is specified when the traceflow packet was received by an overlay logical network. format: int32 + Vni *int64 + // The name of the component that issued the observation. + ComponentName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER1 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_VRF_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LS_TRANSIT + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_CLASSIFIER + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_PROXY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_VDR + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_ENI + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_AWS_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_TGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_EDGE_UPLINK + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_DELL_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_UNKNOWN + // + // The sub type of the component that issued the observation. + ComponentSubType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_PHYSICAL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LR + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LS + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_HOSTSWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_FW_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_RTEP_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LOAD_BALANCER + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_NAT + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_IPSEC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SERVICE_INSERTION + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_VMC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_FW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DLB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_LB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_ROUTING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_FORWARDING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_HOST_SWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_UNKNOWN + // + // The type of the component that issued the observation. + ComponentType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDELIVERED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONREPLICATIONLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRELAYEDLOGICAL + ResourceType string + // the hop count for observations on the transport node that a traceflow packet is injected in will be 0. The hop count is incremented each time a subsequent transport node receives the traceflow packet. The sequence number of 999 indicates that the hop count could not be determined for the containing observation. format: int64 + SequenceNo *int64 + // This field contains the site path where this observation was generated. + SitePath *string + // Timestamp when the observation was created by the transport node (milliseconds epoch) format: int64 + Timestamp *int64 + // Timestamp when the observation was created by the transport node (microseconds epoch) format: int64 + TimestampMicro *int64 + // id of the transport node that observed a traceflow packet + TransportNodeId *string + // name of the transport node that observed a traceflow packet + TransportNodeName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_ESX + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_WINDOWSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_EDGE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_PUBLIC_CLOUD_GATEWAY_NODE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OTHERS + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_HYPERV + // + // type of the transport node that observed a traceflow packet + TransportNodeType *string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const TraceflowObservationReceivedLogical__TYPE_IDENTIFIER = "TraceflowObservationReceivedLogical" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_PHYSICAL = "PHYSICAL" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_LR = "LR" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_LS = "LS" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_DFW = "DFW" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_BRIDGE = "BRIDGE" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_EDGE_TUNNEL = "EDGE_TUNNEL" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_EDGE_HOSTSWITCH = "EDGE_HOSTSWITCH" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_FW_BRIDGE = "FW_BRIDGE" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_EDGE_RTEP_TUNNEL = "EDGE_RTEP_TUNNEL" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_LOAD_BALANCER = "LOAD_BALANCER" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_NAT = "NAT" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_IPSEC = "IPSEC" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_SERVICE_INSERTION = "SERVICE_INSERTION" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_VMC = "VMC" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_SPOOFGUARD = "SPOOFGUARD" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_EDGE_FW = "EDGE_FW" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_DLB = "DLB" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_ANTREA_SPOOFGUARD = "ANTREA_SPOOFGUARD" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_ANTREA_LB = "ANTREA_LB" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_ANTREA_ROUTING = "ANTREA_ROUTING" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_ANTREA_DFW = "ANTREA_DFW" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_ANTREA_FORWARDING = "ANTREA_FORWARDING" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_HOST_SWITCH = "HOST_SWITCH" +const TraceflowObservationReceivedLogical_SRC_COMPONENT_TYPE_UNKNOWN = "UNKNOWN" + +func (s *TraceflowObservationReceivedLogical) GetType__() bindings.BindingType { + return TraceflowObservationReceivedLogicalBindingType() +} + +func (s *TraceflowObservationReceivedLogical) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TraceflowObservationReceivedLogical._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TraceflowObservationRelayedLogical struct { + // This field specified the IP address of the destination which the packet will be relayed. format: ip + DstServerAddress *string + // This field specified the logical component that relay service located. + LogicalCompUuid *string + // Possible values are: + // + // * TraceflowObservationRelayedLogical#TraceflowObservationRelayedLogical_MESSAGE_TYPE_REQUEST + // * TraceflowObservationRelayedLogical#TraceflowObservationRelayedLogical_MESSAGE_TYPE_REPLY + // + // This field specified the message type of the relay service REQUEST - The relay service will relay a request message to the destination server REPLY - The relay service will relay a reply message to the client + MessageType *string + // This field specified the IP address of the relay service. format: ip + RelayServerAddress *string + // The name of the component that issued the observation. + ComponentName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER1 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_VRF_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LS_TRANSIT + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_CLASSIFIER + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_PROXY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_VDR + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_ENI + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_AWS_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_TGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_EDGE_UPLINK + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_DELL_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_UNKNOWN + // + // The sub type of the component that issued the observation. + ComponentSubType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_PHYSICAL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LR + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LS + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_HOSTSWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_FW_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_RTEP_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LOAD_BALANCER + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_NAT + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_IPSEC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SERVICE_INSERTION + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_VMC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_FW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DLB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_LB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_ROUTING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_FORWARDING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_HOST_SWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_UNKNOWN + // + // The type of the component that issued the observation. + ComponentType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDELIVERED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONREPLICATIONLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRELAYEDLOGICAL + ResourceType string + // the hop count for observations on the transport node that a traceflow packet is injected in will be 0. The hop count is incremented each time a subsequent transport node receives the traceflow packet. The sequence number of 999 indicates that the hop count could not be determined for the containing observation. format: int64 + SequenceNo *int64 + // This field contains the site path where this observation was generated. + SitePath *string + // Timestamp when the observation was created by the transport node (milliseconds epoch) format: int64 + Timestamp *int64 + // Timestamp when the observation was created by the transport node (microseconds epoch) format: int64 + TimestampMicro *int64 + // id of the transport node that observed a traceflow packet + TransportNodeId *string + // name of the transport node that observed a traceflow packet + TransportNodeName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_ESX + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_WINDOWSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_EDGE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_PUBLIC_CLOUD_GATEWAY_NODE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OTHERS + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_HYPERV + // + // type of the transport node that observed a traceflow packet + TransportNodeType *string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const TraceflowObservationRelayedLogical__TYPE_IDENTIFIER = "TraceflowObservationRelayedLogical" +const TraceflowObservationRelayedLogical_MESSAGE_TYPE_REQUEST = "REQUEST" +const TraceflowObservationRelayedLogical_MESSAGE_TYPE_REPLY = "REPLY" + +func (s *TraceflowObservationRelayedLogical) GetType__() bindings.BindingType { + return TraceflowObservationRelayedLogicalBindingType() +} + +func (s *TraceflowObservationRelayedLogical) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TraceflowObservationRelayedLogical._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TraceflowObservationReplicationLogical struct { + // Local IP address of the component that replicates the packet. format: ip + LocalIpAddress *string + // Possible values are: + // + // * TraceflowObservationReplicationLogical#TraceflowObservationReplicationLogical_REPLICATION_TYPE_TX_VTEP + // * TraceflowObservationReplicationLogical#TraceflowObservationReplicationLogical_REPLICATION_TYPE_TX_MTEP + // * TraceflowObservationReplicationLogical#TraceflowObservationReplicationLogical_REPLICATION_TYPE_RX + // + // This field specifies the type of replication message TX_VTEP - Transmit replication to all VTEPs TX_MTEP - Transmit replication to all MTEPs RX - Receive replication + ReplicationType *string + // The name of uplink + UplinkName *string + // The label of VTEP format: int64 + VtepLabel *int64 + // The name of the component that issued the observation. + ComponentName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_TIER1 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LR_VRF_TIER0 + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LS_TRANSIT + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_CLASSIFIER + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_SI_PROXY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_VDR + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_ENI + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_AWS_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_TGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_EDGE_UPLINK + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_DELL_GATEWAY + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_LGW_ROUTE + // * TraceflowObservation#TraceflowObservation_COMPONENT_SUB_TYPE_UNKNOWN + // + // The sub type of the component that issued the observation. + ComponentSubType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_PHYSICAL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LR + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LS + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_HOSTSWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_FW_BRIDGE + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_RTEP_TUNNEL + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_LOAD_BALANCER + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_NAT + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_IPSEC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SERVICE_INSERTION + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_VMC + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_EDGE_FW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_DLB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_SPOOFGUARD + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_LB + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_ROUTING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_DFW + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_ANTREA_FORWARDING + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_HOST_SWITCH + // * TraceflowObservation#TraceflowObservation_COMPONENT_TYPE_UNKNOWN + // + // The type of the component that issued the observation. + ComponentType *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDELIVERED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVED + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVEDLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONREPLICATIONLOGICAL + // * TraceflowObservation#TraceflowObservation_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRELAYEDLOGICAL + ResourceType string + // the hop count for observations on the transport node that a traceflow packet is injected in will be 0. The hop count is incremented each time a subsequent transport node receives the traceflow packet. The sequence number of 999 indicates that the hop count could not be determined for the containing observation. format: int64 + SequenceNo *int64 + // This field contains the site path where this observation was generated. + SitePath *string + // Timestamp when the observation was created by the transport node (milliseconds epoch) format: int64 + Timestamp *int64 + // Timestamp when the observation was created by the transport node (microseconds epoch) format: int64 + TimestampMicro *int64 + // id of the transport node that observed a traceflow packet + TransportNodeId *string + // name of the transport node that observed a traceflow packet + TransportNodeName *string + // Possible values are: + // + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_ESX + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSCONTAINER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_CENTOSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESKVM + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_SLESSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_WINDOWSSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_RHELSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OELSERVER + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_UBUNTUSMARTNIC + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_EDGE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_PUBLIC_CLOUD_GATEWAY_NODE + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_OTHERS + // * TraceflowObservation#TraceflowObservation_TRANSPORT_NODE_TYPE_HYPERV + // + // type of the transport node that observed a traceflow packet + TransportNodeType *string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const TraceflowObservationReplicationLogical__TYPE_IDENTIFIER = "TraceflowObservationReplicationLogical" +const TraceflowObservationReplicationLogical_REPLICATION_TYPE_TX_VTEP = "TX_VTEP" +const TraceflowObservationReplicationLogical_REPLICATION_TYPE_TX_MTEP = "TX_MTEP" +const TraceflowObservationReplicationLogical_REPLICATION_TYPE_RX = "RX" + +func (s *TraceflowObservationReplicationLogical) GetType__() bindings.BindingType { + return TraceflowObservationReplicationLogicalBindingType() +} + +func (s *TraceflowObservationReplicationLogical) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TraceflowObservationReplicationLogical._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TraceflowRequest struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // id of the source logical port to inject the traceflow packet into + LportId *string + Packet *data.StructValue + // Maximum time (in ms) the management plane will wait for observation result list to be sent by controller plane. Upper limit for federation case is 90000, for non-federation case is 15000, the maximum is set to 90000 as the higher of the two cases. format: int64 + Timeout *int64 +} + +func (s *TraceflowRequest) GetType__() bindings.BindingType { + return TraceflowRequestBindingType() +} + +func (s *TraceflowRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TraceflowRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TransportInfo struct { + // Destination port format: int64 + DstPort *int64 + // Possible values are: + // + // * TransportInfo#TransportInfo_PROTOCOL_TCP + // * TransportInfo#TransportInfo_PROTOCOL_UDP + // * TransportInfo#TransportInfo_PROTOCOL_ICMPV4 + // * TransportInfo#TransportInfo_PROTOCOL_ICMPV6 + // + // Protocol type over IP layer + Protocol *string + // Source port format: int64 + SrcPort *int64 +} + +const TransportInfo_PROTOCOL_TCP = "TCP" +const TransportInfo_PROTOCOL_UDP = "UDP" +const TransportInfo_PROTOCOL_ICMPV4 = "ICMPv4" +const TransportInfo_PROTOCOL_ICMPV6 = "ICMPv6" + +func (s *TransportInfo) GetType__() bindings.BindingType { + return TransportInfoBindingType() +} + +func (s *TransportInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Transport Node +type TransportNode struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Set failure domain of edge transport node which will help in auto placement of TIER1 logical routers, DHCP Servers and MDProxies, if failure domain based allocation is enabled in edge cluster API. It is only supported for edge transport node and not for host transport node. In case failure domain is not set by user explicitly, it will be always assigned with default system created failure domain. + FailureDomainId *string + HostSwitchSpec *data.StructValue + // This flag is relevant to only those hosts which are part of a compute collection which has transport node profile (TNP) applied on it. If you change the transport node configuration and it is different than cluster level TNP then this flag will be set to true + IsOverridden *bool + // Possible values are: + // + // * TransportNode#TransportNode_MAINTENANCE_MODE_ENABLED + // * TransportNode#TransportNode_MAINTENANCE_MODE_FORCE_ENABLED + // * TransportNode#TransportNode_MAINTENANCE_MODE_DISABLED + // + // The property is read-only, used for querying result. User could update transport node maintenance mode by UpdateTransportNodeMaintenanceMode call. + MaintenanceMode *string + NodeDeploymentInfo *data.StructValue + // Unique Id of the fabric node + NodeId *string + RemoteTunnelEndpoint *TransportNodeRemoteTunnelEndpointConfig +} + +const TransportNode_MAINTENANCE_MODE_ENABLED = "ENABLED" +const TransportNode_MAINTENANCE_MODE_FORCE_ENABLED = "FORCE_ENABLED" +const TransportNode_MAINTENANCE_MODE_DISABLED = "DISABLED" + +func (s *TransportNode) GetType__() bindings.BindingType { + return TransportNodeBindingType() +} + +func (s *TransportNode) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportNode._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Entity to indicate relation between Compute collection and Transport node template +type TransportNodeCollection struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Compute collection id + ComputeCollectionId *string + // Flag indicating if applied profile has NVDS + HasNvds *bool + // Possible values are: + // + // * TransportNodeCollection#TransportNodeCollection_INSTALL_MODE_MICROSEG + // * TransportNodeCollection#TransportNodeCollection_INSTALL_MODE_NORMAL + // + // Flag indicating security status of Transport Node Collection + InstallMode *string + // Transport Node Profile ID + TransportNodeProfileId *string +} + +const TransportNodeCollection_INSTALL_MODE_MICROSEG = "MICROSEG" +const TransportNodeCollection_INSTALL_MODE_NORMAL = "NORMAL" + +func (s *TransportNodeCollection) GetType__() bindings.BindingType { + return TransportNodeCollectionBindingType() +} + +func (s *TransportNodeCollection) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportNodeCollection._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Transport Node collections list result +type TransportNodeCollectionListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Transport Node collection results + Results []TransportNodeCollection +} + +func (s *TransportNodeCollectionListResult) GetType__() bindings.BindingType { + return TransportNodeCollectionListResultBindingType() +} + +func (s *TransportNodeCollectionListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportNodeCollectionListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Realization state of attaching or detaching Transport node profile on compute collection. +type TransportNodeCollectionState struct { + // Average of all transport node deployment progress in a cluster. Applicable only if transport node profile is applied on a cluster. format: int64 + AggregateProgressPercentage *int64 + // Errors while applying transport node profile which need cluster level action to resolve + ClusterLevelError *string + // Possible values are: + // + // * TransportNodeCollectionState#TransportNodeCollectionState_STATE_FAILED_TO_CREATE + // * TransportNodeCollectionState#TransportNodeCollectionState_STATE_FAILED_TO_REALIZE + // * TransportNodeCollectionState#TransportNodeCollectionState_STATE_IN_PROGRESS + // * TransportNodeCollectionState#TransportNodeCollectionState_STATE_PROFILE_MISMATCH + // * TransportNodeCollectionState#TransportNodeCollectionState_STATE_SUCCESS + // + // If the host preparation or transport node creation is going on for any host then state will be \"IN_PROGRESS\". If setting desired state of the transport node failed for any of the host then state will be \"FAILED_TO_CREATE\" If realization of transport node failed for any of the host then state will be \"FAILED_TO_REALIZE\" If Transport node is successfully created for all of the hosts in compute collection then state will be \"SUCCESS\" You can override the configuration for one or more hosts in the compute collection by update TN(transport node) request on individual TN. If TN is successfully created for all hosts in compute collection and one or more hosts have overridden configuration then transport node collection state will be \"PROFILE_MISMATCH\". + State *string + // Transport node profile(TNP) will not be applied to a discovered node(DN) if some validations are not passed. In this case transport node is not created or existing transport node is not updated with TNP configurations. + ValidationErrors []ValidationError + // When vLCM is enabled on a compute collection in vSphere the transition workflow is triggered. This field indicates error in this special case. + VlcmTransitionError *string +} + +const TransportNodeCollectionState_STATE_FAILED_TO_CREATE = "FAILED_TO_CREATE" +const TransportNodeCollectionState_STATE_FAILED_TO_REALIZE = "FAILED_TO_REALIZE" +const TransportNodeCollectionState_STATE_IN_PROGRESS = "IN_PROGRESS" +const TransportNodeCollectionState_STATE_PROFILE_MISMATCH = "PROFILE_MISMATCH" +const TransportNodeCollectionState_STATE_SUCCESS = "SUCCESS" + +func (s *TransportNodeCollectionState) GetType__() bindings.BindingType { + return TransportNodeCollectionStateBindingType() +} + +func (s *TransportNodeCollectionState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportNodeCollectionState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Deployment progress state of transport node. Object has current deployment step title and progress in percentage. +type TransportNodeDeploymentProgressState struct { + // Deployment step title + CurrentStepTitle *string + // Percentage of deployment completed format: int64 + Progress *int64 +} + +func (s *TransportNodeDeploymentProgressState) GetType__() bindings.BindingType { + return TransportNodeDeploymentProgressStateBindingType() +} + +func (s *TransportNodeDeploymentProgressState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportNodeDeploymentProgressState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Transport Node queries result +type TransportNodeListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // TransportNode Results + Results []TransportNode +} + +func (s *TransportNodeListResult) GetType__() bindings.BindingType { + return TransportNodeListResultBindingType() +} + +func (s *TransportNodeListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportNodeListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Information about participating transport nodes +type TransportNodeMemberInfo struct { + // Id of the compute collection to which this transport node belongs. Empty if this is standalone transport node or non ESX type node. + ComputeCollectionId *string + // List of host switches using the transport zone + HostSwitches []HostSwitchInfo + // Display name of the transport node which has one or more host switches which belong to associated transport zone. + TransportNodeDisplayName *string + // Id of the transport node which has one or more host switches which belong to associated transport zone. + TransportNodeId *string +} + +func (s *TransportNodeMemberInfo) GetType__() bindings.BindingType { + return TransportNodeMemberInfoBindingType() +} + +func (s *TransportNodeMemberInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportNodeMemberInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Transport Node Profile +type TransportNodeProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + HostSwitchSpec *data.StructValue + // Transport Node Profiles specify the configuration that is applied to all hosts in a cluster. The user has the ability to update the configuration on individual hosts within a cluster which will cause the host configuration to differ from the Transport Node Profile and results in the host to be marked as overridden. If a Transport Node Profile is edited or a new Transport Node Profile is applied on a Transport Node Collection, by default, the host configuration will be overwritten with the Transport Node Profile configuration and the overridden flag will be reset to false. This flag should be used when hosts that are set as overridden should not adopt the Transport Node Profile configuration when it is being updated or a new one is applied to the Transport Node Collection. In other words, when this flag is set to the default value of false and configuration is applied at the cluster level, the configuration will be applied on all hosts regardless if overridden or not. When this flag is set to true, all hosts that are set as overridden, i.e., have been updated invidivually, will be ignored and the cluster-level configuration will not be applied. Note, Transport Node Profiles can be applied on multiple clusters. This field will dictate the behavior followed by all clusters using this Transport Node Profile. + IgnoreOverriddenHosts *bool +} + +func (s *TransportNodeProfile) GetType__() bindings.BindingType { + return TransportNodeProfileBindingType() +} + +func (s *TransportNodeProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportNodeProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Transport Node Profile queries result +type TransportNodeProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // TransportNodeProfile Results + Results []TransportNodeProfile +} + +func (s *TransportNodeProfileListResult) GetType__() bindings.BindingType { + return TransportNodeProfileListResultBindingType() +} + +func (s *TransportNodeProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportNodeProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Remote tunnel endpoint configuration +type TransportNodeRemoteTunnelEndpointConfig struct { + // The host switch name should reference an existing host switch specified in the transport node configuration. The name will be used to identify the host switch responsible for processing remote tunnel endpoint traffic. + HostSwitchName *string + IpAssignmentSpec *data.StructValue + // Specifying this field will override the default teaming policy of the host switch and will be used by remote tunnel endpoint traffic. + NamedTeamingPolicy *string + // The transport VLAN id used for tagging intersite overlay traffic between remote tunnel endpoints. format: int64 + RtepVlan *int64 +} + +func (s *TransportNodeRemoteTunnelEndpointConfig) GetType__() bindings.BindingType { + return TransportNodeRemoteTunnelEndpointConfigBindingType() +} + +func (s *TransportNodeRemoteTunnelEndpointConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportNodeRemoteTunnelEndpointConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Transport Node State +type TransportNodeState struct { + // Array of configuration state of various sub systems + Details []ConfigurationStateElement + // Error code format: int64 + FailureCode *int64 + // Error message in case of failure + FailureMessage *string + // Possible values are: + // + // * TransportNodeState#TransportNodeState_STATE_PENDING + // * TransportNodeState#TransportNodeState_STATE_IN_PROGRESS + // * TransportNodeState#TransportNodeState_STATE_SUCCESS + // * TransportNodeState#TransportNodeState_STATE_FAILED + // * TransportNodeState#TransportNodeState_STATE_PARTIAL_SUCCESS + // * TransportNodeState#TransportNodeState_STATE_ORPHANED + // * TransportNodeState#TransportNodeState_STATE_UNKNOWN + // * TransportNodeState#TransportNodeState_STATE_ERROR + // * TransportNodeState#TransportNodeState_STATE_IN_SYNC + // * TransportNodeState#TransportNodeState_STATE_NOT_AVAILABLE + // * TransportNodeState#TransportNodeState_STATE_VM_DEPLOYMENT_QUEUED + // * TransportNodeState#TransportNodeState_STATE_VM_DEPLOYMENT_IN_PROGRESS + // * TransportNodeState#TransportNodeState_STATE_VM_DEPLOYMENT_FAILED + // * TransportNodeState#TransportNodeState_STATE_VM_POWER_ON_IN_PROGRESS + // * TransportNodeState#TransportNodeState_STATE_VM_POWER_ON_FAILED + // * TransportNodeState#TransportNodeState_STATE_REGISTRATION_PENDING + // * TransportNodeState#TransportNodeState_STATE_NODE_NOT_READY + // * TransportNodeState#TransportNodeState_STATE_NODE_READY + // * TransportNodeState#TransportNodeState_STATE_VM_POWER_OFF_IN_PROGRESS + // * TransportNodeState#TransportNodeState_STATE_VM_POWER_OFF_FAILED + // * TransportNodeState#TransportNodeState_STATE_VM_UNDEPLOY_IN_PROGRESS + // * TransportNodeState#TransportNodeState_STATE_VM_UNDEPLOY_FAILED + // * TransportNodeState#TransportNodeState_STATE_VM_UNDEPLOY_SUCCESSFUL + // * TransportNodeState#TransportNodeState_STATE_EDGE_CONFIG_ERROR + // * TransportNodeState#TransportNodeState_STATE_VM_DEPLOYMENT_RESTARTED + // * TransportNodeState#TransportNodeState_STATE_REGISTRATION_FAILED + // * TransportNodeState#TransportNodeState_STATE_TRANSPORT_NODE_SYNC_PENDING + // * TransportNodeState#TransportNodeState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING + // * TransportNodeState#TransportNodeState_STATE_EDGE_HARDWARE_NOT_SUPPORTED + // * TransportNodeState#TransportNodeState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED + // * TransportNodeState#TransportNodeState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER + // * TransportNodeState#TransportNodeState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED + // * TransportNodeState#TransportNodeState_STATE_NO_PNIC_PREPARED_IN_EDGE + // * TransportNodeState#TransportNodeState_STATE_APPLIANCE_INTERNAL_ERROR + // * TransportNodeState#TransportNodeState_STATE_VTEP_DHCP_NOT_SUPPORTED + // * TransportNodeState#TransportNodeState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE + // * TransportNodeState#TransportNodeState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED + // * TransportNodeState#TransportNodeState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND + // * TransportNodeState#TransportNodeState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED + // * TransportNodeState#TransportNodeState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY + // * TransportNodeState#TransportNodeState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM + // * TransportNodeState#TransportNodeState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM + // * TransportNodeState#TransportNodeState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM + // * TransportNodeState#TransportNodeState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE + // * TransportNodeState#TransportNodeState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE + // * TransportNodeState#TransportNodeState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED + // * TransportNodeState#TransportNodeState_STATE_NO_PNIC_SPECIFIED_IN_TN + // * TransportNodeState#TransportNodeState_STATE_INVALID_PNIC_DEVICE_NAME + // * TransportNodeState#TransportNodeState_STATE_TRANSPORT_NODE_READY + // * TransportNodeState#TransportNodeState_STATE_VM_NETWORK_EDIT_PENDING + // * TransportNodeState#TransportNodeState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY + // * TransportNodeState#TransportNodeState_STATE_MPA_DISCONNECTED + // * TransportNodeState#TransportNodeState_STATE_VM_RENAME_PENDING + // * TransportNodeState#TransportNodeState_STATE_VM_CONFIG_EDIT_PENDING + // * TransportNodeState#TransportNodeState_STATE_VM_NETWORK_EDIT_FAILED + // * TransportNodeState#TransportNodeState_STATE_VM_RENAME_FAILED + // * TransportNodeState#TransportNodeState_STATE_VM_CONFIG_EDIT_FAILED + // * TransportNodeState#TransportNodeState_STATE_VM_CONFIG_DISCREPANCY + // * TransportNodeState#TransportNodeState_STATE_VM_NODE_REFRESH_FAILED + // * TransportNodeState#TransportNodeState_STATE_VM_PLACEMENT_REFRESH_FAILED + // * TransportNodeState#TransportNodeState_STATE_REGISTRATION_TIMEDOUT + // * TransportNodeState#TransportNodeState_STATE_REPLACE_FAILED + // * TransportNodeState#TransportNodeState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED + // * TransportNodeState#TransportNodeState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING + // * TransportNodeState#TransportNodeState_STATE_DELETE_VM_IN_REDEPLOY_FAILED + // * TransportNodeState#TransportNodeState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED + // * TransportNodeState#TransportNodeState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE + // * TransportNodeState#TransportNodeState_STATE_VM_RESOURCE_RESERVATION_FAILED + // * TransportNodeState#TransportNodeState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER + // * TransportNodeState#TransportNodeState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING + // * TransportNodeState#TransportNodeState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE + // * TransportNodeState#TransportNodeState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE + // * TransportNodeState#TransportNodeState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE + // * TransportNodeState#TransportNodeState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE + // * TransportNodeState#TransportNodeState_STATE_COMPUTE_MANAGER_NOT_FOUND + // * TransportNodeState#TransportNodeState_STATE_DELETE_IN_PROGRESS + // + // Gives details of state of desired configuration. Additional enums with more details on progress/success/error states are sent for edge node. The success states are NODE_READY and TRANSPORT_NODE_READY, pending states are {VM_DEPLOYMENT_QUEUED, VM_DEPLOYMENT_IN_PROGRESS, REGISTRATION_PENDING} and other values indicate failures. \"in_sync\" state indicates that the desired configuration has been received by the host to which it applies, but is not yet in effect. When the configuration is actually in effect, the state will change to \"success\". Please note, failed state is deprecated. + State *string + DeploymentProgressState *TransportNodeDeploymentProgressState + // States of HostSwitches on the host + HostSwitchStates []HostSwitchState + // Possible values are: + // + // * TransportNodeState#TransportNodeState_MAINTENANCE_MODE_STATE_ENTERING + // * TransportNodeState#TransportNodeState_MAINTENANCE_MODE_STATE_ENABLED + // * TransportNodeState#TransportNodeState_MAINTENANCE_MODE_STATE_EXITING + // * TransportNodeState#TransportNodeState_MAINTENANCE_MODE_STATE_DISABLED + // + // the present realized maintenance mode state + MaintenanceModeState *string + NodeDeploymentState *ConfigurationState + RemoteTunnelEndpointState *RemoteTunnelEndpointConfigState + // Unique Id of the TransportNode + TransportNodeId *string +} + +const TransportNodeState_STATE_PENDING = "pending" +const TransportNodeState_STATE_IN_PROGRESS = "in_progress" +const TransportNodeState_STATE_SUCCESS = "success" +const TransportNodeState_STATE_FAILED = "failed" +const TransportNodeState_STATE_PARTIAL_SUCCESS = "partial_success" +const TransportNodeState_STATE_ORPHANED = "orphaned" +const TransportNodeState_STATE_UNKNOWN = "unknown" +const TransportNodeState_STATE_ERROR = "error" +const TransportNodeState_STATE_IN_SYNC = "in_sync" +const TransportNodeState_STATE_NOT_AVAILABLE = "NOT_AVAILABLE" +const TransportNodeState_STATE_VM_DEPLOYMENT_QUEUED = "VM_DEPLOYMENT_QUEUED" +const TransportNodeState_STATE_VM_DEPLOYMENT_IN_PROGRESS = "VM_DEPLOYMENT_IN_PROGRESS" +const TransportNodeState_STATE_VM_DEPLOYMENT_FAILED = "VM_DEPLOYMENT_FAILED" +const TransportNodeState_STATE_VM_POWER_ON_IN_PROGRESS = "VM_POWER_ON_IN_PROGRESS" +const TransportNodeState_STATE_VM_POWER_ON_FAILED = "VM_POWER_ON_FAILED" +const TransportNodeState_STATE_REGISTRATION_PENDING = "REGISTRATION_PENDING" +const TransportNodeState_STATE_NODE_NOT_READY = "NODE_NOT_READY" +const TransportNodeState_STATE_NODE_READY = "NODE_READY" +const TransportNodeState_STATE_VM_POWER_OFF_IN_PROGRESS = "VM_POWER_OFF_IN_PROGRESS" +const TransportNodeState_STATE_VM_POWER_OFF_FAILED = "VM_POWER_OFF_FAILED" +const TransportNodeState_STATE_VM_UNDEPLOY_IN_PROGRESS = "VM_UNDEPLOY_IN_PROGRESS" +const TransportNodeState_STATE_VM_UNDEPLOY_FAILED = "VM_UNDEPLOY_FAILED" +const TransportNodeState_STATE_VM_UNDEPLOY_SUCCESSFUL = "VM_UNDEPLOY_SUCCESSFUL" +const TransportNodeState_STATE_EDGE_CONFIG_ERROR = "EDGE_CONFIG_ERROR" +const TransportNodeState_STATE_VM_DEPLOYMENT_RESTARTED = "VM_DEPLOYMENT_RESTARTED" +const TransportNodeState_STATE_REGISTRATION_FAILED = "REGISTRATION_FAILED" +const TransportNodeState_STATE_TRANSPORT_NODE_SYNC_PENDING = "TRANSPORT_NODE_SYNC_PENDING" +const TransportNodeState_STATE_TRANSPORT_NODE_CONFIGURATION_MISSING = "TRANSPORT_NODE_CONFIGURATION_MISSING" +const TransportNodeState_STATE_EDGE_HARDWARE_NOT_SUPPORTED = "EDGE_HARDWARE_NOT_SUPPORTED" +const TransportNodeState_STATE_MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED = "MULTIPLE_OVERLAY_TZS_NOT_SUPPORTED" +const TransportNodeState_STATE_TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER = "TN_OVERLAY_TZ_IN_USE_BY_EDGE_CLUSTER" +const TransportNodeState_STATE_TZ_ENDPOINTS_NOT_SPECIFIED = "TZ_ENDPOINTS_NOT_SPECIFIED" +const TransportNodeState_STATE_NO_PNIC_PREPARED_IN_EDGE = "NO_PNIC_PREPARED_IN_EDGE" +const TransportNodeState_STATE_APPLIANCE_INTERNAL_ERROR = "APPLIANCE_INTERNAL_ERROR" +const TransportNodeState_STATE_VTEP_DHCP_NOT_SUPPORTED = "VTEP_DHCP_NOT_SUPPORTED" +const TransportNodeState_STATE_UNSUPPORTED_HOST_SWITCH_PROFILE = "UNSUPPORTED_HOST_SWITCH_PROFILE" +const TransportNodeState_STATE_UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED = "UPLINK_HOST_SWITCH_PROFILE_NOT_SPECIFIED" +const TransportNodeState_STATE_HOSTSWITCH_PROFILE_NOT_FOUND = "HOSTSWITCH_PROFILE_NOT_FOUND" +const TransportNodeState_STATE_LLDP_SEND_ENABLED_NOT_SUPPORTED = "LLDP_SEND_ENABLED_NOT_SUPPORTED" +const TransportNodeState_STATE_UNSUPPORTED_NAMED_TEAMING_POLICY = "UNSUPPORTED_NAMED_TEAMING_POLICY" +const TransportNodeState_STATE_LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM = "LBSRCID_NOT_SUPPORTED_FOR_EDGE_VM" +const TransportNodeState_STATE_LACP_NOT_SUPPORTED_FOR_EDGE_VM = "LACP_NOT_SUPPORTED_FOR_EDGE_VM" +const TransportNodeState_STATE_STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM = "STANDBY_UPLINKS_NOT_SUPPORTED_FOR_EDGE_VM" +const TransportNodeState_STATE_MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE = "MULTIPLE_ACTIVE_UPLINKS_NOT_SUPPORTED_FOR_EDGE" +const TransportNodeState_STATE_UNSUPPORTED_LACP_LB_ALGO_FOR_NODE = "UNSUPPORTED_LACP_LB_ALGO_FOR_NODE" +const TransportNodeState_STATE_EDGE_NODE_VERSION_NOT_SUPPORTED = "EDGE_NODE_VERSION_NOT_SUPPORTED" +const TransportNodeState_STATE_NO_PNIC_SPECIFIED_IN_TN = "NO_PNIC_SPECIFIED_IN_TN" +const TransportNodeState_STATE_INVALID_PNIC_DEVICE_NAME = "INVALID_PNIC_DEVICE_NAME" +const TransportNodeState_STATE_TRANSPORT_NODE_READY = "TRANSPORT_NODE_READY" +const TransportNodeState_STATE_VM_NETWORK_EDIT_PENDING = "VM_NETWORK_EDIT_PENDING" +const TransportNodeState_STATE_UNSUPPORTED_DEFAULT_TEAMING_POLICY = "UNSUPPORTED_DEFAULT_TEAMING_POLICY" +const TransportNodeState_STATE_MPA_DISCONNECTED = "MPA_DISCONNECTED" +const TransportNodeState_STATE_VM_RENAME_PENDING = "VM_RENAME_PENDING" +const TransportNodeState_STATE_VM_CONFIG_EDIT_PENDING = "VM_CONFIG_EDIT_PENDING" +const TransportNodeState_STATE_VM_NETWORK_EDIT_FAILED = "VM_NETWORK_EDIT_FAILED" +const TransportNodeState_STATE_VM_RENAME_FAILED = "VM_RENAME_FAILED" +const TransportNodeState_STATE_VM_CONFIG_EDIT_FAILED = "VM_CONFIG_EDIT_FAILED" +const TransportNodeState_STATE_VM_CONFIG_DISCREPANCY = "VM_CONFIG_DISCREPANCY" +const TransportNodeState_STATE_VM_NODE_REFRESH_FAILED = "VM_NODE_REFRESH_FAILED" +const TransportNodeState_STATE_VM_PLACEMENT_REFRESH_FAILED = "VM_PLACEMENT_REFRESH_FAILED" +const TransportNodeState_STATE_REGISTRATION_TIMEDOUT = "REGISTRATION_TIMEDOUT" +const TransportNodeState_STATE_REPLACE_FAILED = "REPLACE_FAILED" +const TransportNodeState_STATE_UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED = "UPLINK_FROM_TEAMING_POLICY_NOT_MAPPED" +const TransportNodeState_STATE_LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING = "LOGICAL_SWITCH_NAMED_TEAMING_HAS_NO_PNIC_BACKING" +const TransportNodeState_STATE_DELETE_VM_IN_REDEPLOY_FAILED = "DELETE_VM_IN_REDEPLOY_FAILED" +const TransportNodeState_STATE_DEPLOY_VM_IN_REDEPLOY_FAILED = "DEPLOY_VM_IN_REDEPLOY_FAILED" +const TransportNodeState_STATE_INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE = "INSUFFICIENT_RESOURCES_IN_EDGE_NODE_FOR_SERVICE" +const TransportNodeState_STATE_VM_RESOURCE_RESERVATION_FAILED = "VM_RESOURCE_RESERVATION_FAILED" +const TransportNodeState_STATE_DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER = "DUPLICATE_PNICS_IN_TEAMINGS_WITH_MULTIPLE_UPLINKS_AND_FAILOVER_ORDER" +const TransportNodeState_STATE_DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING = "DUPLICATE_VLANS_SHARING_SAME_PNICMULTIPLE_UPLINKS_IN_NAMED_TEAMING_NOT_SUPPORTED_IF_UPLINK_IN_DEFAULT_TEAMING" +const TransportNodeState_STATE_EDGE_NODE_SETTINGS_MISMATCH_RESOLVE = "EDGE_NODE_SETTINGS_MISMATCH_RESOLVE" +const TransportNodeState_STATE_EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE = "EDGE_VM_VSPHERE_SETTINGS_MISMATCH_RESOLVE" +const TransportNodeState_STATE_EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE = "EDGE_NODE_SETTINGS_AND_VSPHERE_SETTINGS_ARE_CHANGED_RESOLVE" +const TransportNodeState_STATE_EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE = "EDGE_VSPHERE_LOCATION_MISMATCH_RESOLVE" +const TransportNodeState_STATE_COMPUTE_MANAGER_NOT_FOUND = "COMPUTE_MANAGER_NOT_FOUND" +const TransportNodeState_STATE_DELETE_IN_PROGRESS = "DELETE_IN_PROGRESS" +const TransportNodeState_MAINTENANCE_MODE_STATE_ENTERING = "ENTERING" +const TransportNodeState_MAINTENANCE_MODE_STATE_ENABLED = "ENABLED" +const TransportNodeState_MAINTENANCE_MODE_STATE_EXITING = "EXITING" +const TransportNodeState_MAINTENANCE_MODE_STATE_DISABLED = "DISABLED" + +func (s *TransportNodeState) GetType__() bindings.BindingType { + return TransportNodeStateBindingType() +} + +func (s *TransportNodeState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportNodeState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Transport node state queries result +type TransportNodeStateListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Transport Node State Results + Results []TransportNodeState +} + +func (s *TransportNodeStateListResult) GetType__() bindings.BindingType { + return TransportNodeStateListResultBindingType() +} + +func (s *TransportNodeStateListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportNodeStateListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TransportNodeStatus struct { + AgentStatus *AgentStatusCount + ControlConnectionStatus *StatusCount + // Possible values are: + // + // * TransportNodeStatus#TransportNodeStatus_MGMT_CONNECTION_STATUS_UP + // * TransportNodeStatus#TransportNodeStatus_MGMT_CONNECTION_STATUS_DOWN + // + // Management connection status + MgmtConnectionStatus *string + // Transport node display name + NodeDisplayName *string + // Transport node path + NodePath *string + NodeStatus *NodeStatus + // Transport node uuid + NodeUuid *string + PnicStatus *StatusCount + // Possible values are: + // + // * TransportNodeStatus#TransportNodeStatus_STATUS_UP + // * TransportNodeStatus#TransportNodeStatus_STATUS_DOWN + // * TransportNodeStatus#TransportNodeStatus_STATUS_DEGRADED + // * TransportNodeStatus#TransportNodeStatus_STATUS_UNKNOWN + // + // Roll-up status of pNIC, management connection, control connection, tunnel status, agent status + Status *string + ThreatStatus *ThreatStatus + TunnelStatus *TunnelStatusCount +} + +const TransportNodeStatus_MGMT_CONNECTION_STATUS_UP = "UP" +const TransportNodeStatus_MGMT_CONNECTION_STATUS_DOWN = "DOWN" +const TransportNodeStatus_STATUS_UP = "UP" +const TransportNodeStatus_STATUS_DOWN = "DOWN" +const TransportNodeStatus_STATUS_DEGRADED = "DEGRADED" +const TransportNodeStatus_STATUS_UNKNOWN = "UNKNOWN" + +func (s *TransportNodeStatus) GetType__() bindings.BindingType { + return TransportNodeStatusBindingType() +} + +func (s *TransportNodeStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportNodeStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TransportNodeStatusListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of transport node statuses + Results []TransportNodeStatus +} + +func (s *TransportNodeStatusListResult) GetType__() bindings.BindingType { + return TransportNodeStatusListResultBindingType() +} + +func (s *TransportNodeStatusListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportNodeStatusListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TransportProtocolHeader struct { + DhcpHeader *DhcpHeader + Dhcpv6Header *Dhcpv6Header + DnsHeader *DnsHeader + IcmpEchoRequestHeader *IcmpEchoRequestHeader + NdpHeader *NdpHeader + TcpHeader *TcpHeader + UdpHeader *UdpHeader +} + +func (s *TransportProtocolHeader) GetType__() bindings.BindingType { + return TransportProtocolHeaderBindingType() +} + +func (s *TransportProtocolHeader) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportProtocolHeader._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TransportZone struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Only one transport zone can be the default one for a given transport zone type. APIs that need transport zone can choose to use the default transport zone if a transport zone is not given. + IsDefault *bool + // This flag should be set to true in nested NSX environment. When the \"allow_changing_vdr_mac_in_use\" property in the global config object RoutingGlobalConfig is false, this flag can not be changed if this transport zone is OVERLAY and the change will make any transport node in this transport zone to change the VDR MAC used in any host switch. When this flag is true and this transport zone is OVERLAY, all host switches in this transport zone will use the VDR MAC in the \"vdr_mac_nested\" property in the global config object RoutingGlobalConfig. + NestedNsx *bool + // This field is populated only if the transport zone was created by NSX system to support security on vSphere Distributed Switch (vDS). The origin_id will refer to the identifier of corresponding vDS from it's parent vCenter server. + OriginId *string + // Possible values are: + // + // * TransportZone#TransportZone_TRANSPORT_TYPE_OVERLAY + // * TransportZone#TransportZone_TRANSPORT_TYPE_VLAN + // + // The transport type of this transport zone. + TransportType *string + // Identifiers of the transport zone profiles associated with this TransportZone. + TransportZoneProfileIds []TransportZoneProfileTypeIdEntry + // The names of switching uplink teaming policies that all transport nodes in this transport zone must support. An exception will be thrown if a transport node within the transport zone does not support a named teaming policy. The user will need to first ensure all trasnport nodes support the desired named teaming policy before assigning it to the transport zone. If the field is not specified, the host switch's default teaming policy will be used. + UplinkTeamingPolicyNames []string +} + +const TransportZone_TRANSPORT_TYPE_OVERLAY = "OVERLAY" +const TransportZone_TRANSPORT_TYPE_VLAN = "VLAN" + +func (s *TransportZone) GetType__() bindings.BindingType { + return TransportZoneBindingType() +} + +func (s *TransportZone) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportZone._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Specify which HostSwitch from this TransportNode is used handle traffic for given TransportZone +type TransportZoneEndPoint struct { + // For MP APIs provide UUID of transport zone. For Policy APIs provide policyPath of transport zone. + TransportZoneId *string + // For MP APIs provide UUID of transport zone profiles. For Policy APIs provide policyPath of transport zone profiles. + TransportZoneProfileIds []TransportZoneProfileTypeIdEntry +} + +func (s *TransportZoneEndPoint) GetType__() bindings.BindingType { + return TransportZoneEndPointBindingType() +} + +func (s *TransportZoneEndPoint) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportZoneEndPoint._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Transport zone queries result +type TransportZoneListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Transport Zone Results + Results []TransportZone +} + +func (s *TransportZoneListResult) GetType__() bindings.BindingType { + return TransportZoneListResultBindingType() +} + +func (s *TransportZoneListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportZoneListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TransportZoneProfile struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * TransportZoneProfile#TransportZoneProfile_RESOURCE_TYPE_BFDHEALTHMONITORINGPROFILE + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const TransportZoneProfile__TYPE_IDENTIFIER = "TransportZoneProfile" +const TransportZoneProfile_RESOURCE_TYPE_BFDHEALTHMONITORINGPROFILE = "BfdHealthMonitoringProfile" + +func (s *TransportZoneProfile) GetType__() bindings.BindingType { + return TransportZoneProfileBindingType() +} + +func (s *TransportZoneProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportZoneProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Transport zone profile queries result +type TransportZoneProfileListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Transport zone profile results + Results []*data.StructValue +} + +func (s *TransportZoneProfileListResult) GetType__() bindings.BindingType { + return TransportZoneProfileListResultBindingType() +} + +func (s *TransportZoneProfileListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportZoneProfileListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TransportZoneProfileTypeIdEntry struct { + // profile id of the resource type + ProfileId *string + // Possible values are: + // + // * TransportZoneProfileTypeIdEntry#TransportZoneProfileTypeIdEntry_RESOURCE_TYPE_BFDHEALTHMONITORINGPROFILE + // + // Selects the type of the transport zone profile + ResourceType *string +} + +const TransportZoneProfileTypeIdEntry_RESOURCE_TYPE_BFDHEALTHMONITORINGPROFILE = "BfdHealthMonitoringProfile" + +func (s *TransportZoneProfileTypeIdEntry) GetType__() bindings.BindingType { + return TransportZoneProfileTypeIdEntryBindingType() +} + +func (s *TransportZoneProfileTypeIdEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportZoneProfileTypeIdEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Transport zone runtime status information +type TransportZoneStatus struct { + // Count of logical ports in the transport zone format: int32 + NumLogicalPorts *int64 + // Count of logical switches in the transport zone format: int32 + NumLogicalSwitches *int64 + // Count of transport nodes in the transport zone format: int32 + NumTransportNodes *int64 + // Information about transport nodes which are part of this transport zone + TransportNodeMembers []TransportNodeMemberInfo + // Unique ID identifying the transport zone + TransportZoneId *string +} + +func (s *TransportZoneStatus) GetType__() bindings.BindingType { + return TransportZoneStatusBindingType() +} + +func (s *TransportZoneStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TransportZoneStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TriggerUcUpgradeParameters struct { + // Target upgrade coordinator version. + ProductVersion *string +} + +func (s *TriggerUcUpgradeParameters) GetType__() bindings.BindingType { + return TriggerUcUpgradeParametersBindingType() +} + +func (s *TriggerUcUpgradeParameters) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TriggerUcUpgradeParameters._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Trunk VLAN id range +type TrunkVlanRange struct { + // Virtual Local Area Network Identifier format: int64 + End *int64 + // Virtual Local Area Network Identifier format: int64 + Start *int64 +} + +func (s *TrunkVlanRange) GetType__() bindings.BindingType { + return TrunkVlanRangeBindingType() +} + +func (s *TrunkVlanRange) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TrunkVlanRange._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TrustManagementData struct { + // List of supported algorithms. + SupportedAlgorithms []CryptoAlgorithm +} + +func (s *TrustManagementData) GetType__() bindings.BindingType { + return TrustManagementDataBindingType() +} + +func (s *TrustManagementData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TrustManagementData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TrustObjectData struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Key algorithm contained in this certificate. + KeyAlgo *string + // Password for private key encryption. + Passphrase *string + // PEM encoded certificate data. + PemEncoded *string + // Private key data. + PrivateKey *string + // Possible values are: + // + // * TrustObjectData#TrustObjectData_PURPOSE_CA + // + // Purpose of this certificate. Can be empty or set to \"signing-ca\". + Purpose *string +} + +const TrustObjectData_PURPOSE_CA = "signing-ca" + +func (s *TrustObjectData) GetType__() bindings.BindingType { + return TrustObjectDataBindingType() +} + +func (s *TrustObjectData) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TrustObjectData._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TunnelList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of transport node tunnels + Tunnels []TunnelProperties +} + +func (s *TunnelList) GetType__() bindings.BindingType { + return TunnelListBindingType() +} + +func (s *TunnelList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TunnelList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// IP Tunnel port configuration. +type TunnelPortConfig struct { + // IP Tunnel port (commonly referred as VTI) subnet. + IpSubnets []IPSubnet + // Logical route port identifier. + TunnelPortId *string +} + +func (s *TunnelPortConfig) GetType__() bindings.BindingType { + return TunnelPortConfigBindingType() +} + +func (s *TunnelPortConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TunnelPortConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TunnelProperties struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + Bfd *BFDProperties + // Corresponds to the interface where local_ip_address is routed. + EgressInterface *string + // Possible values are: + // + // * TunnelProperties#TunnelProperties_ENCAP_STT + // * TunnelProperties#TunnelProperties_ENCAP_VXLAN + // * TunnelProperties#TunnelProperties_ENCAP_GENEVE + // * TunnelProperties#TunnelProperties_ENCAP_NONE + // * TunnelProperties#TunnelProperties_ENCAP_UNKNOWN_ENCAP + // + // Tunnel encap + Encap *string + // Time at which the Tunnel status has been fetched last time. format: int64 + LastUpdatedTime *int64 + // Possible values are: + // + // * TunnelProperties#TunnelProperties_LATENCY_TYPE_UNKNOWN_LATENCY + // * TunnelProperties#TunnelProperties_LATENCY_TYPE_VALID + // * TunnelProperties#TunnelProperties_LATENCY_TYPE_NOT_READY + // * TunnelProperties#TunnelProperties_LATENCY_TYPE_TIMEOUT + // + // Latency type. + LatencyType *string + // The latency value is set only when latency_type is VALID. format: int64 + LatencyValue *int64 + // Local IP address of tunnel format: ip + LocalIp *string + // Name of tunnel + Name *string + // Remote IP address of tunnel format: ip + RemoteIp *string + // Represents the display name of the remote transport node at the other end of the tunnel. + RemoteNodeDisplayName *string + // UUID of the remote transport node + RemoteNodeId *string + // Possible values are: + // + // * TunnelProperties#TunnelProperties_STATUS_UP + // * TunnelProperties#TunnelProperties_STATUS_DOWN + // * TunnelProperties#TunnelProperties_STATUS_UNKNOWN + // + // Status of tunnel + Status *string +} + +const TunnelProperties_ENCAP_STT = "STT" +const TunnelProperties_ENCAP_VXLAN = "VXLAN" +const TunnelProperties_ENCAP_GENEVE = "GENEVE" +const TunnelProperties_ENCAP_NONE = "NONE" +const TunnelProperties_ENCAP_UNKNOWN_ENCAP = "UNKNOWN_ENCAP" +const TunnelProperties_LATENCY_TYPE_UNKNOWN_LATENCY = "UNKNOWN_LATENCY" +const TunnelProperties_LATENCY_TYPE_VALID = "VALID" +const TunnelProperties_LATENCY_TYPE_NOT_READY = "NOT_READY" +const TunnelProperties_LATENCY_TYPE_TIMEOUT = "TIMEOUT" +const TunnelProperties_STATUS_UP = "UP" +const TunnelProperties_STATUS_DOWN = "DOWN" +const TunnelProperties_STATUS_UNKNOWN = "UNKNOWN" + +func (s *TunnelProperties) GetType__() bindings.BindingType { + return TunnelPropertiesBindingType() +} + +func (s *TunnelProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TunnelProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type TunnelStatusCount struct { + // Degraded count format: int32 + DegradedCount *int64 + // Down count format: int32 + DownCount *int64 + // Possible values are: + // + // * TunnelStatusCount#TunnelStatusCount_STATUS_UP + // * TunnelStatusCount#TunnelStatusCount_STATUS_DOWN + // * TunnelStatusCount#TunnelStatusCount_STATUS_DEGRADED + // * TunnelStatusCount#TunnelStatusCount_STATUS_UNKNOWN + // + // Roll-up status + Status *string + // Up count format: int32 + UpCount *int64 + BfdDiagnostic *BFDDiagnosticCount + BfdStatus *BFDStatusCount +} + +const TunnelStatusCount_STATUS_UP = "UP" +const TunnelStatusCount_STATUS_DOWN = "DOWN" +const TunnelStatusCount_STATUS_DEGRADED = "DEGRADED" +const TunnelStatusCount_STATUS_UNKNOWN = "UNKNOWN" + +func (s *TunnelStatusCount) GetType__() bindings.BindingType { + return TunnelStatusCountBindingType() +} + +func (s *TunnelStatusCount) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for TunnelStatusCount._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Upgrade coordinator Uc functional State. +type UcFunctionalState struct { + // error message that explains why UC is on standby mode. + ErrorMessage *string + // Possible values are: + // + // * UcFunctionalState#UcFunctionalState_STATE_RUNNING + // * UcFunctionalState#UcFunctionalState_STATE_STANDBY + // + // function state of the upgrade coordinator + State *string +} + +const UcFunctionalState_STATE_RUNNING = "RUNNING" +const UcFunctionalState_STATE_STANDBY = "STANDBY" + +func (s *UcFunctionalState) GetType__() bindings.BindingType { + return UcFunctionalStateBindingType() +} + +func (s *UcFunctionalState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UcFunctionalState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Upgrade Coordinator state properties +type UcStateProperties struct { + // Flag for updating upgrade-coodinator state properties to database + UpdateUcStateProperties *bool +} + +func (s *UcStateProperties) GetType__() bindings.BindingType { + return UcStatePropertiesBindingType() +} + +func (s *UcStateProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UcStateProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Upgrade status of upgrade-coordinator +type UcUpgradeStatus struct { + // List of failure messages. + Errors []string + // List of progress messages. + ProgressMessages []string + // Upgrade Coordinator Upgrade Progress Percentage format: int32 + ProgressPercentage *int64 + // Possible values are: + // + // * UcUpgradeStatus#UcUpgradeStatus_STATE_NOT_STARTED + // * UcUpgradeStatus#UcUpgradeStatus_STATE_IN_PROGRESS + // * UcUpgradeStatus#UcUpgradeStatus_STATE_SUCCESS + // * UcUpgradeStatus#UcUpgradeStatus_STATE_FAILED + // + // Current state of UC upgrade + State *string + // Status of UC upgrade. + Status *string +} + +const UcUpgradeStatus_STATE_NOT_STARTED = "NOT_STARTED" +const UcUpgradeStatus_STATE_IN_PROGRESS = "IN_PROGRESS" +const UcUpgradeStatus_STATE_SUCCESS = "SUCCESS" +const UcUpgradeStatus_STATE_FAILED = "FAILED" + +func (s *UcUpgradeStatus) GetType__() bindings.BindingType { + return UcUpgradeStatusBindingType() +} + +func (s *UcUpgradeStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UcUpgradeStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UdpHeader struct { + // Destination port of udp header format: int64 + DstPort *int64 + // Source port of udp header format: int64 + SrcPort *int64 +} + +func (s *UdpHeader) GetType__() bindings.BindingType { + return UdpHeaderBindingType() +} + +func (s *UdpHeader) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UdpHeader._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UnassociatedVMListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Timestamp in milliseconds since epoch format: int64 + LastUpdateTimestamp *int64 + // List of VMs which are not associated with any NSGroup + Results []VirtualMachine +} + +func (s *UnassociatedVMListResult) GetType__() bindings.BindingType { + return UnassociatedVMListResultBindingType() +} + +func (s *UnassociatedVMListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UnassociatedVMListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A key-value pair with no limitations on size +type UnboundedKeyValuePair struct { + // Key + Key *string + // Value + Value *string +} + +func (s *UnboundedKeyValuePair) GetType__() bindings.BindingType { + return UnboundedKeyValuePairBindingType() +} + +func (s *UnboundedKeyValuePair) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UnboundedKeyValuePair._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Representing either forward or reverse service path for ingress or egress traffic respectively. +type UnidirectionalServicePath struct { + // List of service path hops that constitutes the forward or reverse service path. + Hops []ServicePathHop + // The number of times the traffic needs to cross hosts for the given forward or reverse service path. format: int64 + HostCrossCount *int64 + // Is forward or revserse service path in maintenance mode or not. + InMaintenanceMode *bool + // Is forward or revserse service path active or not. + IsActive *bool + // Unique identifier of one directional service path. format: int64 + UnidirServicePathId *int64 +} + +func (s *UnidirectionalServicePath) GetType__() bindings.BindingType { + return UnidirectionalServicePathBindingType() +} + +func (s *UnidirectionalServicePath) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UnidirectionalServicePath._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Request to update the thumbprint of an OpenID Connect end-point with a new thumbprint. +type UpdateOidcEndPointThumbprintRequest struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // URI where to download the meta-data of the OIDC end-point. + OidcUri *string + // Thumbprint of the OIDC URI to make an SSL connection. + Thumbprint *string +} + +func (s *UpdateOidcEndPointThumbprintRequest) GetType__() bindings.BindingType { + return UpdateOidcEndPointThumbprintRequestBindingType() +} + +func (s *UpdateOidcEndPointThumbprintRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpdateOidcEndPointThumbprintRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Request to update the certificate of a principal identity with a new certificate. +type UpdatePrincipalIdentityCertificateRequest struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Id of the stored certificate. + CertificateId *string + // Unique ID of the principal. + PrincipalIdentityId *string +} + +func (s *UpdatePrincipalIdentityCertificateRequest) GetType__() bindings.BindingType { + return UpdatePrincipalIdentityCertificateRequestBindingType() +} + +func (s *UpdatePrincipalIdentityCertificateRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpdatePrincipalIdentityCertificateRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// URL and other fetch requests of upgrade bundle +type UpgradeBundleFetchRequest struct { + // URL for uploading upgrade bundle + Url *string +} + +func (s *UpgradeBundleFetchRequest) GetType__() bindings.BindingType { + return UpgradeBundleFetchRequestBindingType() +} + +func (s *UpgradeBundleFetchRequest) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeBundleFetchRequest._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Identifier of the upgrade bundle +type UpgradeBundleId struct { + // Identifier of bundle upload + BundleId *string +} + +func (s *UpgradeBundleId) GetType__() bindings.BindingType { + return UpgradeBundleIdBindingType() +} + +func (s *UpgradeBundleId) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeBundleId._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Information about the upgrade bundle +type UpgradeBundleInfo struct { + // size of upgrade bundle + BundleSize *string + // URL for uploading upgrade bundle + Url *string +} + +func (s *UpgradeBundleInfo) GetType__() bindings.BindingType { + return UpgradeBundleInfoBindingType() +} + +func (s *UpgradeBundleInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeBundleInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Upload status of upgrade bundle uploaded from url +type UpgradeBundleUploadStatus struct { + // Detailed status of upgrade bundle upload + DetailedStatus *string + // Percent of bundle uploaded from URL + Percent *float64 + // Possible values are: + // + // * UpgradeBundleUploadStatus#UpgradeBundleUploadStatus_STATUS_UPLOADING + // * UpgradeBundleUploadStatus#UpgradeBundleUploadStatus_STATUS_VERIFYING + // * UpgradeBundleUploadStatus#UpgradeBundleUploadStatus_STATUS_SUCCESS + // * UpgradeBundleUploadStatus#UpgradeBundleUploadStatus_STATUS_FAILED + // + // Current status of upgrade bundle upload + Status *string + // URL for uploading upgrade bundle + Url *string +} + +const UpgradeBundleUploadStatus_STATUS_UPLOADING = "UPLOADING" +const UpgradeBundleUploadStatus_STATUS_VERIFYING = "VERIFYING" +const UpgradeBundleUploadStatus_STATUS_SUCCESS = "SUCCESS" +const UpgradeBundleUploadStatus_STATUS_FAILED = "FAILED" + +func (s *UpgradeBundleUploadStatus) GetType__() bindings.BindingType { + return UpgradeBundleUploadStatusBindingType() +} + +func (s *UpgradeBundleUploadStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeBundleUploadStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Check to identify potential pre/post-upgrade issues +type UpgradeCheck struct { + // Component type + ComponentType *string + // Name of the pre/post-upgrade check + DisplayName *string + // List of failure messages. This field is deprecated now. Please use failures instead. + FailureMessages []string + // List of failures + Failures []UpgradeCheckFailureMessage + // Possible values are: + // + // * UpgradeCheck#UpgradeCheck_STATUS_SUCCESS + // * UpgradeCheck#UpgradeCheck_STATUS_FAILURE + // * UpgradeCheck#UpgradeCheck_STATUS_WARNING + // + // Status of pre/post-upgrade check + Status *string +} + +const UpgradeCheck_STATUS_SUCCESS = "SUCCESS" +const UpgradeCheck_STATUS_FAILURE = "FAILURE" +const UpgradeCheck_STATUS_WARNING = "WARNING" + +func (s *UpgradeCheck) GetType__() bindings.BindingType { + return UpgradeCheckBindingType() +} + +func (s *UpgradeCheck) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeCheck._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeCheckCsvListResult struct { + // File name set by HTTP server if API returns CSV result as a file. + FileName *string + Results []UpgradeCheckCsvRecord +} + +func (s *UpgradeCheckCsvListResult) GetType__() bindings.BindingType { + return UpgradeCheckCsvListResultBindingType() +} + +func (s *UpgradeCheckCsvListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeCheckCsvListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// CSV record for a pre/post-upgrade check +type UpgradeCheckCsvRecord struct { + // Description of the pre/post-upgrade check + CheckDescription *string + // Display name of the pre/post-upgrade check + CheckName *string + // Space-separated list of failure messages + FailureMessages *string + // Possible values are: + // + // * UpgradeCheckCsvRecord#UpgradeCheckCsvRecord_STATUS_SUCCESS + // * UpgradeCheckCsvRecord#UpgradeCheckCsvRecord_STATUS_FAILURE + // * UpgradeCheckCsvRecord#UpgradeCheckCsvRecord_STATUS_WARNING + // + // Status of the pre/post-upgrade check + Status *string + // Identifier of the upgrade unit + UpgradeUnitId *string + // Meta-data of the upgrade-unit + UpgradeUnitMetadata *string + // Component type of the upgrade unit + UpgradeUnitType *string +} + +const UpgradeCheckCsvRecord_STATUS_SUCCESS = "SUCCESS" +const UpgradeCheckCsvRecord_STATUS_FAILURE = "FAILURE" +const UpgradeCheckCsvRecord_STATUS_WARNING = "WARNING" + +func (s *UpgradeCheckCsvRecord) GetType__() bindings.BindingType { + return UpgradeCheckCsvRecordBindingType() +} + +func (s *UpgradeCheckCsvRecord) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeCheckCsvRecord._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Pre/post-upgrade check failure +type UpgradeCheckFailure struct { + // Component type of the origin of failure + ComponentType *string + // Name of the upgrade group of the origin of failure. Only applicable when origin_type is UPGRADE_UNIT. + GroupName *string + Message *UpgradeCheckFailureMessage + // Unique id of origin of pre/post-upgrade check failure + OriginId *string + // Name of origin of pre/post-upgrade check failure + OriginName *string + // Possible values are: + // + // * UpgradeCheckFailure#UpgradeCheckFailure_ORIGIN_TYPE_COMPONENT + // * UpgradeCheckFailure#UpgradeCheckFailure_ORIGIN_TYPE_UPGRADE_UNIT + // + // Type of origin of pre/post-upgrade check failure + OriginType *string + // Possible values are: + // + // * UpgradeCheckFailure#UpgradeCheckFailure_TYPE_FAILURE + // * UpgradeCheckFailure#UpgradeCheckFailure_TYPE_WARNING + // + // Type of the pre/post-upgrade check failure + Type_ *string +} + +const UpgradeCheckFailure_ORIGIN_TYPE_COMPONENT = "COMPONENT" +const UpgradeCheckFailure_ORIGIN_TYPE_UPGRADE_UNIT = "UPGRADE_UNIT" +const UpgradeCheckFailure_TYPE_FAILURE = "FAILURE" +const UpgradeCheckFailure_TYPE_WARNING = "WARNING" + +func (s *UpgradeCheckFailure) GetType__() bindings.BindingType { + return UpgradeCheckFailureBindingType() +} + +func (s *UpgradeCheckFailure) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeCheckFailure._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeCheckFailureListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Collection of pre/post-upgrade check failures + Results []UpgradeCheckFailure +} + +func (s *UpgradeCheckFailureListResult) GetType__() bindings.BindingType { + return UpgradeCheckFailureListResultBindingType() +} + +func (s *UpgradeCheckFailureListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeCheckFailureListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Pre/post-upgrade check failure message +type UpgradeCheckFailureMessage struct { + // Error code for the error/warning format: int64 + ErrorCode *int64 + // Error/warning message + Message *string +} + +func (s *UpgradeCheckFailureMessage) GetType__() bindings.BindingType { + return UpgradeCheckFailureMessageBindingType() +} + +func (s *UpgradeCheckFailureMessage) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeCheckFailureMessage._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Meta-data of a pre/post-upgrade check +type UpgradeCheckInfo struct { + // Component type of the pre/post-upgrade check + ComponentType *string + // Description of the pre/post-upgrade check + Description *string + // Display name of the pre/post-upgrade check + Name *string +} + +func (s *UpgradeCheckInfo) GetType__() bindings.BindingType { + return UpgradeCheckInfoBindingType() +} + +func (s *UpgradeCheckInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeCheckInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeCheckListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged Collection of pre/post-upgrade checks + Checks []UpgradeCheck +} + +func (s *UpgradeCheckListResult) GetType__() bindings.BindingType { + return UpgradeCheckListResultBindingType() +} + +func (s *UpgradeCheckListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeCheckListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeCheckListResults struct { + ChecksWithWarnings *UpgradeCheckListResult + FailedChecks *UpgradeCheckListResult + SuccessfulChecks *UpgradeCheckListResult +} + +func (s *UpgradeCheckListResults) GetType__() bindings.BindingType { + return UpgradeCheckListResultsBindingType() +} + +func (s *UpgradeCheckListResults) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeCheckListResults._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Execution status of pre/post-upgrade checks +type UpgradeChecksExecutionStatus struct { + // Details about current execution of pre/post-upgrade checks + Details *string + // Time (in milliseconds since epoch) when the execution of pre/post-upgrade checks completed format: int64 + EndTime *int64 + // Total count of generated failures or warnings in last execution of pre/post-upgrade checks format: int32 + FailureCount *int64 + // Number of nodes which generated failures or warnings in last execution of pre/post-upgrade checks. This field has been deprecated. Please use failure_count instead. format: int32 + NodeWithIssuesCount *int64 + // Time (in milliseconds since epoch) when the execution of pre/post-upgrade checks started format: int64 + StartTime *int64 + // Possible values are: + // + // * UpgradeChecksExecutionStatus#UpgradeChecksExecutionStatus_STATUS_NOT_STARTED + // * UpgradeChecksExecutionStatus#UpgradeChecksExecutionStatus_STATUS_IN_PROGRESS + // * UpgradeChecksExecutionStatus#UpgradeChecksExecutionStatus_STATUS_ABORTING + // * UpgradeChecksExecutionStatus#UpgradeChecksExecutionStatus_STATUS_ABORTED + // * UpgradeChecksExecutionStatus#UpgradeChecksExecutionStatus_STATUS_COMPLETED + // + // Status of execution of pre/post-upgrade checks + Status *string +} + +const UpgradeChecksExecutionStatus_STATUS_NOT_STARTED = "NOT_STARTED" +const UpgradeChecksExecutionStatus_STATUS_IN_PROGRESS = "IN_PROGRESS" +const UpgradeChecksExecutionStatus_STATUS_ABORTING = "ABORTING" +const UpgradeChecksExecutionStatus_STATUS_ABORTED = "ABORTED" +const UpgradeChecksExecutionStatus_STATUS_COMPLETED = "COMPLETED" + +func (s *UpgradeChecksExecutionStatus) GetType__() bindings.BindingType { + return UpgradeChecksExecutionStatusBindingType() +} + +func (s *UpgradeChecksExecutionStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeChecksExecutionStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeHistory struct { + // Version before the upgrade started + InitialVersion *string + // Version being upgraded to + TargetVersion *string + // Timestamp (in milliseconds since epoch) when the upgrade was performed format: int64 + Timestamp *int64 + // Possible values are: + // + // * UpgradeHistory#UpgradeHistory_UPGRADE_STATUS_STARTED + // * UpgradeHistory#UpgradeHistory_UPGRADE_STATUS_SUCCESS + // * UpgradeHistory#UpgradeHistory_UPGRADE_STATUS_FAILED + // + // Status of the upgrade + UpgradeStatus *string +} + +const UpgradeHistory_UPGRADE_STATUS_STARTED = "STARTED" +const UpgradeHistory_UPGRADE_STATUS_SUCCESS = "SUCCESS" +const UpgradeHistory_UPGRADE_STATUS_FAILED = "FAILED" + +func (s *UpgradeHistory) GetType__() bindings.BindingType { + return UpgradeHistoryBindingType() +} + +func (s *UpgradeHistory) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeHistory._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeHistoryList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Upgrade history list + Results []UpgradeHistory +} + +func (s *UpgradeHistoryList) GetType__() bindings.BindingType { + return UpgradeHistoryListBindingType() +} + +func (s *UpgradeHistoryList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeHistoryList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradePlanSettings struct { + // Upgrade Method to specify whether the upgrade is to be performed serially or in parallel + Parallel *bool + // Flag to indicate whether to pause the upgrade after upgrade of each group is completed + PauseAfterEachGroup *bool + // Flag to indicate whether to pause the upgrade plan execution when an error occurs + PauseOnError *bool +} + +func (s *UpgradePlanSettings) GetType__() bindings.BindingType { + return UpgradePlanSettingsBindingType() +} + +func (s *UpgradePlanSettings) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradePlanSettings._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Upgrade progress status +type UpgradeProgressStatus struct { + // Status of last upgrade step + LastUpgradeStepStatus *data.StructValue + // True if upgrade bundle is present + UpgradeBundlePresent *bool + // Meta info of upgrade + UpgradeMetadata *data.StructValue +} + +func (s *UpgradeProgressStatus) GetType__() bindings.BindingType { + return UpgradeProgressStatusBindingType() +} + +func (s *UpgradeProgressStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeProgressStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeStatus struct { + CcpStatus *CCPUpgradeStatus + // List of component statuses + ComponentStatus []ComponentUpgradeStatus + EdgeStatus *EdgeUpgradeStatus + HostStatus *HostUpgradeStatus + // Possible values are: + // + // * UpgradeStatus#UpgradeStatus_OVERALL_UPGRADE_STATUS_SUCCESS + // * UpgradeStatus#UpgradeStatus_OVERALL_UPGRADE_STATUS_FAILED + // * UpgradeStatus#UpgradeStatus_OVERALL_UPGRADE_STATUS_IN_PROGRESS + // * UpgradeStatus#UpgradeStatus_OVERALL_UPGRADE_STATUS_NOT_STARTED + // * UpgradeStatus#UpgradeStatus_OVERALL_UPGRADE_STATUS_PAUSING + // * UpgradeStatus#UpgradeStatus_OVERALL_UPGRADE_STATUS_PAUSED + // + // Status of upgrade + OverallUpgradeStatus *string +} + +const UpgradeStatus_OVERALL_UPGRADE_STATUS_SUCCESS = "SUCCESS" +const UpgradeStatus_OVERALL_UPGRADE_STATUS_FAILED = "FAILED" +const UpgradeStatus_OVERALL_UPGRADE_STATUS_IN_PROGRESS = "IN_PROGRESS" +const UpgradeStatus_OVERALL_UPGRADE_STATUS_NOT_STARTED = "NOT_STARTED" +const UpgradeStatus_OVERALL_UPGRADE_STATUS_PAUSING = "PAUSING" +const UpgradeStatus_OVERALL_UPGRADE_STATUS_PAUSED = "PAUSED" + +func (s *UpgradeStatus) GetType__() bindings.BindingType { + return UpgradeStatusBindingType() +} + +func (s *UpgradeStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Upgrade status summry +type UpgradeStatusSummary struct { + // True if upgrade bundle is present + UpgradeBundlePresent *bool + // Meta info of upgrade + UpgradeMetadata *data.StructValue + // List of all upgrade steps performed + UpgradeSteps []*data.StructValue +} + +func (s *UpgradeStatusSummary) GetType__() bindings.BindingType { + return UpgradeStatusSummaryBindingType() +} + +func (s *UpgradeStatusSummary) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeStatusSummary._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeSummary struct { + ComponentTargetVersions []ComponentTargetVersion + // Current system version + SystemVersion *string + // Target system version + TargetVersion *string + // Name of the last successfully uploaded upgrade bundle file + UpgradeBundleFileName *string + // Has upgrade coordinator been updated after upload of upgrade bundle file + UpgradeCoordinatorUpdated *bool + // Current version of upgrade coordinator + UpgradeCoordinatorVersion *string + // Possible values are: + // + // * UpgradeSummary#UpgradeSummary_UPGRADE_STATUS_SUCCESS + // * UpgradeSummary#UpgradeSummary_UPGRADE_STATUS_FAILED + // * UpgradeSummary#UpgradeSummary_UPGRADE_STATUS_IN_PROGRESS + // * UpgradeSummary#UpgradeSummary_UPGRADE_STATUS_NOT_STARTED + // * UpgradeSummary#UpgradeSummary_UPGRADE_STATUS_PAUSING + // * UpgradeSummary#UpgradeSummary_UPGRADE_STATUS_PAUSED + // + // Status of upgrade + UpgradeStatus *string +} + +const UpgradeSummary_UPGRADE_STATUS_SUCCESS = "SUCCESS" +const UpgradeSummary_UPGRADE_STATUS_FAILED = "FAILED" +const UpgradeSummary_UPGRADE_STATUS_IN_PROGRESS = "IN_PROGRESS" +const UpgradeSummary_UPGRADE_STATUS_NOT_STARTED = "NOT_STARTED" +const UpgradeSummary_UPGRADE_STATUS_PAUSING = "PAUSING" +const UpgradeSummary_UPGRADE_STATUS_PAUSED = "PAUSED" + +func (s *UpgradeSummary) GetType__() bindings.BindingType { + return UpgradeSummaryBindingType() +} + +func (s *UpgradeSummary) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeSummary._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Task properties +type UpgradeTaskProperties struct { + // Name of Bundle + BundleName *string + // Bundle arguments + Parameters *data.StructValue + // Step name + Step *string +} + +func (s *UpgradeTaskProperties) GetType__() bindings.BindingType { + return UpgradeTaskPropertiesBindingType() +} + +func (s *UpgradeTaskProperties) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeTaskProperties._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Recommended topology for migrating NVDS to VDS +type UpgradeTopology struct { + // All resultant VDS mapping for a NVDS after the migration + Topology []NvdsUpgradeTopology +} + +func (s *UpgradeTopology) GetType__() bindings.BindingType { + return UpgradeTopologyBindingType() +} + +func (s *UpgradeTopology) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeTopology._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeUnit struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // This is component version e.g. if upgrade unit is of type edge, then this is edge version. + CurrentVersion *string + // Name of the upgrade unit + DisplayName *string + Group *UpgradeUnitGroupInfo + // Identifier of the upgrade unit + Id *string + // Metadata about upgrade unit + Metadata []KeyValuePair + // Upgrade unit type + Type_ *string + // List of warnings indicating issues with the upgrade unit that may result in upgrade failure + Warnings []string +} + +func (s *UpgradeUnit) GetType__() bindings.BindingType { + return UpgradeUnitBindingType() +} + +func (s *UpgradeUnit) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeUnit._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeUnitAggregateInfo struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // This is component version e.g. if upgrade unit is of type edge, then this is edge version. + CurrentVersion *string + // Name of the upgrade unit + DisplayName *string + // List of errors occurred during upgrade of this upgrade unit + Errors []string + Group *UpgradeUnitGroupInfo + // Identifier of the upgrade unit + Id *string + // Metadata about upgrade unit + Metadata []KeyValuePair + // Indicator of upgrade progress in percentage + PercentComplete *float64 + PostUpgradeChecks *UpgradeCheckListResults + PreUpgradeChecks *UpgradeCheckListResults + // Possible values are: + // + // * UpgradeUnitAggregateInfo#UpgradeUnitAggregateInfo_STATUS_SUCCESS + // * UpgradeUnitAggregateInfo#UpgradeUnitAggregateInfo_STATUS_FAILED + // * UpgradeUnitAggregateInfo#UpgradeUnitAggregateInfo_STATUS_IN_PROGRESS + // * UpgradeUnitAggregateInfo#UpgradeUnitAggregateInfo_STATUS_NOT_STARTED + // * UpgradeUnitAggregateInfo#UpgradeUnitAggregateInfo_STATUS_PAUSING + // * UpgradeUnitAggregateInfo#UpgradeUnitAggregateInfo_STATUS_PAUSED + // + // Status of upgrade unit + Status *string + // Upgrade unit type + Type_ *string + // List of warnings indicating issues with the upgrade unit that may result in upgrade failure + Warnings []string +} + +const UpgradeUnitAggregateInfo_STATUS_SUCCESS = "SUCCESS" +const UpgradeUnitAggregateInfo_STATUS_FAILED = "FAILED" +const UpgradeUnitAggregateInfo_STATUS_IN_PROGRESS = "IN_PROGRESS" +const UpgradeUnitAggregateInfo_STATUS_NOT_STARTED = "NOT_STARTED" +const UpgradeUnitAggregateInfo_STATUS_PAUSING = "PAUSING" +const UpgradeUnitAggregateInfo_STATUS_PAUSED = "PAUSED" + +func (s *UpgradeUnitAggregateInfo) GetType__() bindings.BindingType { + return UpgradeUnitAggregateInfoBindingType() +} + +func (s *UpgradeUnitAggregateInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeUnitAggregateInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeUnitAggregateInfoListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged collection of UpgradeUnit AggregateInfo + Results []UpgradeUnitAggregateInfo +} + +func (s *UpgradeUnitAggregateInfoListResult) GetType__() bindings.BindingType { + return UpgradeUnitAggregateInfoListResultBindingType() +} + +func (s *UpgradeUnitAggregateInfoListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeUnitAggregateInfoListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeUnitGroup struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Flag to indicate whether upgrade of this group is enabled or not + Enabled *bool + // Extended configuration for the group. Following extended_configuration is supported: Key: upgrade_mode Supported values: maintenance_mode, in_place, stage_in_vlcm Key: maintenance_mode_config_vsan_mode Supported values: evacuate_all_data, ensure_object_accessibility, no_action Key: maintenance_mode_config_evacuate_powered_off_vms Supported values: true, false Key: rebootless_upgrade Supported values: true, false + ExtendedConfiguration []KeyValuePair + // Upgrade method to specify whether the upgrade is to be performed in parallel or serially + Parallel *bool + // Component type + Type_ *string + // Number of upgrade units in the group format: int32 + UpgradeUnitCount *int64 + // List of upgrade units in the group + UpgradeUnits []UpgradeUnit +} + +func (s *UpgradeUnitGroup) GetType__() bindings.BindingType { + return UpgradeUnitGroupBindingType() +} + +func (s *UpgradeUnitGroup) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeUnitGroup._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeUnitGroupAggregateInfo struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Flag to indicate whether upgrade of this group is enabled or not + Enabled *bool + // Extended configuration for the group + ExtendedConfiguration []KeyValuePair + // Number of nodes in the upgrade unit group that failed upgrade format: int32 + FailedCount *int64 + // Reports failures that occured at the group or cluster level. + GroupLevelFailure []string + // Upgrade method to specify whether the upgrade is to be performed in parallel or serially + Parallel *bool + // Indicator of upgrade progress in percentage + PercentComplete *float64 + PostUpgradeStatus *UpgradeChecksExecutionStatus + // Possible values are: + // + // * UpgradeUnitGroupAggregateInfo#UpgradeUnitGroupAggregateInfo_STATUS_SUCCESS + // * UpgradeUnitGroupAggregateInfo#UpgradeUnitGroupAggregateInfo_STATUS_FAILED + // * UpgradeUnitGroupAggregateInfo#UpgradeUnitGroupAggregateInfo_STATUS_IN_PROGRESS + // * UpgradeUnitGroupAggregateInfo#UpgradeUnitGroupAggregateInfo_STATUS_NOT_STARTED + // * UpgradeUnitGroupAggregateInfo#UpgradeUnitGroupAggregateInfo_STATUS_PAUSING + // * UpgradeUnitGroupAggregateInfo#UpgradeUnitGroupAggregateInfo_STATUS_PAUSED + // + // Upgrade status of upgrade unit group + Status *string + // Component type + Type_ *string + // Number of upgrade units in the group format: int32 + UpgradeUnitCount *int64 + // List of upgrade units in the group + UpgradeUnits []UpgradeUnit +} + +const UpgradeUnitGroupAggregateInfo_STATUS_SUCCESS = "SUCCESS" +const UpgradeUnitGroupAggregateInfo_STATUS_FAILED = "FAILED" +const UpgradeUnitGroupAggregateInfo_STATUS_IN_PROGRESS = "IN_PROGRESS" +const UpgradeUnitGroupAggregateInfo_STATUS_NOT_STARTED = "NOT_STARTED" +const UpgradeUnitGroupAggregateInfo_STATUS_PAUSING = "PAUSING" +const UpgradeUnitGroupAggregateInfo_STATUS_PAUSED = "PAUSED" + +func (s *UpgradeUnitGroupAggregateInfo) GetType__() bindings.BindingType { + return UpgradeUnitGroupAggregateInfoBindingType() +} + +func (s *UpgradeUnitGroupAggregateInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeUnitGroupAggregateInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeUnitGroupAggregateInfoListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged collection of upgrade status for upgrade unit groups + Results []UpgradeUnitGroupAggregateInfo +} + +func (s *UpgradeUnitGroupAggregateInfoListResult) GetType__() bindings.BindingType { + return UpgradeUnitGroupAggregateInfoListResultBindingType() +} + +func (s *UpgradeUnitGroupAggregateInfoListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeUnitGroupAggregateInfoListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeUnitGroupInfo struct { + // Name of the group + DisplayName *string + // Identifier of group + Id *string +} + +func (s *UpgradeUnitGroupInfo) GetType__() bindings.BindingType { + return UpgradeUnitGroupInfoBindingType() +} + +func (s *UpgradeUnitGroupInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeUnitGroupInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeUnitGroupListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged Collection of Upgrade unit groups + Results []UpgradeUnitGroup +} + +func (s *UpgradeUnitGroupListResult) GetType__() bindings.BindingType { + return UpgradeUnitGroupListResultBindingType() +} + +func (s *UpgradeUnitGroupListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeUnitGroupListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeUnitGroupStatus struct { + // Number of nodes in the upgrade unit group that failed upgrade format: int32 + FailedCount *int64 + // Identifier for upgrade unit group + GroupId *string + // Name of the upgrade unit group + GroupName *string + // Indicator of upgrade progress in percentage + PercentComplete *float64 + // Possible values are: + // + // * UpgradeUnitGroupStatus#UpgradeUnitGroupStatus_STATUS_SUCCESS + // * UpgradeUnitGroupStatus#UpgradeUnitGroupStatus_STATUS_FAILED + // * UpgradeUnitGroupStatus#UpgradeUnitGroupStatus_STATUS_IN_PROGRESS + // * UpgradeUnitGroupStatus#UpgradeUnitGroupStatus_STATUS_NOT_STARTED + // * UpgradeUnitGroupStatus#UpgradeUnitGroupStatus_STATUS_PAUSING + // * UpgradeUnitGroupStatus#UpgradeUnitGroupStatus_STATUS_PAUSED + // + // Upgrade status of upgrade unit group + Status *string + // Number of upgrade units in the group format: int32 + UpgradeUnitCount *int64 +} + +const UpgradeUnitGroupStatus_STATUS_SUCCESS = "SUCCESS" +const UpgradeUnitGroupStatus_STATUS_FAILED = "FAILED" +const UpgradeUnitGroupStatus_STATUS_IN_PROGRESS = "IN_PROGRESS" +const UpgradeUnitGroupStatus_STATUS_NOT_STARTED = "NOT_STARTED" +const UpgradeUnitGroupStatus_STATUS_PAUSING = "PAUSING" +const UpgradeUnitGroupStatus_STATUS_PAUSED = "PAUSED" + +func (s *UpgradeUnitGroupStatus) GetType__() bindings.BindingType { + return UpgradeUnitGroupStatusBindingType() +} + +func (s *UpgradeUnitGroupStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeUnitGroupStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeUnitGroupStatusListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged collection of upgrade status for upgrade unit groups + Results []UpgradeUnitGroupStatus +} + +func (s *UpgradeUnitGroupStatusListResult) GetType__() bindings.BindingType { + return UpgradeUnitGroupStatusListResultBindingType() +} + +func (s *UpgradeUnitGroupStatusListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeUnitGroupStatusListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeUnitList struct { + // Collection of Upgrade units + List []UpgradeUnit +} + +func (s *UpgradeUnitList) GetType__() bindings.BindingType { + return UpgradeUnitListBindingType() +} + +func (s *UpgradeUnitList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeUnitList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeUnitListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged Collection of Upgrade units + Results []UpgradeUnit +} + +func (s *UpgradeUnitListResult) GetType__() bindings.BindingType { + return UpgradeUnitListResultBindingType() +} + +func (s *UpgradeUnitListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeUnitListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeUnitStatus struct { + // Name of upgrade unit + DisplayName *string + // List of errors occurred during upgrade of this upgrade unit + Errors []string + // Identifier of upgrade unit + Id *string + // Metadata about upgrade unit + Metadata []KeyValuePair + // Indicator of upgrade progress in percentage + PercentComplete *float64 + // Possible values are: + // + // * UpgradeUnitStatus#UpgradeUnitStatus_STATUS_SUCCESS + // * UpgradeUnitStatus#UpgradeUnitStatus_STATUS_FAILED + // * UpgradeUnitStatus#UpgradeUnitStatus_STATUS_IN_PROGRESS + // * UpgradeUnitStatus#UpgradeUnitStatus_STATUS_NOT_STARTED + // * UpgradeUnitStatus#UpgradeUnitStatus_STATUS_PAUSING + // * UpgradeUnitStatus#UpgradeUnitStatus_STATUS_PAUSED + // + // Status of upgrade unit + Status *string +} + +const UpgradeUnitStatus_STATUS_SUCCESS = "SUCCESS" +const UpgradeUnitStatus_STATUS_FAILED = "FAILED" +const UpgradeUnitStatus_STATUS_IN_PROGRESS = "IN_PROGRESS" +const UpgradeUnitStatus_STATUS_NOT_STARTED = "NOT_STARTED" +const UpgradeUnitStatus_STATUS_PAUSING = "PAUSING" +const UpgradeUnitStatus_STATUS_PAUSED = "PAUSED" + +func (s *UpgradeUnitStatus) GetType__() bindings.BindingType { + return UpgradeUnitStatusBindingType() +} + +func (s *UpgradeUnitStatus) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeUnitStatus._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeUnitStatusListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Paged Collection of upgrade units status + Results []UpgradeUnitStatus +} + +func (s *UpgradeUnitStatusListResult) GetType__() bindings.BindingType { + return UpgradeUnitStatusListResultBindingType() +} + +func (s *UpgradeUnitStatusListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeUnitStatusListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeUnitTypeStats struct { + // Number of nodes format: int32 + NodeCount *int64 + // Number of nodes with issues that may cause upgrade failure format: int32 + NodeWithIssuesCount *int64 + // Type of upgrade unit + Type_ *string + // Possible values are: + // + // * UpgradeUnitTypeStats#UpgradeUnitTypeStats_UPGRADE_UNIT_SUBTYPE_RESOURCE + // * UpgradeUnitTypeStats#UpgradeUnitTypeStats_UPGRADE_UNIT_SUBTYPE_ACTION + // + // UpgradeUnit sub type + UpgradeUnitSubtype *string + // Version of the upgrade unit + Version *string +} + +const UpgradeUnitTypeStats_UPGRADE_UNIT_SUBTYPE_RESOURCE = "RESOURCE" +const UpgradeUnitTypeStats_UPGRADE_UNIT_SUBTYPE_ACTION = "ACTION" + +func (s *UpgradeUnitTypeStats) GetType__() bindings.BindingType { + return UpgradeUnitTypeStatsBindingType() +} + +func (s *UpgradeUnitTypeStats) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeUnitTypeStats._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type UpgradeUnitTypeStatsList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of upgrade unit type stats + Results []UpgradeUnitTypeStats +} + +func (s *UpgradeUnitTypeStatsList) GetType__() bindings.BindingType { + return UpgradeUnitTypeStatsListBindingType() +} + +func (s *UpgradeUnitTypeStatsList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UpgradeUnitTypeStatsList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Object to identify an uplink based on its type and name +type Uplink struct { + // Name of this uplink + UplinkName *string + // Possible values are: + // + // * Uplink#Uplink_UPLINK_TYPE_PNIC + // * Uplink#Uplink_UPLINK_TYPE_LAG + // + // Type of the uplink + UplinkType *string +} + +const Uplink_UPLINK_TYPE_PNIC = "PNIC" +const Uplink_UPLINK_TYPE_LAG = "LAG" + +func (s *Uplink) GetType__() bindings.BindingType { + return UplinkBindingType() +} + +func (s *Uplink) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for Uplink._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Profile for uplink policies +type UplinkHostSwitchProfile struct { + // list of LACP group + Lags []Lag + // Maximum Transmission Unit used for uplinks format: int32 + Mtu *int64 + // List of named uplink teaming policies that can be used by logical switches + NamedTeamings []NamedTeamingPolicy + // Possible values are: + // + // * UplinkHostSwitchProfile#UplinkHostSwitchProfile_OVERLAY_ENCAP_VXLAN + // * UplinkHostSwitchProfile#UplinkHostSwitchProfile_OVERLAY_ENCAP_GENEVE + // + // The protocol used to encapsulate overlay traffic + OverlayEncap *string + Teaming *TeamingPolicy + // VLAN used for tagging Overlay traffic of associated HostSwitch format: int64 + TransportVlan *int64 + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * BaseHostSwitchProfile#BaseHostSwitchProfile_RESOURCE_TYPE_UPLINKHOSTSWITCHPROFILE + // * BaseHostSwitchProfile#BaseHostSwitchProfile_RESOURCE_TYPE_LLDPHOSTSWITCHPROFILE + // * BaseHostSwitchProfile#BaseHostSwitchProfile_RESOURCE_TYPE_NIOCPROFILE + // * BaseHostSwitchProfile#BaseHostSwitchProfile_RESOURCE_TYPE_EXTRACONFIGHOSTSWITCHPROFILE + // + // Supported HostSwitch profiles. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + RequiredCapabilities []string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const UplinkHostSwitchProfile__TYPE_IDENTIFIER = "UplinkHostSwitchProfile" +const UplinkHostSwitchProfile_OVERLAY_ENCAP_VXLAN = "VXLAN" +const UplinkHostSwitchProfile_OVERLAY_ENCAP_GENEVE = "GENEVE" + +func (s *UplinkHostSwitchProfile) GetType__() bindings.BindingType { + return UplinkHostSwitchProfileBindingType() +} + +func (s *UplinkHostSwitchProfile) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UplinkHostSwitchProfile._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Short name or alias of a url. It is used to represent the url. +type UrlAlias struct { + // + Alias *string + KeystoreInfo *KeyStoreInfo + // Search query to be applied, if any. If query string is not provided, it will be ignored. + Query *string + // A raw request body in the form json format for a given url. This request body will be submitted along with request while giving a post api call. + RequestBody *data.StructValue + // A raw request header in the form json format for a given url. This request header will be submitted along with request while giving a api call. + RequestHeaders *data.StructValue + // Possible values are: + // + // * UrlAlias#UrlAlias_REQUEST_METHOD_GET + // * UrlAlias#UrlAlias_REQUEST_METHOD_POST + // + // Type of the http method (Get, Post) to be used while invoking the given url through dashboard datasource framework. + RequestMethod *string + // Url to fetch data from. + Url *string +} + +const UrlAlias_REQUEST_METHOD_GET = "Get" +const UrlAlias_REQUEST_METHOD_POST = "Post" + +func (s *UrlAlias) GetType__() bindings.BindingType { + return UrlAliasBindingType() +} + +func (s *UrlAlias) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UrlAlias._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Authenticated User Info +type UserInfo struct { + // Permissions + Roles []NsxRole + // User Name + UserName *string +} + +func (s *UserInfo) GetType__() bindings.BindingType { + return UserInfoBindingType() +} + +func (s *UserInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UserInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A login credential specifying a username and password +type UsernamePasswordLoginCredential struct { + // The authentication password for login + Password *string + // Thumbprint of the login server + Thumbprint *string + // The username for login + Username *string + // Possible values are 'UsernamePasswordLoginCredential', 'VerifiableAsymmetricLoginCredential', 'SessionLoginCredential'. + CredentialType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const UsernamePasswordLoginCredential__TYPE_IDENTIFIER = "UsernamePasswordLoginCredential" + +func (s *UsernamePasswordLoginCredential) GetType__() bindings.BindingType { + return UsernamePasswordLoginCredentialBindingType() +} + +func (s *UsernamePasswordLoginCredential) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for UsernamePasswordLoginCredential._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Details about mapping of NSX-V and NSX-T Local Manager. +type V2tSiteMapping struct { + // Federation NSX-T site id. + FederationSiteId *string + // NSX-V API endpoint IP address format: hostname-or-ip + NsxvIp *string +} + +func (s *V2tSiteMapping) GetType__() bindings.BindingType { + return V2tSiteMappingBindingType() +} + +func (s *V2tSiteMapping) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for V2tSiteMapping._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Input spec for mapping of NSX-V and NSX-T sites +type V2tSiteMappingSpec struct { + // Federation NSX-T site id. + FederationSiteId *string + // NSX-V API endpoint IP address format: hostname-or-ip + NsxvIp *string + // Password for connecting to NSX-V manager. + NsxvPassword *string + // Username for NSX-V manager + NsxvUsername *string + // IP address or host name of VC. format: hostname-or-ip + VcIp *string + // Password for connecting to VC. + VcPassword *string + // VC port that will be used to fetch details. format: int32 + VcPort *int64 + // Username for connecting to VC. + VcUsername *string +} + +func (s *V2tSiteMappingSpec) GetType__() bindings.BindingType { + return V2tSiteMappingSpecBindingType() +} + +func (s *V2tSiteMappingSpec) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for V2tSiteMappingSpec._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type VIPSubnet struct { + // Array of IP address subnets which will be used as floating IP addresses. | These IPs will move and will be owned by Active node. format: ip + ActiveVipAddresses []string + // Subnet Prefix Length format: int64 + PrefixLength *int64 +} + +func (s *VIPSubnet) GetType__() bindings.BindingType { + return VIPSubnetBindingType() +} + +func (s *VIPSubnet) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VIPSubnet._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Deployment progress state of node VM. This Object contains name of current deployment step and overall progress percentage. +type VMDeploymentProgressState struct { + // Name of the current running step of deployment + CurrentStepTitle *string + // Overall progress percentage of deployment completed format: int64 + Progress *int64 +} + +func (s *VMDeploymentProgressState) GetType__() bindings.BindingType { + return VMDeploymentProgressStateBindingType() +} + +func (s *VMDeploymentProgressState) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VMDeploymentProgressState._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Error while applying transport node profile on discovered node +type ValidationError struct { + // Discovered Node Id + DiscoveredNodeId *string + // Validation error message + ErrorMessage *string +} + +func (s *ValidationError) GetType__() bindings.BindingType { + return ValidationErrorBindingType() +} + +func (s *ValidationError) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ValidationError._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// VDS details where NVDS will be migrated to +type VdsTopology struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Identifier of cluster where VDS will be created + ClusterId *string + // Identifier of datacenter where VDS will be created + DataCenterId *string + // Details of the VDS configuration status + StatusDetails []string + // Transport node identifiers on which NVDS(s) being upgraded to VDS + TransportNodeId []string + VdsConfig *DVSConfig + // VDS name that will be created under above datacenter + VdsName *string + // Possible values are: + // + // * VdsTopology#VdsTopology_VDS_STATUS_PENDING_TOPOLOGY + // * VdsTopology#VdsTopology_VDS_STATUS_APPLYING_TOPOLOGY + // * VdsTopology#VdsTopology_VDS_STATUS_APPLY_TOPOLOGY_FAILED + // * VdsTopology#VdsTopology_VDS_STATUS_READY + // * VdsTopology#VdsTopology_VDS_STATUS_REMOVING_TOPOLOGY + // + // Status of the VDS configuration + VdsStatus *string + // Virtual network interfaces that will be moved from VLAN Logical switch to Distributed Virtual PortGroup + Vmknic []string +} + +const VdsTopology_VDS_STATUS_PENDING_TOPOLOGY = "PENDING_TOPOLOGY" +const VdsTopology_VDS_STATUS_APPLYING_TOPOLOGY = "APPLYING_TOPOLOGY" +const VdsTopology_VDS_STATUS_APPLY_TOPOLOGY_FAILED = "APPLY_TOPOLOGY_FAILED" +const VdsTopology_VDS_STATUS_READY = "READY" +const VdsTopology_VDS_STATUS_REMOVING_TOPOLOGY = "REMOVING_TOPOLOGY" + +func (s *VdsTopology) GetType__() bindings.BindingType { + return VdsTopologyBindingType() +} + +func (s *VdsTopology) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VdsTopology._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// If Virtual Distributed Switch is used as a HostSwitch to configure TransportNode or TransportNodeProfie, this mapping should be specified. You can either use vds_uplink_name or vds_lag_name to associate with uplink_name from UplinkHostSwitch profile. +type VdsUplink struct { + // This name is from UplinkHostSwitch profile that is associated with the HostSwitch specified in TransportNode or TransportNodeProfile configuration. This name will be used as an alias to either VDS uplink or lag in other configuration. + UplinkName *string + // LAG name that is connected to Physical NIC on a host from vSphere. + VdsLagName *string + // Uplink name of VDS that is connected to Physical NIC on a host from vSphere. + VdsUplinkName *string +} + +func (s *VdsUplink) GetType__() bindings.BindingType { + return VdsUplinkBindingType() +} + +func (s *VdsUplink) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VdsUplink._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Vendor Templates are registered by the partner service manager to be used in the service profile. They contain named (k-v) pairs. +type VendorTemplate struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // List of attributes specific to a partner for which the vendor template is created. There attributes are passed on to the partner appliance and is opaque to the NSX Manager. Attributes are not supported by guest introspection service. + Attributes []Attribute + // Possible values are: + // + // * VendorTemplate#VendorTemplate_FUNCTIONALITY_NG_FW + // * VendorTemplate#VendorTemplate_FUNCTIONALITY_IDS_IPS + // * VendorTemplate#VendorTemplate_FUNCTIONALITY_NET_MON + // * VendorTemplate#VendorTemplate_FUNCTIONALITY_HCX + // * VendorTemplate#VendorTemplate_FUNCTIONALITY_BYOD + // * VendorTemplate#VendorTemplate_FUNCTIONALITY_EPP + // * VendorTemplate#VendorTemplate_FUNCTIONALITY_MPS + // + // The capabilities provided by the services. Needs to be one of the following | NG_FW - Next Generation Firewall | IDS_IPS - Intrusion detection System / Intrusion Prevention System | NET_MON - Network Monitoring | HCX - Hybrid Cloud Exchange | BYOD - Bring Your Own Device | EPP - Endpoint Protection.(Third party AntiVirus partners using NXGI should use this functionality for the service) | MPS - Malware Prevention Solution + Functionality *string + // Possible values are: + // + // * VendorTemplate#VendorTemplate_REDIRECTION_ACTION_PUNT + // * VendorTemplate#VendorTemplate_REDIRECTION_ACTION_COPY + // + // The redirection action represents if the packet is exclusively redirected to the service, or if a copy is forwarded to the service. Service profile inherits the redirection action specified at the vendor template and cannot override the action specified at the vendor template. Redirection action is not applicable to guest introspection service. + RedirectionAction *string + // The service to which the vendor template belongs. + ServiceId *string + // Different VMs in data center can have Different protection levels as specified by administrator in the policy. The identifier for the policy with which the partner appliance identifies this policy. This identifier will be passed to the partner appliance at runtime to specify which protection level is applicable for the VM being protected. + VendorTemplateKey *string +} + +const VendorTemplate_FUNCTIONALITY_NG_FW = "NG_FW" +const VendorTemplate_FUNCTIONALITY_IDS_IPS = "IDS_IPS" +const VendorTemplate_FUNCTIONALITY_NET_MON = "NET_MON" +const VendorTemplate_FUNCTIONALITY_HCX = "HCX" +const VendorTemplate_FUNCTIONALITY_BYOD = "BYOD" +const VendorTemplate_FUNCTIONALITY_EPP = "EPP" +const VendorTemplate_FUNCTIONALITY_MPS = "MPS" +const VendorTemplate_REDIRECTION_ACTION_PUNT = "PUNT" +const VendorTemplate_REDIRECTION_ACTION_COPY = "COPY" + +func (s *VendorTemplate) GetType__() bindings.BindingType { + return VendorTemplateBindingType() +} + +func (s *VendorTemplate) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VendorTemplate._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Vendor Template List +type VendorTemplateListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List of the Service-Insertion Services. The list has to be homogenous. + Results []VendorTemplate +} + +func (s *VendorTemplateListResult) GetType__() bindings.BindingType { + return VendorTemplateListResultBindingType() +} + +func (s *VendorTemplateListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VendorTemplateListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type VerifiableAsymmetricLoginCredential struct { + // Asymmetric login credential + AsymmetricCredential *string + // Credential key + CredentialKey *string + // Credential verifier + CredentialVerifier *string + // Possible values are 'UsernamePasswordLoginCredential', 'VerifiableAsymmetricLoginCredential', 'SessionLoginCredential'. + CredentialType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const VerifiableAsymmetricLoginCredential__TYPE_IDENTIFIER = "VerifiableAsymmetricLoginCredential" + +func (s *VerifiableAsymmetricLoginCredential) GetType__() bindings.BindingType { + return VerifiableAsymmetricLoginCredentialBindingType() +} + +func (s *VerifiableAsymmetricLoginCredential) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VerifiableAsymmetricLoginCredential._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type VersionList struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // List of component versions + AcceptableVersions []string +} + +func (s *VersionList) GetType__() bindings.BindingType { + return VersionListBindingType() +} + +func (s *VersionList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VersionList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Vidm Info +type VidmInfo struct { + // User's Full Name Or User Group's Display Name + DisplayName *string + // Username Or Groupname + Name *string + // Possible values are: + // + // * VidmInfo#VidmInfo_TYPE_USER + // * VidmInfo#VidmInfo_TYPE_GROUP + // + // Type + Type_ *string +} + +const VidmInfo_TYPE_USER = "remote_user" +const VidmInfo_TYPE_GROUP = "remote_group" + +func (s *VidmInfo) GetType__() bindings.BindingType { + return VidmInfoBindingType() +} + +func (s *VidmInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VidmInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type VidmInfoListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // List results + Results []VidmInfo +} + +func (s *VidmInfoListResult) GetType__() bindings.BindingType { + return VidmInfoListResultBindingType() +} + +func (s *VidmInfoListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VidmInfoListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Describes the configuration of a view to be displayed on the dashboard. +type View struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Comma separated list of roles to which the shared view is not visible. Allows user to prevent the visibility of a shared view to the specified roles. User defined roles can also be specified in the list. The roles can be obtained via GET /api/v1/aaa/roles. Please visit API documentation for details about roles. If include_roles is specified then exclude_roles cannot be specified. + ExcludeRoles *string + // Comma separated list of roles to which the shared view is visible. Allows user to specify the visibility of a shared view to the specified roles. User defined roles can also be specified in the list. The roles can be obtained via GET /api/v1/aaa/roles. Please visit API documentation for details about roles. + IncludeRoles *string + // Defaults to false. Set to true to publish the view to other users. The widgets of a shared view are visible to other users. + Shared *bool + // Determines placement of view relative to other views. The lower the weight, the higher it is in the placement order. format: int32 + Weight *int64 + // Array of widgets that are part of the view. + Widgets []WidgetItem +} + +func (s *View) GetType__() bindings.BindingType { + return ViewBindingType() +} + +func (s *View) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for View._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents a list of views. +type ViewList struct { + // Array of views + Views []View +} + +func (s *ViewList) GetType__() bindings.BindingType { + return ViewListBindingType() +} + +func (s *ViewList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for ViewList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type VifAttachmentContext struct { + // An application ID used to identify / look up a child VIF behind a parent VIF. Only effective when vif_type is CHILD. + AppId *string + BmsInterfaceConfig *AttachedInterface + // VIF ID of the parent VIF if vif_type is CHILD + ParentVifId *string + // Current we use VLAN id as the traffic tag. Only effective when vif_type is CHILD. Each logical port inside a container must have a unique traffic tag. If the traffic_tag is not unique, no error is generated, but traffic will not be delivered to any port with a non-unique tag. format: int32 + TrafficTag *int64 + // Only effective when vif_type is INDEPENDENT. Each logical port inside a bare metal server or container must have a transport node UUID. We use transport node ID as transport node UUID. + TransportNodeUuid *string + // Possible values are: + // + // * VifAttachmentContext#VifAttachmentContext_VIF_TYPE_PARENT + // * VifAttachmentContext#VifAttachmentContext_VIF_TYPE_CHILD + // * VifAttachmentContext#VifAttachmentContext_VIF_TYPE_INDEPENDENT + // + // Type of the VIF attached to logical port + VifType *string + // Possible values are: + // + // * AttachmentContext#AttachmentContext_ALLOCATE_ADDRESSES_IPPOOL + // * AttachmentContext#AttachmentContext_ALLOCATE_ADDRESSES_MACPOOL + // * AttachmentContext#AttachmentContext_ALLOCATE_ADDRESSES_BOTH + // * AttachmentContext#AttachmentContext_ALLOCATE_ADDRESSES_NONE + // * AttachmentContext#AttachmentContext_ALLOCATE_ADDRESSES_DHCP + // + // A flag to indicate whether to allocate addresses from allocation pools bound to the parent logical switch. + AllocateAddresses *string + // Used to identify which concrete class it is + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const VifAttachmentContext__TYPE_IDENTIFIER = "VifAttachmentContext" +const VifAttachmentContext_VIF_TYPE_PARENT = "PARENT" +const VifAttachmentContext_VIF_TYPE_CHILD = "CHILD" +const VifAttachmentContext_VIF_TYPE_INDEPENDENT = "INDEPENDENT" + +func (s *VifAttachmentContext) GetType__() bindings.BindingType { + return VifAttachmentContextBindingType() +} + +func (s *VifAttachmentContext) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VifAttachmentContext._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type VirtualMachine struct { + // List of external compute ids of the virtual machine in the format 'id-type-key:value' , list of external compute ids ['uuid:xxxx-xxxx-xxxx-xxxx', 'moIdOnHost:moref-11', 'instanceUuid:xxxx-xxxx-xxxx-xxxx'] + ComputeIds []string + // Current external id of this virtual machine in the system. + ExternalId *string + GuestInfo *GuestInfo + // Id of the host in which this virtual machine exists. + HostId *string + // Id of the vm unique within the host. + LocalIdOnHost *string + // Possible values are: + // + // * VirtualMachine#VirtualMachine_POWER_STATE_VM_RUNNING + // * VirtualMachine#VirtualMachine_POWER_STATE_VM_STOPPED + // * VirtualMachine#VirtualMachine_POWER_STATE_VM_SUSPENDED + // * VirtualMachine#VirtualMachine_POWER_STATE_UNKNOWN + // + // Current power state of this virtual machine in the system. + PowerState *string + Source *ResourceReference + // Possible values are: + // + // * VirtualMachine#VirtualMachine_TYPE_EDGE + // * VirtualMachine#VirtualMachine_TYPE_SERVICE + // * VirtualMachine#VirtualMachine_TYPE_REGULAR + // * VirtualMachine#VirtualMachine_TYPE_MP + // * VirtualMachine#VirtualMachine_TYPE_INTELLIGENCE + // * VirtualMachine#VirtualMachine_TYPE_VC_SYSTEM + // * VirtualMachine#VirtualMachine_TYPE_UNKNOWN + // + // Virtual Machine type; Edge, Service VM or other. + Type_ *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Specifies list of scope of discovered resource. e.g. if VHC path is associated with principal identity, who owns the discovered resource, then scope id will be VHC path and scope type will be VHC. + Scope []DiscoveredResourceScope + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const VirtualMachine__TYPE_IDENTIFIER = "VirtualMachine" +const VirtualMachine_POWER_STATE_VM_RUNNING = "VM_RUNNING" +const VirtualMachine_POWER_STATE_VM_STOPPED = "VM_STOPPED" +const VirtualMachine_POWER_STATE_VM_SUSPENDED = "VM_SUSPENDED" +const VirtualMachine_POWER_STATE_UNKNOWN = "UNKNOWN" +const VirtualMachine_TYPE_EDGE = "EDGE" +const VirtualMachine_TYPE_SERVICE = "SERVICE" +const VirtualMachine_TYPE_REGULAR = "REGULAR" +const VirtualMachine_TYPE_MP = "MP" +const VirtualMachine_TYPE_INTELLIGENCE = "INTELLIGENCE" +const VirtualMachine_TYPE_VC_SYSTEM = "VC_SYSTEM" +const VirtualMachine_TYPE_UNKNOWN = "UNKNOWN" + +func (s *VirtualMachine) GetType__() bindings.BindingType { + return VirtualMachineBindingType() +} + +func (s *VirtualMachine) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VirtualMachine._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type VirtualMachineListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // VirtualMachine list results + Results []VirtualMachine +} + +func (s *VirtualMachineListResult) GetType__() bindings.BindingType { + return VirtualMachineListResultBindingType() +} + +func (s *VirtualMachineListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VirtualMachineListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type VirtualMachineTagUpdate struct { + // External id of the virtual machine to which tags are to be applied + ExternalId *string + // List of tags to be applied to the virtual machine + Tags []Tag +} + +func (s *VirtualMachineTagUpdate) GetType__() bindings.BindingType { + return VirtualMachineTagUpdateBindingType() +} + +func (s *VirtualMachineTagUpdate) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VirtualMachineTagUpdate._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type VirtualNetworkInterface struct { + // Device key of the virtual network interface. + DeviceKey *string + // Device name of the virtual network interface. + DeviceName *string + // External Id of the virtual network inferface. + ExternalId *string + // Id of the host on which the vm exists. + HostId *string + // IP Addresses of the the virtual network interface, from various sources. + IpAddressInfo []IpAddressInfo + // LPort Attachment Id of the virtual network interface. + LportAttachmentId *string + // MAC address of the virtual network interface. + MacAddress *string + // Id of the vm to which this virtual network interface belongs. + OwnerVmId *string + // Possible values are: + // + // * VirtualNetworkInterface#VirtualNetworkInterface_OWNER_VM_TYPE_EDGE + // * VirtualNetworkInterface#VirtualNetworkInterface_OWNER_VM_TYPE_SERVICE + // * VirtualNetworkInterface#VirtualNetworkInterface_OWNER_VM_TYPE_REGULAR + // + // Owner virtual machine type; Edge, Service VM or other. + OwnerVmType *string + // Id of the vm unique within the host. + VmLocalIdOnHost *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Specifies list of scope of discovered resource. e.g. if VHC path is associated with principal identity, who owns the discovered resource, then scope id will be VHC path and scope type will be VHC. + Scope []DiscoveredResourceScope + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const VirtualNetworkInterface__TYPE_IDENTIFIER = "VirtualNetworkInterface" +const VirtualNetworkInterface_OWNER_VM_TYPE_EDGE = "EDGE" +const VirtualNetworkInterface_OWNER_VM_TYPE_SERVICE = "SERVICE" +const VirtualNetworkInterface_OWNER_VM_TYPE_REGULAR = "REGULAR" + +func (s *VirtualNetworkInterface) GetType__() bindings.BindingType { + return VirtualNetworkInterfaceBindingType() +} + +func (s *VirtualNetworkInterface) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VirtualNetworkInterface._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type VirtualNetworkInterfaceListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // VirtualNetworkInterface list results + Results []VirtualNetworkInterface +} + +func (s *VirtualNetworkInterfaceListResult) GetType__() bindings.BindingType { + return VirtualNetworkInterfaceListResultBindingType() +} + +func (s *VirtualNetworkInterfaceListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VirtualNetworkInterfaceListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Virtual portgroup on a virtual switch +type VirtualPortgroup struct { + // Id of the portgroup, eg. a mo-ref from VC. + CmLocalId *string + // External id of the virtual portgroup + ExternalId *string + // Portgroup type like DistributedVirtualPortgroup + OriginType *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Specifies list of scope of discovered resource. e.g. if VHC path is associated with principal identity, who owns the discovered resource, then scope id will be VHC path and scope type will be VHC. + Scope []DiscoveredResourceScope + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const VirtualPortgroup__TYPE_IDENTIFIER = "VirtualPortgroup" + +func (s *VirtualPortgroup) GetType__() bindings.BindingType { + return VirtualPortgroupBindingType() +} + +func (s *VirtualPortgroup) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VirtualPortgroup._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// VirtualServiceInstance is a custom instance to be used when NSX is not handling the lifecycles of appliance/s and the user is not bringing their own appliance (BYOD). +type VirtualServiceInstance struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * BaseServiceInstance#BaseServiceInstance_RESOURCE_TYPE_SERVICEINSTANCE + // * BaseServiceInstance#BaseServiceInstance_RESOURCE_TYPE_BYODSERVICEINSTANCE + // * BaseServiceInstance#BaseServiceInstance_RESOURCE_TYPE_VIRTUALSERVICEINSTANCE + // + // ServiceInstance is used when NSX handles the lifecyle of appliance. Deployment and appliance related all the information is necessary. ByodServiceInstance is a custom instance to be used when NSX is not handling the lifecycles of appliance/s. User will manage their own appliance (BYOD) to connect with NSX. VirtualServiceInstance is a a custom instance to be used when NSX is not handling the lifecycle of an appliance and when the user is not bringing their own appliance. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // Possible values are: + // + // * BaseServiceInstance#BaseServiceInstance_ON_FAILURE_POLICY_ALLOW + // * BaseServiceInstance#BaseServiceInstance_ON_FAILURE_POLICY_BLOCK + // + // Failure policy of the service instance - if it has to be different from the service. By default the service instance inherits the FailurePolicy of the service it belongs to. + OnFailurePolicy *string + // The Service to which the service instance is associated. + ServiceId *string + // Possible values are: + // + // * BaseServiceInstance#BaseServiceInstance_TRANSPORT_TYPE_L2_BRIDGE + // * BaseServiceInstance#BaseServiceInstance_TRANSPORT_TYPE_L3_ROUTED + // * BaseServiceInstance#BaseServiceInstance_TRANSPORT_TYPE_NSH + // * BaseServiceInstance#BaseServiceInstance_TRANSPORT_TYPE_NA + // + // Transport to be used by this service instance for deploying the Service-VM. This field is to be set Not Applicable(NA) if the service only caters to functionality EPP(Endpoint Protection) and MPS. + TransportType *string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const VirtualServiceInstance__TYPE_IDENTIFIER = "VirtualServiceInstance" + +func (s *VirtualServiceInstance) GetType__() bindings.BindingType { + return VirtualServiceInstanceBindingType() +} + +func (s *VirtualServiceInstance) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VirtualServiceInstance._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Virtual switch on a compute manager +type VirtualSwitch struct { + // ID of the virtual switch in compute manager + CmLocalId *string + // External id of the virtual switch + ExternalId *string + // ID of the compute manager where this virtual switch is discovered. + OriginId *string + // Switch type like VmwareDistributedVirtualSwitch + OriginType *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Specifies list of scope of discovered resource. e.g. if VHC path is associated with principal identity, who owns the discovered resource, then scope id will be VHC path and scope type will be VHC. + Scope []DiscoveredResourceScope + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const VirtualSwitch__TYPE_IDENTIFIER = "VirtualSwitch" + +func (s *VirtualSwitch) GetType__() bindings.BindingType { + return VirtualSwitchBindingType() +} + +func (s *VirtualSwitch) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VirtualSwitch._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Virtual switch list result +type VirtualSwitchListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Virtual switch list results + Results []VirtualSwitch +} + +func (s *VirtualSwitchListResult) GetType__() bindings.BindingType { + return VirtualSwitchListResultBindingType() +} + +func (s *VirtualSwitchListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VirtualSwitchListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type VlanMirrorSource struct { + // Source VLAN ID list format: int64 + VlanIds []int64 + // Possible values are: + // + // * MirrorSource#MirrorSource_RESOURCE_TYPE_LOGICALPORTMIRRORSOURCE + // * MirrorSource#MirrorSource_RESOURCE_TYPE_PNICMIRRORSOURCE + // * MirrorSource#MirrorSource_RESOURCE_TYPE_VLANMIRRORSOURCE + // * MirrorSource#MirrorSource_RESOURCE_TYPE_LOGICALSWITCHMIRRORSOURCE + // + // Resource types of mirror source + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const VlanMirrorSource__TYPE_IDENTIFIER = "VlanMirrorSource" + +func (s *VlanMirrorSource) GetType__() bindings.BindingType { + return VlanMirrorSourceBindingType() +} + +func (s *VlanMirrorSource) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VlanMirrorSource._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// VlanTrunkspec is used for specifying trunk VLAN id ranges. +type VlanTrunkSpec struct { + // Trunk VLAN id ranges + VlanRanges []TrunkVlanRange +} + +func (s *VlanTrunkSpec) GetType__() bindings.BindingType { + return VlanTrunkSpecBindingType() +} + +func (s *VlanTrunkSpec) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VlanTrunkSpec._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Contains a set of information of a VM on the network interfaces present on the partner appliance that needs to be configured by the NSX Manager. +type VmNicInfo struct { + // Set of information of a VM on the network interfaces present on the partner appliance that needs to be configured by the NSX Manager. + NicInfos []NicInfo +} + +func (s *VmNicInfo) GetType__() bindings.BindingType { + return VmNicInfoBindingType() +} + +func (s *VmNicInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VmNicInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type VmToolsInfo struct { + // Current external id of this virtual machine in the system. + ExternalId *string + // Version of file agent on the VM of a third party partner solution. + FileAgentVersion *string + // Id of the VM which is assigned locally by the host. It is the VM-moref on ESXi hosts, in other environments it is VM UUID. + HostLocalId *string + // Version of network agent on the VM of a third party partner solution. + NetworkAgentVersion *string + Source *ResourceReference + // Connectivity Status between each Guest Introspection Solution deployed in the data center with the guest VM. + SvmStatus []SvmConnectivityStatus + // Endpoint Protection (Third party AV partner using NXGI) status on the VM. TRUE - VM is configured and protected by EPP Service VM. FALSE - VM is either not configured for protection or VM is disconnected from EPP Service VM. + SvmConnectivity *bool + // Version of VMTools installed on the VM. + ToolsVersion *string + // Possible values are: + // + // * VmToolsInfo#VmToolsInfo_VM_TYPE_EDGE + // * VmToolsInfo#VmToolsInfo_VM_TYPE_SERVICE + // * VmToolsInfo#VmToolsInfo_VM_TYPE_REGULAR + // + // Type of VM - Edge, Service or other. + VmType *string + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Timestamp of last modification format: int64 + LastSyncTime *int64 + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // The type of this resource. + ResourceType string + // Specifies list of scope of discovered resource. e.g. if VHC path is associated with principal identity, who owns the discovered resource, then scope id will be VHC path and scope type will be VHC. + Scope []DiscoveredResourceScope + // Opaque identifiers meaningful to the API user + Tags []Tag +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const VmToolsInfo__TYPE_IDENTIFIER = "VmToolsInfo" +const VmToolsInfo_VM_TYPE_EDGE = "EDGE" +const VmToolsInfo_VM_TYPE_SERVICE = "SERVICE" +const VmToolsInfo_VM_TYPE_REGULAR = "REGULAR" + +func (s *VmToolsInfo) GetType__() bindings.BindingType { + return VmToolsInfoBindingType() +} + +func (s *VmToolsInfo) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VmToolsInfo._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type VmToolsInfoListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // VmToolsInfo list results. + Results []VmToolsInfo +} + +func (s *VmToolsInfoListResult) GetType__() bindings.BindingType { + return VmToolsInfoListResultBindingType() +} + +func (s *VmToolsInfoListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VmToolsInfoListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Mapping of all vmk interfaces to destination networks +type VmknicNetwork struct { + // When migrating vmks to N-VDS/logical switches, the id is the logical switch id. When migrating out of N-VDS/logical switches, the id is the vSphere Switch portgroup name in a single vSphere Standard Switch (VSS), or distributed virtual portgroup name in a single distributed virtual switch (DVS). + DestinationNetwork *string + // The vmk interface name, e.g., vmk0, vmk1; the id assigned by vCenter. + DeviceName *string +} + +func (s *VmknicNetwork) GetType__() bindings.BindingType { + return VmknicNetworkBindingType() +} + +func (s *VmknicNetwork) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VmknicNetwork._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type VniPool struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + // VNI range list results + Ranges []VniRange +} + +func (s *VniPool) GetType__() bindings.BindingType { + return VniPoolBindingType() +} + +func (s *VniPool) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VniPool._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type VniPoolListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // VNI pool list results + Results []VniPool +} + +func (s *VniPoolListResult) GetType__() bindings.BindingType { + return VniPoolListResultBindingType() +} + +func (s *VniPoolListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VniPoolListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A range of virtual network identifiers (VNIs) +type VniRange struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // End value for vni range to be used for virtual networks format: int64 + End *int64 + // Start value for vni range to be used for virtual networks format: int64 + Start *int64 +} + +func (s *VniRange) GetType__() bindings.BindingType { + return VniRangeBindingType() +} + +func (s *VniRange) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VniRange._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The Vsphere deployment configuration determines where to deploy the cluster node VM through a vCenter server. It contains settings that are applied during install time. If using DHCP, the following fields must be left unset - dns_servers, management_port_subnets, and default_gateway_addresses +type VsphereClusterNodeVMDeploymentConfig struct { + // If true, the root user will be allowed to log into the VM. Allowing root SSH logins is not recommended for security reasons. + AllowSshRootLogin *bool + // The cluster node VM will be deployed on the specified cluster or resourcepool for specified VC server. + ComputeId *string + // The default gateway for the VM to be deployed must be specified if all the other VMs it communicates with are not in the same subnet. Do not specify this field and management_port_subnets to use DHCP. Note: only single IPv4 default gateway address is supported and it must belong to management network. IMPORTANT: VMs deployed using DHCP are currently not supported, so this parameter should be specified. format: ip + DefaultGatewayAddresses []string + // Possible values are: + // + // * VsphereClusterNodeVMDeploymentConfig#VsphereClusterNodeVMDeploymentConfig_DISK_PROVISIONING_THIN + // * VsphereClusterNodeVMDeploymentConfig#VsphereClusterNodeVMDeploymentConfig_DISK_PROVISIONING_LAZY_ZEROED_THICK + // * VsphereClusterNodeVMDeploymentConfig#VsphereClusterNodeVMDeploymentConfig_DISK_PROVISIONING_EAGER_ZEROED_THICK + // + // Specifies the disk provisioning type of the VM. + DiskProvisioning *string + // List of DNS servers. If DHCP is used, the default DNS servers associated with the DHCP server will be used instead. Required if using static IP. format: ipv4 + DnsServers []string + // If true, the SSH service will automatically be started on the VM. Enabling SSH service is not recommended for security reasons. + EnableSsh *bool + // Specifies the folder in which the VM should be placed. + FolderId *string + // The cluster node VM will be deployed on the specified host in the specified VC server within the cluster if host_id is specified. Note: User must ensure that storage and specified networks are accessible by this host. + HostId *string + // Desired host name/FQDN for the VM to be deployed + Hostname *string + // Distributed portgroup identifier to which the management vnic of cluster node VM will be connected. + ManagementNetworkId *string + // IP Address and subnet configuration for the management port. Do not specify this field and default_gateway_addresses to use DHCP. Note: only one IPv4 address is supported for the management port. IMPORTANT: VMs deployed using DHCP are currently not supported, so this parameter should be specified. + ManagementPortSubnets []IPSubnet + // List of NTP servers. To use hostnames, a DNS server must be defined. If not using DHCP, a DNS server should be specified under dns_servers. format: hostname-or-ipv4 + NtpServers []string + // List of domain names that are used to complete unqualified host names. + SearchDomains []string + // The cluster node VM will be deployed on the specified datastore in the specified VC server. User must ensure that storage is accessible by the specified cluster/host. + StorageId *string + // The VC-specific identifiers will be resolved on this VC, so all other identifiers specified in the config must belong to this vCenter server. + VcId *string + // Possible values are: + // + // * ClusterNodeVMDeploymentConfig#ClusterNodeVMDeploymentConfig_PLACEMENT_TYPE_VSPHERECLUSTERNODEVMDEPLOYMENTCONFIG + // + // Specifies the config for the platform through which to deploy the VM + PlacementType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const VsphereClusterNodeVMDeploymentConfig__TYPE_IDENTIFIER = "VsphereClusterNodeVMDeploymentConfig" +const VsphereClusterNodeVMDeploymentConfig_DISK_PROVISIONING_THIN = "THIN" +const VsphereClusterNodeVMDeploymentConfig_DISK_PROVISIONING_LAZY_ZEROED_THICK = "LAZY_ZEROED_THICK" +const VsphereClusterNodeVMDeploymentConfig_DISK_PROVISIONING_EAGER_ZEROED_THICK = "EAGER_ZEROED_THICK" + +func (s *VsphereClusterNodeVMDeploymentConfig) GetType__() bindings.BindingType { + return VsphereClusterNodeVMDeploymentConfigBindingType() +} + +func (s *VsphereClusterNodeVMDeploymentConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VsphereClusterNodeVMDeploymentConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// The Vsphere deployment configuration determines where to deploy the edge node. It contains settings that are applied during install time. Use EdgeNodeSettings to specify host name, SSH, NTP and DNS settings for both deployment and consequent update. These settings are editable for manually deployed edge nodes as well. EdgeNodeSettings reports current values configured on the edge node. +type VsphereDeploymentConfig struct { + // This field is deprecated. EdgeNodeSettings field 'advanced_configuration' must be used instead. Array of additional specific properties for advanced or cloud-specific deployments in key-value format. + AdvancedConfiguration []KeyValuePair + // The edge node vm will be deployed on the specified compute folder created in a datacenter, if compute folder is specified. Note - User must ensure that compute folder is accessible by specified cluster/host. + ComputeFolderId *string + // The edge node vm will be deployed on the specified cluster or resourcepool. Note - all the hosts must have nsx fabric prepared in the specified cluster. + ComputeId *string + // List of distributed portgroups, VLAN logical switch identifiers or segment paths to which the datapath serving vnics of edge node vm will be connected. If a VM network interface is not configured, it is disconnected and represented as an empty string. + DataNetworkIds []string + // The default gateway for edge node must be specified if all the nodes it communicates with are not in the same subnet. Note: Only single IPv4 default gateway address is supported and it must belong to management network. format: ip + DefaultGatewayAddresses []string + // The edge node vm will be deployed on the specified Host within the cluster if host_id is specified. Note - User must ensure that storage and specified networks are accessible by this host. + HostId *string + // Distributed portgroup identifier to which the management vnic of edge node vm will be connected. This portgroup must have connectivity with MP and CCP. A VLAN logical switch identifier may also be specified. If VM network interface is not connected, it is represented as an empty string. + ManagementNetworkId *string + // IP Address and subnet configuration for the management port. Note: only one IPv4 address is supported for the management port. + ManagementPortSubnets []IPSubnet + ReservationInfo *ReservationInfo + ResourceAllocation *ResourceAssignment + // The edge node vm will be deployed on the specified datastore. User must ensure that storage is accessible by the specified cluster/host. + StorageId *string + // The vc specific identifiers will be resolved on this VC. So all other identifiers specified here must belong to this vcenter server. + VcId *string + // Possible values are: + // + // * DeploymentConfig#DeploymentConfig_PLACEMENT_TYPE_VSPHEREDEPLOYMENTCONFIG + PlacementType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const VsphereDeploymentConfig__TYPE_IDENTIFIER = "VsphereDeploymentConfig" + +func (s *VsphereDeploymentConfig) GetType__() bindings.BindingType { + return VsphereDeploymentConfigBindingType() +} + +func (s *VsphereDeploymentConfig) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VsphereDeploymentConfig._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type VtepCsvListResult struct { + // File name set by HTTP server if API returns CSV result as a file. + FileName *string + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + Results []VtepTableCsvRecord +} + +func (s *VtepCsvListResult) GetType__() bindings.BindingType { + return VtepCsvListResultBindingType() +} + +func (s *VtepCsvListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VtepCsvListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A collection of ranges of virtual tunnel endpoint labels +type VtepLabelPool struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Defaults to ID if not set + DisplayName *string + // Unique identifier of this resource + Id *string + // The type of this resource. + ResourceType *string + // Opaque identifiers meaningful to the API user + Tags []Tag + PoolUsage *VtepLabelPoolUsage + // Array of ranges for virtual tunnel endpoint labels + Ranges []VtepLabelRange +} + +func (s *VtepLabelPool) GetType__() bindings.BindingType { + return VtepLabelPoolBindingType() +} + +func (s *VtepLabelPool) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VtepLabelPool._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type VtepLabelPoolListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Virtual tunnel endpoint label pool list results + Results []VtepLabelPool +} + +func (s *VtepLabelPoolListResult) GetType__() bindings.BindingType { + return VtepLabelPoolListResultBindingType() +} + +func (s *VtepLabelPoolListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VtepLabelPoolListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Pool usage statistics in a pool +type VtepLabelPoolUsage struct { + // Total number of allocated IDs in a pool format: int64 + AllocatedIds *int64 + // Total number of free IDs in a pool format: int64 + FreeIds *int64 + // Total number of IDs in a pool format: int64 + TotalIds *int64 +} + +func (s *VtepLabelPoolUsage) GetType__() bindings.BindingType { + return VtepLabelPoolUsageBindingType() +} + +func (s *VtepLabelPoolUsage) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VtepLabelPoolUsage._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type VtepLabelRange struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // End value for virtual tunnel endpoint label range format: int64 + End *int64 + // Start value for virtual tunnel endpoint label range format: int64 + Start *int64 +} + +func (s *VtepLabelRange) GetType__() bindings.BindingType { + return VtepLabelRangeBindingType() +} + +func (s *VtepLabelRange) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VtepLabelRange._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type VtepListResult struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // Opaque cursor to be used for getting next page of records (supplied by current result page) + Cursor *string + // Count of results found (across all pages), set only on first page format: int64 + ResultCount *int64 + // If true, results are sorted in ascending order + SortAscending *bool + // Field by which records are sorted + SortBy *string + // Timestamp when the data was last updated; unset if data source has never updated the data. format: int64 + LastUpdateTimestamp *int64 + // The id of the logical Switch + LogicalSwitchId *string + Results []VtepTableEntry + // Transport node identifier + TransportNodeId *string +} + +func (s *VtepListResult) GetType__() bindings.BindingType { + return VtepListResultBindingType() +} + +func (s *VtepListResult) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VtepListResult._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type VtepTableCsvRecord struct { + // The segment Id + SegmentId *string + // The virtual tunnel endpoint IP address format: ip + VtepIp *string + // The virtual tunnel endpoint label format: int64 + VtepLabel *int64 + // The virtual tunnel endpoint MAC address + VtepMacAddress *string +} + +func (s *VtepTableCsvRecord) GetType__() bindings.BindingType { + return VtepTableCsvRecordBindingType() +} + +func (s *VtepTableCsvRecord) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VtepTableCsvRecord._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type VtepTableEntry struct { + // The segment Id + SegmentId *string + // The virtual tunnel endpoint IP address format: ip + VtepIp *string + // The virtual tunnel endpoint label format: int64 + VtepLabel *int64 + // The virtual tunnel endpoint MAC address + VtepMacAddress *string +} + +func (s *VtepTableEntry) GetType__() bindings.BindingType { + return VtepTableEntryBindingType() +} + +func (s *VtepTableEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for VtepTableEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Schedule to specify day of the week and time to take automated backup +type WeeklyBackupSchedule struct { + // Days of week when backup is taken. 0 - Sunday, 1 - Monday, 2 - Tuesday, 3 - Wednesday ... format: int64 + DaysOfWeek []int64 + // Time of day when backup is taken format: int64 + HourOfDay *int64 + // Time of day when backup is taken format: int64 + MinuteOfDay *int64 + // Possible values are: + // + // * BackupSchedule#BackupSchedule_RESOURCE_TYPE_WEEKLYBACKUPSCHEDULE + // * BackupSchedule#BackupSchedule_RESOURCE_TYPE_INTERVALBACKUPSCHEDULE + // + // Schedule type + ResourceType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const WeeklyBackupSchedule__TYPE_IDENTIFIER = "WeeklyBackupSchedule" + +func (s *WeeklyBackupSchedule) GetType__() bindings.BindingType { + return WeeklyBackupScheduleBindingType() +} + +func (s *WeeklyBackupSchedule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for WeeklyBackupSchedule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type WeeklyTelemetrySchedule struct { + // Possible values are: + // + // * WeeklyTelemetrySchedule#WeeklyTelemetrySchedule_DAY_OF_WEEK_SUNDAY + // * WeeklyTelemetrySchedule#WeeklyTelemetrySchedule_DAY_OF_WEEK_MONDAY + // * WeeklyTelemetrySchedule#WeeklyTelemetrySchedule_DAY_OF_WEEK_TUESDAY + // * WeeklyTelemetrySchedule#WeeklyTelemetrySchedule_DAY_OF_WEEK_WEDNESDAY + // * WeeklyTelemetrySchedule#WeeklyTelemetrySchedule_DAY_OF_WEEK_THURSDAY + // * WeeklyTelemetrySchedule#WeeklyTelemetrySchedule_DAY_OF_WEEK_FRIDAY + // * WeeklyTelemetrySchedule#WeeklyTelemetrySchedule_DAY_OF_WEEK_SATURDAY + // + // Day of week on which data will be collected. Specify one of SUNDAY through SATURDAY. + DayOfWeek *string + // Hour at which data will be collected. Specify a value between 0 through 23. format: int64 + HourOfDay *int64 + // Minute at which data will be collected. Specify a value between 0 through 59. format: int64 + Minutes *int64 + // Specify one of DailyTelemetrySchedule, WeeklyTelemetrySchedule, or MonthlyTelemetrySchedule. + FrequencyType string +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const WeeklyTelemetrySchedule__TYPE_IDENTIFIER = "WeeklyTelemetrySchedule" +const WeeklyTelemetrySchedule_DAY_OF_WEEK_SUNDAY = "SUNDAY" +const WeeklyTelemetrySchedule_DAY_OF_WEEK_MONDAY = "MONDAY" +const WeeklyTelemetrySchedule_DAY_OF_WEEK_TUESDAY = "TUESDAY" +const WeeklyTelemetrySchedule_DAY_OF_WEEK_WEDNESDAY = "WEDNESDAY" +const WeeklyTelemetrySchedule_DAY_OF_WEEK_THURSDAY = "THURSDAY" +const WeeklyTelemetrySchedule_DAY_OF_WEEK_FRIDAY = "FRIDAY" +const WeeklyTelemetrySchedule_DAY_OF_WEEK_SATURDAY = "SATURDAY" + +func (s *WeeklyTelemetrySchedule) GetType__() bindings.BindingType { + return WeeklyTelemetryScheduleBindingType() +} + +func (s *WeeklyTelemetrySchedule) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for WeeklyTelemetrySchedule._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Describes the configuration of a widget to be displayed on the dashboard. WidgetConfiguration is a base type that provides attributes of a widget in-general. +type WidgetConfiguration struct { + // The server will populate this field when returing the resource. Ignored on PUT and POST. + Links []ResourceLink + // Schema for this resource + Schema *string + Self *SelfResourceLink + // The _revision property describes the current revision of the resource. To prevent clients from overwriting each other's changes, PUT operations must include the current _revision of the resource, which clients should obtain by issuing a GET operation. If the _revision provided in a PUT request is missing or stale, the operation will be rejected. format: int32 + Revision *int64 + // Timestamp of resource creation format: int64 + CreateTime *int64 + // ID of the user who created this resource + CreateUser *string + // Timestamp of last modification format: int64 + LastModifiedTime *int64 + // ID of the user who last modified this resource + LastModifiedUser *string + // Protection status is one of the following: PROTECTED - the client who retrieved the entity is not allowed to modify it. NOT_PROTECTED - the client who retrieved the entity is allowed to modify it REQUIRE_OVERRIDE - the client who retrieved the entity is a super user and can modify it, but only when providing the request header X-Allow-Overwrite=true. UNKNOWN - the _protection field could not be determined for this entity. + Protection *string + // Indicates system owned resource + SystemOwned *bool + // Description of this resource + Description *string + // Title of the widget. If display_name is omitted, the widget will be shown without a title. + DisplayName *string + // Unique identifier of this resource + Id *string + // Possible values are: + // + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_CUSTOMFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_TIMERANGEDROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_SPACERWIDGETCONFIGURATION + // * WidgetConfiguration#WidgetConfiguration_RESOURCE_TYPE_LEGENDWIDGETCONFIGURATION + // + // Supported visualization types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration, ContainerConfiguration, CustomWidgetConfiguration, CustomFilterWidgetConfiguration, TimeRangeDropdownFilterWidgetConfiguration, SpacerWidgetConfiguration, LegendWidgetConfiguration and DropdownFilterWidgetConfiguration. + ResourceType string + // Opaque identifiers meaningful to the API user + Tags []Tag + // If the condition is met then the widget will be displayed to UI. If no condition is provided, then the widget will be displayed unconditionally. + Condition *string + // The 'datasources' represent the sources from which data will be fetched. Currently, only NSX-API is supported as a 'default' datasource. An example of specifying 'default' datasource along with the urls to fetch data from is given at 'example_request' section of 'CreateWidgetConfiguration' API. + Datasources []Datasource + // Default filter values to be passed to datasources. This will be used when the report is requested without filter values. + DefaultFilterValue []DefaultFilterValue + // Id of drilldown widget, if any. Id should be a valid id of an existing widget. A widget is considered as drilldown widget when it is associated with any other widget and provides more detailed information about any data item from the parent widget. + DrilldownId *string + FeatureSet *FeatureSet + // Id of filter widget for subscription, if any. Id should be a valid id of an existing filter widget. Filter widget should be from the same view. Datasource URLs should have placeholder values equal to filter alias to accept the filter value on filter change. This field is deprecated instead use 'filters' property. + Filter *string + // Flag to indicate that widget will continue to work without filter value. If this flag is set to false then default_filter_value is manadatory. + FilterValueRequired *bool + // A List of filter applied to this widget configuration. This will be used to identify the filters applied to this widget. + Filters []string + Footer *Footer + // Icons to be applied at dashboard for widgets and UI elements. + Icons []Icon + // Set to true if this widget should be used as a drilldown. + IsDrilldown *bool + Legend *Legend + // List of plotting configuration for a given widget. Widget plotting configurations which are common across all the widgets types should be define here. + PlotConfigs []WidgetPlotConfiguration + // Represents the vertical span of the widget / container. 1 Row span is equal to 20px. format: int32 + Rowspan *int64 + // Please use the property 'shared' of View instead of this. The widgets of a shared view are visible to other users. + Shared *bool + // If the value of this field is set to true then card header will be displayed otherwise only card will be displayed without header. + ShowHeader *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Specify relavite weight in WidgetItem for placement in a view. Please see WidgetItem for details. format: int32 + Weight *int64 +} + +// Identifier denoting this class, when it is used in polymorphic context. +// +// This value should be assigned to the property which is used to discriminate the actual type used in the polymorphic context. +const WidgetConfiguration__TYPE_IDENTIFIER = "WidgetConfiguration" +const WidgetConfiguration_RESOURCE_TYPE_LABELVALUECONFIGURATION = "LabelValueConfiguration" +const WidgetConfiguration_RESOURCE_TYPE_DONUTCONFIGURATION = "DonutConfiguration" +const WidgetConfiguration_RESOURCE_TYPE_MULTIWIDGETCONFIGURATION = "MultiWidgetConfiguration" +const WidgetConfiguration_RESOURCE_TYPE_CONTAINERCONFIGURATION = "ContainerConfiguration" +const WidgetConfiguration_RESOURCE_TYPE_STATSCONFIGURATION = "StatsConfiguration" +const WidgetConfiguration_RESOURCE_TYPE_GRIDCONFIGURATION = "GridConfiguration" +const WidgetConfiguration_RESOURCE_TYPE_GRAPHCONFIGURATION = "GraphConfiguration" +const WidgetConfiguration_RESOURCE_TYPE_CUSTOMWIDGETCONFIGURATION = "CustomWidgetConfiguration" +const WidgetConfiguration_RESOURCE_TYPE_CUSTOMFILTERWIDGETCONFIGURATION = "CustomFilterWidgetConfiguration" +const WidgetConfiguration_RESOURCE_TYPE_TIMERANGEDROPDOWNFILTERWIDGETCONFIGURATION = "TimeRangeDropdownFilterWidgetConfiguration" +const WidgetConfiguration_RESOURCE_TYPE_DROPDOWNFILTERWIDGETCONFIGURATION = "DropdownFilterWidgetConfiguration" +const WidgetConfiguration_RESOURCE_TYPE_SPACERWIDGETCONFIGURATION = "SpacerWidgetConfiguration" +const WidgetConfiguration_RESOURCE_TYPE_LEGENDWIDGETCONFIGURATION = "LegendWidgetConfiguration" + +func (s *WidgetConfiguration) GetType__() bindings.BindingType { + return WidgetConfigurationBindingType() +} + +func (s *WidgetConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for WidgetConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents a list of widget configurations. +type WidgetConfigurationList struct { + // Array of widget configurations + Widgetconfigurations []*data.StructValue +} + +func (s *WidgetConfigurationList) GetType__() bindings.BindingType { + return WidgetConfigurationListBindingType() +} + +func (s *WidgetConfigurationList) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for WidgetConfigurationList._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Represents a reference to a widget that is held by a container or a multi-widget or a View. +type WidgetItem struct { + // Possible values are: + // + // * WidgetItem#WidgetItem_ALIGNMENT_LEFT + // * WidgetItem#WidgetItem_ALIGNMENT_RIGHT + // + // Aligns widget either left or right. + Alignment *string + Label *Label + // Represents the vertical span of the widget / container format: int32 + Rowspan *int64 + // If true, separates this widget in a container. + Separator *bool + // Represents the horizontal span of the widget / container. format: int32 + Span *int64 + // Determines placement of widget or container relative to other widgets and containers. The lower the weight, the higher it is in the placement order. format: int32 + Weight *int64 + // Id of the widget configuration that is held by a multi-widget or a container or a view. + WidgetId *string +} + +const WidgetItem_ALIGNMENT_LEFT = "LEFT" +const WidgetItem_ALIGNMENT_RIGHT = "RIGHT" + +func (s *WidgetItem) GetType__() bindings.BindingType { + return WidgetItemBindingType() +} + +func (s *WidgetItem) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for WidgetItem._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Base type for widget plot config. +type WidgetPlotConfiguration struct { + // Allow maximize capability for this widget + AllowMaximize *bool + // If the condition is met then the given chart config is applied to the widget configuration. + Condition *string +} + +func (s *WidgetPlotConfiguration) GetType__() bindings.BindingType { + return WidgetPlotConfigurationBindingType() +} + +func (s *WidgetPlotConfiguration) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for WidgetPlotConfiguration._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +type X509Certificate struct { + // One of the DSA cryptogaphic algorithm's strength parameters, base. + DsaPublicKeyg *string + // One of the DSA cryptogaphic algorithm's strength parameters, prime. + DsaPublicKeyp *string + // One of the DSA cryptogaphic algorithm's strength parameters, sub-prime. + DsaPublicKeyq *string + // One of the DSA cryptogaphic algorithm's strength parameters. + DsaPublicKeyy *string + // The Curve name for the ECDSA certificate. + EcdsaCurveName *string + // Possible values are: + // + // * X509Certificate#X509Certificate_ECDSA_EC_FIELD_F2M + // * X509Certificate#X509Certificate_ECDSA_EC_FIELD_FP + // + // Represents an elliptic curve (EC) finite field in ECDSA. + EcdsaEcField *string + // The order of the middle term(s) of the reduction polynomial in elliptic curve (EC) | characteristic 2 finite field.| Contents of this array are copied to protect against subsequent modification in ECDSA. format: int64 + EcdsaEcFieldF2mks []int64 + // The first coefficient of this elliptic curve in elliptic curve (EC) | characteristic 2 finite field for ECDSA. format: int64 + EcdsaEcFieldF2mm *int64 + // The value whose i-th bit corresponds to the i-th coefficient of the reduction polynomial | in elliptic curve (EC) characteristic 2 finite field for ECDSA. + EcdsaEcFieldF2mrp *string + // The specified prime for the elliptic curve prime finite field in ECDSA. + EcdsaEcFieldF2pp *string + // The first coefficient of this elliptic curve in ECDSA. + EcdsaPublicKeya *string + // The second coefficient of this elliptic curve in ECDSA. + EcdsaPublicKeyb *string + // The co-factor in ECDSA. format: int64 + EcdsaPublicKeyCofactor *int64 + // X co-ordinate of G (the generator which is also known as the base point) in ECDSA. + EcdsaPublicKeyGeneratorx *string + // Y co-ordinate of G (the generator which is also known as the base point) in ECDSA. + EcdsaPublicKeyGeneratory *string + // The order of generator G in ECDSA. + EcdsaPublicKeyOrder *string + // The bytes used during curve generation for later validation in ECDSA.| Contents of this array are copied to protect against subsequent modification. + EcdsaPublicKeySeed []string + // True if this is a CA certificate. + IsCa *bool + // True if this certificate is valid. + IsValid *bool + // The certificate issuers complete distinguished name. + Issuer *string + // The certificate issuer's common name. + IssuerCn *string + // The time in epoch milliseconds at which the certificate becomes invalid. format: int64 + NotAfter *int64 + // The time in epoch milliseconds at which the certificate becomes valid. format: int64 + NotBefore *int64 + // Cryptographic algorithm used by the public key for data encryption. + PublicKeyAlgo *string + // Size measured in bits of the public/private keys used in a cryptographic algorithm. format: int64 + PublicKeyLength *int64 + // An RSA public key is made up of the modulus and the public exponent. Exponent is a power number. + RsaPublicKeyExponent *string + // An RSA public key is made up of the modulus and the public exponent. Modulus is wrap around number. + RsaPublicKeyModulus *string + // Certificate's serial number. + SerialNumber *string + // The signature value(the raw signature bits) used for signing and validate the cert. + Signature *string + // The algorithm used by the Certificate Authority to sign the certificate. + SignatureAlgorithm *string + // The certificate owners complete distinguished name. + Subject *string + // The certificate owner's common name. + SubjectCn *string + // Certificate version (default v1). + Version *string +} + +const X509Certificate_ECDSA_EC_FIELD_F2M = "F2M" +const X509Certificate_ECDSA_EC_FIELD_FP = "FP" + +func (s *X509Certificate) GetType__() bindings.BindingType { + return X509CertificateBindingType() +} + +func (s *X509Certificate) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for X509Certificate._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// A CRL is a time-stamped list identifying revoked certificates. +type X509Crl struct { + // List of X509CrlEntry. + CrlEntries []X509CrlEntry + // Issuer's distinguished name. (DN) + Issuer *string + // Next update time for the CRL. + NextUpdate *string + // CRL's version number either 1 or 2. + Version *string +} + +func (s *X509Crl) GetType__() bindings.BindingType { + return X509CrlBindingType() +} + +func (s *X509Crl) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for X509Crl._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +// Each revoked certificate is identified in a CRL by its certificate serial number. +type X509CrlEntry struct { + // Revocation date. + RevocationDate *string + // The revoked certificate's serial number. + SerialNumber *string +} + +func (s *X509CrlEntry) GetType__() bindings.BindingType { + return X509CrlEntryBindingType() +} + +func (s *X509CrlEntry) GetDataValue__() (data.DataValue, []error) { + typeConverter := bindings.NewTypeConverter() + typeConverter.SetMode(bindings.JSONRPC) + dataVal, err := typeConverter.ConvertToVapi(s, s.GetType__()) + if err != nil { + log.Errorf("Error in ConvertToVapi for X509CrlEntry._GetDataValue method - %s", + bindings.VAPIerrorsToError(err).Error()) + return nil, err + } + return dataVal, nil +} + +func ALGTypeNSServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["alg"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["alg"] = "Alg" + fields["destination_ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["destination_ports"] = "DestinationPorts" + fields["source_ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["source_ports"] = "SourcePorts" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ALG_type_NS_service", fields, reflect.TypeOf(ALGTypeNSService{}), fieldNameMap, validators) +} + +func AcceptableComponentVersionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["acceptable_versions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["acceptable_versions"] = "AcceptableVersions" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.acceptable_component_version", fields, reflect.TypeOf(AcceptableComponentVersion{}), fieldNameMap, validators) +} + +func AcceptableComponentVersionListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AcceptableComponentVersionBindingType), reflect.TypeOf([]AcceptableComponentVersion{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.acceptable_component_version_list", fields, reflect.TypeOf(AcceptableComponentVersionList{}), fieldNameMap, validators) +} + +func ActionableResourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.actionable_resource", fields, reflect.TypeOf(ActionableResource{}), fieldNameMap, validators) +} + +func ActionableResourceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ActionableResourceBindingType), reflect.TypeOf([]ActionableResource{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.actionable_resource_list_result", fields, reflect.TypeOf(ActionableResourceListResult{}), fieldNameMap, validators) +} + +func ActiveStandbySyncStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["full_sync_status"] = bindings.NewOptionalType(bindings.NewReferenceType(FullSyncStatusBindingType)) + fieldNameMap["full_sync_status"] = "FullSyncStatus" + fields["is_data_consistent"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_data_consistent"] = "IsDataConsistent" + fields["percentage_completed"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["percentage_completed"] = "PercentageCompleted" + fields["remaining_entries_to_send"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["remaining_entries_to_send"] = "RemainingEntriesToSend" + fields["standby_site"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["standby_site"] = "StandbySite" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["sync_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sync_type"] = "SyncType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.active_standby_sync_status", fields, reflect.TypeOf(ActiveStandbySyncStatus{}), fieldNameMap, validators) +} + +func AddClusterNodeSpecBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["controller_role_config"] = bindings.NewOptionalType(bindings.NewReferenceType(AddControllerNodeSpecBindingType)) + fieldNameMap["controller_role_config"] = "ControllerRoleConfig" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["mgr_role_config"] = bindings.NewOptionalType(bindings.NewReferenceType(AddManagementNodeSpecBindingType)) + fieldNameMap["mgr_role_config"] = "MgrRoleConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.add_cluster_node_spec", fields, reflect.TypeOf(AddClusterNodeSpec{}), fieldNameMap, validators) +} + +func AddClusterNodeVMInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["clustering_config"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ClusteringConfigBindingType)}, bindings.REST)) + fieldNameMap["clustering_config"] = "ClusteringConfig" + fields["deployment_requests"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ClusterNodeVMDeploymentRequestBindingType), reflect.TypeOf([]ClusterNodeVMDeploymentRequest{}))) + fieldNameMap["deployment_requests"] = "DeploymentRequests" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.add_cluster_node_VM_info", fields, reflect.TypeOf(AddClusterNodeVMInfo{}), fieldNameMap, validators) +} + +func AddControllerNodeSpecBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["clustering_params"] = bindings.NewOptionalType(bindings.NewReferenceType(ClusteringInfoBindingType)) + fieldNameMap["clustering_params"] = "ClusteringParams" + fields["control_plane_server_certificate"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["control_plane_server_certificate"] = "ControlPlaneServerCertificate" + fields["host_msg_client_info"] = bindings.NewOptionalType(bindings.NewReferenceType(MsgClientInfoBindingType)) + fieldNameMap["host_msg_client_info"] = "HostMsgClientInfo" + fields["mpa_msg_client_info"] = bindings.NewOptionalType(bindings.NewReferenceType(MsgClientInfoBindingType)) + fieldNameMap["mpa_msg_client_info"] = "MpaMsgClientInfo" + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.add_controller_node_spec", fields, reflect.TypeOf(AddControllerNodeSpec{}), fieldNameMap, validators) +} + +func AddIntelligenceClusterNodeVMInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["deployment_requests"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IntelligenceClusterNodeVMDeploymentRequestBindingType), reflect.TypeOf([]IntelligenceClusterNodeVMDeploymentRequest{}))) + fieldNameMap["deployment_requests"] = "DeploymentRequests" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.add_intelligence_cluster_node_VM_info", fields, reflect.TypeOf(AddIntelligenceClusterNodeVMInfo{}), fieldNameMap, validators) +} + +func AddManagementNodeSpecBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cert_thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cert_thumbprint"] = "CertThumbprint" + fields["mpa_msg_client_info"] = bindings.NewOptionalType(bindings.NewReferenceType(MsgClientInfoBindingType)) + fieldNameMap["mpa_msg_client_info"] = "MpaMsgClientInfo" + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["remote_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["remote_address"] = "RemoteAddress" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + fields["user_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["user_name"] = "UserName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.add_management_node_spec", fields, reflect.TypeOf(AddManagementNodeSpec{}), fieldNameMap, validators) +} + +func AddressBindingEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["binding"] = bindings.NewOptionalType(bindings.NewReferenceType(PacketAddressClassifierBindingType)) + fieldNameMap["binding"] = "Binding" + fields["binding_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["binding_timestamp"] = "BindingTimestamp" + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.address_binding_entry", fields, reflect.TypeOf(AddressBindingEntry{}), fieldNameMap, validators) +} + +func AdvanceClusterRestoreInputBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SelectableResourceReferenceBindingType), reflect.TypeOf([]SelectableResourceReference{}))) + fieldNameMap["resources"] = "Resources" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.advance_cluster_restore_input", fields, reflect.TypeOf(AdvanceClusterRestoreInput{}), fieldNameMap, validators) +} + +func AdvanceClusterRestoreRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["data"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AdvanceClusterRestoreInputBindingType), reflect.TypeOf([]AdvanceClusterRestoreInput{}))) + fieldNameMap["data"] = "Data" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.advance_cluster_restore_request", fields, reflect.TypeOf(AdvanceClusterRestoreRequest{}), fieldNameMap, validators) +} + +func AdvertiseRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["networks"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["networks"] = "Networks" + fields["rule_filter"] = bindings.NewOptionalType(bindings.NewReferenceType(AdvertisementRuleFilterBindingType)) + fieldNameMap["rule_filter"] = "RuleFilter" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.advertise_rule", fields, reflect.TypeOf(AdvertiseRule{}), fieldNameMap, validators) +} + +func AdvertiseRuleListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AdvertiseRuleBindingType), reflect.TypeOf([]AdvertiseRule{}))) + fieldNameMap["rules"] = "Rules" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.advertise_rule_list", fields, reflect.TypeOf(AdvertiseRuleList{}), fieldNameMap, validators) +} + +func AdvertisementConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["advertise_dns_forwarder"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["advertise_dns_forwarder"] = "AdvertiseDnsForwarder" + fields["advertise_ipsec_local_ip"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["advertise_ipsec_local_ip"] = "AdvertiseIpsecLocalIp" + fields["advertise_lb_snat_ip"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["advertise_lb_snat_ip"] = "AdvertiseLbSnatIp" + fields["advertise_lb_vip"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["advertise_lb_vip"] = "AdvertiseLbVip" + fields["advertise_nat_routes"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["advertise_nat_routes"] = "AdvertiseNatRoutes" + fields["advertise_nsx_connected_routes"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["advertise_nsx_connected_routes"] = "AdvertiseNsxConnectedRoutes" + fields["advertise_static_routes"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["advertise_static_routes"] = "AdvertiseStaticRoutes" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.advertisement_config", fields, reflect.TypeOf(AdvertisementConfig{}), fieldNameMap, validators) +} + +func AdvertisementRuleFilterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["match_route_types"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["match_route_types"] = "MatchRouteTypes" + fields["prefix_operator"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["prefix_operator"] = "PrefixOperator" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.advertisement_rule_filter", fields, reflect.TypeOf(AdvertisementRuleFilter{}), fieldNameMap, validators) +} + +func AgentStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.agent_status", fields, reflect.TypeOf(AgentStatus{}), fieldNameMap, validators) +} + +func AgentStatusCountBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["agents"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AgentStatusBindingType), reflect.TypeOf([]AgentStatus{}))) + fieldNameMap["agents"] = "Agents" + fields["down_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["down_count"] = "DownCount" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["up_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["up_count"] = "UpCount" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.agent_status_count", fields, reflect.TypeOf(AgentStatusCount{}), fieldNameMap, validators) +} + +func AggregatedDataCounterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["rx_bytes"] = "RxBytes" + fields["rx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["rx_packets"] = "RxPackets" + fields["tx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["tx_bytes"] = "TxBytes" + fields["tx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["tx_packets"] = "TxPackets" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.aggregated_data_counter", fields, reflect.TypeOf(AggregatedDataCounter{}), fieldNameMap, validators) +} + +func AggregatedDataCounterExBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["rx_bytes"] = "RxBytes" + fields["rx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["rx_packets"] = "RxPackets" + fields["tx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["tx_bytes"] = "TxBytes" + fields["tx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["tx_packets"] = "TxPackets" + fields["dropped_by_security_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(PacketsDroppedBySecurityBindingType)) + fieldNameMap["dropped_by_security_packets"] = "DroppedBySecurityPackets" + fields["mac_learning"] = bindings.NewOptionalType(bindings.NewReferenceType(MacLearningCountersBindingType)) + fieldNameMap["mac_learning"] = "MacLearning" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.aggregated_data_counter_ex", fields, reflect.TypeOf(AggregatedDataCounterEx{}), fieldNameMap, validators) +} + +func AggregatedLogicalRouterPortCountersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["rx"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalRouterPortCountersBindingType)) + fieldNameMap["rx"] = "Rx" + fields["tx"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalRouterPortCountersBindingType)) + fieldNameMap["tx"] = "Tx" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.aggregated_logical_router_port_counters", fields, reflect.TypeOf(AggregatedLogicalRouterPortCounters{}), fieldNameMap, validators) +} + +func AlarmBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["alarm_source"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["alarm_source"] = "AlarmSource" + fields["alarm_source_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["alarm_source_type"] = "AlarmSourceType" + fields["entity_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["entity_id"] = "EntityId" + fields["entity_resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["entity_resource_type"] = "EntityResourceType" + fields["event_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["event_type"] = "EventType" + fields["event_type_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["event_type_display_name"] = "EventTypeDisplayName" + fields["feature_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["feature_display_name"] = "FeatureDisplayName" + fields["feature_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["feature_name"] = "FeatureName" + fields["last_reported_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_reported_time"] = "LastReportedTime" + fields["node_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_display_name"] = "NodeDisplayName" + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fields["node_ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["node_ip_addresses"] = "NodeIpAddresses" + fields["node_resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_resource_type"] = "NodeResourceType" + fields["recommended_action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["recommended_action"] = "RecommendedAction" + fields["reoccurrences_while_suppressed"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["reoccurrences_while_suppressed"] = "ReoccurrencesWhileSuppressed" + fields["resolved_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resolved_by"] = "ResolvedBy" + fields["resolved_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["resolved_time"] = "ResolvedTime" + fields["runtime_data"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["runtime_data"] = "RuntimeData" + fields["severity"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["severity"] = "Severity" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["summary"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["summary"] = "Summary" + fields["suppress_duration"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["suppress_duration"] = "SuppressDuration" + fields["suppress_start_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["suppress_start_time"] = "SuppressStartTime" + fields["suppressed_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["suppressed_by"] = "SuppressedBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.alarm", fields, reflect.TypeOf(Alarm{}), fieldNameMap, validators) +} + +func AlarmsListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AlarmBindingType), reflect.TypeOf([]Alarm{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.alarms_list_result", fields, reflect.TypeOf(AlarmsListResult{}), fieldNameMap, validators) +} + +func AllClusterGroupStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cluster_id"] = "ClusterId" + fields["groups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ClusterGroupStatusBindingType), reflect.TypeOf([]ClusterGroupStatus{}))) + fieldNameMap["groups"] = "Groups" + fields["overall_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["overall_status"] = "OverallStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.all_cluster_group_status", fields, reflect.TypeOf(AllClusterGroupStatus{}), fieldNameMap, validators) +} + +func AllocatedServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allocation_details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["allocation_details"] = "AllocationDetails" + fields["high_availability_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["high_availability_status"] = "HighAvailabilityStatus" + fields["service_reference"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["service_reference"] = "ServiceReference" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.allocated_service", fields, reflect.TypeOf(AllocatedService{}), fieldNameMap, validators) +} + +func AllocationBasedOnFailureDomainBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["action_type"] = bindings.NewStringType() + fieldNameMap["action_type"] = "ActionType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.allocation_based_on_failure_domain", fields, reflect.TypeOf(AllocationBasedOnFailureDomain{}), fieldNameMap, validators) +} + +func AllocationIpAddressBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["allocation_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["allocation_id"] = "AllocationId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.allocation_ip_address", fields, reflect.TypeOf(AllocationIpAddress{}), fieldNameMap, validators) +} + +func AllocationIpAddressListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AllocationIpAddressBindingType), reflect.TypeOf([]AllocationIpAddress{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.allocation_ip_address_list_result", fields, reflect.TypeOf(AllocationIpAddressListResult{}), fieldNameMap, validators) +} + +func AllocationPoolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_service_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["active_service_count"] = "ActiveServiceCount" + fields["standby_service_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["standby_service_count"] = "StandbyServiceCount" + fields["sub_pools"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SubPoolBindingType), reflect.TypeOf([]SubPool{}))) + fieldNameMap["sub_pools"] = "SubPools" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.allocation_pool", fields, reflect.TypeOf(AllocationPool{}), fieldNameMap, validators) +} + +func AllocationRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["action"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(AllocationRuleActionBindingType)}, bindings.REST)) + fieldNameMap["action"] = "Action" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.allocation_rule", fields, reflect.TypeOf(AllocationRule{}), fieldNameMap, validators) +} + +func AllocationRuleActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["action_type"] = bindings.NewStringType() + fieldNameMap["action_type"] = "ActionType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.allocation_rule_action", fields, reflect.TypeOf(AllocationRuleAction{}), fieldNameMap, validators) +} + +func AntreaContainerClusterNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cluster_id"] = "ClusterId" + fields["nodes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["nodes"] = "Nodes" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.antrea_container_cluster_node", fields, reflect.TypeOf(AntreaContainerClusterNode{}), fieldNameMap, validators) +} + +func AntreaSupportBundleContainerNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["clusters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AntreaContainerClusterNodeBindingType), reflect.TypeOf([]AntreaContainerClusterNode{}))) + fieldNameMap["clusters"] = "Clusters" + fields["container_type"] = bindings.NewStringType() + fieldNameMap["container_type"] = "ContainerType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.antrea_support_bundle_container_node", fields, reflect.TypeOf(AntreaSupportBundleContainerNode{}), fieldNameMap, validators) +} + +func AphInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["address"] = "Address" + fields["certificate"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["certificate"] = "Certificate" + fields["fqdn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["fqdn"] = "Fqdn" + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["use_fqdn"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["use_fqdn"] = "UseFqdn" + fields["uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uuid"] = "Uuid" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.aph_info", fields, reflect.TypeOf(AphInfo{}), fieldNameMap, validators) +} + +func ApiErrorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["details"] = "Details" + fields["error_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["error_code"] = "ErrorCode" + fields["error_data"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["error_data"] = "ErrorData" + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["module_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["module_name"] = "ModuleName" + fields["related_errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RelatedApiErrorBindingType), reflect.TypeOf([]RelatedApiError{}))) + fieldNameMap["related_errors"] = "RelatedErrors" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.api_error", fields, reflect.TypeOf(ApiError{}), fieldNameMap, validators) +} + +func ApiServiceConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["basic_authentication_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["basic_authentication_enabled"] = "BasicAuthenticationEnabled" + fields["cipher_suites"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(CipherSuiteBindingType), reflect.TypeOf([]CipherSuite{}))) + fieldNameMap["cipher_suites"] = "CipherSuites" + fields["client_api_concurrency_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["client_api_concurrency_limit"] = "ClientApiConcurrencyLimit" + fields["client_api_rate_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["client_api_rate_limit"] = "ClientApiRateLimit" + fields["connection_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["connection_timeout"] = "ConnectionTimeout" + fields["cookie_based_authentication_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["cookie_based_authentication_enabled"] = "CookieBasedAuthenticationEnabled" + fields["global_api_concurrency_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["global_api_concurrency_limit"] = "GlobalApiConcurrencyLimit" + fields["lockout_immune_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["lockout_immune_addresses"] = "LockoutImmuneAddresses" + fields["protocol_versions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ProtocolVersionBindingType), reflect.TypeOf([]ProtocolVersion{}))) + fieldNameMap["protocol_versions"] = "ProtocolVersions" + fields["redirect_host"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["redirect_host"] = "RedirectHost" + fields["session_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["session_timeout"] = "SessionTimeout" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.api_service_config", fields, reflect.TypeOf(ApiServiceConfig{}), fieldNameMap, validators) +} + +func ApplianceLatencyDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["latency_data"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ApplianceLatencyDataItemBindingType), reflect.TypeOf([]ApplianceLatencyDataItem{}))) + fieldNameMap["latency_data"] = "LatencyData" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.appliance_latency_data", fields, reflect.TypeOf(ApplianceLatencyData{}), fieldNameMap, validators) +} + +func ApplianceLatencyDataItemBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["destination_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["destination_node_id"] = "DestinationNodeId" + fields["destination_node_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["destination_node_ip"] = "DestinationNodeIp" + fields["destination_node_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["destination_node_name"] = "DestinationNodeName" + fields["packet_loss_percent"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["packet_loss_percent"] = "PacketLossPercent" + fields["packet_received"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["packet_received"] = "PacketReceived" + fields["packet_transmitted"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["packet_transmitted"] = "PacketTransmitted" + fields["rtt_avg"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["rtt_avg"] = "RttAvg" + fields["rtt_max"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["rtt_max"] = "RttMax" + fields["rtt_mdev"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["rtt_mdev"] = "RttMdev" + fields["rtt_min"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["rtt_min"] = "RttMin" + fields["source_node_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_node_ip"] = "SourceNodeIp" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["total_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_time"] = "TotalTime" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.appliance_latency_data_item", fields, reflect.TypeOf(ApplianceLatencyDataItem{}), fieldNameMap, validators) +} + +func ApplianceLatencyListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ApplianceLatencyDataBindingType), reflect.TypeOf([]ApplianceLatencyData{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.appliance_latency_list_result", fields, reflect.TypeOf(ApplianceLatencyListResult{}), fieldNameMap, validators) +} + +func ApplianceManagementTaskListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ApplianceManagementTaskPropertiesBindingType), reflect.TypeOf([]ApplianceManagementTaskProperties{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.appliance_management_task_list_result", fields, reflect.TypeOf(ApplianceManagementTaskListResult{}), fieldNameMap, validators) +} + +func ApplianceManagementTaskPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["async_response_available"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["async_response_available"] = "AsyncResponseAvailable" + fields["cancelable"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["cancelable"] = "Cancelable" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["details"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["details"] = "Details" + fields["end_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["end_time"] = "EndTime" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["message"] = "Message" + fields["progress"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["progress"] = "Progress" + fields["request_method"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_method"] = "RequestMethod" + fields["request_uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_uri"] = "RequestUri" + fields["start_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["start_time"] = "StartTime" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["user"] = "User" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.appliance_management_task_properties", fields, reflect.TypeOf(ApplianceManagementTaskProperties{}), fieldNameMap, validators) +} + +func ApplianceProcessDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["top_process_by_cpu_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["top_process_by_cpu_count"] = "TopProcessByCpuCount" + fields["top_process_by_cpu_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ProcessInformationBindingType), reflect.TypeOf([]ProcessInformation{}))) + fieldNameMap["top_process_by_cpu_list"] = "TopProcessByCpuList" + fields["top_process_by_mem_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["top_process_by_mem_count"] = "TopProcessByMemCount" + fields["top_process_by_mem_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ProcessInformationBindingType), reflect.TypeOf([]ProcessInformation{}))) + fieldNameMap["top_process_by_mem_list"] = "TopProcessByMemList" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.appliance_process_data", fields, reflect.TypeOf(ApplianceProcessData{}), fieldNameMap, validators) +} + +func ApplianceProcessListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ApplianceProcessDataBindingType), reflect.TypeOf([]ApplianceProcessData{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.appliance_process_list_result", fields, reflect.TypeOf(ApplianceProcessListResult{}), fieldNameMap, validators) +} + +func AppliedTosBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["logical_ports"] = "LogicalPorts" + fields["logical_switches"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["logical_switches"] = "LogicalSwitches" + fields["nsgroups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["nsgroups"] = "Nsgroups" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.applied_tos", fields, reflect.TypeOf(AppliedTos{}), fieldNameMap, validators) +} + +func ArpHeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dst_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_ip"] = "DstIp" + fields["op_code"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["op_code"] = "OpCode" + fields["src_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["src_ip"] = "SrcIp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.arp_header", fields, reflect.TypeOf(ArpHeader{}), fieldNameMap, validators) +} + +func AssignedByDhcpBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.assigned_by_dhcp", fields, reflect.TypeOf(AssignedByDhcp{}), fieldNameMap, validators) +} + +func AssociationListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.association_list_result", fields, reflect.TypeOf(AssociationListResult{}), fieldNameMap, validators) +} + +func AttachedInterfaceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["app_intf_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["app_intf_name"] = "AppIntfName" + fields["default_gateway"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["default_gateway"] = "DefaultGateway" + fields["migrate_intf"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["migrate_intf"] = "MigrateIntf" + fields["routing_table"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["routing_table"] = "RoutingTable" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.attached_interface", fields, reflect.TypeOf(AttachedInterface{}), fieldNameMap, validators) +} + +func AttachmentContextBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allocate_addresses"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["allocate_addresses"] = "AllocateAddresses" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.attachment_context", fields, reflect.TypeOf(AttachmentContext{}), fieldNameMap, validators) +} + +func AttributeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["attribute_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["attribute_type"] = "AttributeType" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key"] = "Key" + fields["read_only"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["read_only"] = "ReadOnly" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.attribute", fields, reflect.TypeOf(Attribute{}), fieldNameMap, validators) +} + +func AuditLogBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["appname"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["appname"] = "Appname" + fields["facility"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["facility"] = "Facility" + fields["full_log"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["full_log"] = "FullLog" + fields["hostname"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["hostname"] = "Hostname" + fields["message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["message"] = "Message" + fields["msgid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["msgid"] = "Msgid" + fields["priority"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["priority"] = "Priority" + fields["procid"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["procid"] = "Procid" + fields["struct_data"] = bindings.NewOptionalType(bindings.NewReferenceType(StructuredDataBindingType)) + fieldNameMap["struct_data"] = "StructData" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["timestamp"] = "Timestamp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.audit_log", fields, reflect.TypeOf(AuditLog{}), fieldNameMap, validators) +} + +func AuditLogListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["last_full_sync_timestamp"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["last_full_sync_timestamp"] = "LastFullSyncTimestamp" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AuditLogBindingType), reflect.TypeOf([]AuditLog{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.audit_log_list_result", fields, reflect.TypeOf(AuditLogListResult{}), fieldNameMap, validators) +} + +func AuditLogRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["log_age_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["log_age_limit"] = "LogAgeLimit" + fields["log_filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["log_filter"] = "LogFilter" + fields["log_filter_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["log_filter_type"] = "LogFilterType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.audit_log_request", fields, reflect.TypeOf(AuditLogRequest{}), fieldNameMap, validators) +} + +func AuthenticationPolicyPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["api_failed_auth_lockout_period"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["api_failed_auth_lockout_period"] = "ApiFailedAuthLockoutPeriod" + fields["api_failed_auth_reset_period"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["api_failed_auth_reset_period"] = "ApiFailedAuthResetPeriod" + fields["api_max_auth_failures"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["api_max_auth_failures"] = "ApiMaxAuthFailures" + fields["cli_failed_auth_lockout_period"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cli_failed_auth_lockout_period"] = "CliFailedAuthLockoutPeriod" + fields["cli_max_auth_failures"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cli_max_auth_failures"] = "CliMaxAuthFailures" + fields["minimum_password_length"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["minimum_password_length"] = "MinimumPasswordLength" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.authentication_policy_properties", fields, reflect.TypeOf(AuthenticationPolicyProperties{}), fieldNameMap, validators) +} + +func AuthenticationSchemeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["scheme_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scheme_name"] = "SchemeName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.authentication_scheme", fields, reflect.TypeOf(AuthenticationScheme{}), fieldNameMap, validators) +} + +func AutomaticHealthCheckBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["result"] = bindings.NewOptionalType(bindings.NewReferenceType(HealthCheckResultBindingType)) + fieldNameMap["result"] = "Result" + fields["transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_zone_id"] = "TransportZoneId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.automatic_health_check", fields, reflect.TypeOf(AutomaticHealthCheck{}), fieldNameMap, validators) +} + +func AutomaticHealthCheckListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AutomaticHealthCheckBindingType), reflect.TypeOf([]AutomaticHealthCheck{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.automatic_health_check_list_result", fields, reflect.TypeOf(AutomaticHealthCheckListResult{}), fieldNameMap, validators) +} + +func AutomaticHealthCheckToggleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.automatic_health_check_toggle", fields, reflect.TypeOf(AutomaticHealthCheckToggle{}), fieldNameMap, validators) +} + +func AviEndPointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["avi_endpoint_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["avi_endpoint_ip"] = "AviEndpointIp" + fields["avi_endpoint_password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["avi_endpoint_password"] = "AviEndpointPassword" + fields["avi_endpoint_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["avi_endpoint_port"] = "AviEndpointPort" + fields["avi_endpoint_username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["avi_endpoint_username"] = "AviEndpointUsername" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.avi_end_point", fields, reflect.TypeOf(AviEndPoint{}), fieldNameMap, validators) +} + +func AxesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["x_label"] = bindings.NewOptionalType(bindings.NewReferenceType(LabelBindingType)) + fieldNameMap["x_label"] = "XLabel" + fields["x_labels"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LabelBindingType), reflect.TypeOf([]Label{}))) + fieldNameMap["x_labels"] = "XLabels" + fields["y_axis_unit_labels"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LabelBindingType), reflect.TypeOf([]Label{}))) + fieldNameMap["y_axis_unit_labels"] = "YAxisUnitLabels" + fields["y_axis_units"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AxisUnitBindingType), reflect.TypeOf([]AxisUnit{}))) + fieldNameMap["y_axis_units"] = "YAxisUnits" + fields["y_label"] = bindings.NewOptionalType(bindings.NewReferenceType(LabelBindingType)) + fieldNameMap["y_label"] = "YLabel" + fields["y_labels"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LabelBindingType), reflect.TypeOf([]Label{}))) + fieldNameMap["y_labels"] = "YLabels" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.axes", fields, reflect.TypeOf(Axes{}), fieldNameMap, validators) +} + +func AxisUnitBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["unit"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unit"] = "Unit" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.axis_unit", fields, reflect.TypeOf(AxisUnit{}), fieldNameMap, validators) +} + +func BFDDiagnosticCountBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["administratively_down_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["administratively_down_count"] = "AdministrativelyDownCount" + fields["concatenated_path_down_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["concatenated_path_down_count"] = "ConcatenatedPathDownCount" + fields["control_detection_time_expired_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["control_detection_time_expired_count"] = "ControlDetectionTimeExpiredCount" + fields["echo_function_failed_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["echo_function_failed_count"] = "EchoFunctionFailedCount" + fields["forwarding_plane_reset_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["forwarding_plane_reset_count"] = "ForwardingPlaneResetCount" + fields["neighbor_signaled_session_down_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["neighbor_signaled_session_down_count"] = "NeighborSignaledSessionDownCount" + fields["no_diagnostic_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["no_diagnostic_count"] = "NoDiagnosticCount" + fields["path_down_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["path_down_count"] = "PathDownCount" + fields["reverse_concatenated_path_down_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["reverse_concatenated_path_down_count"] = "ReverseConcatenatedPathDownCount" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.BFD_diagnostic_count", fields, reflect.TypeOf(BFDDiagnosticCount{}), fieldNameMap, validators) +} + +func BFDPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["active"] = "Active" + fields["diagnostic"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["diagnostic"] = "Diagnostic" + fields["forwarding"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["forwarding"] = "Forwarding" + fields["remote_diagnostic"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["remote_diagnostic"] = "RemoteDiagnostic" + fields["remote_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["remote_state"] = "RemoteState" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.BFD_properties", fields, reflect.TypeOf(BFDProperties{}), fieldNameMap, validators) +} + +func BFDStatusCountBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bfd_admin_down_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bfd_admin_down_count"] = "BfdAdminDownCount" + fields["bfd_down_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bfd_down_count"] = "BfdDownCount" + fields["bfd_init_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bfd_init_count"] = "BfdInitCount" + fields["bfd_up_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bfd_up_count"] = "BfdUpCount" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.BFD_status_count", fields, reflect.TypeOf(BFDStatusCount{}), fieldNameMap, validators) +} + +func BGPCommunityListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["communities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["communities"] = "Communities" + fields["community_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["community_type"] = "CommunityType" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.BGP_community_list", fields, reflect.TypeOf(BGPCommunityList{}), fieldNameMap, validators) +} + +func BGPCommunityListListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BGPCommunityListBindingType), reflect.TypeOf([]BGPCommunityList{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.BGP_community_list_list_result", fields, reflect.TypeOf(BGPCommunityListListResult{}), fieldNameMap, validators) +} + +func BackupConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["after_inventory_update_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["after_inventory_update_interval"] = "AfterInventoryUpdateInterval" + fields["backup_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["backup_enabled"] = "BackupEnabled" + fields["backup_schedule"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(BackupScheduleBindingType)}, bindings.REST)) + fieldNameMap["backup_schedule"] = "BackupSchedule" + fields["inventory_summary_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["inventory_summary_interval"] = "InventorySummaryInterval" + fields["passphrase"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["passphrase"] = "Passphrase" + fields["remote_file_server"] = bindings.NewOptionalType(bindings.NewReferenceType(RemoteFileServerBindingType)) + fieldNameMap["remote_file_server"] = "RemoteFileServer" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.backup_configuration", fields, reflect.TypeOf(BackupConfiguration{}), fieldNameMap, validators) +} + +func BackupOperationHistoryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cluster_backup_statuses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BackupOperationStatusBindingType), reflect.TypeOf([]BackupOperationStatus{}))) + fieldNameMap["cluster_backup_statuses"] = "ClusterBackupStatuses" + fields["inventory_backup_statuses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BackupOperationStatusBindingType), reflect.TypeOf([]BackupOperationStatus{}))) + fieldNameMap["inventory_backup_statuses"] = "InventoryBackupStatuses" + fields["node_backup_statuses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BackupOperationStatusBindingType), reflect.TypeOf([]BackupOperationStatus{}))) + fieldNameMap["node_backup_statuses"] = "NodeBackupStatuses" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.backup_operation_history", fields, reflect.TypeOf(BackupOperationHistory{}), fieldNameMap, validators) +} + +func BackupOperationStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["backup_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["backup_id"] = "BackupId" + fields["end_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["end_time"] = "EndTime" + fields["error_code"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_code"] = "ErrorCode" + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["start_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["start_time"] = "StartTime" + fields["success"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["success"] = "Success" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.backup_operation_status", fields, reflect.TypeOf(BackupOperationStatus{}), fieldNameMap, validators) +} + +func BackupOverviewBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ClusterBackupInfoBindingType), reflect.TypeOf([]ClusterBackupInfo{}))) + fieldNameMap["results"] = "Results" + fields["backup_config"] = bindings.NewOptionalType(bindings.NewReferenceType(BackupConfigurationBindingType)) + fieldNameMap["backup_config"] = "BackupConfig" + fields["backup_operation_history"] = bindings.NewOptionalType(bindings.NewReferenceType(BackupOperationHistoryBindingType)) + fieldNameMap["backup_operation_history"] = "BackupOperationHistory" + fields["current_backup_operation_status"] = bindings.NewOptionalType(bindings.NewReferenceType(CurrentBackupOperationStatusBindingType)) + fieldNameMap["current_backup_operation_status"] = "CurrentBackupOperationStatus" + fields["restore_status"] = bindings.NewOptionalType(bindings.NewReferenceType(ClusterRestoreStatusBindingType)) + fieldNameMap["restore_status"] = "RestoreStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.backup_overview", fields, reflect.TypeOf(BackupOverview{}), fieldNameMap, validators) +} + +func BackupScheduleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.backup_schedule", fields, reflect.TypeOf(BackupSchedule{}), fieldNameMap, validators) +} + +func BackupUiFramesInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_gm"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["active_gm"] = "ActiveGm" + fields["api_endpoint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["api_endpoint"] = "ApiEndpoint" + fields["frame_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["frame_type"] = "FrameType" + fields["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_id"] = "SiteId" + fields["site_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_version"] = "SiteVersion" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.backup_ui_frames_info", fields, reflect.TypeOf(BackupUiFramesInfo{}), fieldNameMap, validators) +} + +func BackupUiFramesInfoListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["backup_frames_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BackupUiFramesInfoBindingType), reflect.TypeOf([]BackupUiFramesInfo{}))) + fieldNameMap["backup_frames_list"] = "BackupFramesList" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.backup_ui_frames_info_list", fields, reflect.TypeOf(BackupUiFramesInfoList{}), fieldNameMap, validators) +} + +func BaseFirewallProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.base_firewall_profile", fields, reflect.TypeOf(BaseFirewallProfile{}), fieldNameMap, validators) +} + +func BaseHostSwitchProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["required_capabilities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["required_capabilities"] = "RequiredCapabilities" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.base_host_switch_profile", fields, reflect.TypeOf(BaseHostSwitchProfile{}), fieldNameMap, validators) +} + +func BaseNodeAggregateInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["node_interface_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeInterfacePropertiesBindingType), reflect.TypeOf([]NodeInterfaceProperties{}))) + fieldNameMap["node_interface_properties"] = "NodeInterfaceProperties" + fields["node_interface_statistics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeInterfaceStatisticsPropertiesBindingType), reflect.TypeOf([]NodeInterfaceStatisticsProperties{}))) + fieldNameMap["node_interface_statistics"] = "NodeInterfaceStatistics" + fields["node_status"] = bindings.NewOptionalType(bindings.NewReferenceType(ClusterNodeStatusBindingType)) + fieldNameMap["node_status"] = "NodeStatus" + fields["node_status_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeStatusPropertiesBindingType), reflect.TypeOf([]NodeStatusProperties{}))) + fieldNameMap["node_status_properties"] = "NodeStatusProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.base_node_aggregate_info", fields, reflect.TypeOf(BaseNodeAggregateInfo{}), fieldNameMap, validators) +} + +func BasePktCapResourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.base_pkt_cap_resource", fields, reflect.TypeOf(BasePktCapResource{}), fieldNameMap, validators) +} + +func BaseServiceInstanceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["on_failure_policy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["on_failure_policy"] = "OnFailurePolicy" + fields["service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fields["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_type"] = "TransportType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.base_service_instance", fields, reflect.TypeOf(BaseServiceInstance{}), fieldNameMap, validators) +} + +func BaseServiceProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.base_service_profile", fields, reflect.TypeOf(BaseServiceProfile{}), fieldNameMap, validators) +} + +func BaseSwitchingProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["required_capabilities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["required_capabilities"] = "RequiredCapabilities" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.base_switching_profile", fields, reflect.TypeOf(BaseSwitchingProfile{}), fieldNameMap, validators) +} + +func BasicAuthenticationSchemeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["scheme_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scheme_name"] = "SchemeName" + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["username"] = "Username" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.basic_authentication_scheme", fields, reflect.TypeOf(BasicAuthenticationScheme{}), fieldNameMap, validators) +} + +func BatchRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["continue_on_error"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["continue_on_error"] = "ContinueOnError" + fields["requests"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BatchRequestItemBindingType), reflect.TypeOf([]BatchRequestItem{}))) + fieldNameMap["requests"] = "Requests" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.batch_request", fields, reflect.TypeOf(BatchRequest{}), fieldNameMap, validators) +} + +func BatchRequestItemBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["body"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["body"] = "Body" + fields["method"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["method"] = "Method" + fields["uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uri"] = "Uri" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.batch_request_item", fields, reflect.TypeOf(BatchRequestItem{}), fieldNameMap, validators) +} + +func BatchResponseBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["has_errors"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["has_errors"] = "HasErrors" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BatchResponseItemBindingType), reflect.TypeOf([]BatchResponseItem{}))) + fieldNameMap["results"] = "Results" + fields["rolled_back"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["rolled_back"] = "RolledBack" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.batch_response", fields, reflect.TypeOf(BatchResponse{}), fieldNameMap, validators) +} + +func BatchResponseItemBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["body"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["body"] = "Body" + fields["code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["code"] = "Code" + fields["headers"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["headers"] = "Headers" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.batch_response_item", fields, reflect.TypeOf(BatchResponseItem{}), fieldNameMap, validators) +} + +func BfdConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["declare_dead_multiple"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["declare_dead_multiple"] = "DeclareDeadMultiple" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["receive_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["receive_interval"] = "ReceiveInterval" + fields["transmit_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["transmit_interval"] = "TransmitInterval" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bfd_config", fields, reflect.TypeOf(BfdConfig{}), fieldNameMap, validators) +} + +func BfdConfigParametersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["declare_dead_multiple"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["declare_dead_multiple"] = "DeclareDeadMultiple" + fields["receive_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["receive_interval"] = "ReceiveInterval" + fields["transmit_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["transmit_interval"] = "TransmitInterval" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bfd_config_parameters", fields, reflect.TypeOf(BfdConfigParameters{}), fieldNameMap, validators) +} + +func BfdHealthMonitoringProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["latency_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["latency_enabled"] = "LatencyEnabled" + fields["probe_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["probe_interval"] = "ProbeInterval" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bfd_health_monitoring_profile", fields, reflect.TypeOf(BfdHealthMonitoringProfile{}), fieldNameMap, validators) +} + +func BgpAddressFamilyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["in_prefix_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["in_prefix_count"] = "InPrefixCount" + fields["out_prefix_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["out_prefix_count"] = "OutPrefixCount" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bgp_address_family", fields, reflect.TypeOf(BgpAddressFamily{}), fieldNameMap, validators) +} + +func BgpConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["as_num"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["as_num"] = "AsNum" + fields["as_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["as_number"] = "AsNumber" + fields["ecmp"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ecmp"] = "Ecmp" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["graceful_restart"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["graceful_restart"] = "GracefulRestart" + fields["graceful_restart_config"] = bindings.NewOptionalType(bindings.NewReferenceType(GracefulRestartConfigBindingType)) + fieldNameMap["graceful_restart_config"] = "GracefulRestartConfig" + fields["inter_sr_ibgp"] = bindings.NewOptionalType(bindings.NewReferenceType(InterSRRoutingConfigBindingType)) + fieldNameMap["inter_sr_ibgp"] = "InterSrIbgp" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["multipath_relax"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["multipath_relax"] = "MultipathRelax" + fields["route_aggregation"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BgpRouteAggregationBindingType), reflect.TypeOf([]BgpRouteAggregation{}))) + fieldNameMap["route_aggregation"] = "RouteAggregation" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bgp_config", fields, reflect.TypeOf(BgpConfig{}), fieldNameMap, validators) +} + +func BgpNeighborBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["address_families"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BgpNeighborAddressFamilyBindingType), reflect.TypeOf([]BgpNeighborAddressFamily{}))) + fieldNameMap["address_families"] = "AddressFamilies" + fields["allow_as_in"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["allow_as_in"] = "AllowAsIn" + fields["bfd_config"] = bindings.NewOptionalType(bindings.NewReferenceType(BfdConfigParametersBindingType)) + fieldNameMap["bfd_config"] = "BfdConfig" + fields["enable_bfd"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_bfd"] = "EnableBfd" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["filter_in_ipprefixlist_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter_in_ipprefixlist_id"] = "FilterInIpprefixlistId" + fields["filter_in_routemap_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter_in_routemap_id"] = "FilterInRoutemapId" + fields["filter_out_ipprefixlist_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter_out_ipprefixlist_id"] = "FilterOutIpprefixlistId" + fields["filter_out_routemap_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter_out_routemap_id"] = "FilterOutRoutemapId" + fields["graceful_restart_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["graceful_restart_mode"] = "GracefulRestartMode" + fields["hold_down_timer"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["hold_down_timer"] = "HoldDownTimer" + fields["keep_alive_timer"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["keep_alive_timer"] = "KeepAliveTimer" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["maximum_hop_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["maximum_hop_limit"] = "MaximumHopLimit" + fields["neighbor_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["neighbor_address"] = "NeighborAddress" + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["remote_as"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["remote_as"] = "RemoteAs" + fields["remote_as_num"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["remote_as_num"] = "RemoteAsNum" + fields["source_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_address"] = "SourceAddress" + fields["source_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["source_addresses"] = "SourceAddresses" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bgp_neighbor", fields, reflect.TypeOf(BgpNeighbor{}), fieldNameMap, validators) +} + +func BgpNeighborAddressFamilyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["in_filter_ipprefixlist_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["in_filter_ipprefixlist_id"] = "InFilterIpprefixlistId" + fields["in_filter_routemap_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["in_filter_routemap_id"] = "InFilterRoutemapId" + fields["maximum_routes"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["maximum_routes"] = "MaximumRoutes" + fields["out_filter_ipprefixlist_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["out_filter_ipprefixlist_id"] = "OutFilterIpprefixlistId" + fields["out_filter_routemap_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["out_filter_routemap_id"] = "OutFilterRoutemapId" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bgp_neighbor_address_family", fields, reflect.TypeOf(BgpNeighborAddressFamily{}), fieldNameMap, validators) +} + +func BgpNeighborListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BgpNeighborBindingType), reflect.TypeOf([]BgpNeighbor{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bgp_neighbor_list_result", fields, reflect.TypeOf(BgpNeighborListResult{}), fieldNameMap, validators) +} + +func BgpNeighborRouteDetailsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["neighbor_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["neighbor_address"] = "NeighborAddress" + fields["neighbor_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["neighbor_id"] = "NeighborId" + fields["per_transport_node_routes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RoutesPerTransportNodeBindingType), reflect.TypeOf([]RoutesPerTransportNode{}))) + fieldNameMap["per_transport_node_routes"] = "PerTransportNodeRoutes" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bgp_neighbor_route_details", fields, reflect.TypeOf(BgpNeighborRouteDetails{}), fieldNameMap, validators) +} + +func BgpNeighborRouteDetailsCsvRecordBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["as_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["as_path"] = "AsPath" + fields["local_pref"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["local_pref"] = "LocalPref" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["med"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["med"] = "Med" + fields["neighbor_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["neighbor_address"] = "NeighborAddress" + fields["neighbor_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["neighbor_id"] = "NeighborId" + fields["network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network"] = "Network" + fields["next_hop"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["next_hop"] = "NextHop" + fields["source_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_address"] = "SourceAddress" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bgp_neighbor_route_details_csv_record", fields, reflect.TypeOf(BgpNeighborRouteDetailsCsvRecord{}), fieldNameMap, validators) +} + +func BgpNeighborRouteDetailsInCsvFormatBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_name"] = "FileName" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BgpNeighborRouteDetailsCsvRecordBindingType), reflect.TypeOf([]BgpNeighborRouteDetailsCsvRecord{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bgp_neighbor_route_details_in_csv_format", fields, reflect.TypeOf(BgpNeighborRouteDetailsInCsvFormat{}), fieldNameMap, validators) +} + +func BgpNeighborStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["address_families"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BgpAddressFamilyBindingType), reflect.TypeOf([]BgpAddressFamily{}))) + fieldNameMap["address_families"] = "AddressFamilies" + fields["announced_capabilities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["announced_capabilities"] = "AnnouncedCapabilities" + fields["connection_drop_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["connection_drop_count"] = "ConnectionDropCount" + fields["connection_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connection_state"] = "ConnectionState" + fields["established_connection_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["established_connection_count"] = "EstablishedConnectionCount" + fields["graceful_restart"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["graceful_restart"] = "GracefulRestart" + fields["graceful_restart_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["graceful_restart_mode"] = "GracefulRestartMode" + fields["hold_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["hold_time"] = "HoldTime" + fields["keep_alive_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["keep_alive_interval"] = "KeepAliveInterval" + fields["local_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["local_port"] = "LocalPort" + fields["lr_component_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lr_component_id"] = "LrComponentId" + fields["messages_received"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["messages_received"] = "MessagesReceived" + fields["messages_sent"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["messages_sent"] = "MessagesSent" + fields["negotiated_capability"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["negotiated_capability"] = "NegotiatedCapability" + fields["neighbor_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["neighbor_address"] = "NeighborAddress" + fields["neighbor_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["neighbor_router_id"] = "NeighborRouterId" + fields["remote_as_number"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["remote_as_number"] = "RemoteAsNumber" + fields["remote_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["remote_port"] = "RemotePort" + fields["remote_site"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["remote_site"] = "RemoteSite" + fields["source_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_address"] = "SourceAddress" + fields["time_since_established"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["time_since_established"] = "TimeSinceEstablished" + fields["total_in_prefix_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_in_prefix_count"] = "TotalInPrefixCount" + fields["total_out_prefix_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_out_prefix_count"] = "TotalOutPrefixCount" + fields["transport_node"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["transport_node"] = "TransportNode" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bgp_neighbor_status", fields, reflect.TypeOf(BgpNeighborStatus{}), fieldNameMap, validators) +} + +func BgpNeighborStatusLiteDtoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["connection_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connection_state"] = "ConnectionState" + fields["neighbor_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["neighbor_address"] = "NeighborAddress" + fields["remote_site"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["remote_site"] = "RemoteSite" + fields["source_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_address"] = "SourceAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bgp_neighbor_status_lite_dto", fields, reflect.TypeOf(BgpNeighborStatusLiteDto{}), fieldNameMap, validators) +} + +func BgpNeighborsStatusListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["logical_router_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_name"] = "LogicalRouterName" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BgpNeighborStatusBindingType), reflect.TypeOf([]BgpNeighborStatus{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bgp_neighbors_status_list_result", fields, reflect.TypeOf(BgpNeighborsStatusListResult{}), fieldNameMap, validators) +} + +func BgpRouteAggregationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["prefix"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["prefix"] = "Prefix" + fields["summary_only"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["summary_only"] = "SummaryOnly" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bgp_route_aggregation", fields, reflect.TypeOf(BgpRouteAggregation{}), fieldNameMap, validators) +} + +func BinaryPacketDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["payload"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["payload"] = "Payload" + fields["frame_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["frame_size"] = "FrameSize" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["routed"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["routed"] = "Routed" + fields["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_type"] = "TransportType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.binary_packet_data", fields, reflect.TypeOf(BinaryPacketData{}), fieldNameMap, validators) +} + +func BpduFilterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["white_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["white_list"] = "WhiteList" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bpdu_filter", fields, reflect.TypeOf(BpduFilter{}), fieldNameMap, validators) +} + +func BridgeEndpointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["bridge_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["bridge_cluster_id"] = "BridgeClusterId" + fields["bridge_endpoint_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["bridge_endpoint_profile_id"] = "BridgeEndpointProfileId" + fields["ha_enable"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ha_enable"] = "HaEnable" + fields["uplink_teaming_policy_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uplink_teaming_policy_name"] = "UplinkTeamingPolicyName" + fields["vlan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vlan"] = "Vlan" + fields["vlan_transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vlan_transport_zone_id"] = "VlanTransportZoneId" + fields["vlan_trunk_spec"] = bindings.NewOptionalType(bindings.NewReferenceType(VlanTrunkSpecBindingType)) + fieldNameMap["vlan_trunk_spec"] = "VlanTrunkSpec" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bridge_endpoint", fields, reflect.TypeOf(BridgeEndpoint{}), fieldNameMap, validators) +} + +func BridgeEndpointListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BridgeEndpointBindingType), reflect.TypeOf([]BridgeEndpoint{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bridge_endpoint_list_result", fields, reflect.TypeOf(BridgeEndpointListResult{}), fieldNameMap, validators) +} + +func BridgeEndpointProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["edge_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + fields["edge_cluster_member_indexes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewIntegerType(), reflect.TypeOf([]int64{}))) + fieldNameMap["edge_cluster_member_indexes"] = "EdgeClusterMemberIndexes" + fields["failover_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failover_mode"] = "FailoverMode" + fields["high_availability_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["high_availability_mode"] = "HighAvailabilityMode" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bridge_endpoint_profile", fields, reflect.TypeOf(BridgeEndpointProfile{}), fieldNameMap, validators) +} + +func BridgeEndpointProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BridgeEndpointProfileBindingType), reflect.TypeOf([]BridgeEndpointProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bridge_endpoint_profile_list_result", fields, reflect.TypeOf(BridgeEndpointProfileListResult{}), fieldNameMap, validators) +} + +func BridgeEndpointStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["rx_bytes"] = "RxBytes" + fields["rx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["rx_packets"] = "RxPackets" + fields["tx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["tx_bytes"] = "TxBytes" + fields["tx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["tx_packets"] = "TxPackets" + fields["endpoint_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["endpoint_id"] = "EndpointId" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bridge_endpoint_statistics", fields, reflect.TypeOf(BridgeEndpointStatistics{}), fieldNameMap, validators) +} + +func BridgeEndpointStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_nodes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["active_nodes"] = "ActiveNodes" + fields["endpoint_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["endpoint_id"] = "EndpointId" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bridge_endpoint_status", fields, reflect.TypeOf(BridgeEndpointStatus{}), fieldNameMap, validators) +} + +func BridgeHighAvailabilityClusterProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bfd_probe_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bfd_probe_interval"] = "BfdProbeInterval" + fields["enable"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable"] = "Enable" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bridge_high_availability_cluster_profile", fields, reflect.TypeOf(BridgeHighAvailabilityClusterProfile{}), fieldNameMap, validators) +} + +func BrokerPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["BrokerFqdn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["BrokerFqdn"] = "BrokerFqdn" + fields["BrokerIpAddress"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["BrokerIpAddress"] = "BrokerIpAddress" + fields["BrokerIsMaster"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["BrokerIsMaster"] = "BrokerIsMaster" + fields["BrokerPort"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["BrokerPort"] = "BrokerPort" + fields["BrokerSslCertThumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["BrokerSslCertThumbprint"] = "BrokerSslCertThumbprint" + fields["BrokerVirtualHost"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["BrokerVirtualHost"] = "BrokerVirtualHost" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.broker_properties", fields, reflect.TypeOf(BrokerProperties{}), fieldNameMap, validators) +} + +func BundleIdBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bundle_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["bundle_id"] = "BundleId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bundle_id", fields, reflect.TypeOf(BundleId{}), fieldNameMap, validators) +} + +func BundleIdsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["failed"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failed"] = "Failed" + fields["in_progress"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["in_progress"] = "InProgress" + fields["successful"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["successful"] = "Successful" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bundle_ids", fields, reflect.TypeOf(BundleIds{}), fieldNameMap, validators) +} + +func BundleUploadPermissionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["reason"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["reason"] = "Reason" + fields["upload_allowed"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["upload_allowed"] = "UploadAllowed" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bundle_upload_permission", fields, reflect.TypeOf(BundleUploadPermission{}), fieldNameMap, validators) +} + +func BundleUploadStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bundle_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["bundle_name"] = "BundleName" + fields["detailed_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["detailed_status"] = "DetailedStatus" + fields["percent"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["percent"] = "Percent" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["url"] = "Url" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.bundle_upload_status", fields, reflect.TypeOf(BundleUploadStatus{}), fieldNameMap, validators) +} + +func ByodServiceInstanceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["deployment_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["deployment_mode"] = "DeploymentMode" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["on_failure_policy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["on_failure_policy"] = "OnFailurePolicy" + fields["service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fields["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_type"] = "TransportType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.byod_service_instance", fields, reflect.TypeOf(ByodServiceInstance{}), fieldNameMap, validators) +} + +func CCPUpgradeStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["can_rollback"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["can_rollback"] = "CanRollback" + fields["can_skip"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["can_skip"] = "CanSkip" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["current_version_node_summary"] = bindings.NewOptionalType(bindings.NewReferenceType(NodeSummaryListBindingType)) + fieldNameMap["current_version_node_summary"] = "CurrentVersionNodeSummary" + fields["details"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["details"] = "Details" + fields["node_count_at_target_version"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["node_count_at_target_version"] = "NodeCountAtTargetVersion" + fields["percent_complete"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["percent_complete"] = "PercentComplete" + fields["pre_upgrade_status"] = bindings.NewOptionalType(bindings.NewReferenceType(UpgradeChecksExecutionStatusBindingType)) + fieldNameMap["pre_upgrade_status"] = "PreUpgradeStatus" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["target_component_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_component_version"] = "TargetComponentVersion" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.CCP_upgrade_status", fields, reflect.TypeOf(CCPUpgradeStatus{}), fieldNameMap, validators) +} + +func CPUReservationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["reservation_in_mhz"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["reservation_in_mhz"] = "ReservationInMhz" + fields["reservation_in_shares"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["reservation_in_shares"] = "ReservationInShares" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.CPU_reservation", fields, reflect.TypeOf(CPUReservation{}), fieldNameMap, validators) +} + +func CallbackAuthenticationSchemeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["certificate_id"] = "CertificateId" + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["scheme_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scheme_name"] = "SchemeName" + fields["username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["username"] = "Username" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.callback_authentication_scheme", fields, reflect.TypeOf(CallbackAuthenticationScheme{}), fieldNameMap, validators) +} + +func CapacityDashboardUsageBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["current_usage_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["current_usage_count"] = "CurrentUsageCount" + fields["current_usage_percentage"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["current_usage_percentage"] = "CurrentUsagePercentage" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["max_supported_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_supported_count"] = "MaxSupportedCount" + fields["max_threshold_percentage"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["max_threshold_percentage"] = "MaxThresholdPercentage" + fields["min_threshold_percentage"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["min_threshold_percentage"] = "MinThresholdPercentage" + fields["severity"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["severity"] = "Severity" + fields["usage_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["usage_type"] = "UsageType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.capacity_dashboard_usage", fields, reflect.TypeOf(CapacityDashboardUsage{}), fieldNameMap, validators) +} + +func CapacityThresholdBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["max_threshold_percentage"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["max_threshold_percentage"] = "MaxThresholdPercentage" + fields["min_threshold_percentage"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["min_threshold_percentage"] = "MinThresholdPercentage" + fields["threshold_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["threshold_type"] = "ThresholdType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.capacity_threshold", fields, reflect.TypeOf(CapacityThreshold{}), fieldNameMap, validators) +} + +func CapacityThresholdListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["capacity_thresholds"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(CapacityThresholdBindingType), reflect.TypeOf([]CapacityThreshold{}))) + fieldNameMap["capacity_thresholds"] = "CapacityThresholds" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.capacity_threshold_list", fields, reflect.TypeOf(CapacityThresholdList{}), fieldNameMap, validators) +} + +func CapacityUsageBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["capacity_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["capacity_type"] = "CapacityType" + fields["usage_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["usage_count"] = "UsageCount" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.capacity_usage", fields, reflect.TypeOf(CapacityUsage{}), fieldNameMap, validators) +} + +func CapacityUsageMetaInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_updated_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_updated_timestamp"] = "LastUpdatedTimestamp" + fields["max_global_threshold_percentage"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["max_global_threshold_percentage"] = "MaxGlobalThresholdPercentage" + fields["min_global_threshold_percentage"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["min_global_threshold_percentage"] = "MinGlobalThresholdPercentage" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.capacity_usage_meta_info", fields, reflect.TypeOf(CapacityUsageMetaInfo{}), fieldNameMap, validators) +} + +func CapacityUsageResponseBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["capacity_usage"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(CapacityDashboardUsageBindingType), reflect.TypeOf([]CapacityDashboardUsage{}))) + fieldNameMap["capacity_usage"] = "CapacityUsage" + fields["meta_info"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["meta_info"] = "MetaInfo" + fields["unreported_usage_types"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["unreported_usage_types"] = "UnreportedUsageTypes" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.capacity_usage_response", fields, reflect.TypeOf(CapacityUsageResponse{}), fieldNameMap, validators) +} + +func CentralConfigPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["local_override"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["local_override"] = "LocalOverride" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.central_config_properties", fields, reflect.TypeOf(CentralConfigProperties{}), fieldNameMap, validators) +} + +func CentralNodeConfigProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["ntp"] = bindings.NewOptionalType(bindings.NewReferenceType(NtpPropertiesBindingType)) + fieldNameMap["ntp"] = "Ntp" + fields["snmp"] = bindings.NewOptionalType(bindings.NewReferenceType(SnmpPropertiesBindingType)) + fieldNameMap["snmp"] = "Snmp" + fields["syslog"] = bindings.NewOptionalType(bindings.NewReferenceType(SyslogPropertiesBindingType)) + fieldNameMap["syslog"] = "Syslog" + fields["timezone"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["timezone"] = "Timezone" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.central_node_config_profile", fields, reflect.TypeOf(CentralNodeConfigProfile{}), fieldNameMap, validators) +} + +func CentralNodeConfigProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(CentralNodeConfigProfileBindingType), reflect.TypeOf([]CentralNodeConfigProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.central_node_config_profile_list_result", fields, reflect.TypeOf(CentralNodeConfigProfileListResult{}), fieldNameMap, validators) +} + +func CertificateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(X509CertificateBindingType), reflect.TypeOf([]X509Certificate{}))) + fieldNameMap["details"] = "Details" + fields["has_private_key"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["has_private_key"] = "HasPrivateKey" + fields["pem_encoded"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pem_encoded"] = "PemEncoded" + fields["purpose"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["purpose"] = "Purpose" + fields["used_by"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeIdServicesMapBindingType), reflect.TypeOf([]NodeIdServicesMap{}))) + fieldNameMap["used_by"] = "UsedBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.certificate", fields, reflect.TypeOf(Certificate{}), fieldNameMap, validators) +} + +func CertificateCheckingStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.certificate_checking_status", fields, reflect.TypeOf(CertificateCheckingStatus{}), fieldNameMap, validators) +} + +func CertificateKeyPairBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate"] = bindings.NewOptionalType(bindings.NewReferenceType(SecurityCertificateBindingType)) + fieldNameMap["certificate"] = "Certificate" + fields["rsa_private_key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["rsa_private_key"] = "RsaPrivateKey" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.certificate_key_pair", fields, reflect.TypeOf(CertificateKeyPair{}), fieldNameMap, validators) +} + +func CertificateListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(CertificateBindingType), reflect.TypeOf([]Certificate{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.certificate_list", fields, reflect.TypeOf(CertificateList{}), fieldNameMap, validators) +} + +func CertificateProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cluster_certificate"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["cluster_certificate"] = "ClusterCertificate" + fields["extended_key_usage"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["extended_key_usage"] = "ExtendedKeyUsage" + fields["node_type"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["node_type"] = "NodeType" + fields["profile_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["profile_name"] = "ProfileName" + fields["service_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_type"] = "ServiceType" + fields["unique_use"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["unique_use"] = "UniqueUse" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.certificate_profile", fields, reflect.TypeOf(CertificateProfile{}), fieldNameMap, validators) +} + +func CertificateProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(CertificateProfileBindingType), reflect.TypeOf([]CertificateProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.certificate_profile_list_result", fields, reflect.TypeOf(CertificateProfileListResult{}), fieldNameMap, validators) +} + +func CipherSuiteBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cipher_suite", fields, reflect.TypeOf(CipherSuite{}), fieldNameMap, validators) +} + +func ClasslessStaticRouteBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network"] = "Network" + fields["next_hop"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["next_hop"] = "NextHop" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.classless_static_route", fields, reflect.TypeOf(ClasslessStaticRoute{}), fieldNameMap, validators) +} + +func ClientSslProfileBindingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate_chain_depth"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["certificate_chain_depth"] = "CertificateChainDepth" + fields["client_auth"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["client_auth"] = "ClientAuth" + fields["client_auth_ca_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["client_auth_ca_ids"] = "ClientAuthCaIds" + fields["client_auth_crl_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["client_auth_crl_ids"] = "ClientAuthCrlIds" + fields["default_certificate_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["default_certificate_id"] = "DefaultCertificateId" + fields["sni_certificate_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["sni_certificate_ids"] = "SniCertificateIds" + fields["ssl_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ssl_profile_id"] = "SslProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.client_ssl_profile_binding", fields, reflect.TypeOf(ClientSslProfileBinding{}), fieldNameMap, validators) +} + +func CloudNativeServiceInstanceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["service_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_type"] = "ServiceType" + fields["source"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["source"] = "Source" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredResourceScopeBindingType), reflect.TypeOf([]DiscoveredResourceScope{}))) + fieldNameMap["scope"] = "Scope" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cloud_native_service_instance", fields, reflect.TypeOf(CloudNativeServiceInstance{}), fieldNameMap, validators) +} + +func CloudNativeServiceInstanceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(CloudNativeServiceInstanceBindingType), reflect.TypeOf([]CloudNativeServiceInstance{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cloud_native_service_instance_list_result", fields, reflect.TypeOf(CloudNativeServiceInstanceListResult{}), fieldNameMap, validators) +} + +func ClusterBackupInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fields["restore_type"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["restore_type"] = "RestoreType" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_backup_info", fields, reflect.TypeOf(ClusterBackupInfo{}), fieldNameMap, validators) +} + +func ClusterBackupInfoListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ClusterBackupInfoBindingType), reflect.TypeOf([]ClusterBackupInfo{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_backup_info_list_result", fields, reflect.TypeOf(ClusterBackupInfoListResult{}), fieldNameMap, validators) +} + +func ClusterCertificateIdBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["certificate_id"] = "CertificateId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_certificate_id", fields, reflect.TypeOf(ClusterCertificateId{}), fieldNameMap, validators) +} + +func ClusterConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cluster_id"] = "ClusterId" + fields["control_cluster_changes_allowed"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["control_cluster_changes_allowed"] = "ControlClusterChangesAllowed" + fields["mgmt_cluster_changes_allowed"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["mgmt_cluster_changes_allowed"] = "MgmtClusterChangesAllowed" + fields["nodes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ClusterNodeInfoBindingType), reflect.TypeOf([]ClusterNodeInfo{}))) + fieldNameMap["nodes"] = "Nodes" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_config", fields, reflect.TypeOf(ClusterConfig{}), fieldNameMap, validators) +} + +func ClusterConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cluster_id"] = "ClusterId" + fields["config_version"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["config_version"] = "ConfigVersion" + fields["nodes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ClusterNodeBindingType), reflect.TypeOf([]ClusterNode{}))) + fieldNameMap["nodes"] = "Nodes" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_configuration", fields, reflect.TypeOf(ClusterConfiguration{}), fieldNameMap, validators) +} + +func ClusterGroupMemberStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["member_fqdn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["member_fqdn"] = "MemberFqdn" + fields["member_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["member_ip"] = "MemberIp" + fields["member_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["member_status"] = "MemberStatus" + fields["member_uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["member_uuid"] = "MemberUuid" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_group_member_status", fields, reflect.TypeOf(ClusterGroupMemberStatus{}), fieldNameMap, validators) +} + +func ClusterGroupServiceLeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["leader_uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["leader_uuid"] = "LeaderUuid" + fields["lease_version"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["lease_version"] = "LeaseVersion" + fields["service_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_name"] = "ServiceName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_group_service_leader", fields, reflect.TypeOf(ClusterGroupServiceLeader{}), fieldNameMap, validators) +} + +func ClusterGroupStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["group_id"] = "GroupId" + fields["group_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["group_status"] = "GroupStatus" + fields["group_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["group_type"] = "GroupType" + fields["leaders"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ClusterGroupServiceLeaderBindingType), reflect.TypeOf([]ClusterGroupServiceLeader{}))) + fieldNameMap["leaders"] = "Leaders" + fields["members"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ClusterGroupMemberStatusBindingType), reflect.TypeOf([]ClusterGroupMemberStatus{}))) + fieldNameMap["members"] = "Members" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_group_status", fields, reflect.TypeOf(ClusterGroupStatus{}), fieldNameMap, validators) +} + +func ClusterInitializationNodeInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["disk_store_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["disk_store_id"] = "DiskStoreId" + fields["host_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_address"] = "HostAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_initialization_node_info", fields, reflect.TypeOf(ClusterInitializationNodeInfo{}), fieldNameMap, validators) +} + +func ClusterNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["entities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ClusterNodeEntityBindingType), reflect.TypeOf([]ClusterNodeEntity{}))) + fieldNameMap["entities"] = "Entities" + fields["node_uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_uuid"] = "NodeUuid" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_node", fields, reflect.TypeOf(ClusterNode{}), fieldNameMap, validators) +} + +func ClusterNodeConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["appliance_mgmt_listen_addr"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["appliance_mgmt_listen_addr"] = "ApplianceMgmtListenAddr" + fields["controller_role"] = bindings.NewOptionalType(bindings.NewReferenceType(ControllerClusterRoleConfigBindingType)) + fieldNameMap["controller_role"] = "ControllerRole" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["manager_role"] = bindings.NewOptionalType(bindings.NewReferenceType(ManagementClusterRoleConfigBindingType)) + fieldNameMap["manager_role"] = "ManagerRole" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_node_config", fields, reflect.TypeOf(ClusterNodeConfig{}), fieldNameMap, validators) +} + +func ClusterNodeConfigListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ClusterNodeConfigBindingType), reflect.TypeOf([]ClusterNodeConfig{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_node_config_list_result", fields, reflect.TypeOf(ClusterNodeConfigListResult{}), fieldNameMap, validators) +} + +func ClusterNodeEntityBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["certificate"] = "Certificate" + fields["entity_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["entity_type"] = "EntityType" + fields["entity_uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["entity_uuid"] = "EntityUuid" + fields["fqdn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["fqdn"] = "Fqdn" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["subnet_prefix_length"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["subnet_prefix_length"] = "SubnetPrefixLength" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_node_entity", fields, reflect.TypeOf(ClusterNodeEntity{}), fieldNameMap, validators) +} + +func ClusterNodeInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["api_listen_addr"] = bindings.NewOptionalType(bindings.NewReferenceType(ServiceEndpointBindingType)) + fieldNameMap["api_listen_addr"] = "ApiListenAddr" + fields["appliance_connection_info"] = bindings.NewOptionalType(bindings.NewReferenceType(ServiceEndpointBindingType)) + fieldNameMap["appliance_connection_info"] = "ApplianceConnectionInfo" + fields["certificates"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeCertificateInfoBindingType), reflect.TypeOf([]NodeCertificateInfo{}))) + fieldNameMap["certificates"] = "Certificates" + fields["control_plane_listen_addr"] = bindings.NewOptionalType(bindings.NewReferenceType(ServiceEndpointBindingType)) + fieldNameMap["control_plane_listen_addr"] = "ControlPlaneListenAddr" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["entities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeEntityInfoBindingType), reflect.TypeOf([]NodeEntityInfo{}))) + fieldNameMap["entities"] = "Entities" + fields["fqdn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["fqdn"] = "Fqdn" + fields["msg_clients"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeMessagingClientInfoBindingType), reflect.TypeOf([]NodeMessagingClientInfo{}))) + fieldNameMap["msg_clients"] = "MsgClients" + fields["node_uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_uuid"] = "NodeUuid" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_node_info", fields, reflect.TypeOf(ClusterNodeInfo{}), fieldNameMap, validators) +} + +func ClusterNodeStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["control_cluster_status"] = bindings.NewOptionalType(bindings.NewReferenceType(ControlClusterNodeStatusBindingType)) + fieldNameMap["control_cluster_status"] = "ControlClusterStatus" + fields["mgmt_cluster_status"] = bindings.NewOptionalType(bindings.NewReferenceType(ManagementClusterNodeStatusBindingType)) + fieldNameMap["mgmt_cluster_status"] = "MgmtClusterStatus" + fields["system_status"] = bindings.NewOptionalType(bindings.NewReferenceType(NodeStatusPropertiesBindingType)) + fieldNameMap["system_status"] = "SystemStatus" + fields["version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["version"] = "Version" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_node_status", fields, reflect.TypeOf(ClusterNodeStatus{}), fieldNameMap, validators) +} + +func ClusterNodeVMDeploymentConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["placement_type"] = bindings.NewStringType() + fieldNameMap["placement_type"] = "PlacementType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_node_VM_deployment_config", fields, reflect.TypeOf(ClusterNodeVMDeploymentConfig{}), fieldNameMap, validators) +} + +func ClusterNodeVMDeploymentProgressStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["current_step_title"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["current_step_title"] = "CurrentStepTitle" + fields["progress"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["progress"] = "Progress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_node_VM_deployment_progress_state", fields, reflect.TypeOf(ClusterNodeVMDeploymentProgressState{}), fieldNameMap, validators) +} + +func ClusterNodeVMDeploymentRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["deployment_config"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ClusterNodeVMDeploymentConfigBindingType)}, bindings.REST)) + fieldNameMap["deployment_config"] = "DeploymentConfig" + fields["form_factor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["form_factor"] = "FormFactor" + fields["roles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["roles"] = "Roles" + fields["user_settings"] = bindings.NewOptionalType(bindings.NewReferenceType(NodeUserSettingsBindingType)) + fieldNameMap["user_settings"] = "UserSettings" + fields["vm_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vm_id"] = "VmId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_node_VM_deployment_request", fields, reflect.TypeOf(ClusterNodeVMDeploymentRequest{}), fieldNameMap, validators) +} + +func ClusterNodeVMDeploymentRequestListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ClusterNodeVMDeploymentRequestBindingType), reflect.TypeOf([]ClusterNodeVMDeploymentRequest{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_node_VM_deployment_request_list", fields, reflect.TypeOf(ClusterNodeVMDeploymentRequestList{}), fieldNameMap, validators) +} + +func ClusterNodeVMDeploymentStatusReportBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["deployment_progress_state"] = bindings.NewOptionalType(bindings.NewReferenceType(VMDeploymentProgressStateBindingType)) + fieldNameMap["deployment_progress_state"] = "DeploymentProgressState" + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_node_VM_deployment_status_report", fields, reflect.TypeOf(ClusterNodeVMDeploymentStatusReport{}), fieldNameMap, validators) +} + +func ClusterProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_profile", fields, reflect.TypeOf(ClusterProfile{}), fieldNameMap, validators) +} + +func ClusterProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ClusterProfileBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_profile_list_result", fields, reflect.TypeOf(ClusterProfileListResult{}), fieldNameMap, validators) +} + +func ClusterProfileTypeIdEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["profile_id"] = "ProfileId" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_profile_type_id_entry", fields, reflect.TypeOf(ClusterProfileTypeIdEntry{}), fieldNameMap, validators) +} + +func ClusterRestoreStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["backup_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["backup_timestamp"] = "BackupTimestamp" + fields["endpoints"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["endpoints"] = "Endpoints" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["instructions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(InstructionInfoBindingType), reflect.TypeOf([]InstructionInfo{}))) + fieldNameMap["instructions"] = "Instructions" + fields["not_allowed_actions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["not_allowed_actions"] = "NotAllowedActions" + fields["restore_end_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["restore_end_time"] = "RestoreEndTime" + fields["restore_start_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["restore_start_time"] = "RestoreStartTime" + fields["status"] = bindings.NewOptionalType(bindings.NewReferenceType(GlobalRestoreStatusBindingType)) + fieldNameMap["status"] = "Status" + fields["step"] = bindings.NewOptionalType(bindings.NewReferenceType(RestoreStepBindingType)) + fieldNameMap["step"] = "Step" + fields["total_steps"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_steps"] = "TotalSteps" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_restore_status", fields, reflect.TypeOf(ClusterRestoreStatus{}), fieldNameMap, validators) +} + +func ClusterRoleConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_role_config", fields, reflect.TypeOf(ClusterRoleConfig{}), fieldNameMap, validators) +} + +func ClusterStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cluster_id"] = "ClusterId" + fields["control_cluster_status"] = bindings.NewOptionalType(bindings.NewReferenceType(ControllerClusterStatusBindingType)) + fieldNameMap["control_cluster_status"] = "ControlClusterStatus" + fields["detailed_cluster_status"] = bindings.NewOptionalType(bindings.NewReferenceType(AllClusterGroupStatusBindingType)) + fieldNameMap["detailed_cluster_status"] = "DetailedClusterStatus" + fields["mgmt_cluster_status"] = bindings.NewOptionalType(bindings.NewReferenceType(ManagementClusterStatusBindingType)) + fieldNameMap["mgmt_cluster_status"] = "MgmtClusterStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_status", fields, reflect.TypeOf(ClusterStatus{}), fieldNameMap, validators) +} + +func ClusterVirtualIpPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cluster_virtual_ip_properties", fields, reflect.TypeOf(ClusterVirtualIpProperties{}), fieldNameMap, validators) +} + +func ClusteringConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["clustering_type"] = bindings.NewStringType() + fieldNameMap["clustering_type"] = "ClusteringType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.clustering_config", fields, reflect.TypeOf(ClusteringConfig{}), fieldNameMap, validators) +} + +func ClusteringInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["join_to_existing_cluster"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["join_to_existing_cluster"] = "JoinToExistingCluster" + fields["shared_secret"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["shared_secret"] = "SharedSecret" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.clustering_info", fields, reflect.TypeOf(ClusteringInfo{}), fieldNameMap, validators) +} + +func ClustersAggregateInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cluster_status"] = bindings.NewOptionalType(bindings.NewReferenceType(AllClusterGroupStatusBindingType)) + fieldNameMap["cluster_status"] = "ClusterStatus" + fields["controller_cluster"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ControllerNodeAggregateInfoBindingType), reflect.TypeOf([]ControllerNodeAggregateInfo{}))) + fieldNameMap["controller_cluster"] = "ControllerCluster" + fields["management_cluster"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ManagementNodeAggregateInfoBindingType), reflect.TypeOf([]ManagementNodeAggregateInfo{}))) + fieldNameMap["management_cluster"] = "ManagementCluster" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.clusters_aggregate_info", fields, reflect.TypeOf(ClustersAggregateInfo{}), fieldNameMap, validators) +} + +func ColumnItemBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["column_identifier"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["column_identifier"] = "ColumnIdentifier" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["field"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["field"] = "Field" + fields["hidden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["hidden"] = "Hidden" + fields["label"] = bindings.NewOptionalType(bindings.NewReferenceType(LabelBindingType)) + fieldNameMap["label"] = "Label" + fields["navigation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["navigation"] = "Navigation" + fields["render_configuration"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RenderConfigurationBindingType), reflect.TypeOf([]RenderConfiguration{}))) + fieldNameMap["render_configuration"] = "RenderConfiguration" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_key"] = "SortKey" + fields["tooltip"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TooltipBindingType), reflect.TypeOf([]Tooltip{}))) + fieldNameMap["tooltip"] = "Tooltip" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.column_item", fields, reflect.TypeOf(ColumnItem{}), fieldNameMap, validators) +} + +func CommunityMatchExpressionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["expression"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(CommunityMatchOperationBindingType), reflect.TypeOf([]CommunityMatchOperation{}))) + fieldNameMap["expression"] = "Expression" + fields["operator"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["operator"] = "Operator" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.community_match_expression", fields, reflect.TypeOf(CommunityMatchExpression{}), fieldNameMap, validators) +} + +func CommunityMatchOperationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["community_list_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["community_list_id"] = "CommunityListId" + fields["match_operator"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_operator"] = "MatchOperator" + fields["regular_expression"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["regular_expression"] = "RegularExpression" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.community_match_operation", fields, reflect.TypeOf(CommunityMatchOperation{}), fieldNameMap, validators) +} + +func ComponentMigrationStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["can_skip"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["can_skip"] = "CanSkip" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["details"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["details"] = "Details" + fields["percent_complete"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["percent_complete"] = "PercentComplete" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.component_migration_status", fields, reflect.TypeOf(ComponentMigrationStatus{}), fieldNameMap, validators) +} + +func ComponentTargetVersionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["target_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_version"] = "TargetVersion" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.component_target_version", fields, reflect.TypeOf(ComponentTargetVersion{}), fieldNameMap, validators) +} + +func ComponentUpgradeChecksInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["post_upgrade_checks_info"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UpgradeCheckInfoBindingType), reflect.TypeOf([]UpgradeCheckInfo{}))) + fieldNameMap["post_upgrade_checks_info"] = "PostUpgradeChecksInfo" + fields["pre_upgrade_checks_info"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UpgradeCheckInfoBindingType), reflect.TypeOf([]UpgradeCheckInfo{}))) + fieldNameMap["pre_upgrade_checks_info"] = "PreUpgradeChecksInfo" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.component_upgrade_checks_info", fields, reflect.TypeOf(ComponentUpgradeChecksInfo{}), fieldNameMap, validators) +} + +func ComponentUpgradeChecksInfoListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ComponentUpgradeChecksInfoBindingType), reflect.TypeOf([]ComponentUpgradeChecksInfo{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.component_upgrade_checks_info_list_result", fields, reflect.TypeOf(ComponentUpgradeChecksInfoListResult{}), fieldNameMap, validators) +} + +func ComponentUpgradeStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["can_rollback"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["can_rollback"] = "CanRollback" + fields["can_skip"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["can_skip"] = "CanSkip" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["current_version_node_summary"] = bindings.NewOptionalType(bindings.NewReferenceType(NodeSummaryListBindingType)) + fieldNameMap["current_version_node_summary"] = "CurrentVersionNodeSummary" + fields["details"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["details"] = "Details" + fields["node_count_at_target_version"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["node_count_at_target_version"] = "NodeCountAtTargetVersion" + fields["percent_complete"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["percent_complete"] = "PercentComplete" + fields["pre_upgrade_status"] = bindings.NewOptionalType(bindings.NewReferenceType(UpgradeChecksExecutionStatusBindingType)) + fieldNameMap["pre_upgrade_status"] = "PreUpgradeStatus" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["target_component_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_component_version"] = "TargetComponentVersion" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.component_upgrade_status", fields, reflect.TypeOf(ComponentUpgradeStatus{}), fieldNameMap, validators) +} + +func ComputeCollectionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cm_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cm_local_id"] = "CmLocalId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["origin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_id"] = "OriginId" + fields["origin_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["origin_properties"] = "OriginProperties" + fields["origin_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_type"] = "OriginType" + fields["owner_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["owner_id"] = "OwnerId" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredResourceScopeBindingType), reflect.TypeOf([]DiscoveredResourceScope{}))) + fieldNameMap["scope"] = "Scope" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.compute_collection", fields, reflect.TypeOf(ComputeCollection{}), fieldNameMap, validators) +} + +func ComputeCollectionListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ComputeCollectionBindingType), reflect.TypeOf([]ComputeCollection{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.compute_collection_list_result", fields, reflect.TypeOf(ComputeCollectionListResult{}), fieldNameMap, validators) +} + +func ComputeCollectionNetworkInterfacesListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredNodeNetworkInterfacesBindingType), reflect.TypeOf([]DiscoveredNodeNetworkInterfaces{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.compute_collection_network_interfaces_list_result", fields, reflect.TypeOf(ComputeCollectionNetworkInterfacesListResult{}), fieldNameMap, validators) +} + +func ComputeManagerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["access_level_for_oidc"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["access_level_for_oidc"] = "AccessLevelForOidc" + fields["create_service_account"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["create_service_account"] = "CreateServiceAccount" + fields["credential"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LoginCredentialBindingType)}, bindings.REST)) + fieldNameMap["credential"] = "Credential" + fields["origin_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["origin_properties"] = "OriginProperties" + fields["origin_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_type"] = "OriginType" + fields["reverse_proxy_https_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["reverse_proxy_https_port"] = "ReverseProxyHttpsPort" + fields["server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server"] = "Server" + fields["set_as_oidc_provider"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["set_as_oidc_provider"] = "SetAsOidcProvider" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.compute_manager", fields, reflect.TypeOf(ComputeManager{}), fieldNameMap, validators) +} + +func ComputeManagerListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ComputeManagerBindingType), reflect.TypeOf([]ComputeManager{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.compute_manager_list_result", fields, reflect.TypeOf(ComputeManagerListResult{}), fieldNameMap, validators) +} + +func ComputeManagerStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["connection_errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ErrorInfoBindingType), reflect.TypeOf([]ErrorInfo{}))) + fieldNameMap["connection_errors"] = "ConnectionErrors" + fields["connection_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connection_status"] = "ConnectionStatus" + fields["connection_status_details"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connection_status_details"] = "ConnectionStatusDetails" + fields["last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_sync_time"] = "LastSyncTime" + fields["oidc_end_point_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["oidc_end_point_id"] = "OidcEndPointId" + fields["registration_errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ErrorInfoBindingType), reflect.TypeOf([]ErrorInfo{}))) + fieldNameMap["registration_errors"] = "RegistrationErrors" + fields["registration_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["registration_status"] = "RegistrationStatus" + fields["version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["version"] = "Version" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.compute_manager_status", fields, reflect.TypeOf(ComputeManagerStatus{}), fieldNameMap, validators) +} + +func ComputeManagerTopologyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["compute_manager_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["compute_manager_id"] = "ComputeManagerId" + fields["dvswitch"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VdsTopologyBindingType), reflect.TypeOf([]VdsTopology{}))) + fieldNameMap["dvswitch"] = "Dvswitch" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.compute_manager_topology", fields, reflect.TypeOf(ComputeManagerTopology{}), fieldNameMap, validators) +} + +func ConditionalForwarderZoneBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["source_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_ip"] = "SourceIp" + fields["upstream_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["upstream_servers"] = "UpstreamServers" + fields["domain_names"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["domain_names"] = "DomainNames" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.conditional_forwarder_zone", fields, reflect.TypeOf(ConditionalForwarderZone{}), fieldNameMap, validators) +} + +func ConfigurationStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ConfigurationStateElementBindingType), reflect.TypeOf([]ConfigurationStateElement{}))) + fieldNameMap["details"] = "Details" + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.configuration_state", fields, reflect.TypeOf(ConfigurationState{}), fieldNameMap, validators) +} + +func ConfigurationStateElementBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + fields["sub_system_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sub_system_address"] = "SubSystemAddress" + fields["sub_system_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sub_system_id"] = "SubSystemId" + fields["sub_system_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sub_system_name"] = "SubSystemName" + fields["sub_system_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sub_system_type"] = "SubSystemType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.configuration_state_element", fields, reflect.TypeOf(ConfigurationStateElement{}), fieldNameMap, validators) +} + +func ConsolidatedEffectiveIPAddressMemberListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(EffectiveIPInfoBindingType), reflect.TypeOf([]EffectiveIPInfo{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.consolidated_effective_IP_address_member_list_result", fields, reflect.TypeOf(ConsolidatedEffectiveIPAddressMemberListResult{}), fieldNameMap, validators) +} + +func ContainerApplicationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fields["container_project_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_project_id"] = "ContainerProjectId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["network_errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NetworkErrorBindingType), reflect.TypeOf([]NetworkError{}))) + fieldNameMap["network_errors"] = "NetworkErrors" + fields["network_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network_status"] = "NetworkStatus" + fields["origin_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["origin_properties"] = "OriginProperties" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredResourceScopeBindingType), reflect.TypeOf([]DiscoveredResourceScope{}))) + fieldNameMap["scope"] = "Scope" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.container_application", fields, reflect.TypeOf(ContainerApplication{}), fieldNameMap, validators) +} + +func ContainerApplicationInstanceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cluster_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cluster_node_id"] = "ClusterNodeId" + fields["container_application_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["container_application_ids"] = "ContainerApplicationIds" + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fields["container_project_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_project_id"] = "ContainerProjectId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["network_errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NetworkErrorBindingType), reflect.TypeOf([]NetworkError{}))) + fieldNameMap["network_errors"] = "NetworkErrors" + fields["network_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network_status"] = "NetworkStatus" + fields["origin_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["origin_properties"] = "OriginProperties" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredResourceScopeBindingType), reflect.TypeOf([]DiscoveredResourceScope{}))) + fieldNameMap["scope"] = "Scope" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.container_application_instance", fields, reflect.TypeOf(ContainerApplicationInstance{}), fieldNameMap, validators) +} + +func ContainerApplicationInstanceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ContainerApplicationInstanceBindingType), reflect.TypeOf([]ContainerApplicationInstance{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.container_application_instance_list_result", fields, reflect.TypeOf(ContainerApplicationInstanceListResult{}), fieldNameMap, validators) +} + +func ContainerApplicationListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ContainerApplicationBindingType), reflect.TypeOf([]ContainerApplication{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.container_application_list_result", fields, reflect.TypeOf(ContainerApplicationListResult{}), fieldNameMap, validators) +} + +func ContainerClusterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cluster_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cluster_type"] = "ClusterType" + fields["cni_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cni_type"] = "CniType" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["infrastructure"] = bindings.NewOptionalType(bindings.NewReferenceType(ContainerInfrastructureInfoBindingType)) + fieldNameMap["infrastructure"] = "Infrastructure" + fields["network_errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NetworkErrorBindingType), reflect.TypeOf([]NetworkError{}))) + fieldNameMap["network_errors"] = "NetworkErrors" + fields["network_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network_status"] = "NetworkStatus" + fields["origin_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["origin_properties"] = "OriginProperties" + fields["supervisor_project_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["supervisor_project_id"] = "SupervisorProjectId" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredResourceScopeBindingType), reflect.TypeOf([]DiscoveredResourceScope{}))) + fieldNameMap["scope"] = "Scope" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.container_cluster", fields, reflect.TypeOf(ContainerCluster{}), fieldNameMap, validators) +} + +func ContainerClusterListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ContainerClusterBindingType), reflect.TypeOf([]ContainerCluster{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.container_cluster_list_result", fields, reflect.TypeOf(ContainerClusterListResult{}), fieldNameMap, validators) +} + +func ContainerClusterNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cni_agent_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cni_agent_status"] = "CniAgentStatus" + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["network_errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NetworkErrorBindingType), reflect.TypeOf([]NetworkError{}))) + fieldNameMap["network_errors"] = "NetworkErrors" + fields["network_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network_status"] = "NetworkStatus" + fields["origin_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["origin_properties"] = "OriginProperties" + fields["provider_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["provider_id"] = "ProviderId" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredResourceScopeBindingType), reflect.TypeOf([]DiscoveredResourceScope{}))) + fieldNameMap["scope"] = "Scope" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.container_cluster_node", fields, reflect.TypeOf(ContainerClusterNode{}), fieldNameMap, validators) +} + +func ContainerClusterNodeListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ContainerClusterNodeBindingType), reflect.TypeOf([]ContainerClusterNode{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.container_cluster_node_list_result", fields, reflect.TypeOf(ContainerClusterNodeListResult{}), fieldNameMap, validators) +} + +func ContainerClusterStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cluster_id"] = "ClusterId" + fields["detail"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["detail"] = "Detail" + fields["interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interval"] = "Interval" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.container_cluster_status", fields, reflect.TypeOf(ContainerClusterStatus{}), fieldNameMap, validators) +} + +func ContainerClusterStatusListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ContainerClusterSummaryBindingType), reflect.TypeOf([]ContainerClusterSummary{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.container_cluster_status_list", fields, reflect.TypeOf(ContainerClusterStatusList{}), fieldNameMap, validators) +} + +func ContainerClusterSummaryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cluster_id"] = "ClusterId" + fields["cluster_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cluster_name"] = "ClusterName" + fields["detail"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["detail"] = "Detail" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.container_cluster_summary", fields, reflect.TypeOf(ContainerClusterSummary{}), fieldNameMap, validators) +} + +func ContainerConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["header"] = bindings.NewOptionalType(bindings.NewReferenceType(HeaderBindingType)) + fieldNameMap["header"] = "Header" + fields["labels"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LabelBindingType), reflect.TypeOf([]Label{}))) + fieldNameMap["labels"] = "Labels" + fields["layout"] = bindings.NewOptionalType(bindings.NewReferenceType(LayoutBindingType)) + fieldNameMap["layout"] = "Layout" + fields["navigation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["navigation"] = "Navigation" + fields["widgets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(WidgetItemBindingType), reflect.TypeOf([]WidgetItem{}))) + fieldNameMap["widgets"] = "Widgets" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["feature_set"] = bindings.NewOptionalType(bindings.NewReferenceType(FeatureSetBindingType)) + fieldNameMap["feature_set"] = "FeatureSet" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["filters"] = "Filters" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["plot_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(WidgetPlotConfigurationBindingType), reflect.TypeOf([]WidgetPlotConfiguration{}))) + fieldNameMap["plot_configs"] = "PlotConfigs" + fields["rowspan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rowspan"] = "Rowspan" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["show_header"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_header"] = "ShowHeader" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.container_configuration", fields, reflect.TypeOf(ContainerConfiguration{}), fieldNameMap, validators) +} + +func ContainerInfrastructureInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["infra_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["infra_type"] = "InfraType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.container_infrastructure_info", fields, reflect.TypeOf(ContainerInfrastructureInfo{}), fieldNameMap, validators) +} + +func ContainerIngressPolicyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_application_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["container_application_ids"] = "ContainerApplicationIds" + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fields["container_project_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_project_id"] = "ContainerProjectId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["network_errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NetworkErrorBindingType), reflect.TypeOf([]NetworkError{}))) + fieldNameMap["network_errors"] = "NetworkErrors" + fields["network_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network_status"] = "NetworkStatus" + fields["origin_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["origin_properties"] = "OriginProperties" + fields["spec"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["spec"] = "Spec" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredResourceScopeBindingType), reflect.TypeOf([]DiscoveredResourceScope{}))) + fieldNameMap["scope"] = "Scope" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.container_ingress_policy", fields, reflect.TypeOf(ContainerIngressPolicy{}), fieldNameMap, validators) +} + +func ContainerIngressPolicyListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ContainerIngressPolicyBindingType), reflect.TypeOf([]ContainerIngressPolicy{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.container_ingress_policy_list_result", fields, reflect.TypeOf(ContainerIngressPolicyListResult{}), fieldNameMap, validators) +} + +func ContainerNetworkPolicyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fields["container_project_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_project_id"] = "ContainerProjectId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["network_errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NetworkErrorBindingType), reflect.TypeOf([]NetworkError{}))) + fieldNameMap["network_errors"] = "NetworkErrors" + fields["network_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network_status"] = "NetworkStatus" + fields["origin_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["origin_properties"] = "OriginProperties" + fields["policy_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["policy_type"] = "PolicyType" + fields["spec"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["spec"] = "Spec" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredResourceScopeBindingType), reflect.TypeOf([]DiscoveredResourceScope{}))) + fieldNameMap["scope"] = "Scope" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.container_network_policy", fields, reflect.TypeOf(ContainerNetworkPolicy{}), fieldNameMap, validators) +} + +func ContainerNetworkPolicyListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ContainerNetworkPolicyBindingType), reflect.TypeOf([]ContainerNetworkPolicy{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.container_network_policy_list_result", fields, reflect.TypeOf(ContainerNetworkPolicyListResult{}), fieldNameMap, validators) +} + +func ContainerProjectBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["container_cluster_id"] = "ContainerClusterId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["network_errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NetworkErrorBindingType), reflect.TypeOf([]NetworkError{}))) + fieldNameMap["network_errors"] = "NetworkErrors" + fields["network_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network_status"] = "NetworkStatus" + fields["origin_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["origin_properties"] = "OriginProperties" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredResourceScopeBindingType), reflect.TypeOf([]DiscoveredResourceScope{}))) + fieldNameMap["scope"] = "Scope" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.container_project", fields, reflect.TypeOf(ContainerProject{}), fieldNameMap, validators) +} + +func ContainerProjectListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ContainerProjectBindingType), reflect.TypeOf([]ContainerProject{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.container_project_list_result", fields, reflect.TypeOf(ContainerProjectListResult{}), fieldNameMap, validators) +} + +func ControlClusterNodeStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["control_cluster_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["control_cluster_status"] = "ControlClusterStatus" + fields["mgmt_connection_status"] = bindings.NewOptionalType(bindings.NewReferenceType(MgmtConnStatusBindingType)) + fieldNameMap["mgmt_connection_status"] = "MgmtConnectionStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.control_cluster_node_status", fields, reflect.TypeOf(ControlClusterNodeStatus{}), fieldNameMap, validators) +} + +func ControlClusteringConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["join_to_existing_cluster"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["join_to_existing_cluster"] = "JoinToExistingCluster" + fields["shared_secret"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["shared_secret"] = "SharedSecret" + fields["clustering_type"] = bindings.NewStringType() + fieldNameMap["clustering_type"] = "ClusteringType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.control_clustering_config", fields, reflect.TypeOf(ControlClusteringConfig{}), fieldNameMap, validators) +} + +func ControlConnStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["control_node_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["control_node_ip"] = "ControlNodeIp" + fields["failure_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_status"] = "FailureStatus" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.control_conn_status", fields, reflect.TypeOf(ControlConnStatus{}), fieldNameMap, validators) +} + +func ControllerClusterRoleConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + fields["control_cluster_listen_addr"] = bindings.NewOptionalType(bindings.NewReferenceType(ServiceEndpointBindingType)) + fieldNameMap["control_cluster_listen_addr"] = "ControlClusterListenAddr" + fields["control_plane_listen_addr"] = bindings.NewOptionalType(bindings.NewReferenceType(ServiceEndpointBindingType)) + fieldNameMap["control_plane_listen_addr"] = "ControlPlaneListenAddr" + fields["host_msg_client_info"] = bindings.NewOptionalType(bindings.NewReferenceType(MsgClientInfoBindingType)) + fieldNameMap["host_msg_client_info"] = "HostMsgClientInfo" + fields["mpa_msg_client_info"] = bindings.NewOptionalType(bindings.NewReferenceType(MsgClientInfoBindingType)) + fieldNameMap["mpa_msg_client_info"] = "MpaMsgClientInfo" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.controller_cluster_role_config", fields, reflect.TypeOf(ControllerClusterRoleConfig{}), fieldNameMap, validators) +} + +func ControllerClusterStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.controller_cluster_status", fields, reflect.TypeOf(ControllerClusterStatus{}), fieldNameMap, validators) +} + +func ControllerNodeAggregateInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["node_interface_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeInterfacePropertiesBindingType), reflect.TypeOf([]NodeInterfaceProperties{}))) + fieldNameMap["node_interface_properties"] = "NodeInterfaceProperties" + fields["node_interface_statistics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeInterfaceStatisticsPropertiesBindingType), reflect.TypeOf([]NodeInterfaceStatisticsProperties{}))) + fieldNameMap["node_interface_statistics"] = "NodeInterfaceStatistics" + fields["node_status"] = bindings.NewOptionalType(bindings.NewReferenceType(ClusterNodeStatusBindingType)) + fieldNameMap["node_status"] = "NodeStatus" + fields["node_status_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeStatusPropertiesBindingType), reflect.TypeOf([]NodeStatusProperties{}))) + fieldNameMap["node_status_properties"] = "NodeStatusProperties" + fields["role_config"] = bindings.NewOptionalType(bindings.NewReferenceType(ControllerClusterRoleConfigBindingType)) + fieldNameMap["role_config"] = "RoleConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.controller_node_aggregate_info", fields, reflect.TypeOf(ControllerNodeAggregateInfo{}), fieldNameMap, validators) +} + +func ControllerProfilerPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.controller_profiler_properties", fields, reflect.TypeOf(ControllerProfilerProperties{}), fieldNameMap, validators) +} + +func CopyFromRemoteFilePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server"] = "Server" + fields["uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uri"] = "Uri" + fields["protocol"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ProtocolBindingType)}, bindings.REST)) + fieldNameMap["protocol"] = "Protocol" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.copy_from_remote_file_properties", fields, reflect.TypeOf(CopyFromRemoteFileProperties{}), fieldNameMap, validators) +} + +func CopyRemoteFilePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server"] = "Server" + fields["uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uri"] = "Uri" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.copy_remote_file_properties", fields, reflect.TypeOf(CopyRemoteFileProperties{}), fieldNameMap, validators) +} + +func CopyToRemoteFilePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server"] = "Server" + fields["uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uri"] = "Uri" + fields["protocol"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(ProtocolBindingType)}, bindings.REST)) + fieldNameMap["protocol"] = "Protocol" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.copy_to_remote_file_properties", fields, reflect.TypeOf(CopyToRemoteFileProperties{}), fieldNameMap, validators) +} + +func CpuCoreConfigForEnhancedNetworkingStackSwitchBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["num_lcores"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["num_lcores"] = "NumLcores" + fields["numa_node_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["numa_node_index"] = "NumaNodeIndex" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cpu_core_config_for_enhanced_networking_stack_switch", fields, reflect.TypeOf(CpuCoreConfigForEnhancedNetworkingStackSwitch{}), fieldNameMap, validators) +} + +func CpuUsageBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["avg_cpu_core_usage_dpdk"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["avg_cpu_core_usage_dpdk"] = "AvgCpuCoreUsageDpdk" + fields["avg_cpu_core_usage_non_dpdk"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["avg_cpu_core_usage_non_dpdk"] = "AvgCpuCoreUsageNonDpdk" + fields["highest_cpu_core_usage_dpdk"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["highest_cpu_core_usage_dpdk"] = "HighestCpuCoreUsageDpdk" + fields["highest_cpu_core_usage_non_dpdk"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["highest_cpu_core_usage_non_dpdk"] = "HighestCpuCoreUsageNonDpdk" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.cpu_usage", fields, reflect.TypeOf(CpuUsage{}), fieldNameMap, validators) +} + +func CreateRemoteDirectoryPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server"] = "Server" + fields["uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uri"] = "Uri" + fields["protocol"] = bindings.NewOptionalType(bindings.NewReferenceType(SftpProtocolBindingType)) + fieldNameMap["protocol"] = "Protocol" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.create_remote_directory_properties", fields, reflect.TypeOf(CreateRemoteDirectoryProperties{}), fieldNameMap, validators) +} + +func CrlBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["crl_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["crl_type"] = "CrlType" + fields["details"] = bindings.NewOptionalType(bindings.NewReferenceType(X509CrlBindingType)) + fieldNameMap["details"] = "Details" + fields["details_revoked_by_issuer_and_serial_number"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IssuerSerialNumberBindingType), reflect.TypeOf([]IssuerSerialNumber{}))) + fieldNameMap["details_revoked_by_issuer_and_serial_number"] = "DetailsRevokedByIssuerAndSerialNumber" + fields["details_revoked_by_subject_and_public_key_hash"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SubjectPublicKeyHashBindingType), reflect.TypeOf([]SubjectPublicKeyHash{}))) + fieldNameMap["details_revoked_by_subject_and_public_key_hash"] = "DetailsRevokedBySubjectAndPublicKeyHash" + fields["one_crl"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["one_crl"] = "OneCrl" + fields["pem_encoded"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pem_encoded"] = "PemEncoded" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.crl", fields, reflect.TypeOf(Crl{}), fieldNameMap, validators) +} + +func CrlDistributionPointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["cdp_uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cdp_uri"] = "CdpUri" + fields["issuer"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["issuer"] = "Issuer" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.crl_distribution_point", fields, reflect.TypeOf(CrlDistributionPoint{}), fieldNameMap, validators) +} + +func CrlDistributionPointListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(CrlDistributionPointBindingType), reflect.TypeOf([]CrlDistributionPoint{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.crl_distribution_point_list", fields, reflect.TypeOf(CrlDistributionPointList{}), fieldNameMap, validators) +} + +func CrlDistributionPointStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.crl_distribution_point_status", fields, reflect.TypeOf(CrlDistributionPointStatus{}), fieldNameMap, validators) +} + +func CrlListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(CrlBindingType), reflect.TypeOf([]Crl{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.crl_list", fields, reflect.TypeOf(CrlList{}), fieldNameMap, validators) +} + +func CrlObjectDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["crl_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["crl_type"] = "CrlType" + fields["one_crl"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["one_crl"] = "OneCrl" + fields["pem_encoded"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pem_encoded"] = "PemEncoded" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.crl_object_data", fields, reflect.TypeOf(CrlObjectData{}), fieldNameMap, validators) +} + +func CrlPemRequestTypeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cdp_uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cdp_uri"] = "CdpUri" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.crl_pem_request_type", fields, reflect.TypeOf(CrlPemRequestType{}), fieldNameMap, validators) +} + +func CryptoAlgorithmBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["key_size"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewIntegerType(), reflect.TypeOf([]int64{}))) + fieldNameMap["key_size"] = "KeySize" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.crypto_algorithm", fields, reflect.TypeOf(CryptoAlgorithm{}), fieldNameMap, validators) +} + +func CsrBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["algorithm"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["algorithm"] = "Algorithm" + fields["is_ca"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_ca"] = "IsCa" + fields["key_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["key_size"] = "KeySize" + fields["pem_encoded"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pem_encoded"] = "PemEncoded" + fields["subject"] = bindings.NewOptionalType(bindings.NewReferenceType(PrincipalBindingType)) + fieldNameMap["subject"] = "Subject" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.csr", fields, reflect.TypeOf(Csr{}), fieldNameMap, validators) +} + +func CsrExtBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["algorithm"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["algorithm"] = "Algorithm" + fields["is_ca"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_ca"] = "IsCa" + fields["key_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["key_size"] = "KeySize" + fields["pem_encoded"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pem_encoded"] = "PemEncoded" + fields["subject"] = bindings.NewOptionalType(bindings.NewReferenceType(PrincipalBindingType)) + fieldNameMap["subject"] = "Subject" + fields["extensions"] = bindings.NewOptionalType(bindings.NewReferenceType(CsrExtensionsBindingType)) + fieldNameMap["extensions"] = "Extensions" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.csr_ext", fields, reflect.TypeOf(CsrExt{}), fieldNameMap, validators) +} + +func CsrExtensionsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["subject_alt_names"] = bindings.NewOptionalType(bindings.NewReferenceType(SubjectAltNamesBindingType)) + fieldNameMap["subject_alt_names"] = "SubjectAltNames" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.csr_extensions", fields, reflect.TypeOf(CsrExtensions{}), fieldNameMap, validators) +} + +func CsrListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(CsrBindingType), reflect.TypeOf([]Csr{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.csr_list", fields, reflect.TypeOf(CsrList{}), fieldNameMap, validators) +} + +func CsrWithDaysValidBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["algorithm"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["algorithm"] = "Algorithm" + fields["is_ca"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_ca"] = "IsCa" + fields["key_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["key_size"] = "KeySize" + fields["pem_encoded"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pem_encoded"] = "PemEncoded" + fields["subject"] = bindings.NewOptionalType(bindings.NewReferenceType(PrincipalBindingType)) + fieldNameMap["subject"] = "Subject" + fields["days_valid"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["days_valid"] = "DaysValid" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.csr_with_days_valid", fields, reflect.TypeOf(CsrWithDaysValid{}), fieldNameMap, validators) +} + +func CsvListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_name"] = "FileName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.csv_list_result", fields, reflect.TypeOf(CsvListResult{}), fieldNameMap, validators) +} + +func CsvRecordBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.csv_record", fields, reflect.TypeOf(CsvRecord{}), fieldNameMap, validators) +} + +func CurrentBackupOperationStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["backup_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["backup_id"] = "BackupId" + fields["current_step"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["current_step"] = "CurrentStep" + fields["current_step_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["current_step_message"] = "CurrentStepMessage" + fields["end_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["end_time"] = "EndTime" + fields["operation_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["operation_type"] = "OperationType" + fields["start_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["start_time"] = "StartTime" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.current_backup_operation_status", fields, reflect.TypeOf(CurrentBackupOperationStatus{}), fieldNameMap, validators) +} + +func CurrentRealizationStateBarrierBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["current_barrier_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["current_barrier_number"] = "CurrentBarrierNumber" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.current_realization_state_barrier", fields, reflect.TypeOf(CurrentRealizationStateBarrier{}), fieldNameMap, validators) +} + +func CustomFilterWidgetConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ui_component_identifier"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ui_component_identifier"] = "UiComponentIdentifier" + fields["alias"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["alias"] = "Alias" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["feature_set"] = bindings.NewOptionalType(bindings.NewReferenceType(FeatureSetBindingType)) + fieldNameMap["feature_set"] = "FeatureSet" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["filters"] = "Filters" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["plot_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(WidgetPlotConfigurationBindingType), reflect.TypeOf([]WidgetPlotConfiguration{}))) + fieldNameMap["plot_configs"] = "PlotConfigs" + fields["rowspan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rowspan"] = "Rowspan" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["show_header"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_header"] = "ShowHeader" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.custom_filter_widget_configuration", fields, reflect.TypeOf(CustomFilterWidgetConfiguration{}), fieldNameMap, validators) +} + +func CustomWidgetConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ui_component_identifier"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ui_component_identifier"] = "UiComponentIdentifier" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["feature_set"] = bindings.NewOptionalType(bindings.NewReferenceType(FeatureSetBindingType)) + fieldNameMap["feature_set"] = "FeatureSet" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["filters"] = "Filters" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["plot_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(WidgetPlotConfigurationBindingType), reflect.TypeOf([]WidgetPlotConfiguration{}))) + fieldNameMap["plot_configs"] = "PlotConfigs" + fields["rowspan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rowspan"] = "Rowspan" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["show_header"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_header"] = "ShowHeader" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.custom_widget_configuration", fields, reflect.TypeOf(CustomWidgetConfiguration{}), fieldNameMap, validators) +} + +func DADProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["dad_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dad_mode"] = "DadMode" + fields["ns_retries"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ns_retries"] = "NsRetries" + fields["wait_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["wait_time"] = "WaitTime" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.DAD_profile", fields, reflect.TypeOf(DADProfile{}), fieldNameMap, validators) +} + +func DADProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DADProfileBindingType), reflect.TypeOf([]DADProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.DAD_profile_list_result", fields, reflect.TypeOf(DADProfileListResult{}), fieldNameMap, validators) +} + +func DSExcludeListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["member_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["member_count"] = "MemberCount" + fields["members"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["members"] = "Members" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.DS_exclude_list", fields, reflect.TypeOf(DSExcludeList{}), fieldNameMap, validators) +} + +func DSInsertParametersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["operation"] = "Operation" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.DS_insert_parameters", fields, reflect.TypeOf(DSInsertParameters{}), fieldNameMap, validators) +} + +func DSRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_owner"] = bindings.NewOptionalType(bindings.NewReferenceType(OwnerResourceLinkBindingType)) + fieldNameMap["_owner"] = "Owner" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["applied_tos"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["applied_tos"] = "AppliedTos" + fields["destinations"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["destinations"] = "Destinations" + fields["destinations_excluded"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["destinations_excluded"] = "DestinationsExcluded" + fields["direction"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["direction"] = "Direction" + fields["disabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["disabled"] = "Disabled" + fields["ip_protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_protocol"] = "IpProtocol" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["logged"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["logged"] = "Logged" + fields["notes"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["notes"] = "Notes" + fields["priority"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["priority"] = "Priority" + fields["rule_tag"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["rule_tag"] = "RuleTag" + fields["sources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["sources"] = "Sources" + fields["sources_excluded"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sources_excluded"] = "SourcesExcluded" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.DS_rule", fields, reflect.TypeOf(DSRule{}), fieldNameMap, validators) +} + +func DSRuleStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ConfigurationStateElementBindingType), reflect.TypeOf([]ConfigurationStateElement{}))) + fieldNameMap["details"] = "Details" + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + fields["revision_desired"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["revision_desired"] = "RevisionDesired" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.DS_rule_state", fields, reflect.TypeOf(DSRuleState{}), fieldNameMap, validators) +} + +func DSSectionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["applied_tos"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["applied_tos"] = "AppliedTos" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["rule_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rule_count"] = "RuleCount" + fields["section_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_type"] = "SectionType" + fields["stateful"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["stateful"] = "Stateful" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.DS_section", fields, reflect.TypeOf(DSSection{}), fieldNameMap, validators) +} + +func DSSectionListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.DS_section_list_result", fields, reflect.TypeOf(DSSectionListResult{}), fieldNameMap, validators) +} + +func DSSectionQueryParametersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cascade"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["cascade"] = "Cascade" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.DS_section_query_parameters", fields, reflect.TypeOf(DSSectionQueryParameters{}), fieldNameMap, validators) +} + +func DSSectionStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ConfigurationStateElementBindingType), reflect.TypeOf([]ConfigurationStateElement{}))) + fieldNameMap["details"] = "Details" + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + fields["revision_desired"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["revision_desired"] = "RevisionDesired" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.DS_section_state", fields, reflect.TypeOf(DSSectionState{}), fieldNameMap, validators) +} + +func DSServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["is_valid"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_valid"] = "IsValid" + fields["target_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_display_name"] = "TargetDisplayName" + fields["target_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_id"] = "TargetId" + fields["target_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_type"] = "TargetType" + fields["service"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(NSServiceElementBindingType)}, bindings.REST)) + fieldNameMap["service"] = "Service" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.DS_service", fields, reflect.TypeOf(DSService{}), fieldNameMap, validators) +} + +func DVSConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["host_infra_traffic_res"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceAllocationBindingType), reflect.TypeOf([]ResourceAllocation{}))) + fieldNameMap["host_infra_traffic_res"] = "HostInfraTrafficRes" + fields["lacp_group_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LacpGroupConfigInfoBindingType), reflect.TypeOf([]LacpGroupConfigInfo{}))) + fieldNameMap["lacp_group_configs"] = "LacpGroupConfigs" + fields["lldp_send_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["lldp_send_enabled"] = "LldpSendEnabled" + fields["mtu"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mtu"] = "Mtu" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["uplink_port_names"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["uplink_port_names"] = "UplinkPortNames" + fields["uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uuid"] = "Uuid" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.DVS_config", fields, reflect.TypeOf(DVSConfig{}), fieldNameMap, validators) +} + +func DailyTelemetryScheduleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["hour_of_day"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["hour_of_day"] = "HourOfDay" + fields["minutes"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["minutes"] = "Minutes" + fields["frequency_type"] = bindings.NewStringType() + fieldNameMap["frequency_type"] = "FrequencyType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.daily_telemetry_schedule", fields, reflect.TypeOf(DailyTelemetrySchedule{}), fieldNameMap, validators) +} + +func DataCounterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dropped"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dropped"] = "Dropped" + fields["multicast_broadcast"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["multicast_broadcast"] = "MulticastBroadcast" + fields["total"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total"] = "Total" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.data_counter", fields, reflect.TypeOf(DataCounter{}), fieldNameMap, validators) +} + +func DatasourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["keystore_info"] = bindings.NewOptionalType(bindings.NewReferenceType(KeyStoreInfoBindingType)) + fieldNameMap["keystore_info"] = "KeystoreInfo" + fields["urls"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UrlAliasBindingType), reflect.TypeOf([]UrlAlias{}))) + fieldNameMap["urls"] = "Urls" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.datasource", fields, reflect.TypeOf(Datasource{}), fieldNameMap, validators) +} + +func DefaultFilterValueBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["alias"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["alias"] = "Alias" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.default_filter_value", fields, reflect.TypeOf(DefaultFilterValue{}), fieldNameMap, validators) +} + +func DeploymentConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["placement_type"] = bindings.NewStringType() + fieldNameMap["placement_type"] = "PlacementType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.deployment_config", fields, reflect.TypeOf(DeploymentConfig{}), fieldNameMap, validators) +} + +func DeploymentSpecNameBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["deployment_spec_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["deployment_spec_name"] = "DeploymentSpecName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.deployment_spec_name", fields, reflect.TypeOf(DeploymentSpecName{}), fieldNameMap, validators) +} + +func DeploymentTemplateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["attributes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AttributeBindingType), reflect.TypeOf([]Attribute{}))) + fieldNameMap["attributes"] = "Attributes" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.deployment_template", fields, reflect.TypeOf(DeploymentTemplate{}), fieldNameMap, validators) +} + +func DestinationNsxApiEndpointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["destination_nsx_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["destination_nsx_ip"] = "DestinationNsxIp" + fields["destination_nsx_password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["destination_nsx_password"] = "DestinationNsxPassword" + fields["destination_nsx_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["destination_nsx_port"] = "DestinationNsxPort" + fields["destination_nsx_username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["destination_nsx_username"] = "DestinationNsxUsername" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.destination_nsx_api_endpoint", fields, reflect.TypeOf(DestinationNsxApiEndpoint{}), fieldNameMap, validators) +} + +func DhcpFilterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["client_block_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["client_block_enabled"] = "ClientBlockEnabled" + fields["server_block_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["server_block_enabled"] = "ServerBlockEnabled" + fields["v6_client_block_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["v6_client_block_enabled"] = "V6ClientBlockEnabled" + fields["v6_server_block_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["v6_server_block_enabled"] = "V6ServerBlockEnabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_filter", fields, reflect.TypeOf(DhcpFilter{}), fieldNameMap, validators) +} + +func DhcpHeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["op_code"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["op_code"] = "OpCode" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_header", fields, reflect.TypeOf(DhcpHeader{}), fieldNameMap, validators) +} + +func DhcpIpPoolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["gateway_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["gateway_ip"] = "GatewayIp" + fields["lease_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["lease_time"] = "LeaseTime" + fields["options"] = bindings.NewOptionalType(bindings.NewReferenceType(DhcpOptionsBindingType)) + fieldNameMap["options"] = "Options" + fields["allocation_ranges"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IpPoolRangeBindingType), reflect.TypeOf([]IpPoolRange{}))) + fieldNameMap["allocation_ranges"] = "AllocationRanges" + fields["error_threshold"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["error_threshold"] = "ErrorThreshold" + fields["warning_threshold"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["warning_threshold"] = "WarningThreshold" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_ip_pool", fields, reflect.TypeOf(DhcpIpPool{}), fieldNameMap, validators) +} + +func DhcpIpPoolListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DhcpIpPoolBindingType), reflect.TypeOf([]DhcpIpPool{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_ip_pool_list_result", fields, reflect.TypeOf(DhcpIpPoolListResult{}), fieldNameMap, validators) +} + +func DhcpIpPoolUsageBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allocated_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["allocated_number"] = "AllocatedNumber" + fields["allocated_percentage"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["allocated_percentage"] = "AllocatedPercentage" + fields["dhcp_ip_pool_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dhcp_ip_pool_id"] = "DhcpIpPoolId" + fields["pool_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["pool_size"] = "PoolSize" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_ip_pool_usage", fields, reflect.TypeOf(DhcpIpPoolUsage{}), fieldNameMap, validators) +} + +func DhcpLeasePerIPBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["expire_time"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["expire_time"] = "ExpireTime" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["lease_time"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lease_time"] = "LeaseTime" + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + fields["start_time"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["start_time"] = "StartTime" + fields["subnet"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["subnet"] = "Subnet" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_lease_per_IP", fields, reflect.TypeOf(DhcpLeasePerIP{}), fieldNameMap, validators) +} + +func DhcpLeasesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["dhcp_server_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dhcp_server_id"] = "DhcpServerId" + fields["leases"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DhcpLeasePerIPBindingType), reflect.TypeOf([]DhcpLeasePerIP{}))) + fieldNameMap["leases"] = "Leases" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_leases", fields, reflect.TypeOf(DhcpLeases{}), fieldNameMap, validators) +} + +func DhcpOption121BindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["static_routes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ClasslessStaticRouteBindingType), reflect.TypeOf([]ClasslessStaticRoute{}))) + fieldNameMap["static_routes"] = "StaticRoutes" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_option121", fields, reflect.TypeOf(DhcpOption121{}), fieldNameMap, validators) +} + +func DhcpOptionsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["option121"] = bindings.NewOptionalType(bindings.NewReferenceType(DhcpOption121BindingType)) + fieldNameMap["option121"] = "Option121" + fields["others"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(GenericDhcpOptionBindingType), reflect.TypeOf([]GenericDhcpOption{}))) + fieldNameMap["others"] = "Others" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_options", fields, reflect.TypeOf(DhcpOptions{}), fieldNameMap, validators) +} + +func DhcpProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["edge_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + fields["edge_cluster_member_indexes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewIntegerType(), reflect.TypeOf([]int64{}))) + fieldNameMap["edge_cluster_member_indexes"] = "EdgeClusterMemberIndexes" + fields["enable_standby_relocation"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_standby_relocation"] = "EnableStandbyRelocation" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_profile", fields, reflect.TypeOf(DhcpProfile{}), fieldNameMap, validators) +} + +func DhcpProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DhcpProfileBindingType), reflect.TypeOf([]DhcpProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_profile_list_result", fields, reflect.TypeOf(DhcpProfileListResult{}), fieldNameMap, validators) +} + +func DhcpRelayProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["server_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["server_addresses"] = "ServerAddresses" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_relay_profile", fields, reflect.TypeOf(DhcpRelayProfile{}), fieldNameMap, validators) +} + +func DhcpRelayProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DhcpRelayProfileBindingType), reflect.TypeOf([]DhcpRelayProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_relay_profile_list_result", fields, reflect.TypeOf(DhcpRelayProfileListResult{}), fieldNameMap, validators) +} + +func DhcpRelayServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["dhcp_relay_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dhcp_relay_profile_id"] = "DhcpRelayProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_relay_service", fields, reflect.TypeOf(DhcpRelayService{}), fieldNameMap, validators) +} + +func DhcpRelayServiceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DhcpRelayServiceBindingType), reflect.TypeOf([]DhcpRelayService{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_relay_service_list_result", fields, reflect.TypeOf(DhcpRelayServiceListResult{}), fieldNameMap, validators) +} + +func DhcpServerStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_node"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["active_node"] = "ActiveNode" + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["service_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_status"] = "ServiceStatus" + fields["stand_by_node"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["stand_by_node"] = "StandByNode" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_server_status", fields, reflect.TypeOf(DhcpServerStatus{}), fieldNameMap, validators) +} + +func DhcpStaticBindingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["gateway_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["gateway_ip"] = "GatewayIp" + fields["lease_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["lease_time"] = "LeaseTime" + fields["options"] = bindings.NewOptionalType(bindings.NewReferenceType(DhcpOptionsBindingType)) + fieldNameMap["options"] = "Options" + fields["host_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_name"] = "HostName" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_static_binding", fields, reflect.TypeOf(DhcpStaticBinding{}), fieldNameMap, validators) +} + +func DhcpStaticBindingListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DhcpStaticBindingBindingType), reflect.TypeOf([]DhcpStaticBinding{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_static_binding_list_result", fields, reflect.TypeOf(DhcpStaticBindingListResult{}), fieldNameMap, validators) +} + +func DhcpStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["acks"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["acks"] = "Acks" + fields["declines"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["declines"] = "Declines" + fields["dhcp_server_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dhcp_server_id"] = "DhcpServerId" + fields["discovers"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["discovers"] = "Discovers" + fields["errors"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["errors"] = "Errors" + fields["informs"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["informs"] = "Informs" + fields["ip_pool_stats"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DhcpIpPoolUsageBindingType), reflect.TypeOf([]DhcpIpPoolUsage{}))) + fieldNameMap["ip_pool_stats"] = "IpPoolStats" + fields["nacks"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["nacks"] = "Nacks" + fields["offers"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["offers"] = "Offers" + fields["releases"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["releases"] = "Releases" + fields["requests"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["requests"] = "Requests" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_statistics", fields, reflect.TypeOf(DhcpStatistics{}), fieldNameMap, validators) +} + +func DhcpV6InfoBaseBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["dns_nameservers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dns_nameservers"] = "DnsNameservers" + fields["domain_names"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["domain_names"] = "DomainNames" + fields["lease_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["lease_time"] = "LeaseTime" + fields["preferred_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["preferred_time"] = "PreferredTime" + fields["sntp_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["sntp_servers"] = "SntpServers" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_v6_info_base", fields, reflect.TypeOf(DhcpV6InfoBase{}), fieldNameMap, validators) +} + +func DhcpV6IpPoolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["dns_nameservers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dns_nameservers"] = "DnsNameservers" + fields["domain_names"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["domain_names"] = "DomainNames" + fields["lease_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["lease_time"] = "LeaseTime" + fields["preferred_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["preferred_time"] = "PreferredTime" + fields["sntp_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["sntp_servers"] = "SntpServers" + fields["excluded_ranges"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IpPoolRangeBindingType), reflect.TypeOf([]IpPoolRange{}))) + fieldNameMap["excluded_ranges"] = "ExcludedRanges" + fields["ranges"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IpPoolRangeBindingType), reflect.TypeOf([]IpPoolRange{}))) + fieldNameMap["ranges"] = "Ranges" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_v6_ip_pool", fields, reflect.TypeOf(DhcpV6IpPool{}), fieldNameMap, validators) +} + +func DhcpV6IpPoolListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DhcpV6IpPoolBindingType), reflect.TypeOf([]DhcpV6IpPool{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_v6_ip_pool_list_result", fields, reflect.TypeOf(DhcpV6IpPoolListResult{}), fieldNameMap, validators) +} + +func DhcpV6StaticBindingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["dns_nameservers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dns_nameservers"] = "DnsNameservers" + fields["domain_names"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["domain_names"] = "DomainNames" + fields["lease_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["lease_time"] = "LeaseTime" + fields["preferred_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["preferred_time"] = "PreferredTime" + fields["sntp_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["sntp_servers"] = "SntpServers" + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_v6_static_binding", fields, reflect.TypeOf(DhcpV6StaticBinding{}), fieldNameMap, validators) +} + +func DhcpV6StaticBindingListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DhcpV6StaticBindingBindingType), reflect.TypeOf([]DhcpV6StaticBinding{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcp_v6_static_binding_list_result", fields, reflect.TypeOf(DhcpV6StaticBindingListResult{}), fieldNameMap, validators) +} + +func Dhcpv6HeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["msg_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["msg_type"] = "MsgType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dhcpv6_header", fields, reflect.TypeOf(Dhcpv6Header{}), fieldNameMap, validators) +} + +func DirectoryAdDomainBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["base_distinguished_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["base_distinguished_name"] = "BaseDistinguishedName" + fields["netbios_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["netbios_name"] = "NetbiosName" + fields["selective_sync_settings"] = bindings.NewOptionalType(bindings.NewReferenceType(SelectiveSyncSettingsBindingType)) + fieldNameMap["selective_sync_settings"] = "SelectiveSyncSettings" + fields["sync_settings"] = bindings.NewOptionalType(bindings.NewReferenceType(DirectoryDomainSyncSettingsBindingType)) + fieldNameMap["sync_settings"] = "SyncSettings" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["event_log_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DirectoryEventLogServerBindingType), reflect.TypeOf([]DirectoryEventLogServer{}))) + fieldNameMap["event_log_servers"] = "EventLogServers" + fields["ldap_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DirectoryLdapServerBindingType), reflect.TypeOf([]DirectoryLdapServer{}))) + fieldNameMap["ldap_servers"] = "LdapServers" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.directory_ad_domain", fields, reflect.TypeOf(DirectoryAdDomain{}), fieldNameMap, validators) +} + +func DirectoryAdGroupBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["object_guid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["object_guid"] = "ObjectGuid" + fields["secure_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["secure_id"] = "SecureId" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["distinguished_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["distinguished_name"] = "DistinguishedName" + fields["domain_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_id"] = "DomainId" + fields["domain_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_name"] = "DomainName" + fields["domain_sync_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_sync_node_id"] = "DomainSyncNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.directory_ad_group", fields, reflect.TypeOf(DirectoryAdGroup{}), fieldNameMap, validators) +} + +func DirectoryDomainBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["event_log_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DirectoryEventLogServerBindingType), reflect.TypeOf([]DirectoryEventLogServer{}))) + fieldNameMap["event_log_servers"] = "EventLogServers" + fields["ldap_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DirectoryLdapServerBindingType), reflect.TypeOf([]DirectoryLdapServer{}))) + fieldNameMap["ldap_servers"] = "LdapServers" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.directory_domain", fields, reflect.TypeOf(DirectoryDomain{}), fieldNameMap, validators) +} + +func DirectoryDomainListResultsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(DirectoryDomainBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.directory_domain_list_results", fields, reflect.TypeOf(DirectoryDomainListResults{}), fieldNameMap, validators) +} + +func DirectoryDomainSizeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["group_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["group_count"] = "GroupCount" + fields["group_member_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["group_member_count"] = "GroupMemberCount" + fields["user_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["user_count"] = "UserCount" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.directory_domain_size", fields, reflect.TypeOf(DirectoryDomainSize{}), fieldNameMap, validators) +} + +func DirectoryDomainSyncSettingsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["delta_sync_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["delta_sync_interval"] = "DeltaSyncInterval" + fields["full_sync_cron_expr"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["full_sync_cron_expr"] = "FullSyncCronExpr" + fields["sync_delay_in_sec"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sync_delay_in_sec"] = "SyncDelayInSec" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.directory_domain_sync_settings", fields, reflect.TypeOf(DirectoryDomainSyncSettings{}), fieldNameMap, validators) +} + +func DirectoryDomainSyncStatsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["avg_delta_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["avg_delta_sync_time"] = "AvgDeltaSyncTime" + fields["avg_full_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["avg_full_sync_time"] = "AvgFullSyncTime" + fields["current_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["current_state"] = "CurrentState" + fields["current_state_begin_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["current_state_begin_time"] = "CurrentStateBeginTime" + fields["num_delta_sync"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["num_delta_sync"] = "NumDeltaSync" + fields["num_full_sync"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["num_full_sync"] = "NumFullSync" + fields["prev_sync_end_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["prev_sync_end_time"] = "PrevSyncEndTime" + fields["prev_sync_error"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["prev_sync_error"] = "PrevSyncError" + fields["prev_sync_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["prev_sync_status"] = "PrevSyncStatus" + fields["prev_sync_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["prev_sync_type"] = "PrevSyncType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.directory_domain_sync_stats", fields, reflect.TypeOf(DirectoryDomainSyncStats{}), fieldNameMap, validators) +} + +func DirectoryEventLogServerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["domain_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_name"] = "DomainName" + fields["host"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host"] = "Host" + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["status"] = bindings.NewOptionalType(bindings.NewReferenceType(DirectoryEventLogServerStatusBindingType)) + fieldNameMap["status"] = "Status" + fields["username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["username"] = "Username" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.directory_event_log_server", fields, reflect.TypeOf(DirectoryEventLogServer{}), fieldNameMap, validators) +} + +func DirectoryEventLogServerStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["last_event_record_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_event_record_id"] = "LastEventRecordId" + fields["last_event_time_created"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_event_time_created"] = "LastEventTimeCreated" + fields["last_polling_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_polling_time"] = "LastPollingTime" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.directory_event_log_server_status", fields, reflect.TypeOf(DirectoryEventLogServerStatus{}), fieldNameMap, validators) +} + +func DirectoryGroupBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["distinguished_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["distinguished_name"] = "DistinguishedName" + fields["domain_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_id"] = "DomainId" + fields["domain_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_name"] = "DomainName" + fields["domain_sync_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_sync_node_id"] = "DomainSyncNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.directory_group", fields, reflect.TypeOf(DirectoryGroup{}), fieldNameMap, validators) +} + +func DirectoryGroupListResultsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(DirectoryGroupBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.directory_group_list_results", fields, reflect.TypeOf(DirectoryGroupListResults{}), fieldNameMap, validators) +} + +func DirectoryGroupMemberBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["group_distinguished_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["group_distinguished_name"] = "GroupDistinguishedName" + fields["group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["group_id"] = "GroupId" + fields["member_group_distinguished_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["member_group_distinguished_name"] = "MemberGroupDistinguishedName" + fields["member_group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["member_group_id"] = "MemberGroupId" + fields["nested"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["nested"] = "Nested" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.directory_group_member", fields, reflect.TypeOf(DirectoryGroupMember{}), fieldNameMap, validators) +} + +func DirectoryGroupMemberListResultsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DirectoryGroupMemberBindingType), reflect.TypeOf([]DirectoryGroupMember{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.directory_group_member_list_results", fields, reflect.TypeOf(DirectoryGroupMemberListResults{}), fieldNameMap, validators) +} + +func DirectoryLdapServerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["domain_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_name"] = "DomainName" + fields["host"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host"] = "Host" + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["protocol"] = "Protocol" + fields["thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["thumbprint"] = "Thumbprint" + fields["username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["username"] = "Username" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.directory_ldap_server", fields, reflect.TypeOf(DirectoryLdapServer{}), fieldNameMap, validators) +} + +func DirectoryLdapServerListResultsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DirectoryLdapServerBindingType), reflect.TypeOf([]DirectoryLdapServer{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.directory_ldap_server_list_results", fields, reflect.TypeOf(DirectoryLdapServerListResults{}), fieldNameMap, validators) +} + +func DirectoryLdapServerStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["error_id"] = "ErrorId" + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.directory_ldap_server_status", fields, reflect.TypeOf(DirectoryLdapServerStatus{}), fieldNameMap, validators) +} + +func DirectoryOrgUnitBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["children"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DirectoryOrgUnitBindingType), reflect.TypeOf([]DirectoryOrgUnit{}))) + fieldNameMap["children"] = "Children" + fields["distinguished_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["distinguished_name"] = "DistinguishedName" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.directory_org_unit", fields, reflect.TypeOf(DirectoryOrgUnit{}), fieldNameMap, validators) +} + +func DirectoryOrgUnitListResultsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DirectoryOrgUnitBindingType), reflect.TypeOf([]DirectoryOrgUnit{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.directory_org_unit_list_results", fields, reflect.TypeOf(DirectoryOrgUnitListResults{}), fieldNameMap, validators) +} + +func DiscoveredNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["certificate"] = "Certificate" + fields["cm_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cm_local_id"] = "CmLocalId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["hardware_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["hardware_id"] = "HardwareId" + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_type"] = "NodeType" + fields["origin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_id"] = "OriginId" + fields["origin_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["origin_properties"] = "OriginProperties" + fields["os_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["os_type"] = "OsType" + fields["os_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["os_version"] = "OsVersion" + fields["parent_compute_collection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_compute_collection"] = "ParentComputeCollection" + fields["stateless"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["stateless"] = "Stateless" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredResourceScopeBindingType), reflect.TypeOf([]DiscoveredResourceScope{}))) + fieldNameMap["scope"] = "Scope" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.discovered_node", fields, reflect.TypeOf(DiscoveredNode{}), fieldNameMap, validators) +} + +func DiscoveredNodeInterfacePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["connected_switch"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connected_switch"] = "ConnectedSwitch" + fields["connected_switch_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connected_switch_type"] = "ConnectedSwitchType" + fields["interface_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["interface_id"] = "InterfaceId" + fields["physical_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["physical_address"] = "PhysicalAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.discovered_node_interface_properties", fields, reflect.TypeOf(DiscoveredNodeInterfaceProperties{}), fieldNameMap, validators) +} + +func DiscoveredNodeListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredNodeBindingType), reflect.TypeOf([]DiscoveredNode{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.discovered_node_list_result", fields, reflect.TypeOf(DiscoveredNodeListResult{}), fieldNameMap, validators) +} + +func DiscoveredNodeNetworkInterfacesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["discovered_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["discovered_node_id"] = "DiscoveredNodeId" + fields["network_interfaces"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredNodeInterfacePropertiesBindingType), reflect.TypeOf([]DiscoveredNodeInterfaceProperties{}))) + fieldNameMap["network_interfaces"] = "NetworkInterfaces" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.discovered_node_network_interfaces", fields, reflect.TypeOf(DiscoveredNodeNetworkInterfaces{}), fieldNameMap, validators) +} + +func DiscoveredResourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredResourceScopeBindingType), reflect.TypeOf([]DiscoveredResourceScope{}))) + fieldNameMap["scope"] = "Scope" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.discovered_resource", fields, reflect.TypeOf(DiscoveredResource{}), fieldNameMap, validators) +} + +func DiscoveredResourceScopeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["scope_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scope_id"] = "ScopeId" + fields["scope_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scope_type"] = "ScopeType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.discovered_resource_scope", fields, reflect.TypeOf(DiscoveredResourceScope{}), fieldNameMap, validators) +} + +func DistributedVirtualPortgroupBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["backing_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["backing_type"] = "BackingType" + fields["key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key"] = "Key" + fields["overall_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["overall_status"] = "OverallStatus" + fields["cm_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cm_local_id"] = "CmLocalId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["origin_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_type"] = "OriginType" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredResourceScopeBindingType), reflect.TypeOf([]DiscoveredResourceScope{}))) + fieldNameMap["scope"] = "Scope" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.distributed_virtual_portgroup", fields, reflect.TypeOf(DistributedVirtualPortgroup{}), fieldNameMap, validators) +} + +func DistributedVirtualSwitchBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["discovered_nodes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredNodeBindingType), reflect.TypeOf([]DiscoveredNode{}))) + fieldNameMap["discovered_nodes"] = "DiscoveredNodes" + fields["lacp_group_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LacpGroupConfigInfoBindingType), reflect.TypeOf([]LacpGroupConfigInfo{}))) + fieldNameMap["lacp_group_configs"] = "LacpGroupConfigs" + fields["origin_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["origin_properties"] = "OriginProperties" + fields["uplink_port_names"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["uplink_port_names"] = "UplinkPortNames" + fields["uplink_portgroup"] = bindings.NewOptionalType(bindings.NewReferenceType(DistributedVirtualPortgroupBindingType)) + fieldNameMap["uplink_portgroup"] = "UplinkPortgroup" + fields["uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uuid"] = "Uuid" + fields["cm_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cm_local_id"] = "CmLocalId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["origin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_id"] = "OriginId" + fields["origin_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_type"] = "OriginType" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredResourceScopeBindingType), reflect.TypeOf([]DiscoveredResourceScope{}))) + fieldNameMap["scope"] = "Scope" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.distributed_virtual_switch", fields, reflect.TypeOf(DistributedVirtualSwitch{}), fieldNameMap, validators) +} + +func DnsAnswerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["answers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DnsQueryAnswerBindingType), reflect.TypeOf([]DnsQueryAnswer{}))) + fieldNameMap["answers"] = "Answers" + fields["authoritative_answers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DnsQueryAnswerBindingType), reflect.TypeOf([]DnsQueryAnswer{}))) + fieldNameMap["authoritative_answers"] = "AuthoritativeAnswers" + fields["dns_server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dns_server"] = "DnsServer" + fields["edge_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_node_id"] = "EdgeNodeId" + fields["non_authoritative_answers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DnsQueryAnswerBindingType), reflect.TypeOf([]DnsQueryAnswer{}))) + fieldNameMap["non_authoritative_answers"] = "NonAuthoritativeAnswers" + fields["raw_answer"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["raw_answer"] = "RawAnswer" + fields["source_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_ip"] = "SourceIp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dns_answer", fields, reflect.TypeOf(DnsAnswer{}), fieldNameMap, validators) +} + +func DnsFailedQueriesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["per_node_failed_queries"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PerNodeDnsFailedQueriesBindingType), reflect.TypeOf([]PerNodeDnsFailedQueries{}))) + fieldNameMap["per_node_failed_queries"] = "PerNodeFailedQueries" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["timestamp"] = "Timestamp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dns_failed_queries", fields, reflect.TypeOf(DnsFailedQueries{}), fieldNameMap, validators) +} + +func DnsFailedQueryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["address"] = "Address" + fields["client_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["client_ip"] = "ClientIp" + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["error_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_type"] = "ErrorType" + fields["forwarder_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["forwarder_ip"] = "ForwarderIp" + fields["record_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["record_type"] = "RecordType" + fields["source_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_ip"] = "SourceIp" + fields["time_spent"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["time_spent"] = "TimeSpent" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["upstream_server_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["upstream_server_ip"] = "UpstreamServerIp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dns_failed_query", fields, reflect.TypeOf(DnsFailedQuery{}), fieldNameMap, validators) +} + +func DnsForwarderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["cache_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cache_size"] = "CacheSize" + fields["conditional_forwarders"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ConditionalForwarderZoneBindingType), reflect.TypeOf([]ConditionalForwarderZone{}))) + fieldNameMap["conditional_forwarders"] = "ConditionalForwarders" + fields["default_forwarder"] = bindings.NewOptionalType(bindings.NewReferenceType(ForwarderZoneBindingType)) + fieldNameMap["default_forwarder"] = "DefaultForwarder" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["listener_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["listener_ip"] = "ListenerIp" + fields["log_level"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["log_level"] = "LogLevel" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dns_forwarder", fields, reflect.TypeOf(DnsForwarder{}), fieldNameMap, validators) +} + +func DnsForwarderListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DnsForwarderBindingType), reflect.TypeOf([]DnsForwarder{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dns_forwarder_list_result", fields, reflect.TypeOf(DnsForwarderListResult{}), fieldNameMap, validators) +} + +func DnsForwarderStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["conditional_forwarder_statistics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PerForwarderStatisticsBindingType), reflect.TypeOf([]PerForwarderStatistics{}))) + fieldNameMap["conditional_forwarder_statistics"] = "ConditionalForwarderStatistics" + fields["configured_cache_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["configured_cache_size"] = "ConfiguredCacheSize" + fields["default_forwarder_statistics"] = bindings.NewOptionalType(bindings.NewReferenceType(PerForwarderStatisticsBindingType)) + fieldNameMap["default_forwarder_statistics"] = "DefaultForwarderStatistics" + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["queries_answered_locally"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["queries_answered_locally"] = "QueriesAnsweredLocally" + fields["queries_forwarded"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["queries_forwarded"] = "QueriesForwarded" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["total_queries"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_queries"] = "TotalQueries" + fields["used_cache_statistics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PerNodeUsedCacheStatisticsBindingType), reflect.TypeOf([]PerNodeUsedCacheStatistics{}))) + fieldNameMap["used_cache_statistics"] = "UsedCacheStatistics" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dns_forwarder_statistics", fields, reflect.TypeOf(DnsForwarderStatistics{}), fieldNameMap, validators) +} + +func DnsForwarderStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_node"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["active_node"] = "ActiveNode" + fields["extra_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["extra_message"] = "ExtraMessage" + fields["standby_node"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["standby_node"] = "StandbyNode" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dns_forwarder_status", fields, reflect.TypeOf(DnsForwarderStatus{}), fieldNameMap, validators) +} + +func DnsHeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["address"] = "Address" + fields["address_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["address_type"] = "AddressType" + fields["message_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["message_type"] = "MessageType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dns_header", fields, reflect.TypeOf(DnsHeader{}), fieldNameMap, validators) +} + +func DnsQueryAnswerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["address"] = "Address" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["raw_string"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["raw_string"] = "RawString" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dns_query_answer", fields, reflect.TypeOf(DnsQueryAnswer{}), fieldNameMap, validators) +} + +func DnsTtlConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dns_ttl_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dns_ttl_type"] = "DnsTtlType" + fields["ttl"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ttl"] = "Ttl" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dns_ttl_config", fields, reflect.TypeOf(DnsTtlConfig{}), fieldNameMap, validators) +} + +func DonutConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["count"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["count"] = "Count" + fields["display_count"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["display_count"] = "DisplayCount" + fields["label"] = bindings.NewOptionalType(bindings.NewReferenceType(LabelBindingType)) + fieldNameMap["label"] = "Label" + fields["navigation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["navigation"] = "Navigation" + fields["sections"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DonutSectionBindingType), reflect.TypeOf([]DonutSection{}))) + fieldNameMap["sections"] = "Sections" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["feature_set"] = bindings.NewOptionalType(bindings.NewReferenceType(FeatureSetBindingType)) + fieldNameMap["feature_set"] = "FeatureSet" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["filters"] = "Filters" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["plot_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(WidgetPlotConfigurationBindingType), reflect.TypeOf([]WidgetPlotConfiguration{}))) + fieldNameMap["plot_configs"] = "PlotConfigs" + fields["rowspan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rowspan"] = "Rowspan" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["show_header"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_header"] = "ShowHeader" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.donut_configuration", fields, reflect.TypeOf(DonutConfiguration{}), fieldNameMap, validators) +} + +func DonutPartBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["field"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["field"] = "Field" + fields["hide_empty_legend"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["hide_empty_legend"] = "HideEmptyLegend" + fields["label"] = bindings.NewOptionalType(bindings.NewReferenceType(LabelBindingType)) + fieldNameMap["label"] = "Label" + fields["navigation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["navigation"] = "Navigation" + fields["render_configuration"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RenderConfigurationBindingType), reflect.TypeOf([]RenderConfiguration{}))) + fieldNameMap["render_configuration"] = "RenderConfiguration" + fields["tooltip"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TooltipBindingType), reflect.TypeOf([]Tooltip{}))) + fieldNameMap["tooltip"] = "Tooltip" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.donut_part", fields, reflect.TypeOf(DonutPart{}), fieldNameMap, validators) +} + +func DonutSectionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["parts"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DonutPartBindingType), reflect.TypeOf([]DonutPart{}))) + fieldNameMap["parts"] = "Parts" + fields["row_list_field"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["row_list_field"] = "RowListField" + fields["template"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["template"] = "Template" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.donut_section", fields, reflect.TypeOf(DonutSection{}), fieldNameMap, validators) +} + +func DropdownFilterPlotConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allow_maximize"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["allow_maximize"] = "AllowMaximize" + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["allow_search"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["allow_search"] = "AllowSearch" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dropdown_filter_plot_configuration", fields, reflect.TypeOf(DropdownFilterPlotConfiguration{}), fieldNameMap, validators) +} + +func DropdownFilterWidgetConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["default_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["default_value"] = "DefaultValue" + fields["dropdown_filter_plot_config"] = bindings.NewOptionalType(bindings.NewReferenceType(DropdownFilterPlotConfigurationBindingType)) + fieldNameMap["dropdown_filter_plot_config"] = "DropdownFilterPlotConfig" + fields["dropdown_item"] = bindings.NewOptionalType(bindings.NewReferenceType(DropdownItemBindingType)) + fieldNameMap["dropdown_item"] = "DropdownItem" + fields["placeholder_msg"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["placeholder_msg"] = "PlaceholderMsg" + fields["static_filter_condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["static_filter_condition"] = "StaticFilterCondition" + fields["static_filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(StaticFilterBindingType), reflect.TypeOf([]StaticFilter{}))) + fieldNameMap["static_filters"] = "StaticFilters" + fields["alias"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["alias"] = "Alias" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["feature_set"] = bindings.NewOptionalType(bindings.NewReferenceType(FeatureSetBindingType)) + fieldNameMap["feature_set"] = "FeatureSet" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["filters"] = "Filters" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["plot_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(WidgetPlotConfigurationBindingType), reflect.TypeOf([]WidgetPlotConfiguration{}))) + fieldNameMap["plot_configs"] = "PlotConfigs" + fields["rowspan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rowspan"] = "Rowspan" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["show_header"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_header"] = "ShowHeader" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dropdown_filter_widget_configuration", fields, reflect.TypeOf(DropdownFilterWidgetConfiguration{}), fieldNameMap, validators) +} + +func DropdownItemBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["additional_value"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["additional_value"] = "AdditionalValue" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["field"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["field"] = "Field" + fields["short_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["short_display_name"] = "ShortDisplayName" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dropdown_item", fields, reflect.TypeOf(DropdownItem{}), fieldNameMap, validators) +} + +func DscpBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mode"] = "Mode" + fields["priority"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["priority"] = "Priority" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dscp", fields, reflect.TypeOf(Dscp{}), fieldNameMap, validators) +} + +func DuplicateAddressBindingEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["binding"] = bindings.NewOptionalType(bindings.NewReferenceType(PacketAddressClassifierBindingType)) + fieldNameMap["binding"] = "Binding" + fields["binding_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["binding_timestamp"] = "BindingTimestamp" + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source"] = "Source" + fields["conflicting_port"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["conflicting_port"] = "ConflictingPort" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.duplicate_address_binding_entry", fields, reflect.TypeOf(DuplicateAddressBindingEntry{}), fieldNameMap, validators) +} + +func DuplicateIPDetectionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["duplicate_ip_detection_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["duplicate_ip_detection_enabled"] = "DuplicateIpDetectionEnabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.duplicate_IP_detection", fields, reflect.TypeOf(DuplicateIPDetection{}), fieldNameMap, validators) +} + +func DynamicContentFiltersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dynamic_content_filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dynamic_content_filters"] = "DynamicContentFilters" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.dynamic_content_filters", fields, reflect.TypeOf(DynamicContentFilters{}), fieldNameMap, validators) +} + +func EULAAcceptanceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["acceptance"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["acceptance"] = "Acceptance" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.EULA_acceptance", fields, reflect.TypeOf(EULAAcceptance{}), fieldNameMap, validators) +} + +func EULAContentBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["content"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["content"] = "Content" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.EULA_content", fields, reflect.TypeOf(EULAContent{}), fieldNameMap, validators) +} + +func EdgeClusterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["allocation_rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AllocationRuleBindingType), reflect.TypeOf([]AllocationRule{}))) + fieldNameMap["allocation_rules"] = "AllocationRules" + fields["cluster_profile_bindings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ClusterProfileTypeIdEntryBindingType), reflect.TypeOf([]ClusterProfileTypeIdEntry{}))) + fieldNameMap["cluster_profile_bindings"] = "ClusterProfileBindings" + fields["deployment_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["deployment_type"] = "DeploymentType" + fields["enable_inter_site_forwarding"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_inter_site_forwarding"] = "EnableInterSiteForwarding" + fields["member_node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["member_node_type"] = "MemberNodeType" + fields["members"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(EdgeClusterMemberBindingType), reflect.TypeOf([]EdgeClusterMember{}))) + fieldNameMap["members"] = "Members" + fields["node_rtep_ips"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeRtepIpsConfigBindingType), reflect.TypeOf([]NodeRtepIpsConfig{}))) + fieldNameMap["node_rtep_ips"] = "NodeRtepIps" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.edge_cluster", fields, reflect.TypeOf(EdgeCluster{}), fieldNameMap, validators) +} + +func EdgeClusterAllocationStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["member_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["member_count"] = "MemberCount" + fields["members"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(EdgeMemberAllocationStatusBindingType), reflect.TypeOf([]EdgeMemberAllocationStatus{}))) + fieldNameMap["members"] = "Members" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.edge_cluster_allocation_status", fields, reflect.TypeOf(EdgeClusterAllocationStatus{}), fieldNameMap, validators) +} + +func EdgeClusterInterSiteStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["edge_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + fields["edge_cluster_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_cluster_name"] = "EdgeClusterName" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["member_status"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(EdgeClusterMemberInterSiteStatusBindingType), reflect.TypeOf([]EdgeClusterMemberInterSiteStatus{}))) + fieldNameMap["member_status"] = "MemberStatus" + fields["overall_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["overall_status"] = "OverallStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.edge_cluster_inter_site_status", fields, reflect.TypeOf(EdgeClusterInterSiteStatus{}), fieldNameMap, validators) +} + +func EdgeClusterListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(EdgeClusterBindingType), reflect.TypeOf([]EdgeCluster{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.edge_cluster_list_result", fields, reflect.TypeOf(EdgeClusterListResult{}), fieldNameMap, validators) +} + +func EdgeClusterMemberBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["member_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["member_index"] = "MemberIndex" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.edge_cluster_member", fields, reflect.TypeOf(EdgeClusterMember{}), fieldNameMap, validators) +} + +func EdgeClusterMemberAllocationPoolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allocation_pool_type"] = bindings.NewStringType() + fieldNameMap["allocation_pool_type"] = "AllocationPoolType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.edge_cluster_member_allocation_pool", fields, reflect.TypeOf(EdgeClusterMemberAllocationPool{}), fieldNameMap, validators) +} + +func EdgeClusterMemberAllocationProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allocation_pool"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(EdgeClusterMemberAllocationPoolBindingType)}, bindings.REST)) + fieldNameMap["allocation_pool"] = "AllocationPool" + fields["allocation_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["allocation_type"] = "AllocationType" + fields["enable_standby_relocation"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_standby_relocation"] = "EnableStandbyRelocation" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.edge_cluster_member_allocation_profile", fields, reflect.TypeOf(EdgeClusterMemberAllocationProfile{}), fieldNameMap, validators) +} + +func EdgeClusterMemberInterSiteStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["established_bgp_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["established_bgp_sessions"] = "EstablishedBgpSessions" + fields["neighbor_status"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BgpNeighborStatusLiteDtoBindingType), reflect.TypeOf([]BgpNeighborStatusLiteDto{}))) + fieldNameMap["neighbor_status"] = "NeighborStatus" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["total_bgp_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_bgp_sessions"] = "TotalBgpSessions" + fields["transport_node"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["transport_node"] = "TransportNode" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.edge_cluster_member_inter_site_status", fields, reflect.TypeOf(EdgeClusterMemberInterSiteStatus{}), fieldNameMap, validators) +} + +func EdgeClusterMemberStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["transport_node"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["transport_node"] = "TransportNode" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.edge_cluster_member_status", fields, reflect.TypeOf(EdgeClusterMemberStatus{}), fieldNameMap, validators) +} + +func EdgeClusterMemberTransportNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["member_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["member_index"] = "MemberIndex" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.edge_cluster_member_transport_node", fields, reflect.TypeOf(EdgeClusterMemberTransportNode{}), fieldNameMap, validators) +} + +func EdgeClusterStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ConfigurationStateElementBindingType), reflect.TypeOf([]ConfigurationStateElement{}))) + fieldNameMap["details"] = "Details" + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + fields["pending_change_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["pending_change_list"] = "PendingChangeList" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.edge_cluster_state", fields, reflect.TypeOf(EdgeClusterState{}), fieldNameMap, validators) +} + +func EdgeClusterStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["edge_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + fields["edge_cluster_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_cluster_status"] = "EdgeClusterStatus" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["member_status"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(EdgeClusterMemberStatusBindingType), reflect.TypeOf([]EdgeClusterMemberStatus{}))) + fieldNameMap["member_status"] = "MemberStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.edge_cluster_status", fields, reflect.TypeOf(EdgeClusterStatus{}), fieldNameMap, validators) +} + +func EdgeConfigurationStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ConfigurationStateElementBindingType), reflect.TypeOf([]ConfigurationStateElement{}))) + fieldNameMap["details"] = "Details" + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + fields["pending_change_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["pending_change_list"] = "PendingChangeList" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.edge_configuration_state", fields, reflect.TypeOf(EdgeConfigurationState{}), fieldNameMap, validators) +} + +func EdgeHighAvailabilityProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bfd_allowed_hops"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bfd_allowed_hops"] = "BfdAllowedHops" + fields["bfd_declare_dead_multiple"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bfd_declare_dead_multiple"] = "BfdDeclareDeadMultiple" + fields["bfd_probe_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bfd_probe_interval"] = "BfdProbeInterval" + fields["standby_relocation_config"] = bindings.NewOptionalType(bindings.NewReferenceType(StandbyRelocationConfigBindingType)) + fieldNameMap["standby_relocation_config"] = "StandbyRelocationConfig" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.edge_high_availability_profile", fields, reflect.TypeOf(EdgeHighAvailabilityProfile{}), fieldNameMap, validators) +} + +func EdgeMemberAllocationStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allocated_services"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AllocatedServiceBindingType), reflect.TypeOf([]AllocatedService{}))) + fieldNameMap["allocated_services"] = "AllocatedServices" + fields["allocation_pools"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AllocationPoolBindingType), reflect.TypeOf([]AllocationPool{}))) + fieldNameMap["allocation_pools"] = "AllocationPools" + fields["member_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["member_index"] = "MemberIndex" + fields["node_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_display_name"] = "NodeDisplayName" + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.edge_member_allocation_status", fields, reflect.TypeOf(EdgeMemberAllocationStatus{}), fieldNameMap, validators) +} + +func EdgeNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allocation_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["allocation_list"] = "AllocationList" + fields["deployment_config"] = bindings.NewOptionalType(bindings.NewReferenceType(EdgeNodeDeploymentConfigBindingType)) + fieldNameMap["deployment_config"] = "DeploymentConfig" + fields["deployment_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["deployment_type"] = "DeploymentType" + fields["node_settings"] = bindings.NewOptionalType(bindings.NewReferenceType(EdgeNodeSettingsBindingType)) + fieldNameMap["node_settings"] = "NodeSettings" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["discovered_ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["discovered_ip_addresses"] = "DiscoveredIpAddresses" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["fqdn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["fqdn"] = "Fqdn" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.edge_node", fields, reflect.TypeOf(EdgeNode{}), fieldNameMap, validators) +} + +func EdgeNodeDeploymentConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["form_factor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["form_factor"] = "FormFactor" + fields["node_user_settings"] = bindings.NewOptionalType(bindings.NewReferenceType(NodeUserSettingsBindingType)) + fieldNameMap["node_user_settings"] = "NodeUserSettings" + fields["vm_deployment_config"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(DeploymentConfigBindingType)}, bindings.REST)) + fieldNameMap["vm_deployment_config"] = "VmDeploymentConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.edge_node_deployment_config", fields, reflect.TypeOf(EdgeNodeDeploymentConfig{}), fieldNameMap, validators) +} + +func EdgeNodeSettingsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["advanced_configuration"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["advanced_configuration"] = "AdvancedConfiguration" + fields["allow_ssh_root_login"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["allow_ssh_root_login"] = "AllowSshRootLogin" + fields["dns_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dns_servers"] = "DnsServers" + fields["enable_ssh"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_ssh"] = "EnableSsh" + fields["hostname"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["hostname"] = "Hostname" + fields["ntp_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ntp_servers"] = "NtpServers" + fields["search_domains"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["search_domains"] = "SearchDomains" + fields["syslog_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SyslogConfigurationBindingType), reflect.TypeOf([]SyslogConfiguration{}))) + fieldNameMap["syslog_servers"] = "SyslogServers" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.edge_node_settings", fields, reflect.TypeOf(EdgeNodeSettings{}), fieldNameMap, validators) +} + +func EdgeTransportNodeDatapathMemoryPoolUsageBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["usage"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["usage"] = "Usage" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.edge_transport_node_datapath_memory_pool_usage", fields, reflect.TypeOf(EdgeTransportNodeDatapathMemoryPoolUsage{}), fieldNameMap, validators) +} + +func EdgeTransportNodeDatapathMemoryUsageBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["datapath_heap_usage"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["datapath_heap_usage"] = "DatapathHeapUsage" + fields["datapath_mem_pools_usage"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(EdgeTransportNodeDatapathMemoryPoolUsageBindingType), reflect.TypeOf([]EdgeTransportNodeDatapathMemoryPoolUsage{}))) + fieldNameMap["datapath_mem_pools_usage"] = "DatapathMemPoolsUsage" + fields["highest_datapath_mem_pool_usage"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["highest_datapath_mem_pool_usage"] = "HighestDatapathMemPoolUsage" + fields["highest_datapath_mem_pool_usage_names"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["highest_datapath_mem_pool_usage_names"] = "HighestDatapathMemPoolUsageNames" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.edge_transport_node_datapath_memory_usage", fields, reflect.TypeOf(EdgeTransportNodeDatapathMemoryUsage{}), fieldNameMap, validators) +} + +func EdgeTransportNodeMemoryUsageBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cache_usage"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["cache_usage"] = "CacheUsage" + fields["datapath_mem_usage_details"] = bindings.NewOptionalType(bindings.NewReferenceType(EdgeTransportNodeDatapathMemoryUsageBindingType)) + fieldNameMap["datapath_mem_usage_details"] = "DatapathMemUsageDetails" + fields["datapath_total_usage"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["datapath_total_usage"] = "DatapathTotalUsage" + fields["swap_usage"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["swap_usage"] = "SwapUsage" + fields["system_mem_usage"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["system_mem_usage"] = "SystemMemUsage" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.edge_transport_node_memory_usage", fields, reflect.TypeOf(EdgeTransportNodeMemoryUsage{}), fieldNameMap, validators) +} + +func EdgeUpgradeStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["can_rollback"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["can_rollback"] = "CanRollback" + fields["can_skip"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["can_skip"] = "CanSkip" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["current_version_node_summary"] = bindings.NewOptionalType(bindings.NewReferenceType(NodeSummaryListBindingType)) + fieldNameMap["current_version_node_summary"] = "CurrentVersionNodeSummary" + fields["details"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["details"] = "Details" + fields["node_count_at_target_version"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["node_count_at_target_version"] = "NodeCountAtTargetVersion" + fields["percent_complete"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["percent_complete"] = "PercentComplete" + fields["pre_upgrade_status"] = bindings.NewOptionalType(bindings.NewReferenceType(UpgradeChecksExecutionStatusBindingType)) + fieldNameMap["pre_upgrade_status"] = "PreUpgradeStatus" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["target_component_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_component_version"] = "TargetComponentVersion" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.edge_upgrade_status", fields, reflect.TypeOf(EdgeUpgradeStatus{}), fieldNameMap, validators) +} + +func EffectiveIPAddressMemberListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.effective_IP_address_member_list_result", fields, reflect.TypeOf(EffectiveIPAddressMemberListResult{}), fieldNameMap, validators) +} + +func EffectiveIPInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["effective_ips"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["effective_ips"] = "EffectiveIps" + fields["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_id"] = "SiteId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.effective_IP_info", fields, reflect.TypeOf(EffectiveIPInfo{}), fieldNameMap, validators) +} + +func EffectiveMemberResourceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.effective_member_resource_list_result", fields, reflect.TypeOf(EffectiveMemberResourceListResult{}), fieldNameMap, validators) +} + +func EffectiveMemberTypeListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.effective_member_type_list_result", fields, reflect.TypeOf(EffectiveMemberTypeListResult{}), fieldNameMap, validators) +} + +func EffectiveProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NSXProfileReferenceBindingType), reflect.TypeOf([]NSXProfileReference{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.effective_profile_list_result", fields, reflect.TypeOf(EffectiveProfileListResult{}), fieldNameMap, validators) +} + +func EgressRateShaperBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["average_bandwidth_mbps"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["average_bandwidth_mbps"] = "AverageBandwidthMbps" + fields["burst_size_bytes"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["burst_size_bytes"] = "BurstSizeBytes" + fields["peak_bandwidth_mbps"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["peak_bandwidth_mbps"] = "PeakBandwidthMbps" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.egress_rate_shaper", fields, reflect.TypeOf(EgressRateShaper{}), fieldNameMap, validators) +} + +func EmbeddedResourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_owner"] = bindings.NewOptionalType(bindings.NewReferenceType(OwnerResourceLinkBindingType)) + fieldNameMap["_owner"] = "Owner" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.embedded_resource", fields, reflect.TypeOf(EmbeddedResource{}), fieldNameMap, validators) +} + +func EndpointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["default_gateway"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["default_gateway"] = "DefaultGateway" + fields["device_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["device_name"] = "DeviceName" + fields["ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip"] = "Ip" + fields["label"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["label"] = "Label" + fields["mac"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac"] = "Mac" + fields["subnet_mask"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["subnet_mask"] = "SubnetMask" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.endpoint", fields, reflect.TypeOf(Endpoint{}), fieldNameMap, validators) +} + +func ErrorInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["error_code"] = "ErrorCode" + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.error_info", fields, reflect.TypeOf(ErrorInfo{}), fieldNameMap, validators) +} + +func ErrorResolverInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["error_id"] = "ErrorId" + fields["resolver_present"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["resolver_present"] = "ResolverPresent" + fields["user_metadata"] = bindings.NewOptionalType(bindings.NewReferenceType(ErrorResolverUserMetadataBindingType)) + fieldNameMap["user_metadata"] = "UserMetadata" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.error_resolver_info", fields, reflect.TypeOf(ErrorResolverInfo{}), fieldNameMap, validators) +} + +func ErrorResolverInfoListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ErrorResolverInfoBindingType), reflect.TypeOf([]ErrorResolverInfo{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.error_resolver_info_list", fields, reflect.TypeOf(ErrorResolverInfoList{}), fieldNameMap, validators) +} + +func ErrorResolverMetadataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["entity_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["entity_id"] = "EntityId" + fields["error_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["error_id"] = "ErrorId" + fields["system_metadata"] = bindings.NewOptionalType(bindings.NewReferenceType(ErrorResolverSystemMetadataBindingType)) + fieldNameMap["system_metadata"] = "SystemMetadata" + fields["user_metadata"] = bindings.NewOptionalType(bindings.NewReferenceType(ErrorResolverUserMetadataBindingType)) + fieldNameMap["user_metadata"] = "UserMetadata" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.error_resolver_metadata", fields, reflect.TypeOf(ErrorResolverMetadata{}), fieldNameMap, validators) +} + +func ErrorResolverMetadataListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ErrorResolverMetadataBindingType), reflect.TypeOf([]ErrorResolverMetadata{}))) + fieldNameMap["errors"] = "Errors" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.error_resolver_metadata_list", fields, reflect.TypeOf(ErrorResolverMetadataList{}), fieldNameMap, validators) +} + +func ErrorResolverSystemMetadataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.error_resolver_system_metadata", fields, reflect.TypeOf(ErrorResolverSystemMetadata{}), fieldNameMap, validators) +} + +func ErrorResolverUserInputDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["data_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["data_type"] = "DataType" + fields["property_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["property_name"] = "PropertyName" + fields["property_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["property_value"] = "PropertyValue" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.error_resolver_user_input_data", fields, reflect.TypeOf(ErrorResolverUserInputData{}), fieldNameMap, validators) +} + +func ErrorResolverUserMetadataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["user_input_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ErrorResolverUserInputDataBindingType), reflect.TypeOf([]ErrorResolverUserInputData{}))) + fieldNameMap["user_input_list"] = "UserInputList" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.error_resolver_user_metadata", fields, reflect.TypeOf(ErrorResolverUserMetadata{}), fieldNameMap, validators) +} + +func EsxGlobalOpaqueConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["opaque_config"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["opaque_config"] = "OpaqueConfig" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.esx_global_opaque_config", fields, reflect.TypeOf(EsxGlobalOpaqueConfig{}), fieldNameMap, validators) +} + +func EtherTypeNSServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ether_type"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ether_type"] = "EtherType" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ether_type_NS_service", fields, reflect.TypeOf(EtherTypeNSService{}), fieldNameMap, validators) +} + +func EthernetHeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dst_mac"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_mac"] = "DstMac" + fields["eth_type"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["eth_type"] = "EthType" + fields["src_mac"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["src_mac"] = "SrcMac" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ethernet_header", fields, reflect.TypeOf(EthernetHeader{}), fieldNameMap, validators) +} + +func EventListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MonitoringEventBindingType), reflect.TypeOf([]MonitoringEvent{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.event_list_result", fields, reflect.TypeOf(EventListResult{}), fieldNameMap, validators) +} + +func ExcludeListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["member_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["member_count"] = "MemberCount" + fields["members"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["members"] = "Members" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.exclude_list", fields, reflect.TypeOf(ExcludeList{}), fieldNameMap, validators) +} + +func ExtendedSolutionConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["attributes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AttributeBindingType), reflect.TypeOf([]Attribute{}))) + fieldNameMap["attributes"] = "Attributes" + fields["service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.extended_solution_config", fields, reflect.TypeOf(ExtendedSolutionConfig{}), fieldNameMap, validators) +} + +func ExtraConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["config_pair"] = bindings.NewOptionalType(bindings.NewReferenceType(UnboundedKeyValuePairBindingType)) + fieldNameMap["config_pair"] = "ConfigPair" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.extra_config", fields, reflect.TypeOf(ExtraConfig{}), fieldNameMap, validators) +} + +func ExtraConfigHostSwitchProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["extra_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ExtraConfigBindingType), reflect.TypeOf([]ExtraConfig{}))) + fieldNameMap["extra_configs"] = "ExtraConfigs" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["required_capabilities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["required_capabilities"] = "RequiredCapabilities" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.extra_config_host_switch_profile", fields, reflect.TypeOf(ExtraConfigHostSwitchProfile{}), fieldNameMap, validators) +} + +func FailedNodeSupportBundleResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_code"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_code"] = "ErrorCode" + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["node_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_display_name"] = "NodeDisplayName" + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.failed_node_support_bundle_result", fields, reflect.TypeOf(FailedNodeSupportBundleResult{}), fieldNameMap, validators) +} + +func FailureDomainBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["preferred_active_edge_services"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["preferred_active_edge_services"] = "PreferredActiveEdgeServices" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.failure_domain", fields, reflect.TypeOf(FailureDomain{}), fieldNameMap, validators) +} + +func FailureDomainListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FailureDomainBindingType), reflect.TypeOf([]FailureDomain{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.failure_domain_list_result", fields, reflect.TypeOf(FailureDomainListResult{}), fieldNameMap, validators) +} + +func FeaturePermissionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["feature"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["feature"] = "Feature" + fields["feature_description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["feature_description"] = "FeatureDescription" + fields["feature_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["feature_name"] = "FeatureName" + fields["is_execute_recommended"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_execute_recommended"] = "IsExecuteRecommended" + fields["is_internal"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_internal"] = "IsInternal" + fields["permission"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["permission"] = "Permission" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.feature_permission", fields, reflect.TypeOf(FeaturePermission{}), fieldNameMap, validators) +} + +func FeaturePermissionArrayBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["feature_permissions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FeaturePermissionBindingType), reflect.TypeOf([]FeaturePermission{}))) + fieldNameMap["feature_permissions"] = "FeaturePermissions" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.feature_permission_array", fields, reflect.TypeOf(FeaturePermissionArray{}), fieldNameMap, validators) +} + +func FeaturePermissionListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FeaturePermissionBindingType), reflect.TypeOf([]FeaturePermission{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.feature_permission_list_result", fields, reflect.TypeOf(FeaturePermissionListResult{}), fieldNameMap, validators) +} + +func FeatureSetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["feature_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["feature_list"] = "FeatureList" + fields["require_all_permissions"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["require_all_permissions"] = "RequireAllPermissions" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.feature_set", fields, reflect.TypeOf(FeatureSet{}), fieldNameMap, validators) +} + +func FeatureUsageBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["capacity_usage"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(CapacityUsageBindingType), reflect.TypeOf([]CapacityUsage{}))) + fieldNameMap["capacity_usage"] = "CapacityUsage" + fields["feature"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["feature"] = "Feature" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.feature_usage", fields, reflect.TypeOf(FeatureUsage{}), fieldNameMap, validators) +} + +func FeatureUsageCsvRecordBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ccu_usage_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ccu_usage_count"] = "CcuUsageCount" + fields["core_usage_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["core_usage_count"] = "CoreUsageCount" + fields["cpu_usage_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cpu_usage_count"] = "CpuUsageCount" + fields["feature"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["feature"] = "Feature" + fields["vcpu_usage_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vcpu_usage_count"] = "VcpuUsageCount" + fields["vm_usage_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vm_usage_count"] = "VmUsageCount" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.feature_usage_csv_record", fields, reflect.TypeOf(FeatureUsageCsvRecord{}), fieldNameMap, validators) +} + +func FeatureUsageListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["feature_usage_info"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FeatureUsageBindingType), reflect.TypeOf([]FeatureUsage{}))) + fieldNameMap["feature_usage_info"] = "FeatureUsageInfo" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.feature_usage_list", fields, reflect.TypeOf(FeatureUsageList{}), fieldNameMap, validators) +} + +func FeatureUsageListInCsvFormatBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_name"] = "FileName" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FeatureUsageCsvRecordBindingType), reflect.TypeOf([]FeatureUsageCsvRecord{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.feature_usage_list_in_csv_format", fields, reflect.TypeOf(FeatureUsageListInCsvFormat{}), fieldNameMap, validators) +} + +func FederationConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["epoch"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["epoch"] = "Epoch" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["sites"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FederationSiteBindingType), reflect.TypeOf([]FederationSite{}))) + fieldNameMap["sites"] = "Sites" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.federation_configuration", fields, reflect.TypeOf(FederationConfiguration{}), fieldNameMap, validators) +} + +func FederationSiteBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_gm"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["active_gm"] = "ActiveGm" + fields["aph_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AphInfoBindingType), reflect.TypeOf([]AphInfo{}))) + fieldNameMap["aph_list"] = "AphList" + fields["cert_hash"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cert_hash"] = "CertHash" + fields["cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cluster_id"] = "ClusterId" + fields["config_version"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["config_version"] = "ConfigVersion" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["is_federated"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_federated"] = "IsFederated" + fields["is_local"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_local"] = "IsLocal" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_type"] = "NodeType" + fields["site_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_version"] = "SiteVersion" + fields["split_brain"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["split_brain"] = "SplitBrain" + fields["system_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["system_id"] = "SystemId" + fields["trust_manager_cert"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["trust_manager_cert"] = "TrustManagerCert" + fields["vip_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vip_ip"] = "VipIp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.federation_site", fields, reflect.TypeOf(FederationSite{}), fieldNameMap, validators) +} + +func FederationSiteMigrationStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["site_migration_state"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["site_migration_state"] = "SiteMigrationState" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.federation_site_migration_state", fields, reflect.TypeOf(FederationSiteMigrationState{}), fieldNameMap, validators) +} + +func FederationStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_standby_sync_statuses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ActiveStandbySyncStatusBindingType), reflect.TypeOf([]ActiveStandbySyncStatus{}))) + fieldNameMap["active_standby_sync_statuses"] = "ActiveStandbySyncStatuses" + fields["remote_connections"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SiteStatusBindingType), reflect.TypeOf([]SiteStatus{}))) + fieldNameMap["remote_connections"] = "RemoteConnections" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.federation_status", fields, reflect.TypeOf(FederationStatus{}), fieldNameMap, validators) +} + +func FeedBackBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FeedBackErrorMessageBindingType), reflect.TypeOf([]FeedBackErrorMessage{}))) + fieldNameMap["error_list"] = "ErrorList" + fields["mp_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mp_display_name"] = "MpDisplayName" + fields["mp_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mp_id"] = "MpId" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.feed_back", fields, reflect.TypeOf(FeedBack{}), fieldNameMap, validators) +} + +func FeedBackErrorMessageBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_desc"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_desc"] = "ErrorDesc" + fields["error_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_id"] = "ErrorId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.feed_back_error_message", fields, reflect.TypeOf(FeedBackErrorMessage{}), fieldNameMap, validators) +} + +func FeedBackListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FeedBackBindingType), reflect.TypeOf([]FeedBack{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.feed_back_list_result", fields, reflect.TypeOf(FeedBackListResult{}), fieldNameMap, validators) +} + +func FieldsFilterDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_info"] = bindings.NewOptionalType(bindings.NewReferenceType(IpInfoBindingType)) + fieldNameMap["ip_info"] = "IpInfo" + fields["transport_info"] = bindings.NewOptionalType(bindings.NewReferenceType(TransportInfoBindingType)) + fieldNameMap["transport_info"] = "TransportInfo" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.fields_filter_data", fields, reflect.TypeOf(FieldsFilterData{}), fieldNameMap, validators) +} + +func FieldsPacketDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["arp_header"] = bindings.NewOptionalType(bindings.NewReferenceType(ArpHeaderBindingType)) + fieldNameMap["arp_header"] = "ArpHeader" + fields["eth_header"] = bindings.NewOptionalType(bindings.NewReferenceType(EthernetHeaderBindingType)) + fieldNameMap["eth_header"] = "EthHeader" + fields["ip_header"] = bindings.NewOptionalType(bindings.NewReferenceType(Ipv4HeaderBindingType)) + fieldNameMap["ip_header"] = "IpHeader" + fields["ipv6_header"] = bindings.NewOptionalType(bindings.NewReferenceType(Ipv6HeaderBindingType)) + fieldNameMap["ipv6_header"] = "Ipv6Header" + fields["payload"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["payload"] = "Payload" + fields["transport_header"] = bindings.NewOptionalType(bindings.NewReferenceType(TransportProtocolHeaderBindingType)) + fieldNameMap["transport_header"] = "TransportHeader" + fields["frame_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["frame_size"] = "FrameSize" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["routed"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["routed"] = "Routed" + fields["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_type"] = "TransportType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.fields_packet_data", fields, reflect.TypeOf(FieldsPacketData{}), fieldNameMap, validators) +} + +func FilePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["created_epoch_ms"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["created_epoch_ms"] = "CreatedEpochMs" + fields["modified_epoch_ms"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["modified_epoch_ms"] = "ModifiedEpochMs" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["size"] = "Size" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.file_properties", fields, reflect.TypeOf(FileProperties{}), fieldNameMap, validators) +} + +func FilePropertiesListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FilePropertiesBindingType), reflect.TypeOf([]FileProperties{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.file_properties_list_result", fields, reflect.TypeOf(FilePropertiesListResult{}), fieldNameMap, validators) +} + +func FileThumbprintBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["sha1"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sha1"] = "Sha1" + fields["sha256"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sha256"] = "Sha256" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.file_thumbprint", fields, reflect.TypeOf(FileThumbprint{}), fieldNameMap, validators) +} + +func FileTransferAuthenticationSchemeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["scheme_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scheme_name"] = "SchemeName" + fields["username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["username"] = "Username" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.file_transfer_authentication_scheme", fields, reflect.TypeOf(FileTransferAuthenticationScheme{}), fieldNameMap, validators) +} + +func FileTransferProtocolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["authentication_scheme"] = bindings.NewOptionalType(bindings.NewReferenceType(FileTransferAuthenticationSchemeBindingType)) + fieldNameMap["authentication_scheme"] = "AuthenticationScheme" + fields["protocol_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["protocol_name"] = "ProtocolName" + fields["ssh_fingerprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ssh_fingerprint"] = "SshFingerprint" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.file_transfer_protocol", fields, reflect.TypeOf(FileTransferProtocol{}), fieldNameMap, validators) +} + +func FilterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.filter", fields, reflect.TypeOf(Filter{}), fieldNameMap, validators) +} + +func FilterRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["case_sensitive"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["case_sensitive"] = "CaseSensitive" + fields["field_names"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["field_names"] = "FieldNames" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.filter_request", fields, reflect.TypeOf(FilterRequest{}), fieldNameMap, validators) +} + +func FilterWidgetConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["alias"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["alias"] = "Alias" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["feature_set"] = bindings.NewOptionalType(bindings.NewReferenceType(FeatureSetBindingType)) + fieldNameMap["feature_set"] = "FeatureSet" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["filters"] = "Filters" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["plot_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(WidgetPlotConfigurationBindingType), reflect.TypeOf([]WidgetPlotConfiguration{}))) + fieldNameMap["plot_configs"] = "PlotConfigs" + fields["rowspan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rowspan"] = "Rowspan" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["show_header"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_header"] = "ShowHeader" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.filter_widget_configuration", fields, reflect.TypeOf(FilterWidgetConfiguration{}), fieldNameMap, validators) +} + +func FipsGlobalConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lb_fips_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["lb_fips_enabled"] = "LbFipsEnabled" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.fips_global_config", fields, reflect.TypeOf(FipsGlobalConfig{}), fieldNameMap, validators) +} + +func FireWallServiceAssociationListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FirewallRuleBindingType), reflect.TypeOf([]FirewallRule{}))) + fieldNameMap["results"] = "Results" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["service_type"] = bindings.NewStringType() + fieldNameMap["service_type"] = "ServiceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.fire_wall_service_association_list_result", fields, reflect.TypeOf(FireWallServiceAssociationListResult{}), fieldNameMap, validators) +} + +func FirewallCpuMemThresholdsProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cpu_threshold_percentage"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cpu_threshold_percentage"] = "CpuThresholdPercentage" + fields["mem_threshold_percentage"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mem_threshold_percentage"] = "MemThresholdPercentage" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.firewall_cpu_mem_thresholds_profile", fields, reflect.TypeOf(FirewallCpuMemThresholdsProfile{}), fieldNameMap, validators) +} + +func FirewallDnsProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dns_ttl_config"] = bindings.NewOptionalType(bindings.NewReferenceType(DnsTtlConfigBindingType)) + fieldNameMap["dns_ttl_config"] = "DnsTtlConfig" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.firewall_dns_profile", fields, reflect.TypeOf(FirewallDnsProfile{}), fieldNameMap, validators) +} + +func FirewallFloodProtectionProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enable_rst_spoofing"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_rst_spoofing"] = "EnableRstSpoofing" + fields["enable_syncache"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_syncache"] = "EnableSyncache" + fields["icmp_active_flow_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["icmp_active_flow_limit"] = "IcmpActiveFlowLimit" + fields["nat_active_conn_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["nat_active_conn_limit"] = "NatActiveConnLimit" + fields["other_active_conn_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["other_active_conn_limit"] = "OtherActiveConnLimit" + fields["tcp_half_open_conn_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tcp_half_open_conn_limit"] = "TcpHalfOpenConnLimit" + fields["udp_active_flow_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["udp_active_flow_limit"] = "UdpActiveFlowLimit" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.firewall_flood_protection_profile", fields, reflect.TypeOf(FirewallFloodProtectionProfile{}), fieldNameMap, validators) +} + +func FirewallGlobalConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["global_addrset_mode_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["global_addrset_mode_enabled"] = "GlobalAddrsetModeEnabled" + fields["global_fastpath_mode_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["global_fastpath_mode_enabled"] = "GlobalFastpathModeEnabled" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.firewall_global_config", fields, reflect.TypeOf(FirewallGlobalConfig{}), fieldNameMap, validators) +} + +func FirewallProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(BaseFirewallProfileBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.firewall_profile_list_result", fields, reflect.TypeOf(FirewallProfileListResult{}), fieldNameMap, validators) +} + +func FirewallRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_owner"] = bindings.NewOptionalType(bindings.NewReferenceType(OwnerResourceLinkBindingType)) + fieldNameMap["_owner"] = "Owner" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["applied_tos"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["applied_tos"] = "AppliedTos" + fields["destinations"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["destinations"] = "Destinations" + fields["destinations_excluded"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["destinations_excluded"] = "DestinationsExcluded" + fields["direction"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["direction"] = "Direction" + fields["disabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["disabled"] = "Disabled" + fields["ip_protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_protocol"] = "IpProtocol" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["logged"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["logged"] = "Logged" + fields["notes"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["notes"] = "Notes" + fields["priority"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["priority"] = "Priority" + fields["rule_tag"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["rule_tag"] = "RuleTag" + fields["sources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["sources"] = "Sources" + fields["sources_excluded"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sources_excluded"] = "SourcesExcluded" + fields["context_profiles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["context_profiles"] = "ContextProfiles" + fields["extended_sources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["extended_sources"] = "ExtendedSources" + fields["section_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fields["services"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FirewallServiceBindingType), reflect.TypeOf([]FirewallService{}))) + fieldNameMap["services"] = "Services" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.firewall_rule", fields, reflect.TypeOf(FirewallRule{}), fieldNameMap, validators) +} + +func FirewallRuleListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FirewallRuleBindingType), reflect.TypeOf([]FirewallRule{}))) + fieldNameMap["rules"] = "Rules" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.firewall_rule_list", fields, reflect.TypeOf(FirewallRuleList{}), fieldNameMap, validators) +} + +func FirewallRuleListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FirewallRuleBindingType), reflect.TypeOf([]FirewallRule{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.firewall_rule_list_result", fields, reflect.TypeOf(FirewallRuleListResult{}), fieldNameMap, validators) +} + +func FirewallSectionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["applied_tos"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["applied_tos"] = "AppliedTos" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["rule_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rule_count"] = "RuleCount" + fields["section_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_type"] = "SectionType" + fields["stateful"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["stateful"] = "Stateful" + fields["autoplumbed"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["autoplumbed"] = "Autoplumbed" + fields["category"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["category"] = "Category" + fields["comments"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["comments"] = "Comments" + fields["enforced_on"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforced_on"] = "EnforcedOn" + fields["firewall_schedule"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["firewall_schedule"] = "FirewallSchedule" + fields["lock_modified_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lock_modified_by"] = "LockModifiedBy" + fields["lock_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["lock_modified_time"] = "LockModifiedTime" + fields["locked"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["locked"] = "Locked" + fields["priority"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["priority"] = "Priority" + fields["tcp_strict"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["tcp_strict"] = "TcpStrict" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.firewall_section", fields, reflect.TypeOf(FirewallSection{}), fieldNameMap, validators) +} + +func FirewallSectionListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FirewallSectionBindingType), reflect.TypeOf([]FirewallSection{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.firewall_section_list_result", fields, reflect.TypeOf(FirewallSectionListResult{}), fieldNameMap, validators) +} + +func FirewallSectionLockBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["comments"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["comments"] = "Comments" + fields["section_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["section_revision"] = "SectionRevision" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.firewall_section_lock", fields, reflect.TypeOf(FirewallSectionLock{}), fieldNameMap, validators) +} + +func FirewallSectionRuleListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["applied_tos"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["applied_tos"] = "AppliedTos" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["rule_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rule_count"] = "RuleCount" + fields["section_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_type"] = "SectionType" + fields["stateful"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["stateful"] = "Stateful" + fields["autoplumbed"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["autoplumbed"] = "Autoplumbed" + fields["category"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["category"] = "Category" + fields["comments"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["comments"] = "Comments" + fields["enforced_on"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enforced_on"] = "EnforcedOn" + fields["firewall_schedule"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["firewall_schedule"] = "FirewallSchedule" + fields["lock_modified_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lock_modified_by"] = "LockModifiedBy" + fields["lock_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["lock_modified_time"] = "LockModifiedTime" + fields["locked"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["locked"] = "Locked" + fields["priority"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["priority"] = "Priority" + fields["tcp_strict"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["tcp_strict"] = "TcpStrict" + fields["rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FirewallRuleBindingType), reflect.TypeOf([]FirewallRule{}))) + fieldNameMap["rules"] = "Rules" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.firewall_section_rule_list", fields, reflect.TypeOf(FirewallSectionRuleList{}), fieldNameMap, validators) +} + +func FirewallSectionStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ConfigurationStateElementBindingType), reflect.TypeOf([]ConfigurationStateElement{}))) + fieldNameMap["details"] = "Details" + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + fields["revision_desired"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["revision_desired"] = "RevisionDesired" + fields["pending_change_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PendingChangeBindingType), reflect.TypeOf([]PendingChange{}))) + fieldNameMap["pending_change_list"] = "PendingChangeList" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.firewall_section_state", fields, reflect.TypeOf(FirewallSectionState{}), fieldNameMap, validators) +} + +func FirewallSectionsSummaryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["rule_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rule_count"] = "RuleCount" + fields["section_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["section_count"] = "SectionCount" + fields["section_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_type"] = "SectionType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.firewall_sections_summary", fields, reflect.TypeOf(FirewallSectionsSummary{}), fieldNameMap, validators) +} + +func FirewallSectionsSummaryListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_compute_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_compute_time"] = "LastComputeTime" + fields["sections_summary"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FirewallSectionsSummaryBindingType), reflect.TypeOf([]FirewallSectionsSummary{}))) + fieldNameMap["sections_summary"] = "SectionsSummary" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.firewall_sections_summary_list", fields, reflect.TypeOf(FirewallSectionsSummaryList{}), fieldNameMap, validators) +} + +func FirewallServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["is_valid"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_valid"] = "IsValid" + fields["target_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_display_name"] = "TargetDisplayName" + fields["target_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_id"] = "TargetId" + fields["target_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_type"] = "TargetType" + fields["service"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(NSServiceElementBindingType)}, bindings.REST)) + fieldNameMap["service"] = "Service" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.firewall_service", fields, reflect.TypeOf(FirewallService{}), fieldNameMap, validators) +} + +func FirewallSessionTimerProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["icmp_error_reply"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["icmp_error_reply"] = "IcmpErrorReply" + fields["icmp_first_packet"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["icmp_first_packet"] = "IcmpFirstPacket" + fields["tcp_closed"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tcp_closed"] = "TcpClosed" + fields["tcp_closing"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tcp_closing"] = "TcpClosing" + fields["tcp_established"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tcp_established"] = "TcpEstablished" + fields["tcp_finwait"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tcp_finwait"] = "TcpFinwait" + fields["tcp_first_packet"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tcp_first_packet"] = "TcpFirstPacket" + fields["tcp_opening"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tcp_opening"] = "TcpOpening" + fields["udp_first_packet"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["udp_first_packet"] = "UdpFirstPacket" + fields["udp_multiple"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["udp_multiple"] = "UdpMultiple" + fields["udp_single"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["udp_single"] = "UdpSingle" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.firewall_session_timer_profile", fields, reflect.TypeOf(FirewallSessionTimerProfile{}), fieldNameMap, validators) +} + +func FirewallStatsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["byte_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["byte_count"] = "ByteCount" + fields["hit_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["hit_count"] = "HitCount" + fields["l7_accept_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["l7_accept_count"] = "L7AcceptCount" + fields["l7_reject_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["l7_reject_count"] = "L7RejectCount" + fields["l7_reject_with_response_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["l7_reject_with_response_count"] = "L7RejectWithResponseCount" + fields["max_popularity_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_popularity_index"] = "MaxPopularityIndex" + fields["max_session_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_session_count"] = "MaxSessionCount" + fields["packet_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["packet_count"] = "PacketCount" + fields["popularity_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["popularity_index"] = "PopularityIndex" + fields["rule_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["rule_id"] = "RuleId" + fields["session_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["session_count"] = "SessionCount" + fields["total_session_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_session_count"] = "TotalSessionCount" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.firewall_stats", fields, reflect.TypeOf(FirewallStats{}), fieldNameMap, validators) +} + +func FirewallStatsListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FirewallStatsBindingType), reflect.TypeOf([]FirewallStats{}))) + fieldNameMap["results"] = "Results" + fields["section_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.firewall_stats_list", fields, reflect.TypeOf(FirewallStatsList{}), fieldNameMap, validators) +} + +func FirewallStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["context"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["context"] = "Context" + fields["global_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["global_status"] = "GlobalStatus" + fields["target_statuses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TargetResourceStatusBindingType), reflect.TypeOf([]TargetResourceStatus{}))) + fieldNameMap["target_statuses"] = "TargetStatuses" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.firewall_status", fields, reflect.TypeOf(FirewallStatus{}), fieldNameMap, validators) +} + +func FirewallStatusListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FirewallStatusBindingType), reflect.TypeOf([]FirewallStatus{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.firewall_status_list_result", fields, reflect.TypeOf(FirewallStatusListResult{}), fieldNameMap, validators) +} + +func FirstnSamplingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["match_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["match_number"] = "MatchNumber" + fields["sampling_type"] = bindings.NewStringType() + fieldNameMap["sampling_type"] = "SamplingType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.firstn_sampling", fields, reflect.TypeOf(FirstnSampling{}), fieldNameMap, validators) +} + +func FooterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["actions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FooterActionBindingType), reflect.TypeOf([]FooterAction{}))) + fieldNameMap["actions"] = "Actions" + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.footer", fields, reflect.TypeOf(Footer{}), fieldNameMap, validators) +} + +func FooterActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dock_to_container_footer"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["dock_to_container_footer"] = "DockToContainerFooter" + fields["label"] = bindings.NewOptionalType(bindings.NewReferenceType(LabelBindingType)) + fieldNameMap["label"] = "Label" + fields["url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["url"] = "Url" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.footer_action", fields, reflect.TypeOf(FooterAction{}), fieldNameMap, validators) +} + +func ForwarderZoneBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["source_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_ip"] = "SourceIp" + fields["upstream_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["upstream_servers"] = "UpstreamServers" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.forwarder_zone", fields, reflect.TypeOf(ForwarderZone{}), fieldNameMap, validators) +} + +func FullSyncStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["completed_at"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["completed_at"] = "CompletedAt" + fields["snapshot_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["snapshot_version"] = "SnapshotVersion" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["sync_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sync_id"] = "SyncId" + fields["sync_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sync_type"] = "SyncType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.full_sync_status", fields, reflect.TypeOf(FullSyncStatus{}), fieldNameMap, validators) +} + +func GeneralSecuritySettingsProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enable_double_flow"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_double_flow"] = "EnableDoubleFlow" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.general_security_settings_profile", fields, reflect.TypeOf(GeneralSecuritySettingsProfile{}), fieldNameMap, validators) +} + +func GenericDhcpOptionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["code"] = "Code" + fields["values"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["values"] = "Values" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.generic_dhcp_option", fields, reflect.TypeOf(GenericDhcpOption{}), fieldNameMap, validators) +} + +func GiServiceProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fields["vendor_template_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vendor_template_id"] = "VendorTemplateId" + fields["vendor_template_key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vendor_template_key"] = "VendorTemplateKey" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.gi_service_profile", fields, reflect.TypeOf(GiServiceProfile{}), fieldNameMap, validators) +} + +func GlobalConfigsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.global_configs", fields, reflect.TypeOf(GlobalConfigs{}), fieldNameMap, validators) +} + +func GlobalConfigsListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(GlobalConfigsBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.global_configs_list_result", fields, reflect.TypeOf(GlobalConfigsListResult{}), fieldNameMap, validators) +} + +func GlobalRestoreStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.global_restore_status", fields, reflect.TypeOf(GlobalRestoreStatus{}), fieldNameMap, validators) +} + +func GracefulRestartConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["graceful_restart_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["graceful_restart_mode"] = "GracefulRestartMode" + fields["graceful_restart_timer"] = bindings.NewOptionalType(bindings.NewReferenceType(GracefulRestartTimerBindingType)) + fieldNameMap["graceful_restart_timer"] = "GracefulRestartTimer" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.graceful_restart_config", fields, reflect.TypeOf(GracefulRestartConfig{}), fieldNameMap, validators) +} + +func GracefulRestartTimerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["restart_timer"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["restart_timer"] = "RestartTimer" + fields["stale_timer"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["stale_timer"] = "StaleTimer" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.graceful_restart_timer", fields, reflect.TypeOf(GracefulRestartTimer{}), fieldNameMap, validators) +} + +func GraphConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["axes"] = bindings.NewOptionalType(bindings.NewReferenceType(AxesBindingType)) + fieldNameMap["axes"] = "Axes" + fields["display_x_value"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["display_x_value"] = "DisplayxValue" + fields["graphs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(GraphDefinitionBindingType), reflect.TypeOf([]GraphDefinition{}))) + fieldNameMap["graphs"] = "Graphs" + fields["graphs_colors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["graphs_colors"] = "GraphsColors" + fields["line_chart_plot_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LineChartPlotConfigurationBindingType), reflect.TypeOf([]LineChartPlotConfiguration{}))) + fieldNameMap["line_chart_plot_configs"] = "LineChartPlotConfigs" + fields["navigation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["navigation"] = "Navigation" + fields["sub_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sub_type"] = "SubType" + fields["x_value_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["x_value_type"] = "XValueType" + fields["y_value_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["y_value_type"] = "YValueType" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["feature_set"] = bindings.NewOptionalType(bindings.NewReferenceType(FeatureSetBindingType)) + fieldNameMap["feature_set"] = "FeatureSet" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["filters"] = "Filters" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["plot_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(WidgetPlotConfigurationBindingType), reflect.TypeOf([]WidgetPlotConfiguration{}))) + fieldNameMap["plot_configs"] = "PlotConfigs" + fields["rowspan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rowspan"] = "Rowspan" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["show_header"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_header"] = "ShowHeader" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.graph_configuration", fields, reflect.TypeOf(GraphConfiguration{}), fieldNameMap, validators) +} + +func GraphDefinitionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["label"] = bindings.NewOptionalType(bindings.NewReferenceType(LabelBindingType)) + fieldNameMap["label"] = "Label" + fields["point_definition"] = bindings.NewOptionalType(bindings.NewReferenceType(PointDefinitionBindingType)) + fieldNameMap["point_definition"] = "PointDefinition" + fields["render_configuration"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RenderConfigurationBindingType), reflect.TypeOf([]RenderConfiguration{}))) + fieldNameMap["render_configuration"] = "RenderConfiguration" + fields["row_list_field"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["row_list_field"] = "RowListField" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.graph_definition", fields, reflect.TypeOf(GraphDefinition{}), fieldNameMap, validators) +} + +func GridConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["columns"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ColumnItemBindingType), reflect.TypeOf([]ColumnItem{}))) + fieldNameMap["columns"] = "Columns" + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["page_size"] = "PageSize" + fields["row_list_fields"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RowListFieldBindingType), reflect.TypeOf([]RowListField{}))) + fieldNameMap["row_list_fields"] = "RowListFields" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["feature_set"] = bindings.NewOptionalType(bindings.NewReferenceType(FeatureSetBindingType)) + fieldNameMap["feature_set"] = "FeatureSet" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["filters"] = "Filters" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["plot_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(WidgetPlotConfigurationBindingType), reflect.TypeOf([]WidgetPlotConfiguration{}))) + fieldNameMap["plot_configs"] = "PlotConfigs" + fields["rowspan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rowspan"] = "Rowspan" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["show_header"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_header"] = "ShowHeader" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.grid_configuration", fields, reflect.TypeOf(GridConfiguration{}), fieldNameMap, validators) +} + +func GroupedMigrationFeedbackRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["accepted_actions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["accepted_actions"] = "AcceptedActions" + fields["accepted_value_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["accepted_value_type"] = "AcceptedValueType" + fields["accepted_values"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["accepted_values"] = "AcceptedValues" + fields["hash"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["hash"] = "Hash" + fields["message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["message"] = "Message" + fields["multi_value"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["multi_value"] = "MultiValue" + fields["objects"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SummaryMigrationFeedbackRequestBindingType), reflect.TypeOf([]SummaryMigrationFeedbackRequest{}))) + fieldNameMap["objects"] = "Objects" + fields["resolved"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["resolved"] = "Resolved" + fields["sub_vertical"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sub_vertical"] = "SubVertical" + fields["suggested_action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["suggested_action"] = "SuggestedAction" + fields["suggested_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["suggested_value"] = "SuggestedValue" + fields["vertical"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vertical"] = "Vertical" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.grouped_migration_feedback_request", fields, reflect.TypeOf(GroupedMigrationFeedbackRequest{}), fieldNameMap, validators) +} + +func GroupedMigrationFeedbackRequestListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(GroupedMigrationFeedbackRequestBindingType), reflect.TypeOf([]GroupedMigrationFeedbackRequest{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.grouped_migration_feedback_request_list_result", fields, reflect.TypeOf(GroupedMigrationFeedbackRequestListResult{}), fieldNameMap, validators) +} + +func GuestInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["computer_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["computer_name"] = "ComputerName" + fields["os_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["os_name"] = "OsName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.guest_info", fields, reflect.TypeOf(GuestInfo{}), fieldNameMap, validators) +} + +func HaVipConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["ha_vip_subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VIPSubnetBindingType), reflect.TypeOf([]VIPSubnet{}))) + fieldNameMap["ha_vip_subnets"] = "HaVipSubnets" + fields["redundant_uplink_port_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["redundant_uplink_port_ids"] = "RedundantUplinkPortIds" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ha_vip_config", fields, reflect.TypeOf(HaVipConfig{}), fieldNameMap, validators) +} + +func HeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["content_alignment"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["content_alignment"] = "ContentAlignment" + fields["sub_header_widgets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(WidgetItemBindingType), reflect.TypeOf([]WidgetItem{}))) + fieldNameMap["sub_header_widgets"] = "SubHeaderWidgets" + fields["sub_headers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PropertyItemBindingType), reflect.TypeOf([]PropertyItem{}))) + fieldNameMap["sub_headers"] = "SubHeaders" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.header", fields, reflect.TypeOf(Header{}), fieldNameMap, validators) +} + +func HealthCheckResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["results_per_transport_node"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(HealthCheckResultPerTransportNodeBindingType), reflect.TypeOf([]HealthCheckResultPerTransportNode{}))) + fieldNameMap["results_per_transport_node"] = "ResultsPerTransportNode" + fields["updated_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["updated_time"] = "UpdatedTime" + fields["vlan_mtu_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vlan_mtu_status"] = "VlanMtuStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.health_check_result", fields, reflect.TypeOf(HealthCheckResult{}), fieldNameMap, validators) +} + +func HealthCheckResultOnHostSwitchBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["host_switch_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_switch_name"] = "HostSwitchName" + fields["results_per_uplink"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(HealthCheckResultPerUplinkBindingType), reflect.TypeOf([]HealthCheckResultPerUplink{}))) + fieldNameMap["results_per_uplink"] = "ResultsPerUplink" + fields["updated_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["updated_time"] = "UpdatedTime" + fields["vlan_mtu_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vlan_mtu_status"] = "VlanMtuStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.health_check_result_on_host_switch", fields, reflect.TypeOf(HealthCheckResultOnHostSwitch{}), fieldNameMap, validators) +} + +func HealthCheckResultPerTransportNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["result_on_host_switch"] = bindings.NewOptionalType(bindings.NewReferenceType(HealthCheckResultOnHostSwitchBindingType)) + fieldNameMap["result_on_host_switch"] = "ResultOnHostSwitch" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.health_check_result_per_transport_node", fields, reflect.TypeOf(HealthCheckResultPerTransportNode{}), fieldNameMap, validators) +} + +func HealthCheckResultPerUplinkBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mtu_disallowed"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(HealthCheckVlanRangeBindingType), reflect.TypeOf([]HealthCheckVlanRange{}))) + fieldNameMap["mtu_disallowed"] = "MtuDisallowed" + fields["uplink_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uplink_name"] = "UplinkName" + fields["vlan_and_mtu_allowed"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(HealthCheckVlanRangeBindingType), reflect.TypeOf([]HealthCheckVlanRange{}))) + fieldNameMap["vlan_and_mtu_allowed"] = "VlanAndMtuAllowed" + fields["vlan_disallowed"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(HealthCheckVlanRangeBindingType), reflect.TypeOf([]HealthCheckVlanRange{}))) + fieldNameMap["vlan_disallowed"] = "VlanDisallowed" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.health_check_result_per_uplink", fields, reflect.TypeOf(HealthCheckResultPerUplink{}), fieldNameMap, validators) +} + +func HealthCheckSpecVlansBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["vlan_ranges"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(HealthCheckVlanRangeBindingType), reflect.TypeOf([]HealthCheckVlanRange{}))) + fieldNameMap["vlan_ranges"] = "VlanRanges" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.health_check_spec_vlans", fields, reflect.TypeOf(HealthCheckSpecVlans{}), fieldNameMap, validators) +} + +func HealthCheckVlanRangeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["end"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["end"] = "End" + fields["start"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["start"] = "Start" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.health_check_vlan_range", fields, reflect.TypeOf(HealthCheckVlanRange{}), fieldNameMap, validators) +} + +func HeatMapTransportNodesAggregateStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["degraded_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["degraded_count"] = "DegradedCount" + fields["down_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["down_count"] = "DownCount" + fields["unknown_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["unknown_count"] = "UnknownCount" + fields["up_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["up_count"] = "UpCount" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.heat_map_transport_nodes_aggregate_status", fields, reflect.TypeOf(HeatMapTransportNodesAggregateStatus{}), fieldNameMap, validators) +} + +func HeatMapTransportZoneStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["degraded_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["degraded_count"] = "DegradedCount" + fields["down_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["down_count"] = "DownCount" + fields["unknown_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["unknown_count"] = "UnknownCount" + fields["up_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["up_count"] = "UpCount" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.heat_map_transport_zone_status", fields, reflect.TypeOf(HeatMapTransportZoneStatus{}), fieldNameMap, validators) +} + +func HostInfraTrafficTypeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dynamic_res_pool_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dynamic_res_pool_name"] = "DynamicResPoolName" + fields["traffic_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["traffic_name"] = "TrafficName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.host_infra_traffic_type", fields, reflect.TypeOf(HostInfraTrafficType{}), fieldNameMap, validators) +} + +func HostNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["compute_collection_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["compute_collection_id"] = "ComputeCollectionId" + fields["discovered_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["discovered_node_id"] = "DiscoveredNodeId" + fields["host_credential"] = bindings.NewOptionalType(bindings.NewReferenceType(HostNodeLoginCredentialBindingType)) + fieldNameMap["host_credential"] = "HostCredential" + fields["maintenance_mode_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["maintenance_mode_state"] = "MaintenanceModeState" + fields["managed_by_server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["managed_by_server"] = "ManagedByServer" + fields["os_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["os_type"] = "OsType" + fields["os_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["os_version"] = "OsVersion" + fields["windows_install_location"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["windows_install_location"] = "WindowsInstallLocation" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["discovered_ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["discovered_ip_addresses"] = "DiscoveredIpAddresses" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["fqdn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["fqdn"] = "Fqdn" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.host_node", fields, reflect.TypeOf(HostNode{}), fieldNameMap, validators) +} + +func HostNodeLoginCredentialBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["thumbprint"] = "Thumbprint" + fields["username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["username"] = "Username" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.host_node_login_credential", fields, reflect.TypeOf(HostNodeLoginCredential{}), fieldNameMap, validators) +} + +func HostNodeStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["config_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["config_status"] = "ConfigStatus" + fields["deployment_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["deployment_status"] = "DeploymentStatus" + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.host_node_status", fields, reflect.TypeOf(HostNodeStatus{}), fieldNameMap, validators) +} + +func HostNodeStatusListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(HostNodeStatusBindingType), reflect.TypeOf([]HostNodeStatus{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.host_node_status_list_result", fields, reflect.TypeOf(HostNodeStatusListResult{}), fieldNameMap, validators) +} + +func HostSwitchInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["host_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_switch_id"] = "HostSwitchId" + fields["host_switch_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_switch_mode"] = "HostSwitchMode" + fields["host_switch_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_switch_name"] = "HostSwitchName" + fields["host_switch_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_switch_type"] = "HostSwitchType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.host_switch_info", fields, reflect.TypeOf(HostSwitchInfo{}), fieldNameMap, validators) +} + +func HostSwitchProfileTypeIdEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key"] = "Key" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.host_switch_profile_type_id_entry", fields, reflect.TypeOf(HostSwitchProfileTypeIdEntry{}), fieldNameMap, validators) +} + +func HostSwitchProfilesListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(BaseHostSwitchProfileBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.host_switch_profiles_list_result", fields, reflect.TypeOf(HostSwitchProfilesListResult{}), fieldNameMap, validators) +} + +func HostSwitchSpecBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.host_switch_spec", fields, reflect.TypeOf(HostSwitchSpec{}), fieldNameMap, validators) +} + +func HostSwitchStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["endpoints"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(EndpointBindingType), reflect.TypeOf([]Endpoint{}))) + fieldNameMap["endpoints"] = "Endpoints" + fields["host_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_switch_id"] = "HostSwitchId" + fields["host_switch_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_switch_name"] = "HostSwitchName" + fields["host_switch_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_switch_type"] = "HostSwitchType" + fields["transport_zone_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["transport_zone_ids"] = "TransportZoneIds" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.host_switch_state", fields, reflect.TypeOf(HostSwitchState{}), fieldNameMap, validators) +} + +func HostUpgradeStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["can_rollback"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["can_rollback"] = "CanRollback" + fields["can_skip"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["can_skip"] = "CanSkip" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["current_version_node_summary"] = bindings.NewOptionalType(bindings.NewReferenceType(NodeSummaryListBindingType)) + fieldNameMap["current_version_node_summary"] = "CurrentVersionNodeSummary" + fields["details"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["details"] = "Details" + fields["node_count_at_target_version"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["node_count_at_target_version"] = "NodeCountAtTargetVersion" + fields["percent_complete"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["percent_complete"] = "PercentComplete" + fields["pre_upgrade_status"] = bindings.NewOptionalType(bindings.NewReferenceType(UpgradeChecksExecutionStatusBindingType)) + fieldNameMap["pre_upgrade_status"] = "PreUpgradeStatus" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["target_component_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_component_version"] = "TargetComponentVersion" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.host_upgrade_status", fields, reflect.TypeOf(HostUpgradeStatus{}), fieldNameMap, validators) +} + +func HostedEntityInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["entity_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["entity_type"] = "EntityType" + fields["entity_uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["entity_uuid"] = "EntityUuid" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.hosted_entity_info", fields, reflect.TypeOf(HostedEntityInfo{}), fieldNameMap, validators) +} + +func HttpProtocolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["authentication_scheme"] = bindings.NewOptionalType(bindings.NewReferenceType(BasicAuthenticationSchemeBindingType)) + fieldNameMap["authentication_scheme"] = "AuthenticationScheme" + fields["name"] = bindings.NewStringType() + fieldNameMap["name"] = "Name" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.http_protocol", fields, reflect.TypeOf(HttpProtocol{}), fieldNameMap, validators) +} + +func HttpServicePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["basic_authentication_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["basic_authentication_enabled"] = "BasicAuthenticationEnabled" + fields["certificate"] = bindings.NewOptionalType(bindings.NewReferenceType(CertificateBindingType)) + fieldNameMap["certificate"] = "Certificate" + fields["cipher_suites"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(CipherSuiteBindingType), reflect.TypeOf([]CipherSuite{}))) + fieldNameMap["cipher_suites"] = "CipherSuites" + fields["client_api_concurrency_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["client_api_concurrency_limit"] = "ClientApiConcurrencyLimit" + fields["client_api_rate_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["client_api_rate_limit"] = "ClientApiRateLimit" + fields["connection_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["connection_timeout"] = "ConnectionTimeout" + fields["cookie_based_authentication_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["cookie_based_authentication_enabled"] = "CookieBasedAuthenticationEnabled" + fields["global_api_concurrency_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["global_api_concurrency_limit"] = "GlobalApiConcurrencyLimit" + fields["logging_level"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logging_level"] = "LoggingLevel" + fields["protocol_versions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ProtocolVersionBindingType), reflect.TypeOf([]ProtocolVersion{}))) + fieldNameMap["protocol_versions"] = "ProtocolVersions" + fields["redirect_host"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["redirect_host"] = "RedirectHost" + fields["session_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["session_timeout"] = "SessionTimeout" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.http_service_properties", fields, reflect.TypeOf(HttpServiceProperties{}), fieldNameMap, validators) +} + +func HttpsProtocolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["authentication_scheme"] = bindings.NewOptionalType(bindings.NewReferenceType(BasicAuthenticationSchemeBindingType)) + fieldNameMap["authentication_scheme"] = "AuthenticationScheme" + fields["sha256_thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sha256_thumbprint"] = "Sha256Thumbprint" + fields["name"] = bindings.NewStringType() + fieldNameMap["name"] = "Name" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.https_protocol", fields, reflect.TypeOf(HttpsProtocol{}), fieldNameMap, validators) +} + +func ICMPTypeNSServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["icmp_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["icmp_code"] = "IcmpCode" + fields["icmp_type"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["icmp_type"] = "IcmpType" + fields["protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["protocol"] = "Protocol" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ICMP_type_NS_service", fields, reflect.TypeOf(ICMPTypeNSService{}), fieldNameMap, validators) +} + +func IDSEventDataRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FilterRequestBindingType), reflect.TypeOf([]FilterRequest{}))) + fieldNameMap["filters"] = "Filters" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IDS_event_data_request", fields, reflect.TypeOf(IDSEventDataRequest{}), fieldNameMap, validators) +} + +func IDSEventsBySignatureBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["count"] = "Count" + fields["first_occurence"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["first_occurence"] = "FirstOccurence" + fields["is_ongoing"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_ongoing"] = "IsOngoing" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["severity"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["severity"] = "Severity" + fields["signature_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["signature_id"] = "SignatureId" + fields["signature_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["signature_name"] = "SignatureName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IDS_events_by_signature", fields, reflect.TypeOf(IDSEventsBySignature{}), fieldNameMap, validators) +} + +func IDSEventsBySignatureResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IDSEventsBySignatureBindingType), reflect.TypeOf([]IDSEventsBySignature{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IDS_events_by_signature_result", fields, reflect.TypeOf(IDSEventsBySignatureResult{}), fieldNameMap, validators) +} + +func IDSEventsSummaryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["affected_vm_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["affected_vm_count"] = "AffectedVmCount" + fields["first_occurence"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["first_occurence"] = "FirstOccurence" + fields["idsflow_details"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["idsflow_details"] = "IdsflowDetails" + fields["is_ongoing"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_ongoing"] = "IsOngoing" + fields["is_rule_valid"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_rule_valid"] = "IsRuleValid" + fields["latest_occurence"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["latest_occurence"] = "LatestOccurence" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rule_id"] = "RuleId" + fields["signature_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["signature_id"] = "SignatureId" + fields["signature_metadata"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["signature_metadata"] = "SignatureMetadata" + fields["total_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_count"] = "TotalCount" + fields["user_details"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["user_details"] = "UserDetails" + fields["vm_details"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["vm_details"] = "VmDetails" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IDS_events_summary", fields, reflect.TypeOf(IDSEventsSummary{}), fieldNameMap, validators) +} + +func IDSProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["signatures"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["signatures"] = "Signatures" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IDS_profile", fields, reflect.TypeOf(IDSProfile{}), fieldNameMap, validators) +} + +func IDSSignatureDetailBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["affected_product"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["affected_product"] = "AffectedProduct" + fields["attack_target"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["attack_target"] = "AttackTarget" + fields["category"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["category"] = "Category" + fields["class_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["class_type"] = "ClassType" + fields["cves"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["cves"] = "Cves" + fields["cvss"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cvss"] = "Cvss" + fields["cvssv2"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cvssv2"] = "Cvssv2" + fields["cvssv3"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cvssv3"] = "Cvssv3" + fields["direction"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["direction"] = "Direction" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["flow"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["flow"] = "Flow" + fields["malware_family"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["malware_family"] = "MalwareFamily" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["performance_impact"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["performance_impact"] = "PerformanceImpact" + fields["policy"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["policy"] = "Policy" + fields["protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["protocol"] = "Protocol" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["severity"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["severity"] = "Severity" + fields["signature_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["signature_id"] = "SignatureId" + fields["signature_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["signature_revision"] = "SignatureRevision" + fields["signature_severity"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["signature_severity"] = "SignatureSeverity" + fields["tag"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["tag"] = "Tag" + fields["type"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["type"] = "Type_" + fields["urls"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["urls"] = "Urls" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IDS_signature_detail", fields, reflect.TypeOf(IDSSignatureDetail{}), fieldNameMap, validators) +} + +func IDSSummaryListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IDSEventsSummaryBindingType), reflect.TypeOf([]IDSEventsSummary{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IDS_summary_list_result", fields, reflect.TypeOf(IDSSummaryListResult{}), fieldNameMap, validators) +} + +func IGMPTypeNSServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IGMP_type_NS_service", fields, reflect.TypeOf(IGMPTypeNSService{}), fieldNameMap, validators) +} + +func IPAddressElementBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_address_element", fields, reflect.TypeOf(IPAddressElement{}), fieldNameMap, validators) +} + +func IPAddressElementListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPAddressElementBindingType), reflect.TypeOf([]IPAddressElement{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_address_element_list_result", fields, reflect.TypeOf(IPAddressElementListResult{}), fieldNameMap, validators) +} + +func IPAddressesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_addresses", fields, reflect.TypeOf(IPAddresses{}), fieldNameMap, validators) +} + +func IPInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["prefix_length"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["prefix_length"] = "PrefixLength" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_info", fields, reflect.TypeOf(IPInfo{}), fieldNameMap, validators) +} + +func IPMirrorDestinationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["destination_ips"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["destination_ips"] = "DestinationIps" + fields["encapsulation_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["encapsulation_type"] = "EncapsulationType" + fields["erspan_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["erspan_id"] = "ErspanId" + fields["gre_key"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["gre_key"] = "GreKey" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_mirror_destination", fields, reflect.TypeOf(IPMirrorDestination{}), fieldNameMap, validators) +} + +func IPPrefixListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["prefixes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PrefixConfigBindingType), reflect.TypeOf([]PrefixConfig{}))) + fieldNameMap["prefixes"] = "Prefixes" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_prefix_list", fields, reflect.TypeOf(IPPrefixList{}), fieldNameMap, validators) +} + +func IPPrefixListListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPPrefixListBindingType), reflect.TypeOf([]IPPrefixList{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_prefix_list_list_result", fields, reflect.TypeOf(IPPrefixListListResult{}), fieldNameMap, validators) +} + +func IPProtocolNSServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["protocol_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["protocol_number"] = "ProtocolNumber" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_protocol_NS_service", fields, reflect.TypeOf(IPProtocolNSService{}), fieldNameMap, validators) +} + +func IPSecVPNDPDProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["dpd_probe_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dpd_probe_interval"] = "DpdProbeInterval" + fields["dpd_probe_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dpd_probe_mode"] = "DpdProbeMode" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["retry_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["retry_count"] = "RetryCount" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPNDPD_profile", fields, reflect.TypeOf(IPSecVPNDPDProfile{}), fieldNameMap, validators) +} + +func IPSecVPNDPDProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSecVPNDPDProfileBindingType), reflect.TypeOf([]IPSecVPNDPDProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPNDPD_profile_list_result", fields, reflect.TypeOf(IPSecVPNDPDProfileListResult{}), fieldNameMap, validators) +} + +func IPSecVPNIKEProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["dh_groups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dh_groups"] = "DhGroups" + fields["digest_algorithms"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["digest_algorithms"] = "DigestAlgorithms" + fields["encryption_algorithms"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["encryption_algorithms"] = "EncryptionAlgorithms" + fields["ike_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ike_version"] = "IkeVersion" + fields["sa_life_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sa_life_time"] = "SaLifeTime" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPNIKE_profile", fields, reflect.TypeOf(IPSecVPNIKEProfile{}), fieldNameMap, validators) +} + +func IPSecVPNIKEProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSecVPNIKEProfileBindingType), reflect.TypeOf([]IPSecVPNIKEProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPNIKE_profile_list_result", fields, reflect.TypeOf(IPSecVPNIKEProfileListResult{}), fieldNameMap, validators) +} + +func IPSecVPNIKEServiceSummaryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["aggregate_traffic_counters"] = bindings.NewOptionalType(bindings.NewReferenceType(IPSecVPNTrafficCountersBindingType)) + fieldNameMap["aggregate_traffic_counters"] = "AggregateTrafficCounters" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["session_summary"] = bindings.NewOptionalType(bindings.NewReferenceType(IPsecVPNIKESessionSummaryBindingType)) + fieldNameMap["session_summary"] = "SessionSummary" + fields["traffic_summary_per_session"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSecVPNSessionTrafficSummaryBindingType), reflect.TypeOf([]IPSecVPNSessionTrafficSummary{}))) + fieldNameMap["traffic_summary_per_session"] = "TrafficSummaryPerSession" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["ipsec_vpn_service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ipsec_vpn_service_id"] = "IpsecVpnServiceId" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPNIKE_service_summary", fields, reflect.TypeOf(IPSecVPNIKEServiceSummary{}), fieldNameMap, validators) +} + +func IPSecVPNIKESessionStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["fail_reason"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["fail_reason"] = "FailReason" + fields["ike_session_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ike_session_state"] = "IkeSessionState" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPNIKE_session_status", fields, reflect.TypeOf(IPSecVPNIKESessionStatus{}), fieldNameMap, validators) +} + +func IPSecVPNIKETrafficStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bytes_in"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bytes_in"] = "BytesIn" + fields["bytes_out"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bytes_out"] = "BytesOut" + fields["fail_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["fail_count"] = "FailCount" + fields["packets_in"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["packets_in"] = "PacketsIn" + fields["packets_out"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["packets_out"] = "PacketsOut" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPNIKE_traffic_statistics", fields, reflect.TypeOf(IPSecVPNIKETrafficStatistics{}), fieldNameMap, validators) +} + +func IPSecVPNLocalEndpointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["certificate_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["certificate_id"] = "CertificateId" + fields["ipsec_vpn_service_id"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["ipsec_vpn_service_id"] = "IpsecVpnServiceId" + fields["local_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_address"] = "LocalAddress" + fields["local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_id"] = "LocalId" + fields["trust_ca_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["trust_ca_ids"] = "TrustCaIds" + fields["trust_crl_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["trust_crl_ids"] = "TrustCrlIds" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPN_local_endpoint", fields, reflect.TypeOf(IPSecVPNLocalEndpoint{}), fieldNameMap, validators) +} + +func IPSecVPNLocalEndpointListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSecVPNLocalEndpointBindingType), reflect.TypeOf([]IPSecVPNLocalEndpoint{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPN_local_endpoint_list_result", fields, reflect.TypeOf(IPSecVPNLocalEndpointListResult{}), fieldNameMap, validators) +} + +func IPSecVPNPeerEndpointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["authentication_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["authentication_mode"] = "AuthenticationMode" + fields["connection_initiation_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connection_initiation_mode"] = "ConnectionInitiationMode" + fields["dpd_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dpd_profile_id"] = "DpdProfileId" + fields["ike_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ike_profile_id"] = "IkeProfileId" + fields["ipsec_tunnel_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ipsec_tunnel_profile_id"] = "IpsecTunnelProfileId" + fields["peer_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["peer_address"] = "PeerAddress" + fields["peer_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["peer_id"] = "PeerId" + fields["psk"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["psk"] = "Psk" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPN_peer_endpoint", fields, reflect.TypeOf(IPSecVPNPeerEndpoint{}), fieldNameMap, validators) +} + +func IPSecVPNPeerEndpointListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSecVPNPeerEndpointBindingType), reflect.TypeOf([]IPSecVPNPeerEndpoint{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPN_peer_endpoint_list_result", fields, reflect.TypeOf(IPSecVPNPeerEndpointListResult{}), fieldNameMap, validators) +} + +func IPSecVPNPolicyRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_owner"] = bindings.NewOptionalType(bindings.NewReferenceType(OwnerResourceLinkBindingType)) + fieldNameMap["_owner"] = "Owner" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["destinations"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSecVPNPolicySubnetBindingType), reflect.TypeOf([]IPSecVPNPolicySubnet{}))) + fieldNameMap["destinations"] = "Destinations" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["logged"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["logged"] = "Logged" + fields["sources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSecVPNPolicySubnetBindingType), reflect.TypeOf([]IPSecVPNPolicySubnet{}))) + fieldNameMap["sources"] = "Sources" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPN_policy_rule", fields, reflect.TypeOf(IPSecVPNPolicyRule{}), fieldNameMap, validators) +} + +func IPSecVPNPolicySubnetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["subnet"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["subnet"] = "Subnet" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPN_policy_subnet", fields, reflect.TypeOf(IPSecVPNPolicySubnet{}), fieldNameMap, validators) +} + +func IPSecVPNPolicyTrafficStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["aggregate_traffic_counters"] = bindings.NewOptionalType(bindings.NewReferenceType(IPSecVPNTrafficCountersBindingType)) + fieldNameMap["aggregate_traffic_counters"] = "AggregateTrafficCounters" + fields["policy_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["policy_id"] = "PolicyId" + fields["tunnel_port_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tunnel_port_id"] = "TunnelPortId" + fields["tunnel_statistics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSecVPNTunnelTrafficStatisticsBindingType), reflect.TypeOf([]IPSecVPNTunnelTrafficStatistics{}))) + fieldNameMap["tunnel_statistics"] = "TunnelStatistics" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPN_policy_traffic_statistics", fields, reflect.TypeOf(IPSecVPNPolicyTrafficStatistics{}), fieldNameMap, validators) +} + +func IPSecVPNServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["bypass_rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSecVPNPolicyRuleBindingType), reflect.TypeOf([]IPSecVPNPolicyRule{}))) + fieldNameMap["bypass_rules"] = "BypassRules" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["ike_log_level"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ike_log_level"] = "IkeLogLevel" + fields["ipsec_ha_sync"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ipsec_ha_sync"] = "IpsecHaSync" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPN_service", fields, reflect.TypeOf(IPSecVPNService{}), fieldNameMap, validators) +} + +func IPSecVPNServiceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSecVPNServiceBindingType), reflect.TypeOf([]IPSecVPNService{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPN_service_list_result", fields, reflect.TypeOf(IPSecVPNServiceListResult{}), fieldNameMap, validators) +} + +func IPSecVPNSessionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["ipsec_vpn_service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ipsec_vpn_service_id"] = "IpsecVpnServiceId" + fields["local_endpoint_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_endpoint_id"] = "LocalEndpointId" + fields["peer_endpoint_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["peer_endpoint_id"] = "PeerEndpointId" + fields["tcp_mss_clamping"] = bindings.NewOptionalType(bindings.NewReferenceType(TcpMssClampingBindingType)) + fieldNameMap["tcp_mss_clamping"] = "TcpMssClamping" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPN_session", fields, reflect.TypeOf(IPSecVPNSession{}), fieldNameMap, validators) +} + +func IPSecVPNSessionListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(IPSecVPNSessionBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPN_session_list_result", fields, reflect.TypeOf(IPSecVPNSessionListResult{}), fieldNameMap, validators) +} + +func IPSecVPNSessionStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ConfigurationStateElementBindingType), reflect.TypeOf([]ConfigurationStateElement{}))) + fieldNameMap["details"] = "Details" + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + fields["pending_change_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["pending_change_list"] = "PendingChangeList" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPN_session_state", fields, reflect.TypeOf(IPSecVPNSessionState{}), fieldNameMap, validators) +} + +func IPSecVPNSessionStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["aggregate_traffic_counters"] = bindings.NewOptionalType(bindings.NewReferenceType(IPSecVPNTrafficCountersBindingType)) + fieldNameMap["aggregate_traffic_counters"] = "AggregateTrafficCounters" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["ike_status"] = bindings.NewOptionalType(bindings.NewReferenceType(IPSecVPNIKESessionStatusBindingType)) + fieldNameMap["ike_status"] = "IkeStatus" + fields["ike_traffic_statistics"] = bindings.NewOptionalType(bindings.NewReferenceType(IPSecVPNIKETrafficStatisticsBindingType)) + fieldNameMap["ike_traffic_statistics"] = "IkeTrafficStatistics" + fields["ipsec_vpn_session_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ipsec_vpn_session_id"] = "IpsecVpnSessionId" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["partial_stats"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["partial_stats"] = "PartialStats" + fields["policy_statistics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSecVPNPolicyTrafficStatisticsBindingType), reflect.TypeOf([]IPSecVPNPolicyTrafficStatistics{}))) + fieldNameMap["policy_statistics"] = "PolicyStatistics" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPN_session_statistics", fields, reflect.TypeOf(IPSecVPNSessionStatistics{}), fieldNameMap, validators) +} + +func IPSecVPNSessionStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["aggregate_traffic_counters"] = bindings.NewOptionalType(bindings.NewReferenceType(IPSecVPNTrafficCountersBindingType)) + fieldNameMap["aggregate_traffic_counters"] = "AggregateTrafficCounters" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["failed_tunnels"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failed_tunnels"] = "FailedTunnels" + fields["ike_status"] = bindings.NewOptionalType(bindings.NewReferenceType(IPSecVPNIKESessionStatusBindingType)) + fieldNameMap["ike_status"] = "IkeStatus" + fields["ipsec_vpn_session_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ipsec_vpn_session_id"] = "IpsecVpnSessionId" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["negotiated_tunnels"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["negotiated_tunnels"] = "NegotiatedTunnels" + fields["session_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["session_status"] = "SessionStatus" + fields["total_tunnels"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_tunnels"] = "TotalTunnels" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPN_session_status", fields, reflect.TypeOf(IPSecVPNSessionStatus{}), fieldNameMap, validators) +} + +func IPSecVPNSessionSummaryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["aggregate_traffic_counters"] = bindings.NewOptionalType(bindings.NewReferenceType(IPSecVPNTrafficCountersBindingType)) + fieldNameMap["aggregate_traffic_counters"] = "AggregateTrafficCounters" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["session_summary"] = bindings.NewOptionalType(bindings.NewReferenceType(IPsecVPNIKESessionSummaryBindingType)) + fieldNameMap["session_summary"] = "SessionSummary" + fields["traffic_summary_per_session"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSecVPNSessionTrafficSummaryBindingType), reflect.TypeOf([]IPSecVPNSessionTrafficSummary{}))) + fieldNameMap["traffic_summary_per_session"] = "TrafficSummaryPerSession" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPN_session_summary", fields, reflect.TypeOf(IPSecVPNSessionSummary{}), fieldNameMap, validators) +} + +func IPSecVPNSessionTrafficSummaryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_session"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["ipsec_vpn_session"] = "IpsecVpnSession" + fields["traffic_counters"] = bindings.NewOptionalType(bindings.NewReferenceType(IPSecVPNTrafficCountersBindingType)) + fieldNameMap["traffic_counters"] = "TrafficCounters" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPN_session_traffic_summary", fields, reflect.TypeOf(IPSecVPNSessionTrafficSummary{}), fieldNameMap, validators) +} + +func IPSecVPNTrafficCountersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bytes_in"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bytes_in"] = "BytesIn" + fields["bytes_out"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bytes_out"] = "BytesOut" + fields["dropped_packets_in"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dropped_packets_in"] = "DroppedPacketsIn" + fields["dropped_packets_out"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dropped_packets_out"] = "DroppedPacketsOut" + fields["packets_in"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["packets_in"] = "PacketsIn" + fields["packets_out"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["packets_out"] = "PacketsOut" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPN_traffic_counters", fields, reflect.TypeOf(IPSecVPNTrafficCounters{}), fieldNameMap, validators) +} + +func IPSecVPNTransportStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["status"] = bindings.NewOptionalType(bindings.NewReferenceType(IPSecVPNSessionStatusBindingType)) + fieldNameMap["status"] = "Status" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tunnel_id"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["tunnel_id"] = "TunnelId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPN_transport_status", fields, reflect.TypeOf(IPSecVPNTransportStatus{}), fieldNameMap, validators) +} + +func IPSecVPNTunnelProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["df_policy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["df_policy"] = "DfPolicy" + fields["dh_groups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dh_groups"] = "DhGroups" + fields["digest_algorithms"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["digest_algorithms"] = "DigestAlgorithms" + fields["enable_perfect_forward_secrecy"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_perfect_forward_secrecy"] = "EnablePerfectForwardSecrecy" + fields["encapsulation_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["encapsulation_mode"] = "EncapsulationMode" + fields["encryption_algorithms"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["encryption_algorithms"] = "EncryptionAlgorithms" + fields["sa_life_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sa_life_time"] = "SaLifeTime" + fields["transform_protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transform_protocol"] = "TransformProtocol" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPN_tunnel_profile", fields, reflect.TypeOf(IPSecVPNTunnelProfile{}), fieldNameMap, validators) +} + +func IPSecVPNTunnelProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSecVPNTunnelProfileBindingType), reflect.TypeOf([]IPSecVPNTunnelProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPN_tunnel_profile_list_result", fields, reflect.TypeOf(IPSecVPNTunnelProfileListResult{}), fieldNameMap, validators) +} + +func IPSecVPNTunnelTrafficStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bytes_in"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bytes_in"] = "BytesIn" + fields["bytes_out"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bytes_out"] = "BytesOut" + fields["decryption_failures"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["decryption_failures"] = "DecryptionFailures" + fields["dropped_packets_in"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dropped_packets_in"] = "DroppedPacketsIn" + fields["dropped_packets_out"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dropped_packets_out"] = "DroppedPacketsOut" + fields["encryption_failures"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["encryption_failures"] = "EncryptionFailures" + fields["integrity_failures"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["integrity_failures"] = "IntegrityFailures" + fields["local_subnet"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_subnet"] = "LocalSubnet" + fields["nomatching_policy_errors"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["nomatching_policy_errors"] = "NomatchingPolicyErrors" + fields["packets_in"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["packets_in"] = "PacketsIn" + fields["packets_out"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["packets_out"] = "PacketsOut" + fields["packets_receive_other_error"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["packets_receive_other_error"] = "PacketsReceiveOtherError" + fields["packets_sent_other_error"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["packets_sent_other_error"] = "PacketsSentOtherError" + fields["peer_subnet"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["peer_subnet"] = "PeerSubnet" + fields["policy_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["policy_id"] = "PolicyId" + fields["replay_errors"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["replay_errors"] = "ReplayErrors" + fields["sa_mismatch_errors_in"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sa_mismatch_errors_in"] = "SaMismatchErrorsIn" + fields["sa_mismatch_errors_out"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sa_mismatch_errors_out"] = "SaMismatchErrorsOut" + fields["seq_number_overflow_error"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["seq_number_overflow_error"] = "SeqNumberOverflowError" + fields["tunnel_down_reason"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tunnel_down_reason"] = "TunnelDownReason" + fields["tunnel_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tunnel_status"] = "TunnelStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_sec_VPN_tunnel_traffic_statistics", fields, reflect.TypeOf(IPSecVPNTunnelTrafficStatistics{}), fieldNameMap, validators) +} + +func IPSetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_set", fields, reflect.TypeOf(IPSet{}), fieldNameMap, validators) +} + +func IPSetListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSetBindingType), reflect.TypeOf([]IPSet{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_set_list_result", fields, reflect.TypeOf(IPSetListResult{}), fieldNameMap, validators) +} + +func IPSubnetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["prefix_length"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["prefix_length"] = "PrefixLength" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.IP_subnet", fields, reflect.TypeOf(IPSubnet{}), fieldNameMap, validators) +} + +func IPsecVPNIKESessionSummaryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["degraded_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["degraded_sessions"] = "DegradedSessions" + fields["established_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["established_sessions"] = "EstablishedSessions" + fields["failed_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failed_sessions"] = "FailedSessions" + fields["total_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_sessions"] = "TotalSessions" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.I_psec_VPNIKE_session_summary", fields, reflect.TypeOf(IPsecVPNIKESessionSummary{}), fieldNameMap, validators) +} + +func IPv4AddressPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["netmask"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["netmask"] = "Netmask" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.I_pv4_address_properties", fields, reflect.TypeOf(IPv4AddressProperties{}), fieldNameMap, validators) +} + +func IPv4DhcpServerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dhcp_server_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dhcp_server_ip"] = "DhcpServerIp" + fields["dns_nameservers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dns_nameservers"] = "DnsNameservers" + fields["domain_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_name"] = "DomainName" + fields["gateway_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["gateway_ip"] = "GatewayIp" + fields["monitor_ippool_usage"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["monitor_ippool_usage"] = "MonitorIppoolUsage" + fields["options"] = bindings.NewOptionalType(bindings.NewReferenceType(DhcpOptionsBindingType)) + fieldNameMap["options"] = "Options" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.I_pv4_dhcp_server", fields, reflect.TypeOf(IPv4DhcpServer{}), fieldNameMap, validators) +} + +func IPv6DADStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["transport_node"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["transport_node"] = "TransportNode" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.I_pv6_DAD_status", fields, reflect.TypeOf(IPv6DADStatus{}), fieldNameMap, validators) +} + +func IPv6DhcpServerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dhcp_server_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dhcp_server_ip"] = "DhcpServerIp" + fields["dns_nameservers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dns_nameservers"] = "DnsNameservers" + fields["domain_names"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["domain_names"] = "DomainNames" + fields["server_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_id"] = "ServerId" + fields["sntp_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["sntp_servers"] = "SntpServers" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.I_pv6_dhcp_server", fields, reflect.TypeOf(IPv6DhcpServer{}), fieldNameMap, validators) +} + +func IPv6ProfilesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dad_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dad_profile_id"] = "DadProfileId" + fields["ndra_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ndra_profile_id"] = "NdraProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.I_pv6_profiles", fields, reflect.TypeOf(IPv6Profiles{}), fieldNameMap, validators) +} + +func IcmpEchoRequestHeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["id"] = "Id" + fields["sequence"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence"] = "Sequence" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.icmp_echo_request_header", fields, reflect.TypeOf(IcmpEchoRequestHeader{}), fieldNameMap, validators) +} + +func IconBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["color"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["color"] = "Color" + fields["placement"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["placement"] = "Placement" + fields["size"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["size"] = "Size" + fields["size_unit"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["size_unit"] = "SizeUnit" + fields["tooltip"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TooltipBindingType), reflect.TypeOf([]Tooltip{}))) + fieldNameMap["tooltip"] = "Tooltip" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.icon", fields, reflect.TypeOf(Icon{}), fieldNameMap, validators) +} + +func IdfwComputeCollectionConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["status_detail"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status_detail"] = "StatusDetail" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.idfw_compute_collection_condition", fields, reflect.TypeOf(IdfwComputeCollectionCondition{}), fieldNameMap, validators) +} + +func IdfwComputeCollectionListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdfwComputeCollectionStatusBindingType), reflect.TypeOf([]IdfwComputeCollectionStatus{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.idfw_compute_collection_list_result", fields, reflect.TypeOf(IdfwComputeCollectionListResult{}), fieldNameMap, validators) +} + +func IdfwComputeCollectionStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["compute_collection_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["compute_collection_id"] = "ComputeCollectionId" + fields["compute_collection_status"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdfwComputeCollectionConditionBindingType), reflect.TypeOf([]IdfwComputeCollectionCondition{}))) + fieldNameMap["compute_collection_status"] = "ComputeCollectionStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.idfw_compute_collection_status", fields, reflect.TypeOf(IdfwComputeCollectionStatus{}), fieldNameMap, validators) +} + +func IdfwDirGroupUserSessionMappingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dir_group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dir_group_id"] = "DirGroupId" + fields["user_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["user_id"] = "UserId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.idfw_dir_group_user_session_mapping", fields, reflect.TypeOf(IdfwDirGroupUserSessionMapping{}), fieldNameMap, validators) +} + +func IdfwEnabledComputeCollectionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["compute_collection_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["compute_collection_id"] = "ComputeCollectionId" + fields["compute_collection_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["compute_collection_name"] = "ComputeCollectionName" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.idfw_enabled_compute_collection", fields, reflect.TypeOf(IdfwEnabledComputeCollection{}), fieldNameMap, validators) +} + +func IdfwEnabledComputeCollectionListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdfwEnabledComputeCollectionBindingType), reflect.TypeOf([]IdfwEnabledComputeCollection{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.idfw_enabled_compute_collection_list_result", fields, reflect.TypeOf(IdfwEnabledComputeCollectionListResult{}), fieldNameMap, validators) +} + +func IdfwMasterSwitchSettingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["idfw_master_switch_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["idfw_master_switch_enabled"] = "IdfwMasterSwitchEnabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.idfw_master_switch_setting", fields, reflect.TypeOf(IdfwMasterSwitchSetting{}), fieldNameMap, validators) +} + +func IdfwNsgroupVmDetailListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["ns_group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdfwVmDetailBindingType), reflect.TypeOf([]IdfwVmDetail{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.idfw_nsgroup_vm_detail_list_result", fields, reflect.TypeOf(IdfwNsgroupVmDetailListResult{}), fieldNameMap, validators) +} + +func IdfwStandaloneHostsSwitchSettingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["standalone_hosts_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["standalone_hosts_enabled"] = "StandaloneHostsEnabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.idfw_standalone_hosts_switch_setting", fields, reflect.TypeOf(IdfwStandaloneHostsSwitchSetting{}), fieldNameMap, validators) +} + +func IdfwSystemStatsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["num_concurrent_users"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["num_concurrent_users"] = "NumConcurrentUsers" + fields["num_user_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["num_user_sessions"] = "NumUserSessions" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.idfw_system_stats", fields, reflect.TypeOf(IdfwSystemStats{}), fieldNameMap, validators) +} + +func IdfwTransportNodeConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["status_detail"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status_detail"] = "StatusDetail" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.idfw_transport_node_condition", fields, reflect.TypeOf(IdfwTransportNodeCondition{}), fieldNameMap, validators) +} + +func IdfwTransportNodeStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fields["transport_node_status"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdfwTransportNodeConditionBindingType), reflect.TypeOf([]IdfwTransportNodeCondition{}))) + fieldNameMap["transport_node_status"] = "TransportNodeStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.idfw_transport_node_status", fields, reflect.TypeOf(IdfwTransportNodeStatus{}), fieldNameMap, validators) +} + +func IdfwTransportNodeStatusListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdfwTransportNodeStatusBindingType), reflect.TypeOf([]IdfwTransportNodeStatus{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.idfw_transport_node_status_list_result", fields, reflect.TypeOf(IdfwTransportNodeStatusListResult{}), fieldNameMap, validators) +} + +func IdfwUserSessionDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["domain_name"] = "DomainName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["login_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["login_time"] = "LoginTime" + fields["logout_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["logout_time"] = "LogoutTime" + fields["session_source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["session_source"] = "SessionSource" + fields["user_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["user_id"] = "UserId" + fields["user_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["user_name"] = "UserName" + fields["user_session_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["user_session_id"] = "UserSessionId" + fields["vm_ext_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vm_ext_id"] = "VmExtId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.idfw_user_session_data", fields, reflect.TypeOf(IdfwUserSessionData{}), fieldNameMap, validators) +} + +func IdfwUserSessionDataAndMappingsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_user_sessions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdfwUserSessionDataBindingType), reflect.TypeOf([]IdfwUserSessionData{}))) + fieldNameMap["active_user_sessions"] = "ActiveUserSessions" + fields["archived_user_sessions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdfwUserSessionDataBindingType), reflect.TypeOf([]IdfwUserSessionData{}))) + fieldNameMap["archived_user_sessions"] = "ArchivedUserSessions" + fields["dir_group_to_user_session_data_mappings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdfwDirGroupUserSessionMappingBindingType), reflect.TypeOf([]IdfwDirGroupUserSessionMapping{}))) + fieldNameMap["dir_group_to_user_session_data_mappings"] = "DirGroupToUserSessionDataMappings" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.idfw_user_session_data_and_mappings", fields, reflect.TypeOf(IdfwUserSessionDataAndMappings{}), fieldNameMap, validators) +} + +func IdfwUserStatsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_sessions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdfwUserSessionDataBindingType), reflect.TypeOf([]IdfwUserSessionData{}))) + fieldNameMap["active_sessions"] = "ActiveSessions" + fields["archived_sessions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdfwUserSessionDataBindingType), reflect.TypeOf([]IdfwUserSessionData{}))) + fieldNameMap["archived_sessions"] = "ArchivedSessions" + fields["user_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["user_id"] = "UserId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.idfw_user_stats", fields, reflect.TypeOf(IdfwUserStats{}), fieldNameMap, validators) +} + +func IdfwVirtualMachineConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["status_detail"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status_detail"] = "StatusDetail" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.idfw_virtual_machine_condition", fields, reflect.TypeOf(IdfwVirtualMachineCondition{}), fieldNameMap, validators) +} + +func IdfwVirtualMachineStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["vm_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vm_id"] = "VmId" + fields["vm_status"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdfwVirtualMachineConditionBindingType), reflect.TypeOf([]IdfwVirtualMachineCondition{}))) + fieldNameMap["vm_status"] = "VmStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.idfw_virtual_machine_status", fields, reflect.TypeOf(IdfwVirtualMachineStatus{}), fieldNameMap, validators) +} + +func IdfwVirtualMachineStatusListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdfwVirtualMachineStatusBindingType), reflect.TypeOf([]IdfwVirtualMachineStatus{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.idfw_virtual_machine_status_list_result", fields, reflect.TypeOf(IdfwVirtualMachineStatusListResult{}), fieldNameMap, validators) +} + +func IdfwVmDetailBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_login_user_session"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["last_login_user_session"] = "LastLoginUserSession" + fields["user_sessions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdfwUserSessionDataBindingType), reflect.TypeOf([]IdfwUserSessionData{}))) + fieldNameMap["user_sessions"] = "UserSessions" + fields["vm_ext_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vm_ext_id"] = "VmExtId" + fields["vm_ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["vm_ip_addresses"] = "VmIpAddresses" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.idfw_vm_detail", fields, reflect.TypeOf(IdfwVmDetail{}), fieldNameMap, validators) +} + +func IdfwVmStatsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_sessions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdfwUserSessionDataBindingType), reflect.TypeOf([]IdfwUserSessionData{}))) + fieldNameMap["active_sessions"] = "ActiveSessions" + fields["archived_sessions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IdfwUserSessionDataBindingType), reflect.TypeOf([]IdfwUserSessionData{}))) + fieldNameMap["archived_sessions"] = "ArchivedSessions" + fields["vm_ext_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vm_ext_id"] = "VmExtId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.idfw_vm_stats", fields, reflect.TypeOf(IdfwVmStats{}), fieldNameMap, validators) +} + +func IdsEventFlowDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["action_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action_type"] = "ActionType" + fields["bytes_toclient"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bytes_toclient"] = "BytesToclient" + fields["bytes_toserver"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bytes_toserver"] = "BytesToserver" + fields["client_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["client_ip"] = "ClientIp" + fields["destination_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["destination_ip"] = "DestinationIp" + fields["destination_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["destination_port"] = "DestinationPort" + fields["local_vm_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_vm_ip"] = "LocalVmIp" + fields["profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["profile_id"] = "ProfileId" + fields["protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["protocol"] = "Protocol" + fields["rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rule_id"] = "RuleId" + fields["source_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_ip"] = "SourceIp" + fields["source_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["source_port"] = "SourcePort" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ids_event_flow_data", fields, reflect.TypeOf(IdsEventFlowData{}), fieldNameMap, validators) +} + +func IdsGlobalConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["global_idsevents_to_syslog_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["global_idsevents_to_syslog_enabled"] = "GlobalIdseventsToSyslogEnabled" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ids_global_config", fields, reflect.TypeOf(IdsGlobalConfig{}), fieldNameMap, validators) +} + +func IdsUserListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ids_user_list", fields, reflect.TypeOf(IdsUserList{}), fieldNameMap, validators) +} + +func IdsUserStatsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["count"] = "Count" + fields["user_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["user_list"] = "UserList" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ids_user_stats", fields, reflect.TypeOf(IdsUserStats{}), fieldNameMap, validators) +} + +func IdsVmListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ids_vm_list", fields, reflect.TypeOf(IdsVmList{}), fieldNameMap, validators) +} + +func IdsVmStatsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["count"] = "Count" + fields["vm_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["vm_list"] = "VmList" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ids_vm_stats", fields, reflect.TypeOf(IdsVmStats{}), fieldNameMap, validators) +} + +func IncludedFieldsParametersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["included_fields"] = "IncludedFields" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.included_fields_parameters", fields, reflect.TypeOf(IncludedFieldsParameters{}), fieldNameMap, validators) +} + +func IngressBroadcastRateShaperBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["average_bandwidth_kbps"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["average_bandwidth_kbps"] = "AverageBandwidthKbps" + fields["burst_size_bytes"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["burst_size_bytes"] = "BurstSizeBytes" + fields["peak_bandwidth_kbps"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["peak_bandwidth_kbps"] = "PeakBandwidthKbps" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ingress_broadcast_rate_shaper", fields, reflect.TypeOf(IngressBroadcastRateShaper{}), fieldNameMap, validators) +} + +func IngressRateShaperBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["average_bandwidth_mbps"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["average_bandwidth_mbps"] = "AverageBandwidthMbps" + fields["burst_size_bytes"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["burst_size_bytes"] = "BurstSizeBytes" + fields["peak_bandwidth_mbps"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["peak_bandwidth_mbps"] = "PeakBandwidthMbps" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ingress_rate_shaper", fields, reflect.TypeOf(IngressRateShaper{}), fieldNameMap, validators) +} + +func InitiateClusterRestoreRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.initiate_cluster_restore_request", fields, reflect.TypeOf(InitiateClusterRestoreRequest{}), fieldNameMap, validators) +} + +func InstallUpgradeServicePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["enabled_on"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enabled_on"] = "EnabledOn" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.install_upgrade_service_properties", fields, reflect.TypeOf(InstallUpgradeServiceProperties{}), fieldNameMap, validators) +} + +func InstanceDeploymentConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["compute_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["compute_id"] = "ComputeId" + fields["context_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["context_id"] = "ContextId" + fields["host_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_id"] = "HostId" + fields["storage_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["storage_id"] = "StorageId" + fields["vm_nic_infos"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VmNicInfoBindingType), reflect.TypeOf([]VmNicInfo{}))) + fieldNameMap["vm_nic_infos"] = "VmNicInfos" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.instance_deployment_config", fields, reflect.TypeOf(InstanceDeploymentConfig{}), fieldNameMap, validators) +} + +func InstanceEndpointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["endpoint_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["endpoint_type"] = "EndpointType" + fields["link_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["link_ids"] = "LinkIds" + fields["service_attachments"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["service_attachments"] = "ServiceAttachments" + fields["service_instance_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + fields["target_ips"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPInfoBindingType), reflect.TypeOf([]IPInfo{}))) + fieldNameMap["target_ips"] = "TargetIps" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.instance_endpoint", fields, reflect.TypeOf(InstanceEndpoint{}), fieldNameMap, validators) +} + +func InstanceEndpointListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(InstanceEndpointBindingType), reflect.TypeOf([]InstanceEndpoint{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.instance_endpoint_list_result", fields, reflect.TypeOf(InstanceEndpointListResult{}), fieldNameMap, validators) +} + +func InstanceRuntimeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["compute_collection_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["compute_collection_id"] = "ComputeCollectionId" + fields["deployment_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["deployment_status"] = "DeploymentStatus" + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["maintenance_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["maintenance_mode"] = "MaintenanceMode" + fields["runtime_health_status_by_partner"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["runtime_health_status_by_partner"] = "RuntimeHealthStatusByPartner" + fields["runtime_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["runtime_status"] = "RuntimeStatus" + fields["service_instance_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + fields["service_vm_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_vm_id"] = "ServiceVmId" + fields["storage_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["storage_id"] = "StorageId" + fields["unhealthy_reason"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unhealthy_reason"] = "UnhealthyReason" + fields["vm_nic_info"] = bindings.NewOptionalType(bindings.NewReferenceType(VmNicInfoBindingType)) + fieldNameMap["vm_nic_info"] = "VmNicInfo" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.instance_runtime", fields, reflect.TypeOf(InstanceRuntime{}), fieldNameMap, validators) +} + +func InstanceRuntimeListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(InstanceRuntimeBindingType), reflect.TypeOf([]InstanceRuntime{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.instance_runtime_list_result", fields, reflect.TypeOf(InstanceRuntimeListResult{}), fieldNameMap, validators) +} + +func InstructionInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["actions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["actions"] = "Actions" + fields["fields"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["fields"] = "Fields" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.instruction_info", fields, reflect.TypeOf(InstructionInfo{}), fieldNameMap, validators) +} + +func IntelligenceBrokerEndpointInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["address"] = "Address" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.intelligence_broker_endpoint_info", fields, reflect.TypeOf(IntelligenceBrokerEndpointInfo{}), fieldNameMap, validators) +} + +func IntelligenceClusterNodeVMDeploymentConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["placement_type"] = bindings.NewStringType() + fieldNameMap["placement_type"] = "PlacementType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.intelligence_cluster_node_VM_deployment_config", fields, reflect.TypeOf(IntelligenceClusterNodeVMDeploymentConfig{}), fieldNameMap, validators) +} + +func IntelligenceClusterNodeVMDeploymentRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["deployment_config"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(IntelligenceClusterNodeVMDeploymentConfigBindingType)}, bindings.REST)) + fieldNameMap["deployment_config"] = "DeploymentConfig" + fields["form_factor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["form_factor"] = "FormFactor" + fields["user_settings"] = bindings.NewOptionalType(bindings.NewReferenceType(NodeUserSettingsBindingType)) + fieldNameMap["user_settings"] = "UserSettings" + fields["vm_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vm_id"] = "VmId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.intelligence_cluster_node_VM_deployment_request", fields, reflect.TypeOf(IntelligenceClusterNodeVMDeploymentRequest{}), fieldNameMap, validators) +} + +func IntelligenceClusterNodeVMDeploymentRequestListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IntelligenceClusterNodeVMDeploymentRequestBindingType), reflect.TypeOf([]IntelligenceClusterNodeVMDeploymentRequest{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.intelligence_cluster_node_VM_deployment_request_list", fields, reflect.TypeOf(IntelligenceClusterNodeVMDeploymentRequestList{}), fieldNameMap, validators) +} + +func IntelligenceClusterNodeVMDeploymentStatusReportBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["deployment_progress_state"] = bindings.NewOptionalType(bindings.NewReferenceType(ClusterNodeVMDeploymentProgressStateBindingType)) + fieldNameMap["deployment_progress_state"] = "DeploymentProgressState" + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.intelligence_cluster_node_VM_deployment_status_report", fields, reflect.TypeOf(IntelligenceClusterNodeVMDeploymentStatusReport{}), fieldNameMap, validators) +} + +func IntelligenceFlowPrivateIpPrefixInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["address"] = "Address" + fields["address_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["address_type"] = "AddressType" + fields["prefix_length"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["prefix_length"] = "PrefixLength" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.intelligence_flow_private_ip_prefix_info", fields, reflect.TypeOf(IntelligenceFlowPrivateIpPrefixInfo{}), fieldNameMap, validators) +} + +func IntelligenceFormFactorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["default_worker_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["default_worker_count"] = "DefaultWorkerCount" + fields["disk"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["disk"] = "Disk" + fields["memory"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["memory"] = "Memory" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + fields["vcpu"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vcpu"] = "Vcpu" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.intelligence_form_factor", fields, reflect.TypeOf(IntelligenceFormFactor{}), fieldNameMap, validators) +} + +func IntelligenceFormFactorsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["form_factors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IntelligenceFormFactorBindingType), reflect.TypeOf([]IntelligenceFormFactor{}))) + fieldNameMap["form_factors"] = "FormFactors" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.intelligence_form_factors", fields, reflect.TypeOf(IntelligenceFormFactors{}), fieldNameMap, validators) +} + +func IntelligenceHostConfigurationInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["broker_bootstrap_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IntelligenceBrokerEndpointInfoBindingType), reflect.TypeOf([]IntelligenceBrokerEndpointInfo{}))) + fieldNameMap["broker_bootstrap_servers"] = "BrokerBootstrapServers" + fields["broker_certificate"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["broker_certificate"] = "BrokerCertificate" + fields["broker_truststore"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["broker_truststore"] = "BrokerTruststore" + fields["context_data_collection_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["context_data_collection_interval"] = "ContextDataCollectionInterval" + fields["context_process_hashes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["context_process_hashes"] = "ContextProcessHashes" + fields["context_process_names"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["context_process_names"] = "ContextProcessNames" + fields["context_user_sids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["context_user_sids"] = "ContextUserSids" + fields["context_user_uids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["context_user_uids"] = "ContextUserUids" + fields["enable_context_data_collection"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_context_data_collection"] = "EnableContextDataCollection" + fields["enable_data_collection"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_data_collection"] = "EnableDataCollection" + fields["enable_deep_packet_inspection"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_deep_packet_inspection"] = "EnableDeepPacketInspection" + fields["enable_external_ip_aggregation"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_external_ip_aggregation"] = "EnableExternalIpAggregation" + fields["enable_flow_data_collection"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_flow_data_collection"] = "EnableFlowDataCollection" + fields["flow_data_collection_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["flow_data_collection_interval"] = "FlowDataCollectionInterval" + fields["max_active_flow_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_active_flow_count"] = "MaxActiveFlowCount" + fields["max_active_flow_count_bm"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_active_flow_count_bm"] = "MaxActiveFlowCountBm" + fields["max_inactive_flow_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_inactive_flow_count"] = "MaxInactiveFlowCount" + fields["max_inactive_flow_count_bm"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_inactive_flow_count_bm"] = "MaxInactiveFlowCountBm" + fields["private_ip_prefix"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IntelligenceFlowPrivateIpPrefixInfoBindingType), reflect.TypeOf([]IntelligenceFlowPrivateIpPrefixInfo{}))) + fieldNameMap["private_ip_prefix"] = "PrivateIpPrefix" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.intelligence_host_configuration_info", fields, reflect.TypeOf(IntelligenceHostConfigurationInfo{}), fieldNameMap, validators) +} + +func IntelligenceVsphereClusterNodeVMDeploymentConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allow_ssh_root_login"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["allow_ssh_root_login"] = "AllowSshRootLogin" + fields["compute_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["compute_id"] = "ComputeId" + fields["default_gateway_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["default_gateway_addresses"] = "DefaultGatewayAddresses" + fields["disk_provisioning"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["disk_provisioning"] = "DiskProvisioning" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["dns_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dns_servers"] = "DnsServers" + fields["enable_ssh"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_ssh"] = "EnableSsh" + fields["host_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_id"] = "HostId" + fields["hostname"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["hostname"] = "Hostname" + fields["management_network_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["management_network_id"] = "ManagementNetworkId" + fields["management_port_subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSubnetBindingType), reflect.TypeOf([]IPSubnet{}))) + fieldNameMap["management_port_subnets"] = "ManagementPortSubnets" + fields["ntp_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ntp_servers"] = "NtpServers" + fields["ovf_url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ovf_url"] = "OvfUrl" + fields["storage_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["storage_id"] = "StorageId" + fields["vc_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vc_id"] = "VcId" + fields["placement_type"] = bindings.NewStringType() + fieldNameMap["placement_type"] = "PlacementType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.intelligence_vsphere_cluster_node_VM_deployment_config", fields, reflect.TypeOf(IntelligenceVsphereClusterNodeVMDeploymentConfig{}), fieldNameMap, validators) +} + +func InterSRRoutingConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.inter_SR_routing_config", fields, reflect.TypeOf(InterSRRoutingConfig{}), fieldNameMap, validators) +} + +func InterSiteBgpSummaryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["neighbor_status"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BgpNeighborStatusBindingType), reflect.TypeOf([]BgpNeighborStatus{}))) + fieldNameMap["neighbor_status"] = "NeighborStatus" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.inter_site_bgp_summary", fields, reflect.TypeOf(InterSiteBgpSummary{}), fieldNameMap, validators) +} + +func InterSitePortCountersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["blocked_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["blocked_packets"] = "BlockedPackets" + fields["dad_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dad_dropped_packets"] = "DadDroppedPackets" + fields["destination_unsupported_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["destination_unsupported_dropped_packets"] = "DestinationUnsupportedDroppedPackets" + fields["dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dropped_packets"] = "DroppedPackets" + fields["firewall_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["firewall_dropped_packets"] = "FirewallDroppedPackets" + fields["frag_needed_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["frag_needed_dropped_packets"] = "FragNeededDroppedPackets" + fields["ipsec_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ipsec_dropped_packets"] = "IpsecDroppedPackets" + fields["ipsec_no_sa_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ipsec_no_sa_dropped_packets"] = "IpsecNoSaDroppedPackets" + fields["ipsec_no_vti_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ipsec_no_vti_dropped_packets"] = "IpsecNoVtiDroppedPackets" + fields["ipsec_pol_block_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ipsec_pol_block_dropped_packets"] = "IpsecPolBlockDroppedPackets" + fields["ipsec_pol_err_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ipsec_pol_err_dropped_packets"] = "IpsecPolErrDroppedPackets" + fields["ipv6_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ipv6_dropped_packets"] = "Ipv6DroppedPackets" + fields["kni_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["kni_dropped_packets"] = "KniDroppedPackets" + fields["l4port_unsupported_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["l4port_unsupported_dropped_packets"] = "L4portUnsupportedDroppedPackets" + fields["malformed_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["malformed_dropped_packets"] = "MalformedDroppedPackets" + fields["no_arp_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["no_arp_dropped_packets"] = "NoArpDroppedPackets" + fields["no_linked_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["no_linked_dropped_packets"] = "NoLinkedDroppedPackets" + fields["no_mem_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["no_mem_dropped_packets"] = "NoMemDroppedPackets" + fields["no_receiver_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["no_receiver_dropped_packets"] = "NoReceiverDroppedPackets" + fields["no_route_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["no_route_dropped_packets"] = "NoRouteDroppedPackets" + fields["non_ip_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["non_ip_dropped_packets"] = "NonIpDroppedPackets" + fields["proto_unsupported_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["proto_unsupported_dropped_packets"] = "ProtoUnsupportedDroppedPackets" + fields["redirect_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["redirect_dropped_packets"] = "RedirectDroppedPackets" + fields["rpf_check_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rpf_check_dropped_packets"] = "RpfCheckDroppedPackets" + fields["service_insert_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["service_insert_dropped_packets"] = "ServiceInsertDroppedPackets" + fields["total_bytes"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_bytes"] = "TotalBytes" + fields["total_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_packets"] = "TotalPackets" + fields["ttl_exceeded_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ttl_exceeded_dropped_packets"] = "TtlExceededDroppedPackets" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.inter_site_port_counters", fields, reflect.TypeOf(InterSitePortCounters{}), fieldNameMap, validators) +} + +func InterfaceIgmpLocalGroupConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["igmp_local_join_groups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["igmp_local_join_groups"] = "IgmpLocalJoinGroups" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.interface_igmp_local_group_config", fields, reflect.TypeOf(InterfaceIgmpLocalGroupConfig{}), fieldNameMap, validators) +} + +func InterfaceNeighborPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["ifindex"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ifindex"] = "Ifindex" + fields["mac"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac"] = "Mac" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["neighbors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NeighborPropertiesBindingType), reflect.TypeOf([]NeighborProperties{}))) + fieldNameMap["neighbors"] = "Neighbors" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.interface_neighbor_properties", fields, reflect.TypeOf(InterfaceNeighborProperties{}), fieldNameMap, validators) +} + +func InterfaceNeighborPropertyListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(InterfaceNeighborPropertiesBindingType), reflect.TypeOf([]InterfaceNeighborProperties{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.interface_neighbor_property_list_result", fields, reflect.TypeOf(InterfaceNeighborPropertyListResult{}), fieldNameMap, validators) +} + +func InterfacePimConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["hello_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["hello_interval"] = "HelloInterval" + fields["hold_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["hold_interval"] = "HoldInterval" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.interface_pim_config", fields, reflect.TypeOf(InterfacePimConfig{}), fieldNameMap, validators) +} + +func IntervalBackupScheduleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["seconds_between_backups"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["seconds_between_backups"] = "SecondsBetweenBackups" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.interval_backup_schedule", fields, reflect.TypeOf(IntervalBackupSchedule{}), fieldNameMap, validators) +} + +func IntervalSamplingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["sampling_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sampling_interval"] = "SamplingInterval" + fields["sampling_type"] = bindings.NewStringType() + fieldNameMap["sampling_type"] = "SamplingType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.interval_sampling", fields, reflect.TypeOf(IntervalSampling{}), fieldNameMap, validators) +} + +func InventoryConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["compute_managers_soft_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["compute_managers_soft_limit"] = "ComputeManagersSoftLimit" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.inventory_config", fields, reflect.TypeOf(InventoryConfig{}), fieldNameMap, validators) +} + +func IpAddressInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ip_address_info", fields, reflect.TypeOf(IpAddressInfo{}), fieldNameMap, validators) +} + +func IpAllocationBaseBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["gateway_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["gateway_ip"] = "GatewayIp" + fields["lease_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["lease_time"] = "LeaseTime" + fields["options"] = bindings.NewOptionalType(bindings.NewReferenceType(DhcpOptionsBindingType)) + fieldNameMap["options"] = "Options" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ip_allocation_base", fields, reflect.TypeOf(IpAllocationBase{}), fieldNameMap, validators) +} + +func IpAssignmentSpecBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ip_assignment_spec", fields, reflect.TypeOf(IpAssignmentSpec{}), fieldNameMap, validators) +} + +func IpBlockBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["cidr"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cidr"] = "Cidr" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ip_block", fields, reflect.TypeOf(IpBlock{}), fieldNameMap, validators) +} + +func IpBlockListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IpBlockBindingType), reflect.TypeOf([]IpBlock{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ip_block_list_result", fields, reflect.TypeOf(IpBlockListResult{}), fieldNameMap, validators) +} + +func IpBlockSubnetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["allocation_ranges"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IpPoolRangeBindingType), reflect.TypeOf([]IpPoolRange{}))) + fieldNameMap["allocation_ranges"] = "AllocationRanges" + fields["block_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["block_id"] = "BlockId" + fields["cidr"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cidr"] = "Cidr" + fields["size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["size"] = "Size" + fields["start_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["start_ip"] = "StartIp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ip_block_subnet", fields, reflect.TypeOf(IpBlockSubnet{}), fieldNameMap, validators) +} + +func IpBlockSubnetListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IpBlockSubnetBindingType), reflect.TypeOf([]IpBlockSubnet{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ip_block_subnet_list_result", fields, reflect.TypeOf(IpBlockSubnetListResult{}), fieldNameMap, validators) +} + +func IpDiscoverySwitchingProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["arp_bindings_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["arp_bindings_limit"] = "ArpBindingsLimit" + fields["arp_nd_binding_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["arp_nd_binding_timeout"] = "ArpNdBindingTimeout" + fields["arp_snooping_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["arp_snooping_enabled"] = "ArpSnoopingEnabled" + fields["dhcp_snooping_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["dhcp_snooping_enabled"] = "DhcpSnoopingEnabled" + fields["dhcpv6_snooping_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["dhcpv6_snooping_enabled"] = "Dhcpv6SnoopingEnabled" + fields["duplicate_ip_detection"] = bindings.NewOptionalType(bindings.NewReferenceType(DuplicateIPDetectionBindingType)) + fieldNameMap["duplicate_ip_detection"] = "DuplicateIpDetection" + fields["nd_bindings_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["nd_bindings_limit"] = "NdBindingsLimit" + fields["nd_snooping_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["nd_snooping_enabled"] = "NdSnoopingEnabled" + fields["trust_on_first_use_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["trust_on_first_use_enabled"] = "TrustOnFirstUseEnabled" + fields["vm_tools_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["vm_tools_enabled"] = "VmToolsEnabled" + fields["vm_tools_v6_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["vm_tools_v6_enabled"] = "VmToolsV6Enabled" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["required_capabilities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["required_capabilities"] = "RequiredCapabilities" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ip_discovery_switching_profile", fields, reflect.TypeOf(IpDiscoverySwitchingProfile{}), fieldNameMap, validators) +} + +func IpInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dst_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_ip"] = "DstIp" + fields["src_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["src_ip"] = "SrcIp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ip_info", fields, reflect.TypeOf(IpInfo{}), fieldNameMap, validators) +} + +func IpMacPairBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip"] = "Ip" + fields["mac"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac"] = "Mac" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ip_mac_pair", fields, reflect.TypeOf(IpMacPair{}), fieldNameMap, validators) +} + +func IpPoolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["check_overlap_with_existing_pools"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["check_overlap_with_existing_pools"] = "CheckOverlapWithExistingPools" + fields["ip_release_delay"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ip_release_delay"] = "IpReleaseDelay" + fields["pool_usage"] = bindings.NewOptionalType(bindings.NewReferenceType(PoolUsageBindingType)) + fieldNameMap["pool_usage"] = "PoolUsage" + fields["subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IpPoolSubnetBindingType), reflect.TypeOf([]IpPoolSubnet{}))) + fieldNameMap["subnets"] = "Subnets" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ip_pool", fields, reflect.TypeOf(IpPool{}), fieldNameMap, validators) +} + +func IpPoolListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IpPoolBindingType), reflect.TypeOf([]IpPool{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ip_pool_list_result", fields, reflect.TypeOf(IpPoolListResult{}), fieldNameMap, validators) +} + +func IpPoolRangeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["end"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["end"] = "End" + fields["start"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["start"] = "Start" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ip_pool_range", fields, reflect.TypeOf(IpPoolRange{}), fieldNameMap, validators) +} + +func IpPoolSubnetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["allocation_ranges"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IpPoolRangeBindingType), reflect.TypeOf([]IpPoolRange{}))) + fieldNameMap["allocation_ranges"] = "AllocationRanges" + fields["cidr"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cidr"] = "Cidr" + fields["dns_nameservers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dns_nameservers"] = "DnsNameservers" + fields["dns_suffix"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dns_suffix"] = "DnsSuffix" + fields["gateway_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["gateway_ip"] = "GatewayIp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ip_pool_subnet", fields, reflect.TypeOf(IpPoolSubnet{}), fieldNameMap, validators) +} + +func IpfixCollectorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["collector_ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["collector_ip_address"] = "CollectorIpAddress" + fields["collector_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["collector_port"] = "CollectorPort" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ipfix_collector", fields, reflect.TypeOf(IpfixCollector{}), fieldNameMap, validators) +} + +func IpfixCollectorConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["collectors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IpfixCollectorBindingType), reflect.TypeOf([]IpfixCollector{}))) + fieldNameMap["collectors"] = "Collectors" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ipfix_collector_config", fields, reflect.TypeOf(IpfixCollectorConfig{}), fieldNameMap, validators) +} + +func IpfixCollectorConfigListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IpfixCollectorConfigBindingType), reflect.TypeOf([]IpfixCollectorConfig{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ipfix_collector_config_list_result", fields, reflect.TypeOf(IpfixCollectorConfigListResult{}), fieldNameMap, validators) +} + +func IpfixCollectorUpmProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["collectors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IpfixCollectorBindingType), reflect.TypeOf([]IpfixCollector{}))) + fieldNameMap["collectors"] = "Collectors" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ipfix_collector_upm_profile", fields, reflect.TypeOf(IpfixCollectorUpmProfile{}), fieldNameMap, validators) +} + +func IpfixCollectorUpmProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IpfixCollectorUpmProfileBindingType), reflect.TypeOf([]IpfixCollectorUpmProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ipfix_collector_upm_profile_list_result", fields, reflect.TypeOf(IpfixCollectorUpmProfileListResult{}), fieldNameMap, validators) +} + +func IpfixConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["applied_tos"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["applied_tos"] = "AppliedTos" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ipfix_config", fields, reflect.TypeOf(IpfixConfig{}), fieldNameMap, validators) +} + +func IpfixConfigListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(IpfixConfigBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ipfix_config_list_result", fields, reflect.TypeOf(IpfixConfigListResult{}), fieldNameMap, validators) +} + +func IpfixDfwConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_flow_export_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["active_flow_export_timeout"] = "ActiveFlowExportTimeout" + fields["collector"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["collector"] = "Collector" + fields["observation_domain_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["observation_domain_id"] = "ObservationDomainId" + fields["priority"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["priority"] = "Priority" + fields["template_parameters"] = bindings.NewOptionalType(bindings.NewReferenceType(IpfixDfwTemplateParametersBindingType)) + fieldNameMap["template_parameters"] = "TemplateParameters" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["applied_tos"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["applied_tos"] = "AppliedTos" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ipfix_dfw_config", fields, reflect.TypeOf(IpfixDfwConfig{}), fieldNameMap, validators) +} + +func IpfixDfwTemplateParametersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["destination_address"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["destination_address"] = "DestinationAddress" + fields["destination_transport_port"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["destination_transport_port"] = "DestinationTransportPort" + fields["firewall_event"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["firewall_event"] = "FirewallEvent" + fields["flow_direction"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["flow_direction"] = "FlowDirection" + fields["flow_end"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["flow_end"] = "FlowEnd" + fields["flow_start"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["flow_start"] = "FlowStart" + fields["icmp_code"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["icmp_code"] = "IcmpCode" + fields["octet_delta_count"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["octet_delta_count"] = "OctetDeltaCount" + fields["packet_delta_count"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["packet_delta_count"] = "PacketDeltaCount" + fields["protocol_identifier"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["protocol_identifier"] = "ProtocolIdentifier" + fields["rule_id"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["rule_id"] = "RuleId" + fields["source_address"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["source_address"] = "SourceAddress" + fields["source_icmp_type"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["source_icmp_type"] = "SourceIcmpType" + fields["source_transport_port"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["source_transport_port"] = "SourceTransportPort" + fields["vif_uuid"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["vif_uuid"] = "VifUuid" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ipfix_dfw_template_parameters", fields, reflect.TypeOf(IpfixDfwTemplateParameters{}), fieldNameMap, validators) +} + +func IpfixServiceAssociationListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(IpfixConfigBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["service_type"] = bindings.NewStringType() + fieldNameMap["service_type"] = "ServiceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ipfix_service_association_list_result", fields, reflect.TypeOf(IpfixServiceAssociationListResult{}), fieldNameMap, validators) +} + +func IpfixSwitchUpmProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["active_timeout"] = "ActiveTimeout" + fields["applied_tos"] = bindings.NewOptionalType(bindings.NewReferenceType(AppliedTosBindingType)) + fieldNameMap["applied_tos"] = "AppliedTos" + fields["collector_profile"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["collector_profile"] = "CollectorProfile" + fields["export_overlay_flow"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["export_overlay_flow"] = "ExportOverlayFlow" + fields["idle_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["idle_timeout"] = "IdleTimeout" + fields["max_flows"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_flows"] = "MaxFlows" + fields["observation_domain_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["observation_domain_id"] = "ObservationDomainId" + fields["packet_sample_probability"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["packet_sample_probability"] = "PacketSampleProbability" + fields["priority"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["priority"] = "Priority" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ipfix_switch_upm_profile", fields, reflect.TypeOf(IpfixSwitchUpmProfile{}), fieldNameMap, validators) +} + +func IpfixUpmProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ipfix_upm_profile", fields, reflect.TypeOf(IpfixUpmProfile{}), fieldNameMap, validators) +} + +func IpfixUpmProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(IpfixUpmProfileBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ipfix_upm_profile_list_result", fields, reflect.TypeOf(IpfixUpmProfileListResult{}), fieldNameMap, validators) +} + +func Ipv4HeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dst_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_ip"] = "DstIp" + fields["flags"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["flags"] = "Flags" + fields["protocol"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["protocol"] = "Protocol" + fields["src_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["src_ip"] = "SrcIp" + fields["src_subnet_prefix_len"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["src_subnet_prefix_len"] = "SrcSubnetPrefixLen" + fields["ttl"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ttl"] = "Ttl" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ipv4_header", fields, reflect.TypeOf(Ipv4Header{}), fieldNameMap, validators) +} + +func Ipv6HeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dst_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_ip"] = "DstIp" + fields["hop_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["hop_limit"] = "HopLimit" + fields["next_header"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["next_header"] = "NextHeader" + fields["src_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["src_ip"] = "SrcIp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ipv6_header", fields, reflect.TypeOf(Ipv6Header{}), fieldNameMap, validators) +} + +func IssuerSerialNumberBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["issuer"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["issuer"] = "Issuer" + fields["serial_numbers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["serial_numbers"] = "SerialNumbers" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.issuer_serial_number", fields, reflect.TypeOf(IssuerSerialNumber{}), fieldNameMap, validators) +} + +func JoinClusterParametersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certficate_sha256_thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["certficate_sha256_thumbprint"] = "CertficateSha256Thumbprint" + fields["cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cluster_id"] = "ClusterId" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["token"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["token"] = "Token" + fields["username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["username"] = "Username" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.join_cluster_parameters", fields, reflect.TypeOf(JoinClusterParameters{}), fieldNameMap, validators) +} + +func KeyStoreInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["keystore"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["keystore"] = "Keystore" + fields["keystore_alias"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["keystore_alias"] = "KeystoreAlias" + fields["keystore_phrase"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["keystore_phrase"] = "KeystorePhrase" + fields["truststore"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["truststore"] = "Truststore" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.key_store_info", fields, reflect.TypeOf(KeyStoreInfo{}), fieldNameMap, validators) +} + +func KeyValueBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key"] = "Key" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.key_value", fields, reflect.TypeOf(KeyValue{}), fieldNameMap, validators) +} + +func KeyValuePairBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key"] = "Key" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.key_value_pair", fields, reflect.TypeOf(KeyValuePair{}), fieldNameMap, validators) +} + +func KnownHostParameterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["host"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host"] = "Host" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.known_host_parameter", fields, reflect.TypeOf(KnownHostParameter{}), fieldNameMap, validators) +} + +func L2ForwarderRemoteMacsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["inter_site_forwarder_status"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(L2ForwarderStatusPerNodeBindingType), reflect.TypeOf([]L2ForwarderStatusPerNode{}))) + fieldNameMap["inter_site_forwarder_status"] = "InterSiteForwarderStatus" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + fields["remote_macs_per_site"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(L2ForwarderRemoteMacsPerSiteBindingType), reflect.TypeOf([]L2ForwarderRemoteMacsPerSite{}))) + fieldNameMap["remote_macs_per_site"] = "RemoteMacsPerSite" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l2_forwarder_remote_macs", fields, reflect.TypeOf(L2ForwarderRemoteMacs{}), fieldNameMap, validators) +} + +func L2ForwarderRemoteMacsPerSiteBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["remote_active_ips"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["remote_active_ips"] = "RemoteActiveIps" + fields["remote_mac_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["remote_mac_addresses"] = "RemoteMacAddresses" + fields["remote_site"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["remote_site"] = "RemoteSite" + fields["remote_standby_ips"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["remote_standby_ips"] = "RemoteStandbyIps" + fields["rtep_group_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rtep_group_id"] = "RtepGroupId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l2_forwarder_remote_macs_per_site", fields, reflect.TypeOf(L2ForwarderRemoteMacsPerSite{}), fieldNameMap, validators) +} + +func L2ForwarderStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + fields["rx"] = bindings.NewOptionalType(bindings.NewReferenceType(InterSitePortCountersBindingType)) + fieldNameMap["rx"] = "Rx" + fields["tx"] = bindings.NewOptionalType(bindings.NewReferenceType(InterSitePortCountersBindingType)) + fieldNameMap["tx"] = "Tx" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l2_forwarder_statistics", fields, reflect.TypeOf(L2ForwarderStatistics{}), fieldNameMap, validators) +} + +func L2ForwarderStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + fields["status_per_node"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(L2ForwarderStatusPerNodeBindingType), reflect.TypeOf([]L2ForwarderStatusPerNode{}))) + fieldNameMap["status_per_node"] = "StatusPerNode" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l2_forwarder_status", fields, reflect.TypeOf(L2ForwarderStatus{}), fieldNameMap, validators) +} + +func L2ForwarderStatusPerNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["high_availability_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["high_availability_status"] = "HighAvailabilityStatus" + fields["transport_node"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["transport_node"] = "TransportNode" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l2_forwarder_status_per_node", fields, reflect.TypeOf(L2ForwarderStatusPerNode{}), fieldNameMap, validators) +} + +func L2VPNPerLSTrafficStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bum_bytes_in"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bum_bytes_in"] = "BumBytesIn" + fields["bum_bytes_out"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bum_bytes_out"] = "BumBytesOut" + fields["bum_packets_in"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bum_packets_in"] = "BumPacketsIn" + fields["bum_packets_out"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bum_packets_out"] = "BumPacketsOut" + fields["bytes_in"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bytes_in"] = "BytesIn" + fields["bytes_out"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bytes_out"] = "BytesOut" + fields["logical_switch"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["logical_switch"] = "LogicalSwitch" + fields["packets_in"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["packets_in"] = "PacketsIn" + fields["packets_out"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["packets_out"] = "PacketsOut" + fields["packets_receive_error"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["packets_receive_error"] = "PacketsReceiveError" + fields["packets_sent_error"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["packets_sent_error"] = "PacketsSentError" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l2_VPN_per_LS_traffic_statistics", fields, reflect.TypeOf(L2VPNPerLSTrafficStatistics{}), fieldNameMap, validators) +} + +func L2VPNSessionRemoteMacsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["remote_mac_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(L2VPNSessionRemoteMacsForLSBindingType), reflect.TypeOf([]L2VPNSessionRemoteMacsForLS{}))) + fieldNameMap["remote_mac_addresses"] = "RemoteMacAddresses" + fields["session_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["session_id"] = "SessionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l2_VPN_session_remote_macs", fields, reflect.TypeOf(L2VPNSessionRemoteMacs{}), fieldNameMap, validators) +} + +func L2VPNSessionRemoteMacsForLSBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_switch"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["logical_switch"] = "LogicalSwitch" + fields["remote_mac_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["remote_mac_addresses"] = "RemoteMacAddresses" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l2_VPN_session_remote_macs_for_LS", fields, reflect.TypeOf(L2VPNSessionRemoteMacsForLS{}), fieldNameMap, validators) +} + +func L2VPNSessionStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["partial_stats"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["partial_stats"] = "PartialStats" + fields["session_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["session_id"] = "SessionId" + fields["tap_traffic_counters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(L2VPNTapTrafficStatisticsBindingType), reflect.TypeOf([]L2VPNTapTrafficStatistics{}))) + fieldNameMap["tap_traffic_counters"] = "TapTrafficCounters" + fields["traffic_statistics_per_logical_switch"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(L2VPNPerLSTrafficStatisticsBindingType), reflect.TypeOf([]L2VPNPerLSTrafficStatistics{}))) + fieldNameMap["traffic_statistics_per_logical_switch"] = "TrafficStatisticsPerLogicalSwitch" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l2_VPN_session_statistics", fields, reflect.TypeOf(L2VPNSessionStatistics{}), fieldNameMap, validators) +} + +func L2VPNSessionStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["session_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["session_id"] = "SessionId" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["transport_tunnels"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(L2VPNTransportTunnelStatusBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["transport_tunnels"] = "TransportTunnels" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l2_VPN_session_status", fields, reflect.TypeOf(L2VPNSessionStatus{}), fieldNameMap, validators) +} + +func L2VPNSessionSummaryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["established_l2vpn_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["established_l2vpn_sessions"] = "EstablishedL2vpnSessions" + fields["failed_l2vpn_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failed_l2vpn_sessions"] = "FailedL2vpnSessions" + fields["total_l2vpn_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_l2vpn_sessions"] = "TotalL2vpnSessions" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l2_VPN_session_summary", fields, reflect.TypeOf(L2VPNSessionSummary{}), fieldNameMap, validators) +} + +func L2VPNTapTrafficStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bytes_in"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bytes_in"] = "BytesIn" + fields["bytes_out"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bytes_out"] = "BytesOut" + fields["packets_in"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["packets_in"] = "PacketsIn" + fields["packets_out"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["packets_out"] = "PacketsOut" + fields["packets_receive_error"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["packets_receive_error"] = "PacketsReceiveError" + fields["packets_sent_error"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["packets_sent_error"] = "PacketsSentError" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l2_VPN_tap_traffic_statistics", fields, reflect.TypeOf(L2VPNTapTrafficStatistics{}), fieldNameMap, validators) +} + +func L2VPNTransportTunnelStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tunnel_id"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["tunnel_id"] = "TunnelId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l2_VPN_transport_tunnel_status", fields, reflect.TypeOf(L2VPNTransportTunnelStatus{}), fieldNameMap, validators) +} + +func L2VpnAttachmentContextBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["local_egress_ip"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["local_egress_ip"] = "LocalEgressIp" + fields["tunnel_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tunnel_id"] = "TunnelId" + fields["allocate_addresses"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["allocate_addresses"] = "AllocateAddresses" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l2_vpn_attachment_context", fields, reflect.TypeOf(L2VpnAttachmentContext{}), fieldNameMap, validators) +} + +func L2VpnServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["enable_full_mesh"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_full_mesh"] = "EnableFullMesh" + fields["enable_hub"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_hub"] = "EnableHub" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["logical_tap_ip_pool"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["logical_tap_ip_pool"] = "LogicalTapIpPool" + fields["mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mode"] = "Mode" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l2_vpn_service", fields, reflect.TypeOf(L2VpnService{}), fieldNameMap, validators) +} + +func L2VpnServiceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(L2VpnServiceBindingType), reflect.TypeOf([]L2VpnService{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l2_vpn_service_list_result", fields, reflect.TypeOf(L2VpnServiceListResult{}), fieldNameMap, validators) +} + +func L2VpnSessionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["l2vpn_service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["l2vpn_service_id"] = "L2vpnServiceId" + fields["l2vpn_tcp_mss_clamping"] = bindings.NewOptionalType(bindings.NewReferenceType(L2VpnTcpMssClampingBindingType)) + fieldNameMap["l2vpn_tcp_mss_clamping"] = "L2vpnTcpMssClamping" + fields["transport_tunnels"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["transport_tunnels"] = "TransportTunnels" + fields["tunnel_encapsulation"] = bindings.NewOptionalType(bindings.NewReferenceType(L2VpnTunnelEncapsulationBindingType)) + fieldNameMap["tunnel_encapsulation"] = "TunnelEncapsulation" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l2_vpn_session", fields, reflect.TypeOf(L2VpnSession{}), fieldNameMap, validators) +} + +func L2VpnSessionListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(L2VpnSessionBindingType), reflect.TypeOf([]L2VpnSession{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l2_vpn_session_list_result", fields, reflect.TypeOf(L2VpnSessionListResult{}), fieldNameMap, validators) +} + +func L2VpnSessionPeerCodesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["peer_codes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(L2VpnTunnelPeerCodeBindingType), reflect.TypeOf([]L2VpnTunnelPeerCode{}))) + fieldNameMap["peer_codes"] = "PeerCodes" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l2_vpn_session_peer_codes", fields, reflect.TypeOf(L2VpnSessionPeerCodes{}), fieldNameMap, validators) +} + +func L2VpnTcpMssClampingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["direction"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["direction"] = "Direction" + fields["max_segment_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_segment_size"] = "MaxSegmentSize" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l2_vpn_tcp_mss_clamping", fields, reflect.TypeOf(L2VpnTcpMssClamping{}), fieldNameMap, validators) +} + +func L2VpnTunnelEncapsulationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["local_endpoint_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_endpoint_ip"] = "LocalEndpointIp" + fields["peer_endpoint_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["peer_endpoint_ip"] = "PeerEndpointIp" + fields["protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["protocol"] = "Protocol" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l2_vpn_tunnel_encapsulation", fields, reflect.TypeOf(L2VpnTunnelEncapsulation{}), fieldNameMap, validators) +} + +func L2VpnTunnelPeerCodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["peer_code"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["peer_code"] = "PeerCode" + fields["transport_tunnel"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["transport_tunnel"] = "TransportTunnel" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l2_vpn_tunnel_peer_code", fields, reflect.TypeOf(L2VpnTunnelPeerCode{}), fieldNameMap, validators) +} + +func L4PortSetNSServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["destination_ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["destination_ports"] = "DestinationPorts" + fields["l4_protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["l4_protocol"] = "L4Protocol" + fields["source_ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["source_ports"] = "SourcePorts" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.l4_port_set_NS_service", fields, reflect.TypeOf(L4PortSetNSService{}), fieldNameMap, validators) +} + +func LabelBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["hover"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["hover"] = "Hover" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["navigation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["navigation"] = "Navigation" + fields["text"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["text"] = "Text" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.label", fields, reflect.TypeOf(Label{}), fieldNameMap, validators) +} + +func LabelValueConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["layout"] = bindings.NewOptionalType(bindings.NewReferenceType(LayoutBindingType)) + fieldNameMap["layout"] = "Layout" + fields["navigation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["navigation"] = "Navigation" + fields["properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PropertyItemBindingType), reflect.TypeOf([]PropertyItem{}))) + fieldNameMap["properties"] = "Properties" + fields["sub_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sub_type"] = "SubType" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["feature_set"] = bindings.NewOptionalType(bindings.NewReferenceType(FeatureSetBindingType)) + fieldNameMap["feature_set"] = "FeatureSet" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["filters"] = "Filters" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["plot_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(WidgetPlotConfigurationBindingType), reflect.TypeOf([]WidgetPlotConfiguration{}))) + fieldNameMap["plot_configs"] = "PlotConfigs" + fields["rowspan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rowspan"] = "Rowspan" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["show_header"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_header"] = "ShowHeader" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.label_value_configuration", fields, reflect.TypeOf(LabelValueConfiguration{}), fieldNameMap, validators) +} + +func LacpGroupConfigInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key"] = "Key" + fields["load_balance_algorithm"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["load_balance_algorithm"] = "LoadBalanceAlgorithm" + fields["mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mode"] = "Mode" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["timeout_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["timeout_type"] = "TimeoutType" + fields["uplink_names"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["uplink_names"] = "UplinkNames" + fields["uplink_num"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["uplink_num"] = "UplinkNum" + fields["uplink_port_keys"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["uplink_port_keys"] = "UplinkPortKeys" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lacp_group_config_info", fields, reflect.TypeOf(LacpGroupConfigInfo{}), fieldNameMap, validators) +} + +func LagBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["load_balance_algorithm"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["load_balance_algorithm"] = "LoadBalanceAlgorithm" + fields["mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mode"] = "Mode" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["number_of_uplinks"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["number_of_uplinks"] = "NumberOfUplinks" + fields["timeout_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["timeout_type"] = "TimeoutType" + fields["uplinks"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UplinkBindingType), reflect.TypeOf([]Uplink{}))) + fieldNameMap["uplinks"] = "Uplinks" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lag", fields, reflect.TypeOf(Lag{}), fieldNameMap, validators) +} + +func LatencyStatProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["pnic_latency_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["pnic_latency_enabled"] = "PnicLatencyEnabled" + fields["sampling_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sampling_interval"] = "SamplingInterval" + fields["sampling_rate"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sampling_rate"] = "SamplingRate" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.latency_stat_profile", fields, reflect.TypeOf(LatencyStatProfile{}), fieldNameMap, validators) +} + +func LatencyStatProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LatencyStatProfileBindingType), reflect.TypeOf([]LatencyStatProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.latency_stat_profile_list_result", fields, reflect.TypeOf(LatencyStatProfileListResult{}), fieldNameMap, validators) +} + +func LayoutBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["properties"] = bindings.NewOptionalType(bindings.NewReferenceType(LayoutPropertiesBindingType)) + fieldNameMap["properties"] = "Properties" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.layout", fields, reflect.TypeOf(Layout{}), fieldNameMap, validators) +} + +func LayoutPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["num_columns"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["num_columns"] = "NumColumns" + fields["num_rows"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["num_rows"] = "NumRows" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.layout_properties", fields, reflect.TypeOf(LayoutProperties{}), fieldNameMap, validators) +} + +func LbAccessListControlBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["group_id"] = "GroupId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_access_list_control", fields, reflect.TypeOf(LbAccessListControl{}), fieldNameMap, validators) +} + +func LbActiveMonitorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["fall_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["fall_count"] = "FallCount" + fields["interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interval"] = "Interval" + fields["monitor_port"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["monitor_port"] = "MonitorPort" + fields["rise_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rise_count"] = "RiseCount" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_active_monitor", fields, reflect.TypeOf(LbActiveMonitor{}), fieldNameMap, validators) +} + +func LbAppProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_app_profile", fields, reflect.TypeOf(LbAppProfile{}), fieldNameMap, validators) +} + +func LbAppProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LbAppProfileBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_app_profile_list_result", fields, reflect.TypeOf(LbAppProfileListResult{}), fieldNameMap, validators) +} + +func LbClientCertificateIssuerDnConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["case_sensitive"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["case_sensitive"] = "CaseSensitive" + fields["issuer_dn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["issuer_dn"] = "IssuerDn" + fields["match_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_type"] = "MatchType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_client_certificate_issuer_dn_condition", fields, reflect.TypeOf(LbClientCertificateIssuerDnCondition{}), fieldNameMap, validators) +} + +func LbClientCertificateSubjectDnConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["case_sensitive"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["case_sensitive"] = "CaseSensitive" + fields["match_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_type"] = "MatchType" + fields["subject_dn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["subject_dn"] = "SubjectDn" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_client_certificate_subject_dn_condition", fields, reflect.TypeOf(LbClientCertificateSubjectDnCondition{}), fieldNameMap, validators) +} + +func LbClientSslProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["cipher_group_label"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cipher_group_label"] = "CipherGroupLabel" + fields["ciphers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ciphers"] = "Ciphers" + fields["is_fips"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_fips"] = "IsFips" + fields["is_secure"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_secure"] = "IsSecure" + fields["prefer_server_ciphers"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["prefer_server_ciphers"] = "PreferServerCiphers" + fields["protocols"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["protocols"] = "Protocols" + fields["session_cache_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["session_cache_enabled"] = "SessionCacheEnabled" + fields["session_cache_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["session_cache_timeout"] = "SessionCacheTimeout" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_client_ssl_profile", fields, reflect.TypeOf(LbClientSslProfile{}), fieldNameMap, validators) +} + +func LbClientSslProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbClientSslProfileBindingType), reflect.TypeOf([]LbClientSslProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_client_ssl_profile_list_result", fields, reflect.TypeOf(LbClientSslProfileListResult{}), fieldNameMap, validators) +} + +func LbConnectionDropActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_connection_drop_action", fields, reflect.TypeOf(LbConnectionDropAction{}), fieldNameMap, validators) +} + +func LbCookiePersistenceProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cookie_domain"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cookie_domain"] = "CookieDomain" + fields["cookie_fallback"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["cookie_fallback"] = "CookieFallback" + fields["cookie_garble"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["cookie_garble"] = "CookieGarble" + fields["cookie_httponly"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["cookie_httponly"] = "CookieHttponly" + fields["cookie_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cookie_mode"] = "CookieMode" + fields["cookie_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cookie_name"] = "CookieName" + fields["cookie_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cookie_path"] = "CookiePath" + fields["cookie_secure"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["cookie_secure"] = "CookieSecure" + fields["cookie_time"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LbCookieTimeBindingType)}, bindings.REST)) + fieldNameMap["cookie_time"] = "CookieTime" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["persistence_shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["persistence_shared"] = "PersistenceShared" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_cookie_persistence_profile", fields, reflect.TypeOf(LbCookiePersistenceProfile{}), fieldNameMap, validators) +} + +func LbCookieTimeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_cookie_time", fields, reflect.TypeOf(LbCookieTime{}), fieldNameMap, validators) +} + +func LbEdgeNodeUsageBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["current_credit_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["current_credit_number"] = "CurrentCreditNumber" + fields["current_large_load_balancer_services"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["current_large_load_balancer_services"] = "CurrentLargeLoadBalancerServices" + fields["current_medium_load_balancer_services"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["current_medium_load_balancer_services"] = "CurrentMediumLoadBalancerServices" + fields["current_pool_members"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["current_pool_members"] = "CurrentPoolMembers" + fields["current_pools"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["current_pools"] = "CurrentPools" + fields["current_small_load_balancer_services"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["current_small_load_balancer_services"] = "CurrentSmallLoadBalancerServices" + fields["current_virtual_servers"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["current_virtual_servers"] = "CurrentVirtualServers" + fields["current_xlarge_load_balancer_services"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["current_xlarge_load_balancer_services"] = "CurrentXlargeLoadBalancerServices" + fields["edge_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + fields["form_factor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["form_factor"] = "FormFactor" + fields["remaining_credit_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["remaining_credit_number"] = "RemainingCreditNumber" + fields["remaining_large_load_balancer_services"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["remaining_large_load_balancer_services"] = "RemainingLargeLoadBalancerServices" + fields["remaining_medium_load_balancer_services"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["remaining_medium_load_balancer_services"] = "RemainingMediumLoadBalancerServices" + fields["remaining_pool_members"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["remaining_pool_members"] = "RemainingPoolMembers" + fields["remaining_small_load_balancer_services"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["remaining_small_load_balancer_services"] = "RemainingSmallLoadBalancerServices" + fields["remaining_xlarge_load_balancer_services"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["remaining_xlarge_load_balancer_services"] = "RemainingXlargeLoadBalancerServices" + fields["severity"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["severity"] = "Severity" + fields["usage_percentage"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["usage_percentage"] = "UsagePercentage" + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_edge_node_usage", fields, reflect.TypeOf(LbEdgeNodeUsage{}), fieldNameMap, validators) +} + +func LbFastTcpProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["close_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["close_timeout"] = "CloseTimeout" + fields["ha_flow_mirroring_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ha_flow_mirroring_enabled"] = "HaFlowMirroringEnabled" + fields["idle_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["idle_timeout"] = "IdleTimeout" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_fast_tcp_profile", fields, reflect.TypeOf(LbFastTcpProfile{}), fieldNameMap, validators) +} + +func LbFastUdpProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["flow_mirroring_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["flow_mirroring_enabled"] = "FlowMirroringEnabled" + fields["idle_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["idle_timeout"] = "IdleTimeout" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_fast_udp_profile", fields, reflect.TypeOf(LbFastUdpProfile{}), fieldNameMap, validators) +} + +func LbGenericPersistenceProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ha_persistence_mirroring_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ha_persistence_mirroring_enabled"] = "HaPersistenceMirroringEnabled" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["persistence_shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["persistence_shared"] = "PersistenceShared" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_generic_persistence_profile", fields, reflect.TypeOf(LbGenericPersistenceProfile{}), fieldNameMap, validators) +} + +func LbHttpMonitorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["request_body"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_body"] = "RequestBody" + fields["request_headers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbHttpRequestHeaderBindingType), reflect.TypeOf([]LbHttpRequestHeader{}))) + fieldNameMap["request_headers"] = "RequestHeaders" + fields["request_method"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_method"] = "RequestMethod" + fields["request_url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_url"] = "RequestUrl" + fields["request_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_version"] = "RequestVersion" + fields["response_body"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["response_body"] = "ResponseBody" + fields["response_status_codes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewIntegerType(), reflect.TypeOf([]int64{}))) + fieldNameMap["response_status_codes"] = "ResponseStatusCodes" + fields["fall_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["fall_count"] = "FallCount" + fields["interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interval"] = "Interval" + fields["monitor_port"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["monitor_port"] = "MonitorPort" + fields["rise_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rise_count"] = "RiseCount" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_http_monitor", fields, reflect.TypeOf(LbHttpMonitor{}), fieldNameMap, validators) +} + +func LbHttpProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["http_redirect_to"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["http_redirect_to"] = "HttpRedirectTo" + fields["http_redirect_to_https"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["http_redirect_to_https"] = "HttpRedirectToHttps" + fields["idle_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["idle_timeout"] = "IdleTimeout" + fields["ntlm"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ntlm"] = "Ntlm" + fields["request_body_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["request_body_size"] = "RequestBodySize" + fields["request_header_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["request_header_size"] = "RequestHeaderSize" + fields["response_buffering"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["response_buffering"] = "ResponseBuffering" + fields["response_header_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["response_header_size"] = "ResponseHeaderSize" + fields["response_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["response_timeout"] = "ResponseTimeout" + fields["server_keep_alive"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["server_keep_alive"] = "ServerKeepAlive" + fields["x_forwarded_for"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["x_forwarded_for"] = "XForwardedFor" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_http_profile", fields, reflect.TypeOf(LbHttpProfile{}), fieldNameMap, validators) +} + +func LbHttpRedirectActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["redirect_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["redirect_status"] = "RedirectStatus" + fields["redirect_url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["redirect_url"] = "RedirectUrl" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_http_redirect_action", fields, reflect.TypeOf(LbHttpRedirectAction{}), fieldNameMap, validators) +} + +func LbHttpRejectActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["reply_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["reply_message"] = "ReplyMessage" + fields["reply_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["reply_status"] = "ReplyStatus" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_http_reject_action", fields, reflect.TypeOf(LbHttpRejectAction{}), fieldNameMap, validators) +} + +func LbHttpRequestBodyConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["body_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["body_value"] = "BodyValue" + fields["case_sensitive"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["case_sensitive"] = "CaseSensitive" + fields["match_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_type"] = "MatchType" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_http_request_body_condition", fields, reflect.TypeOf(LbHttpRequestBodyCondition{}), fieldNameMap, validators) +} + +func LbHttpRequestCookieConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["case_sensitive"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["case_sensitive"] = "CaseSensitive" + fields["cookie_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cookie_name"] = "CookieName" + fields["cookie_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cookie_value"] = "CookieValue" + fields["match_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_type"] = "MatchType" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_http_request_cookie_condition", fields, reflect.TypeOf(LbHttpRequestCookieCondition{}), fieldNameMap, validators) +} + +func LbHttpRequestHeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["header_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_name"] = "HeaderName" + fields["header_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_value"] = "HeaderValue" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_http_request_header", fields, reflect.TypeOf(LbHttpRequestHeader{}), fieldNameMap, validators) +} + +func LbHttpRequestHeaderConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["case_sensitive"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["case_sensitive"] = "CaseSensitive" + fields["header_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_name"] = "HeaderName" + fields["header_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_value"] = "HeaderValue" + fields["match_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_type"] = "MatchType" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_http_request_header_condition", fields, reflect.TypeOf(LbHttpRequestHeaderCondition{}), fieldNameMap, validators) +} + +func LbHttpRequestHeaderDeleteActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["header_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_name"] = "HeaderName" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_http_request_header_delete_action", fields, reflect.TypeOf(LbHttpRequestHeaderDeleteAction{}), fieldNameMap, validators) +} + +func LbHttpRequestHeaderRewriteActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["header_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_name"] = "HeaderName" + fields["header_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_value"] = "HeaderValue" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_http_request_header_rewrite_action", fields, reflect.TypeOf(LbHttpRequestHeaderRewriteAction{}), fieldNameMap, validators) +} + +func LbHttpRequestMethodConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["method"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["method"] = "Method" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_http_request_method_condition", fields, reflect.TypeOf(LbHttpRequestMethodCondition{}), fieldNameMap, validators) +} + +func LbHttpRequestUriArgumentsConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["case_sensitive"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["case_sensitive"] = "CaseSensitive" + fields["match_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_type"] = "MatchType" + fields["uri_arguments"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uri_arguments"] = "UriArguments" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_http_request_uri_arguments_condition", fields, reflect.TypeOf(LbHttpRequestUriArgumentsCondition{}), fieldNameMap, validators) +} + +func LbHttpRequestUriConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["case_sensitive"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["case_sensitive"] = "CaseSensitive" + fields["match_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_type"] = "MatchType" + fields["uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uri"] = "Uri" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_http_request_uri_condition", fields, reflect.TypeOf(LbHttpRequestUriCondition{}), fieldNameMap, validators) +} + +func LbHttpRequestUriRewriteActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uri"] = "Uri" + fields["uri_arguments"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uri_arguments"] = "UriArguments" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_http_request_uri_rewrite_action", fields, reflect.TypeOf(LbHttpRequestUriRewriteAction{}), fieldNameMap, validators) +} + +func LbHttpRequestVersionConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["version"] = "Version" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_http_request_version_condition", fields, reflect.TypeOf(LbHttpRequestVersionCondition{}), fieldNameMap, validators) +} + +func LbHttpResponseHeaderConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["case_sensitive"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["case_sensitive"] = "CaseSensitive" + fields["header_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_name"] = "HeaderName" + fields["header_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_value"] = "HeaderValue" + fields["match_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_type"] = "MatchType" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_http_response_header_condition", fields, reflect.TypeOf(LbHttpResponseHeaderCondition{}), fieldNameMap, validators) +} + +func LbHttpResponseHeaderDeleteActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["header_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_name"] = "HeaderName" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_http_response_header_delete_action", fields, reflect.TypeOf(LbHttpResponseHeaderDeleteAction{}), fieldNameMap, validators) +} + +func LbHttpResponseHeaderRewriteActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["header_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_name"] = "HeaderName" + fields["header_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["header_value"] = "HeaderValue" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_http_response_header_rewrite_action", fields, reflect.TypeOf(LbHttpResponseHeaderRewriteAction{}), fieldNameMap, validators) +} + +func LbHttpSslConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["client_certificate_issuer_dn"] = bindings.NewOptionalType(bindings.NewReferenceType(LbClientCertificateIssuerDnConditionBindingType)) + fieldNameMap["client_certificate_issuer_dn"] = "ClientCertificateIssuerDn" + fields["client_certificate_subject_dn"] = bindings.NewOptionalType(bindings.NewReferenceType(LbClientCertificateSubjectDnConditionBindingType)) + fieldNameMap["client_certificate_subject_dn"] = "ClientCertificateSubjectDn" + fields["client_supported_ssl_ciphers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["client_supported_ssl_ciphers"] = "ClientSupportedSslCiphers" + fields["session_reused"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["session_reused"] = "SessionReused" + fields["used_protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["used_protocol"] = "UsedProtocol" + fields["used_ssl_cipher"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["used_ssl_cipher"] = "UsedSslCipher" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_http_ssl_condition", fields, reflect.TypeOf(LbHttpSslCondition{}), fieldNameMap, validators) +} + +func LbHttpsMonitorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate_chain_depth"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["certificate_chain_depth"] = "CertificateChainDepth" + fields["cipher_group_label"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cipher_group_label"] = "CipherGroupLabel" + fields["ciphers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ciphers"] = "Ciphers" + fields["client_certificate_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["client_certificate_id"] = "ClientCertificateId" + fields["is_fips"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_fips"] = "IsFips" + fields["is_secure"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_secure"] = "IsSecure" + fields["protocols"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["protocols"] = "Protocols" + fields["request_body"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_body"] = "RequestBody" + fields["request_headers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbHttpRequestHeaderBindingType), reflect.TypeOf([]LbHttpRequestHeader{}))) + fieldNameMap["request_headers"] = "RequestHeaders" + fields["request_method"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_method"] = "RequestMethod" + fields["request_url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_url"] = "RequestUrl" + fields["request_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_version"] = "RequestVersion" + fields["response_body"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["response_body"] = "ResponseBody" + fields["response_status_codes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewIntegerType(), reflect.TypeOf([]int64{}))) + fieldNameMap["response_status_codes"] = "ResponseStatusCodes" + fields["server_auth"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_auth"] = "ServerAuth" + fields["server_auth_ca_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["server_auth_ca_ids"] = "ServerAuthCaIds" + fields["server_auth_crl_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["server_auth_crl_ids"] = "ServerAuthCrlIds" + fields["fall_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["fall_count"] = "FallCount" + fields["interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interval"] = "Interval" + fields["monitor_port"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["monitor_port"] = "MonitorPort" + fields["rise_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rise_count"] = "RiseCount" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_https_monitor", fields, reflect.TypeOf(LbHttpsMonitor{}), fieldNameMap, validators) +} + +func LbIcmpMonitorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["data_length"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["data_length"] = "DataLength" + fields["fall_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["fall_count"] = "FallCount" + fields["interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interval"] = "Interval" + fields["monitor_port"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["monitor_port"] = "MonitorPort" + fields["rise_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rise_count"] = "RiseCount" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_icmp_monitor", fields, reflect.TypeOf(LbIcmpMonitor{}), fieldNameMap, validators) +} + +func LbIpHeaderConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["group_id"] = "GroupId" + fields["source_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_address"] = "SourceAddress" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_ip_header_condition", fields, reflect.TypeOf(LbIpHeaderCondition{}), fieldNameMap, validators) +} + +func LbJwtAuthActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["key"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LbJwtKeyBindingType)}, bindings.REST)) + fieldNameMap["key"] = "Key" + fields["pass_jwt_to_pool"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["pass_jwt_to_pool"] = "PassJwtToPool" + fields["realm"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["realm"] = "Realm" + fields["tokens"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["tokens"] = "Tokens" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_jwt_auth_action", fields, reflect.TypeOf(LbJwtAuthAction{}), fieldNameMap, validators) +} + +func LbJwtCertificateKeyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["certificate_id"] = "CertificateId" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_jwt_certificate_key", fields, reflect.TypeOf(LbJwtCertificateKey{}), fieldNameMap, validators) +} + +func LbJwtKeyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_jwt_key", fields, reflect.TypeOf(LbJwtKey{}), fieldNameMap, validators) +} + +func LbJwtPublicKeyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["public_key_content"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["public_key_content"] = "PublicKeyContent" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_jwt_public_key", fields, reflect.TypeOf(LbJwtPublicKey{}), fieldNameMap, validators) +} + +func LbJwtSymmetricKeyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_jwt_symmetric_key", fields, reflect.TypeOf(LbJwtSymmetricKey{}), fieldNameMap, validators) +} + +func LbMonitorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_monitor", fields, reflect.TypeOf(LbMonitor{}), fieldNameMap, validators) +} + +func LbMonitorListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LbMonitorBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_monitor_list_result", fields, reflect.TypeOf(LbMonitorListResult{}), fieldNameMap, validators) +} + +func LbNodeCountPerSeverityBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["node_count"] = "NodeCount" + fields["severity"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["severity"] = "Severity" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_node_count_per_severity", fields, reflect.TypeOf(LbNodeCountPerSeverity{}), fieldNameMap, validators) +} + +func LbNodeUsageBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_node_usage", fields, reflect.TypeOf(LbNodeUsage{}), fieldNameMap, validators) +} + +func LbNodeUsageSummaryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["current_credit_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["current_credit_number"] = "CurrentCreditNumber" + fields["current_pool_members"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["current_pool_members"] = "CurrentPoolMembers" + fields["node_counts"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbNodeCountPerSeverityBindingType), reflect.TypeOf([]LbNodeCountPerSeverity{}))) + fieldNameMap["node_counts"] = "NodeCounts" + fields["node_usages"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LbNodeUsageBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["node_usages"] = "NodeUsages" + fields["remaining_credit_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["remaining_credit_number"] = "RemainingCreditNumber" + fields["remaining_pool_members"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["remaining_pool_members"] = "RemainingPoolMembers" + fields["severity"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["severity"] = "Severity" + fields["usage_percentage"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["usage_percentage"] = "UsagePercentage" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_node_usage_summary", fields, reflect.TypeOf(LbNodeUsageSummary{}), fieldNameMap, validators) +} + +func LbPassiveMonitorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["max_fails"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_fails"] = "MaxFails" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_passive_monitor", fields, reflect.TypeOf(LbPassiveMonitor{}), fieldNameMap, validators) +} + +func LbPersistenceCookieTimeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cookie_max_idle"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cookie_max_idle"] = "CookieMaxIdle" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_persistence_cookie_time", fields, reflect.TypeOf(LbPersistenceCookieTime{}), fieldNameMap, validators) +} + +func LbPersistenceProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["persistence_shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["persistence_shared"] = "PersistenceShared" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_persistence_profile", fields, reflect.TypeOf(LbPersistenceProfile{}), fieldNameMap, validators) +} + +func LbPersistenceProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LbPersistenceProfileBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_persistence_profile_list_result", fields, reflect.TypeOf(LbPersistenceProfileListResult{}), fieldNameMap, validators) +} + +func LbPoolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["active_monitor_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["active_monitor_ids"] = "ActiveMonitorIds" + fields["algorithm"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["algorithm"] = "Algorithm" + fields["member_group"] = bindings.NewOptionalType(bindings.NewReferenceType(PoolMemberGroupBindingType)) + fieldNameMap["member_group"] = "MemberGroup" + fields["members"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PoolMemberBindingType), reflect.TypeOf([]PoolMember{}))) + fieldNameMap["members"] = "Members" + fields["min_active_members"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["min_active_members"] = "MinActiveMembers" + fields["passive_monitor_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["passive_monitor_id"] = "PassiveMonitorId" + fields["snat_translation"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LbSnatTranslationBindingType)}, bindings.REST)) + fieldNameMap["snat_translation"] = "SnatTranslation" + fields["tcp_multiplexing_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["tcp_multiplexing_enabled"] = "TcpMultiplexingEnabled" + fields["tcp_multiplexing_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tcp_multiplexing_number"] = "TcpMultiplexingNumber" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_pool", fields, reflect.TypeOf(LbPool{}), fieldNameMap, validators) +} + +func LbPoolListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbPoolBindingType), reflect.TypeOf([]LbPool{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_pool_list_result", fields, reflect.TypeOf(LbPoolListResult{}), fieldNameMap, validators) +} + +func LbPoolMemberStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["port"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["port"] = "Port" + fields["statistics"] = bindings.NewOptionalType(bindings.NewReferenceType(LbStatisticsCounterBindingType)) + fieldNameMap["statistics"] = "Statistics" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_pool_member_statistics", fields, reflect.TypeOf(LbPoolMemberStatistics{}), fieldNameMap, validators) +} + +func LbPoolMemberStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["failure_cause"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_cause"] = "FailureCause" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["last_check_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_check_time"] = "LastCheckTime" + fields["last_state_change_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_state_change_time"] = "LastStateChangeTime" + fields["port"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["port"] = "Port" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_pool_member_status", fields, reflect.TypeOf(LbPoolMemberStatus{}), fieldNameMap, validators) +} + +func LbPoolStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["members"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbPoolMemberStatisticsBindingType), reflect.TypeOf([]LbPoolMemberStatistics{}))) + fieldNameMap["members"] = "Members" + fields["pool_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pool_id"] = "PoolId" + fields["statistics"] = bindings.NewOptionalType(bindings.NewReferenceType(LbStatisticsCounterBindingType)) + fieldNameMap["statistics"] = "Statistics" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_pool_statistics", fields, reflect.TypeOf(LbPoolStatistics{}), fieldNameMap, validators) +} + +func LbPoolStatisticsListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbPoolStatisticsBindingType), reflect.TypeOf([]LbPoolStatistics{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_pool_statistics_list_result", fields, reflect.TypeOf(LbPoolStatisticsListResult{}), fieldNameMap, validators) +} + +func LbPoolStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["members"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbPoolMemberStatusBindingType), reflect.TypeOf([]LbPoolMemberStatus{}))) + fieldNameMap["members"] = "Members" + fields["pool_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pool_id"] = "PoolId" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_pool_status", fields, reflect.TypeOf(LbPoolStatus{}), fieldNameMap, validators) +} + +func LbPoolStatusListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbPoolStatusBindingType), reflect.TypeOf([]LbPoolStatus{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_pool_status_list_result", fields, reflect.TypeOf(LbPoolStatusListResult{}), fieldNameMap, validators) +} + +func LbRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["actions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LbRuleActionBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["actions"] = "Actions" + fields["match_conditions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LbRuleConditionBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["match_conditions"] = "MatchConditions" + fields["match_strategy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_strategy"] = "MatchStrategy" + fields["phase"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["phase"] = "Phase" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_rule", fields, reflect.TypeOf(LbRule{}), fieldNameMap, validators) +} + +func LbRuleActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_rule_action", fields, reflect.TypeOf(LbRuleAction{}), fieldNameMap, validators) +} + +func LbRuleConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_rule_condition", fields, reflect.TypeOf(LbRuleCondition{}), fieldNameMap, validators) +} + +func LbRuleListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbRuleBindingType), reflect.TypeOf([]LbRule{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_rule_list_result", fields, reflect.TypeOf(LbRuleListResult{}), fieldNameMap, validators) +} + +func LbSelectPoolActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["pool_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pool_id"] = "PoolId" + fields["pool_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pool_name"] = "PoolName" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_select_pool_action", fields, reflect.TypeOf(LbSelectPoolAction{}), fieldNameMap, validators) +} + +func LbServerSslProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["cipher_group_label"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cipher_group_label"] = "CipherGroupLabel" + fields["ciphers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ciphers"] = "Ciphers" + fields["is_fips"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_fips"] = "IsFips" + fields["is_secure"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_secure"] = "IsSecure" + fields["protocols"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["protocols"] = "Protocols" + fields["session_cache_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["session_cache_enabled"] = "SessionCacheEnabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_server_ssl_profile", fields, reflect.TypeOf(LbServerSslProfile{}), fieldNameMap, validators) +} + +func LbServerSslProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbServerSslProfileBindingType), reflect.TypeOf([]LbServerSslProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_server_ssl_profile_list_result", fields, reflect.TypeOf(LbServerSslProfileListResult{}), fieldNameMap, validators) +} + +func LbServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["access_log_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["access_log_enabled"] = "AccessLogEnabled" + fields["attachment"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["attachment"] = "Attachment" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["error_log_level"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_log_level"] = "ErrorLogLevel" + fields["relax_scale_validation"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["relax_scale_validation"] = "RelaxScaleValidation" + fields["size"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["size"] = "Size" + fields["virtual_server_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["virtual_server_ids"] = "VirtualServerIds" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_service", fields, reflect.TypeOf(LbService{}), fieldNameMap, validators) +} + +func LbServiceDebugInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["application_profiles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LbAppProfileBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["application_profiles"] = "ApplicationProfiles" + fields["client_ssl_profiles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbClientSslProfileBindingType), reflect.TypeOf([]LbClientSslProfile{}))) + fieldNameMap["client_ssl_profiles"] = "ClientSslProfiles" + fields["monitors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LbMonitorBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["monitors"] = "Monitors" + fields["persistence_profiles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LbPersistenceProfileBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["persistence_profiles"] = "PersistenceProfiles" + fields["pools"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbPoolBindingType), reflect.TypeOf([]LbPool{}))) + fieldNameMap["pools"] = "Pools" + fields["rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbRuleBindingType), reflect.TypeOf([]LbRule{}))) + fieldNameMap["rules"] = "Rules" + fields["server_ssl_profiles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbServerSslProfileBindingType), reflect.TypeOf([]LbServerSslProfile{}))) + fieldNameMap["server_ssl_profiles"] = "ServerSslProfiles" + fields["service"] = bindings.NewOptionalType(bindings.NewReferenceType(LbServiceBindingType)) + fieldNameMap["service"] = "Service" + fields["virtual_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbVirtualServerBindingType), reflect.TypeOf([]LbVirtualServer{}))) + fieldNameMap["virtual_servers"] = "VirtualServers" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_service_debug_info", fields, reflect.TypeOf(LbServiceDebugInfo{}), fieldNameMap, validators) +} + +func LbServiceInstanceDetailBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["attachment"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["attachment"] = "Attachment" + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_service_instance_detail", fields, reflect.TypeOf(LbServiceInstanceDetail{}), fieldNameMap, validators) +} + +func LbServiceInstanceDetailPerStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["instance_details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbServiceInstanceDetailBindingType), reflect.TypeOf([]LbServiceInstanceDetail{}))) + fieldNameMap["instance_details"] = "InstanceDetails" + fields["instance_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["instance_number"] = "InstanceNumber" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_service_instance_detail_per_status", fields, reflect.TypeOf(LbServiceInstanceDetailPerStatus{}), fieldNameMap, validators) +} + +func LbServiceInstanceDetailPerTransportNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["instance_detail_per_status"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbServiceInstanceDetailPerStatusBindingType), reflect.TypeOf([]LbServiceInstanceDetailPerStatus{}))) + fieldNameMap["instance_detail_per_status"] = "InstanceDetailPerStatus" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_service_instance_detail_per_transport_node", fields, reflect.TypeOf(LbServiceInstanceDetailPerTransportNode{}), fieldNameMap, validators) +} + +func LbServiceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbServiceBindingType), reflect.TypeOf([]LbService{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_service_list_result", fields, reflect.TypeOf(LbServiceListResult{}), fieldNameMap, validators) +} + +func LbServiceStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["pools"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbPoolStatisticsBindingType), reflect.TypeOf([]LbPoolStatistics{}))) + fieldNameMap["pools"] = "Pools" + fields["service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fields["statistics"] = bindings.NewOptionalType(bindings.NewReferenceType(LbServiceStatisticsCounterBindingType)) + fieldNameMap["statistics"] = "Statistics" + fields["virtual_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbVirtualServerStatisticsBindingType), reflect.TypeOf([]LbVirtualServerStatistics{}))) + fieldNameMap["virtual_servers"] = "VirtualServers" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_service_statistics", fields, reflect.TypeOf(LbServiceStatistics{}), fieldNameMap, validators) +} + +func LbServiceStatisticsCounterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["l4_current_session_rate"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["l4_current_session_rate"] = "L4CurrentSessionRate" + fields["l4_current_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["l4_current_sessions"] = "L4CurrentSessions" + fields["l4_max_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["l4_max_sessions"] = "L4MaxSessions" + fields["l4_total_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["l4_total_sessions"] = "L4TotalSessions" + fields["l7_current_session_rate"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["l7_current_session_rate"] = "L7CurrentSessionRate" + fields["l7_current_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["l7_current_sessions"] = "L7CurrentSessions" + fields["l7_max_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["l7_max_sessions"] = "L7MaxSessions" + fields["l7_total_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["l7_total_sessions"] = "L7TotalSessions" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_service_statistics_counter", fields, reflect.TypeOf(LbServiceStatisticsCounter{}), fieldNameMap, validators) +} + +func LbServiceStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_transport_nodes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["active_transport_nodes"] = "ActiveTransportNodes" + fields["cpu_usage"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cpu_usage"] = "CpuUsage" + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["instance_detail_per_tn"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbServiceInstanceDetailPerTransportNodeBindingType), reflect.TypeOf([]LbServiceInstanceDetailPerTransportNode{}))) + fieldNameMap["instance_detail_per_tn"] = "InstanceDetailPerTn" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["memory_usage"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["memory_usage"] = "MemoryUsage" + fields["pools"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbPoolStatusBindingType), reflect.TypeOf([]LbPoolStatus{}))) + fieldNameMap["pools"] = "Pools" + fields["service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fields["service_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_status"] = "ServiceStatus" + fields["standby_transport_nodes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["standby_transport_nodes"] = "StandbyTransportNodes" + fields["virtual_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbVirtualServerStatusBindingType), reflect.TypeOf([]LbVirtualServerStatus{}))) + fieldNameMap["virtual_servers"] = "VirtualServers" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_service_status", fields, reflect.TypeOf(LbServiceStatus{}), fieldNameMap, validators) +} + +func LbServiceUsageBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["current_pool_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["current_pool_count"] = "CurrentPoolCount" + fields["current_pool_member_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["current_pool_member_count"] = "CurrentPoolMemberCount" + fields["current_virtual_server_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["current_virtual_server_count"] = "CurrentVirtualServerCount" + fields["pool_capacity"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["pool_capacity"] = "PoolCapacity" + fields["pool_member_capacity"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["pool_member_capacity"] = "PoolMemberCapacity" + fields["service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fields["service_size"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_size"] = "ServiceSize" + fields["severity"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["severity"] = "Severity" + fields["usage_percentage"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["usage_percentage"] = "UsagePercentage" + fields["virtual_server_capacity"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["virtual_server_capacity"] = "VirtualServerCapacity" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_service_usage", fields, reflect.TypeOf(LbServiceUsage{}), fieldNameMap, validators) +} + +func LbSessionCookieTimeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cookie_max_idle"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cookie_max_idle"] = "CookieMaxIdle" + fields["cookie_max_life"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cookie_max_life"] = "CookieMaxLife" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_session_cookie_time", fields, reflect.TypeOf(LbSessionCookieTime{}), fieldNameMap, validators) +} + +func LbSnatAutoMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["port_overload"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port_overload"] = "PortOverload" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_snat_auto_map", fields, reflect.TypeOf(LbSnatAutoMap{}), fieldNameMap, validators) +} + +func LbSnatIpElementBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["prefix_length"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["prefix_length"] = "PrefixLength" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_snat_ip_element", fields, reflect.TypeOf(LbSnatIpElement{}), fieldNameMap, validators) +} + +func LbSnatIpPoolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbSnatIpElementBindingType), reflect.TypeOf([]LbSnatIpElement{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["port_overload"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port_overload"] = "PortOverload" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_snat_ip_pool", fields, reflect.TypeOf(LbSnatIpPool{}), fieldNameMap, validators) +} + +func LbSnatTranslationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["port_overload"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port_overload"] = "PortOverload" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_snat_translation", fields, reflect.TypeOf(LbSnatTranslation{}), fieldNameMap, validators) +} + +func LbSourceIpPersistenceProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ha_persistence_mirroring_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ha_persistence_mirroring_enabled"] = "HaPersistenceMirroringEnabled" + fields["purge"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["purge"] = "Purge" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["persistence_shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["persistence_shared"] = "PersistenceShared" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_source_ip_persistence_profile", fields, reflect.TypeOf(LbSourceIpPersistenceProfile{}), fieldNameMap, validators) +} + +func LbSslCipherAndProtocolListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["ciphers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbSslCipherInfoBindingType), reflect.TypeOf([]LbSslCipherInfo{}))) + fieldNameMap["ciphers"] = "Ciphers" + fields["protocols"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbSslProtocolInfoBindingType), reflect.TypeOf([]LbSslProtocolInfo{}))) + fieldNameMap["protocols"] = "Protocols" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_ssl_cipher_and_protocol_list_result", fields, reflect.TypeOf(LbSslCipherAndProtocolListResult{}), fieldNameMap, validators) +} + +func LbSslCipherInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cipher"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cipher"] = "Cipher" + fields["cipher_group_labels"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["cipher_group_labels"] = "CipherGroupLabels" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["is_secure"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_secure"] = "IsSecure" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_ssl_cipher_info", fields, reflect.TypeOf(LbSslCipherInfo{}), fieldNameMap, validators) +} + +func LbSslModeSelectionActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ssl_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ssl_mode"] = "SslMode" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_ssl_mode_selection_action", fields, reflect.TypeOf(LbSslModeSelectionAction{}), fieldNameMap, validators) +} + +func LbSslProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_ssl_profile", fields, reflect.TypeOf(LbSslProfile{}), fieldNameMap, validators) +} + +func LbSslProtocolInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["is_secure"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_secure"] = "IsSecure" + fields["protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["protocol"] = "Protocol" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_ssl_protocol_info", fields, reflect.TypeOf(LbSslProtocolInfo{}), fieldNameMap, validators) +} + +func LbSslSniConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["case_sensitive"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["case_sensitive"] = "CaseSensitive" + fields["match_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_type"] = "MatchType" + fields["sni"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sni"] = "Sni" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_ssl_sni_condition", fields, reflect.TypeOf(LbSslSniCondition{}), fieldNameMap, validators) +} + +func LbStatisticsCounterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bytes_in"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bytes_in"] = "BytesIn" + fields["bytes_in_rate"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["bytes_in_rate"] = "BytesInRate" + fields["bytes_out"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bytes_out"] = "BytesOut" + fields["bytes_out_rate"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["bytes_out_rate"] = "BytesOutRate" + fields["current_session_rate"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["current_session_rate"] = "CurrentSessionRate" + fields["current_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["current_sessions"] = "CurrentSessions" + fields["dropped_packets_by_access_list"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dropped_packets_by_access_list"] = "DroppedPacketsByAccessList" + fields["dropped_sessions_by_lbrule_action"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dropped_sessions_by_lbrule_action"] = "DroppedSessionsByLbruleAction" + fields["http_request_rate"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["http_request_rate"] = "HttpRequestRate" + fields["http_requests"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["http_requests"] = "HttpRequests" + fields["max_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_sessions"] = "MaxSessions" + fields["packets_in"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["packets_in"] = "PacketsIn" + fields["packets_in_rate"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["packets_in_rate"] = "PacketsInRate" + fields["packets_out"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["packets_out"] = "PacketsOut" + fields["packets_out_rate"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["packets_out_rate"] = "PacketsOutRate" + fields["source_ip_persistence_entry_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["source_ip_persistence_entry_size"] = "SourceIpPersistenceEntrySize" + fields["total_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_sessions"] = "TotalSessions" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_statistics_counter", fields, reflect.TypeOf(LbStatisticsCounter{}), fieldNameMap, validators) +} + +func LbTcpHeaderConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["source_port"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_port"] = "SourcePort" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_tcp_header_condition", fields, reflect.TypeOf(LbTcpHeaderCondition{}), fieldNameMap, validators) +} + +func LbTcpMonitorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["receive"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["receive"] = "Receive" + fields["send"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["send"] = "Send" + fields["fall_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["fall_count"] = "FallCount" + fields["interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interval"] = "Interval" + fields["monitor_port"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["monitor_port"] = "MonitorPort" + fields["rise_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rise_count"] = "RiseCount" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_tcp_monitor", fields, reflect.TypeOf(LbTcpMonitor{}), fieldNameMap, validators) +} + +func LbUdpMonitorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["receive"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["receive"] = "Receive" + fields["send"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["send"] = "Send" + fields["fall_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["fall_count"] = "FallCount" + fields["interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interval"] = "Interval" + fields["monitor_port"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["monitor_port"] = "MonitorPort" + fields["rise_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rise_count"] = "RiseCount" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_udp_monitor", fields, reflect.TypeOf(LbUdpMonitor{}), fieldNameMap, validators) +} + +func LbVariableAssignmentActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["variable_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["variable_name"] = "VariableName" + fields["variable_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["variable_value"] = "VariableValue" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_variable_assignment_action", fields, reflect.TypeOf(LbVariableAssignmentAction{}), fieldNameMap, validators) +} + +func LbVariableConditionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["case_sensitive"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["case_sensitive"] = "CaseSensitive" + fields["match_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_type"] = "MatchType" + fields["variable_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["variable_name"] = "VariableName" + fields["variable_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["variable_value"] = "VariableValue" + fields["inverse"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inverse"] = "Inverse" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_variable_condition", fields, reflect.TypeOf(LbVariableCondition{}), fieldNameMap, validators) +} + +func LbVariablePersistenceLearnActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["persistence_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["persistence_profile_id"] = "PersistenceProfileId" + fields["variable_hash_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["variable_hash_enabled"] = "VariableHashEnabled" + fields["variable_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["variable_name"] = "VariableName" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_variable_persistence_learn_action", fields, reflect.TypeOf(LbVariablePersistenceLearnAction{}), fieldNameMap, validators) +} + +func LbVariablePersistenceOnActionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["persistence_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["persistence_profile_id"] = "PersistenceProfileId" + fields["variable_hash_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["variable_hash_enabled"] = "VariableHashEnabled" + fields["variable_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["variable_name"] = "VariableName" + fields["type"] = bindings.NewStringType() + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_variable_persistence_on_action", fields, reflect.TypeOf(LbVariablePersistenceOnAction{}), fieldNameMap, validators) +} + +func LbVirtualServerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["access_list_control"] = bindings.NewOptionalType(bindings.NewReferenceType(LbAccessListControlBindingType)) + fieldNameMap["access_list_control"] = "AccessListControl" + fields["access_log_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["access_log_enabled"] = "AccessLogEnabled" + fields["application_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["application_profile_id"] = "ApplicationProfileId" + fields["client_ssl_profile_binding"] = bindings.NewOptionalType(bindings.NewReferenceType(ClientSslProfileBindingBindingType)) + fieldNameMap["client_ssl_profile_binding"] = "ClientSslProfileBinding" + fields["default_pool_member_port"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["default_pool_member_port"] = "DefaultPoolMemberPort" + fields["default_pool_member_ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["default_pool_member_ports"] = "DefaultPoolMemberPorts" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["ip_protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_protocol"] = "IpProtocol" + fields["log_significant_event_only"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["log_significant_event_only"] = "LogSignificantEventOnly" + fields["max_concurrent_connections"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_concurrent_connections"] = "MaxConcurrentConnections" + fields["max_new_connection_rate"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_new_connection_rate"] = "MaxNewConnectionRate" + fields["persistence_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["persistence_profile_id"] = "PersistenceProfileId" + fields["pool_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pool_id"] = "PoolId" + fields["port"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["port"] = "Port" + fields["ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ports"] = "Ports" + fields["rule_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["rule_ids"] = "RuleIds" + fields["server_ssl_profile_binding"] = bindings.NewOptionalType(bindings.NewReferenceType(ServerSslProfileBindingBindingType)) + fieldNameMap["server_ssl_profile_binding"] = "ServerSslProfileBinding" + fields["sorry_pool_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sorry_pool_id"] = "SorryPoolId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_virtual_server", fields, reflect.TypeOf(LbVirtualServer{}), fieldNameMap, validators) +} + +func LbVirtualServerListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbVirtualServerBindingType), reflect.TypeOf([]LbVirtualServer{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_virtual_server_list_result", fields, reflect.TypeOf(LbVirtualServerListResult{}), fieldNameMap, validators) +} + +func LbVirtualServerStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["statistics"] = bindings.NewOptionalType(bindings.NewReferenceType(LbStatisticsCounterBindingType)) + fieldNameMap["statistics"] = "Statistics" + fields["virtual_server_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["virtual_server_id"] = "VirtualServerId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_virtual_server_statistics", fields, reflect.TypeOf(LbVirtualServerStatistics{}), fieldNameMap, validators) +} + +func LbVirtualServerStatisticsListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbVirtualServerStatisticsBindingType), reflect.TypeOf([]LbVirtualServerStatistics{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_virtual_server_statistics_list_result", fields, reflect.TypeOf(LbVirtualServerStatisticsListResult{}), fieldNameMap, validators) +} + +func LbVirtualServerStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["virtual_server_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["virtual_server_id"] = "VirtualServerId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_virtual_server_status", fields, reflect.TypeOf(LbVirtualServerStatus{}), fieldNameMap, validators) +} + +func LbVirtualServerStatusListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbVirtualServerStatusBindingType), reflect.TypeOf([]LbVirtualServerStatus{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_virtual_server_status_list_result", fields, reflect.TypeOf(LbVirtualServerStatusListResult{}), fieldNameMap, validators) +} + +func LbVirtualServerWithRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LbRuleBindingType), reflect.TypeOf([]LbRule{}))) + fieldNameMap["rules"] = "Rules" + fields["virtual_server"] = bindings.NewOptionalType(bindings.NewReferenceType(LbVirtualServerBindingType)) + fieldNameMap["virtual_server"] = "VirtualServer" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lb_virtual_server_with_rule", fields, reflect.TypeOf(LbVirtualServerWithRule{}), fieldNameMap, validators) +} + +func LegendBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["alignment"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["alignment"] = "Alignment" + fields["display_count"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["display_count"] = "DisplayCount" + fields["display_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_mode"] = "DisplayMode" + fields["filterable"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filterable"] = "Filterable" + fields["min_legends_display_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["min_legends_display_count"] = "MinLegendsDisplayCount" + fields["other_group_legend_label"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["other_group_legend_label"] = "OtherGroupLegendLabel" + fields["position"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["position"] = "Position" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + fields["unit"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["unit"] = "Unit" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.legend", fields, reflect.TypeOf(Legend{}), fieldNameMap, validators) +} + +func LegendWidgetConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["layout"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["layout"] = "Layout" + fields["source_widget_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_widget_id"] = "SourceWidgetId" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["feature_set"] = bindings.NewOptionalType(bindings.NewReferenceType(FeatureSetBindingType)) + fieldNameMap["feature_set"] = "FeatureSet" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["filters"] = "Filters" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["plot_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(WidgetPlotConfigurationBindingType), reflect.TypeOf([]WidgetPlotConfiguration{}))) + fieldNameMap["plot_configs"] = "PlotConfigs" + fields["rowspan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rowspan"] = "Rowspan" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["show_header"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_header"] = "ShowHeader" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.legend_widget_configuration", fields, reflect.TypeOf(LegendWidgetConfiguration{}), fieldNameMap, validators) +} + +func LicenseBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["capacity_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["capacity_type"] = "CapacityType" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["expiry"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["expiry"] = "Expiry" + fields["features"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["features"] = "Features" + fields["is_eval"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_eval"] = "IsEval" + fields["is_expired"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_expired"] = "IsExpired" + fields["is_mh"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_mh"] = "IsMh" + fields["license_key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["license_key"] = "LicenseKey" + fields["product_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["product_name"] = "ProductName" + fields["product_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["product_version"] = "ProductVersion" + fields["quantity"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["quantity"] = "Quantity" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.license", fields, reflect.TypeOf(License{}), fieldNameMap, validators) +} + +func LicensesListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LicenseBindingType), reflect.TypeOf([]License{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.licenses_list_result", fields, reflect.TypeOf(LicensesListResult{}), fieldNameMap, validators) +} + +func LineChartPlotConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allow_maximize"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["allow_maximize"] = "AllowMaximize" + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["fill_gradient_area"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["fill_gradient_area"] = "FillGradientArea" + fields["num_of_series_to_display"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["num_of_series_to_display"] = "NumOfSeriesToDisplay" + fields["show_curved_lines"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_curved_lines"] = "ShowCurvedLines" + fields["show_data_in_tooltip"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_data_in_tooltip"] = "ShowDataInTooltip" + fields["show_data_points"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_data_points"] = "ShowDataPoints" + fields["show_grid_lines"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_grid_lines"] = "ShowGridLines" + fields["show_grouped_tooltip"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_grouped_tooltip"] = "ShowGroupedTooltip" + fields["show_min_max_on_series"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_min_max_on_series"] = "ShowMinMaxOnSeries" + fields["show_unit_in_tooltip"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_unit_in_tooltip"] = "ShowUnitInTooltip" + fields["sort_data_in_grouped_tooltip"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_data_in_grouped_tooltip"] = "SortDataInGroupedTooltip" + fields["sort_series"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_series"] = "SortSeries" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.line_chart_plot_configuration", fields, reflect.TypeOf(LineChartPlotConfiguration{}), fieldNameMap, validators) +} + +func ListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.list_result", fields, reflect.TypeOf(ListResult{}), fieldNameMap, validators) +} + +func ListResultQueryParametersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["fields"] = "Fields" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.list_result_query_parameters", fields, reflect.TypeOf(ListResultQueryParameters{}), fieldNameMap, validators) +} + +func LiveTraceActionConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["pktcap_config"] = bindings.NewOptionalType(bindings.NewReferenceType(PktcapActionConfigBindingType)) + fieldNameMap["pktcap_config"] = "PktcapConfig" + fields["trace_config"] = bindings.NewOptionalType(bindings.NewReferenceType(TraceActionConfigBindingType)) + fieldNameMap["trace_config"] = "TraceConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.live_trace_action_config", fields, reflect.TypeOf(LiveTraceActionConfig{}), fieldNameMap, validators) +} + +func LiveTraceFilterDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.live_trace_filter_data", fields, reflect.TypeOf(LiveTraceFilterData{}), fieldNameMap, validators) +} + +func LiveTraceFilterInvalidInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["filter"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LiveTraceFilterDataBindingType)}, bindings.REST)) + fieldNameMap["filter"] = "Filter" + fields["reason"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["reason"] = "Reason" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.live_trace_filter_invalid_info", fields, reflect.TypeOf(LiveTraceFilterInvalidInfo{}), fieldNameMap, validators) +} + +func LiveTraceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LiveTraceStatusBindingType), reflect.TypeOf([]LiveTraceStatus{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.live_trace_list_result", fields, reflect.TypeOf(LiveTraceListResult{}), fieldNameMap, validators) +} + +func LiveTraceRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["actions"] = bindings.NewOptionalType(bindings.NewReferenceType(LiveTraceActionConfigBindingType)) + fieldNameMap["actions"] = "Actions" + fields["filter"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LiveTraceFilterDataBindingType)}, bindings.REST)) + fieldNameMap["filter"] = "Filter" + fields["source_lport"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_lport"] = "SourceLport" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.live_trace_request", fields, reflect.TypeOf(LiveTraceRequest{}), fieldNameMap, validators) +} + +func LiveTraceResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["pktcap_results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PktCapResultBindingType), reflect.TypeOf([]PktCapResult{}))) + fieldNameMap["pktcap_results"] = "PktcapResults" + fields["trace_results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TraceResultBindingType), reflect.TypeOf([]TraceResult{}))) + fieldNameMap["trace_results"] = "TraceResults" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.live_trace_result", fields, reflect.TypeOf(LiveTraceResult{}), fieldNameMap, validators) +} + +func LiveTraceStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["actions"] = bindings.NewOptionalType(bindings.NewReferenceType(LiveTraceActionConfigBindingType)) + fieldNameMap["actions"] = "Actions" + fields["filter"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LiveTraceFilterDataBindingType)}, bindings.REST)) + fieldNameMap["filter"] = "Filter" + fields["filter_invalid_info"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LiveTraceFilterInvalidInfoBindingType), reflect.TypeOf([]LiveTraceFilterInvalidInfo{}))) + fieldNameMap["filter_invalid_info"] = "FilterInvalidInfo" + fields["invalidation_reason"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["invalidation_reason"] = "InvalidationReason" + fields["operation_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["operation_state"] = "OperationState" + fields["request_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_status"] = "RequestStatus" + fields["source_lport"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_lport"] = "SourceLport" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.live_trace_status", fields, reflect.TypeOf(LiveTraceStatus{}), fieldNameMap, validators) +} + +func LldpHostSwitchProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["send_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["send_enabled"] = "SendEnabled" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["required_capabilities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["required_capabilities"] = "RequiredCapabilities" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.lldp_host_switch_profile", fields, reflect.TypeOf(LldpHostSwitchProfile{}), fieldNameMap, validators) +} + +func LoadBalancerAllocationPoolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allocation_size"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["allocation_size"] = "AllocationSize" + fields["allocation_pool_type"] = bindings.NewStringType() + fieldNameMap["allocation_pool_type"] = "AllocationPoolType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.load_balancer_allocation_pool", fields, reflect.TypeOf(LoadBalancerAllocationPool{}), fieldNameMap, validators) +} + +func LocalSiteConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["epoch"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["epoch"] = "Epoch" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["site"] = bindings.NewOptionalType(bindings.NewReferenceType(FederationSiteBindingType)) + fieldNameMap["site"] = "Site" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.local_site_configuration", fields, reflect.TypeOf(LocalSiteConfiguration{}), fieldNameMap, validators) +} + +func LoggingServicePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logging_level"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logging_level"] = "LoggingLevel" + fields["modified_package_logging_levels"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["modified_package_logging_levels"] = "ModifiedPackageLoggingLevels" + fields["package_logging_level"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PackageLoggingLevelsBindingType), reflect.TypeOf([]PackageLoggingLevels{}))) + fieldNameMap["package_logging_level"] = "PackageLoggingLevel" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logging_service_properties", fields, reflect.TypeOf(LoggingServiceProperties{}), fieldNameMap, validators) +} + +func LogicalConstructMigrationStatsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_id"] = "SiteId" + fields["source_count"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_count"] = "SourceCount" + fields["source_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_type"] = "SourceType" + fields["target_count"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_count"] = "TargetCount" + fields["target_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_type"] = "TargetType" + fields["vertical"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vertical"] = "Vertical" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_construct_migration_stats", fields, reflect.TypeOf(LogicalConstructMigrationStats{}), fieldNameMap, validators) +} + +func LogicalConstructMigrationStatsListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LogicalConstructMigrationStatsBindingType), reflect.TypeOf([]LogicalConstructMigrationStats{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_construct_migration_stats_list_result", fields, reflect.TypeOf(LogicalConstructMigrationStatsListResult{}), fieldNameMap, validators) +} + +func LogicalDhcpServerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["attached_logical_port_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["attached_logical_port_id"] = "AttachedLogicalPortId" + fields["dhcp_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dhcp_profile_id"] = "DhcpProfileId" + fields["ipv4_dhcp_server"] = bindings.NewOptionalType(bindings.NewReferenceType(IPv4DhcpServerBindingType)) + fieldNameMap["ipv4_dhcp_server"] = "Ipv4DhcpServer" + fields["ipv6_dhcp_server"] = bindings.NewOptionalType(bindings.NewReferenceType(IPv6DhcpServerBindingType)) + fieldNameMap["ipv6_dhcp_server"] = "Ipv6DhcpServer" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_dhcp_server", fields, reflect.TypeOf(LogicalDhcpServer{}), fieldNameMap, validators) +} + +func LogicalDhcpServerListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LogicalDhcpServerBindingType), reflect.TypeOf([]LogicalDhcpServer{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_dhcp_server_list_result", fields, reflect.TypeOf(LogicalDhcpServerListResult{}), fieldNameMap, validators) +} + +func LogicalPortBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["address_bindings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PacketAddressClassifierBindingType), reflect.TypeOf([]PacketAddressClassifier{}))) + fieldNameMap["address_bindings"] = "AddressBindings" + fields["admin_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["admin_state"] = "AdminState" + fields["attachment"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalPortAttachmentBindingType)) + fieldNameMap["attachment"] = "Attachment" + fields["extra_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ExtraConfigBindingType), reflect.TypeOf([]ExtraConfig{}))) + fieldNameMap["extra_configs"] = "ExtraConfigs" + fields["ignore_address_bindings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PacketAddressClassifierBindingType), reflect.TypeOf([]PacketAddressClassifier{}))) + fieldNameMap["ignore_address_bindings"] = "IgnoreAddressBindings" + fields["init_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["init_state"] = "InitState" + fields["internal_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["internal_id"] = "InternalId" + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + fields["origin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_id"] = "OriginId" + fields["switching_profile_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SwitchingProfileTypeIdEntryBindingType), reflect.TypeOf([]SwitchingProfileTypeIdEntry{}))) + fieldNameMap["switching_profile_ids"] = "SwitchingProfileIds" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_port", fields, reflect.TypeOf(LogicalPort{}), fieldNameMap, validators) +} + +func LogicalPortAttachmentBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["attachment_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["attachment_type"] = "AttachmentType" + fields["context"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(AttachmentContextBindingType)}, bindings.REST)) + fieldNameMap["context"] = "Context" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_port_attachment", fields, reflect.TypeOf(LogicalPortAttachment{}), fieldNameMap, validators) +} + +func LogicalPortAttachmentStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["attachers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PortAttacherBindingType), reflect.TypeOf([]PortAttacher{}))) + fieldNameMap["attachers"] = "Attachers" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_port_attachment_state", fields, reflect.TypeOf(LogicalPortAttachmentState{}), fieldNameMap, validators) +} + +func LogicalPortListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LogicalPortBindingType), reflect.TypeOf([]LogicalPort{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_port_list_result", fields, reflect.TypeOf(LogicalPortListResult{}), fieldNameMap, validators) +} + +func LogicalPortMacAddressCsvListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_name"] = "FileName" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LogicalPortMacTableCsvEntryBindingType), reflect.TypeOf([]LogicalPortMacTableCsvEntry{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_port_mac_address_csv_list_result", fields, reflect.TypeOf(LogicalPortMacAddressCsvListResult{}), fieldNameMap, validators) +} + +func LogicalPortMacAddressListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["logical_port_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_port_id"] = "LogicalPortId" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LogicalPortMacTableEntryBindingType), reflect.TypeOf([]LogicalPortMacTableEntry{}))) + fieldNameMap["results"] = "Results" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_port_mac_address_list_result", fields, reflect.TypeOf(LogicalPortMacAddressListResult{}), fieldNameMap, validators) +} + +func LogicalPortMacTableCsvEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + fields["mac_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_type"] = "MacType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_port_mac_table_csv_entry", fields, reflect.TypeOf(LogicalPortMacTableCsvEntry{}), fieldNameMap, validators) +} + +func LogicalPortMacTableEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + fields["mac_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_type"] = "MacType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_port_mac_table_entry", fields, reflect.TypeOf(LogicalPortMacTableEntry{}), fieldNameMap, validators) +} + +func LogicalPortMirrorDestinationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["port_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["port_ids"] = "PortIds" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_port_mirror_destination", fields, reflect.TypeOf(LogicalPortMirrorDestination{}), fieldNameMap, validators) +} + +func LogicalPortMirrorSourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["port_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["port_ids"] = "PortIds" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_port_mirror_source", fields, reflect.TypeOf(LogicalPortMirrorSource{}), fieldNameMap, validators) +} + +func LogicalPortOperationalStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["logical_port_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_port_id"] = "LogicalPortId" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_port_operational_status", fields, reflect.TypeOf(LogicalPortOperationalStatus{}), fieldNameMap, validators) +} + +func LogicalPortStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["attachment"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalPortAttachmentStateBindingType)) + fieldNameMap["attachment"] = "Attachment" + fields["discovered_bindings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AddressBindingEntryBindingType), reflect.TypeOf([]AddressBindingEntry{}))) + fieldNameMap["discovered_bindings"] = "DiscoveredBindings" + fields["duplicate_bindings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DuplicateAddressBindingEntryBindingType), reflect.TypeOf([]DuplicateAddressBindingEntry{}))) + fieldNameMap["duplicate_bindings"] = "DuplicateBindings" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["realized_bindings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AddressBindingEntryBindingType), reflect.TypeOf([]AddressBindingEntry{}))) + fieldNameMap["realized_bindings"] = "RealizedBindings" + fields["transport_node_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["transport_node_ids"] = "TransportNodeIds" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_port_state", fields, reflect.TypeOf(LogicalPortState{}), fieldNameMap, validators) +} + +func LogicalPortStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["rx_bytes"] = "RxBytes" + fields["rx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["rx_packets"] = "RxPackets" + fields["tx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["tx_bytes"] = "TxBytes" + fields["tx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["tx_packets"] = "TxPackets" + fields["dropped_by_security_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(PacketsDroppedBySecurityBindingType)) + fieldNameMap["dropped_by_security_packets"] = "DroppedBySecurityPackets" + fields["mac_learning"] = bindings.NewOptionalType(bindings.NewReferenceType(MacLearningCountersBindingType)) + fieldNameMap["mac_learning"] = "MacLearning" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["logical_port_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_port_id"] = "LogicalPortId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_port_statistics", fields, reflect.TypeOf(LogicalPortStatistics{}), fieldNameMap, validators) +} + +func LogicalPortStatusSummaryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FilterBindingType), reflect.TypeOf([]Filter{}))) + fieldNameMap["filters"] = "Filters" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["total_ports"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_ports"] = "TotalPorts" + fields["up_ports"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["up_ports"] = "UpPorts" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_port_status_summary", fields, reflect.TypeOf(LogicalPortStatusSummary{}), fieldNameMap, validators) +} + +func LogicalRouterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["advanced_config"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalRouterConfigBindingType)) + fieldNameMap["advanced_config"] = "AdvancedConfig" + fields["allocation_profile"] = bindings.NewOptionalType(bindings.NewReferenceType(EdgeClusterMemberAllocationProfileBindingType)) + fieldNameMap["allocation_profile"] = "AllocationProfile" + fields["edge_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + fields["edge_cluster_member_indices"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewIntegerType(), reflect.TypeOf([]int64{}))) + fieldNameMap["edge_cluster_member_indices"] = "EdgeClusterMemberIndices" + fields["failover_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failover_mode"] = "FailoverMode" + fields["firewall_sections"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["firewall_sections"] = "FirewallSections" + fields["high_availability_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["high_availability_mode"] = "HighAvailabilityMode" + fields["ipv6_profiles"] = bindings.NewOptionalType(bindings.NewReferenceType(IPv6ProfilesBindingType)) + fieldNameMap["ipv6_profiles"] = "Ipv6Profiles" + fields["preferred_edge_cluster_member_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["preferred_edge_cluster_member_index"] = "PreferredEdgeClusterMemberIndex" + fields["router_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["router_type"] = "RouterType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router", fields, reflect.TypeOf(LogicalRouter{}), fieldNameMap, validators) +} + +func LogicalRouterCentralizedServicePortBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enable_netx"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_netx"] = "EnableNetx" + fields["linked_logical_switch_port_id"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["linked_logical_switch_port_id"] = "LinkedLogicalSwitchPortId" + fields["mtu"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mtu"] = "Mtu" + fields["ndra_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ndra_profile_id"] = "NdraProfileId" + fields["subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSubnetBindingType), reflect.TypeOf([]IPSubnet{}))) + fieldNameMap["subnets"] = "Subnets" + fields["urpf_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["urpf_mode"] = "UrpfMode" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["service_bindings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceBindingBindingType), reflect.TypeOf([]ServiceBinding{}))) + fieldNameMap["service_bindings"] = "ServiceBindings" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_centralized_service_port", fields, reflect.TypeOf(LogicalRouterCentralizedServicePort{}), fieldNameMap, validators) +} + +func LogicalRouterConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["external_transit_networks"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["external_transit_networks"] = "ExternalTransitNetworks" + fields["ha_vip_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(HaVipConfigBindingType), reflect.TypeOf([]HaVipConfig{}))) + fieldNameMap["ha_vip_configs"] = "HaVipConfigs" + fields["internal_transit_network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["internal_transit_network"] = "InternalTransitNetwork" + fields["transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_zone_id"] = "TransportZoneId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_config", fields, reflect.TypeOf(LogicalRouterConfig{}), fieldNameMap, validators) +} + +func LogicalRouterDownLinkPortBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enable_multicast"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_multicast"] = "EnableMulticast" + fields["linked_logical_switch_port_id"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["linked_logical_switch_port_id"] = "LinkedLogicalSwitchPortId" + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + fields["ndra_prefix_config"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NDRAPrefixConfigBindingType), reflect.TypeOf([]NDRAPrefixConfig{}))) + fieldNameMap["ndra_prefix_config"] = "NdraPrefixConfig" + fields["ndra_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ndra_profile_id"] = "NdraProfileId" + fields["routing_policies"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RoutingPolicyBindingType), reflect.TypeOf([]RoutingPolicy{}))) + fieldNameMap["routing_policies"] = "RoutingPolicies" + fields["subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSubnetBindingType), reflect.TypeOf([]IPSubnet{}))) + fieldNameMap["subnets"] = "Subnets" + fields["urpf_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["urpf_mode"] = "UrpfMode" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["service_bindings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceBindingBindingType), reflect.TypeOf([]ServiceBinding{}))) + fieldNameMap["service_bindings"] = "ServiceBindings" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_down_link_port", fields, reflect.TypeOf(LogicalRouterDownLinkPort{}), fieldNameMap, validators) +} + +func LogicalRouterIPTunnelPortBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["admin_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["admin_state"] = "AdminState" + fields["subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSubnetBindingType), reflect.TypeOf([]IPSubnet{}))) + fieldNameMap["subnets"] = "Subnets" + fields["vpn_session_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vpn_session_id"] = "VpnSessionId" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["service_bindings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceBindingBindingType), reflect.TypeOf([]ServiceBinding{}))) + fieldNameMap["service_bindings"] = "ServiceBindings" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_IP_tunnel_port", fields, reflect.TypeOf(LogicalRouterIPTunnelPort{}), fieldNameMap, validators) +} + +func LogicalRouterLinkPortOnTIER0BindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["linked_logical_router_port_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["linked_logical_router_port_id"] = "LinkedLogicalRouterPortId" + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + fields["subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSubnetBindingType), reflect.TypeOf([]IPSubnet{}))) + fieldNameMap["subnets"] = "Subnets" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["service_bindings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceBindingBindingType), reflect.TypeOf([]ServiceBinding{}))) + fieldNameMap["service_bindings"] = "ServiceBindings" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_link_port_on_TIE_r0", fields, reflect.TypeOf(LogicalRouterLinkPortOnTIER0{}), fieldNameMap, validators) +} + +func LogicalRouterLinkPortOnTIER1BindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["edge_cluster_member_index"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewIntegerType(), reflect.TypeOf([]int64{}))) + fieldNameMap["edge_cluster_member_index"] = "EdgeClusterMemberIndex" + fields["linked_logical_router_port_id"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["linked_logical_router_port_id"] = "LinkedLogicalRouterPortId" + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + fields["subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSubnetBindingType), reflect.TypeOf([]IPSubnet{}))) + fieldNameMap["subnets"] = "Subnets" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["service_bindings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceBindingBindingType), reflect.TypeOf([]ServiceBinding{}))) + fieldNameMap["service_bindings"] = "ServiceBindings" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_link_port_on_TIE_r1", fields, reflect.TypeOf(LogicalRouterLinkPortOnTIER1{}), fieldNameMap, validators) +} + +func LogicalRouterListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LogicalRouterBindingType), reflect.TypeOf([]LogicalRouter{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_list_result", fields, reflect.TypeOf(LogicalRouterListResult{}), fieldNameMap, validators) +} + +func LogicalRouterLoopbackPortBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["edge_cluster_member_index"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewIntegerType(), reflect.TypeOf([]int64{}))) + fieldNameMap["edge_cluster_member_index"] = "EdgeClusterMemberIndex" + fields["subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSubnetBindingType), reflect.TypeOf([]IPSubnet{}))) + fieldNameMap["subnets"] = "Subnets" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["service_bindings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceBindingBindingType), reflect.TypeOf([]ServiceBinding{}))) + fieldNameMap["service_bindings"] = "ServiceBindings" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_loopback_port", fields, reflect.TypeOf(LogicalRouterLoopbackPort{}), fieldNameMap, validators) +} + +func LogicalRouterPortBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["service_bindings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceBindingBindingType), reflect.TypeOf([]ServiceBinding{}))) + fieldNameMap["service_bindings"] = "ServiceBindings" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_port", fields, reflect.TypeOf(LogicalRouterPort{}), fieldNameMap, validators) +} + +func LogicalRouterPortArpCsvRecordBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip"] = "Ip" + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_port_arp_csv_record", fields, reflect.TypeOf(LogicalRouterPortArpCsvRecord{}), fieldNameMap, validators) +} + +func LogicalRouterPortArpEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip"] = "Ip" + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_port_arp_entry", fields, reflect.TypeOf(LogicalRouterPortArpEntry{}), fieldNameMap, validators) +} + +func LogicalRouterPortArpTableBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["logical_router_port_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LogicalRouterPortArpEntryBindingType), reflect.TypeOf([]LogicalRouterPortArpEntry{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_port_arp_table", fields, reflect.TypeOf(LogicalRouterPortArpTable{}), fieldNameMap, validators) +} + +func LogicalRouterPortArpTableInCsvFormatBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_name"] = "FileName" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LogicalRouterPortArpCsvRecordBindingType), reflect.TypeOf([]LogicalRouterPortArpCsvRecord{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_port_arp_table_in_csv_format", fields, reflect.TypeOf(LogicalRouterPortArpTableInCsvFormat{}), fieldNameMap, validators) +} + +func LogicalRouterPortCountersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["blocked_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["blocked_packets"] = "BlockedPackets" + fields["dad_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dad_dropped_packets"] = "DadDroppedPackets" + fields["destination_unsupported_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["destination_unsupported_dropped_packets"] = "DestinationUnsupportedDroppedPackets" + fields["dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dropped_packets"] = "DroppedPackets" + fields["firewall_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["firewall_dropped_packets"] = "FirewallDroppedPackets" + fields["frag_needed_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["frag_needed_dropped_packets"] = "FragNeededDroppedPackets" + fields["ipsec_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ipsec_dropped_packets"] = "IpsecDroppedPackets" + fields["ipsec_no_sa_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ipsec_no_sa_dropped_packets"] = "IpsecNoSaDroppedPackets" + fields["ipsec_no_vti_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ipsec_no_vti_dropped_packets"] = "IpsecNoVtiDroppedPackets" + fields["ipsec_pol_block_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ipsec_pol_block_dropped_packets"] = "IpsecPolBlockDroppedPackets" + fields["ipsec_pol_err_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ipsec_pol_err_dropped_packets"] = "IpsecPolErrDroppedPackets" + fields["ipv6_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ipv6_dropped_packets"] = "Ipv6DroppedPackets" + fields["kni_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["kni_dropped_packets"] = "KniDroppedPackets" + fields["l4port_unsupported_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["l4port_unsupported_dropped_packets"] = "L4portUnsupportedDroppedPackets" + fields["malformed_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["malformed_dropped_packets"] = "MalformedDroppedPackets" + fields["no_arp_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["no_arp_dropped_packets"] = "NoArpDroppedPackets" + fields["no_linked_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["no_linked_dropped_packets"] = "NoLinkedDroppedPackets" + fields["no_mem_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["no_mem_dropped_packets"] = "NoMemDroppedPackets" + fields["no_receiver_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["no_receiver_dropped_packets"] = "NoReceiverDroppedPackets" + fields["no_route_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["no_route_dropped_packets"] = "NoRouteDroppedPackets" + fields["non_ip_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["non_ip_dropped_packets"] = "NonIpDroppedPackets" + fields["proto_unsupported_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["proto_unsupported_dropped_packets"] = "ProtoUnsupportedDroppedPackets" + fields["redirect_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["redirect_dropped_packets"] = "RedirectDroppedPackets" + fields["rpf_check_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rpf_check_dropped_packets"] = "RpfCheckDroppedPackets" + fields["service_insert_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["service_insert_dropped_packets"] = "ServiceInsertDroppedPackets" + fields["total_bytes"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_bytes"] = "TotalBytes" + fields["total_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_packets"] = "TotalPackets" + fields["ttl_exceeded_dropped_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ttl_exceeded_dropped_packets"] = "TtlExceededDroppedPackets" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_port_counters", fields, reflect.TypeOf(LogicalRouterPortCounters{}), fieldNameMap, validators) +} + +func LogicalRouterPortListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LogicalRouterPortBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_port_list_result", fields, reflect.TypeOf(LogicalRouterPortListResult{}), fieldNameMap, validators) +} + +func LogicalRouterPortStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ConfigurationStateElementBindingType), reflect.TypeOf([]ConfigurationStateElement{}))) + fieldNameMap["details"] = "Details" + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + fields["pending_change_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["pending_change_list"] = "PendingChangeList" + fields["ipv6_dad_statuses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPv6DADStatusBindingType), reflect.TypeOf([]IPv6DADStatus{}))) + fieldNameMap["ipv6_dad_statuses"] = "Ipv6DadStatuses" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_port_state", fields, reflect.TypeOf(LogicalRouterPortState{}), fieldNameMap, validators) +} + +func LogicalRouterPortStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_router_port_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + fields["per_node_statistics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LogicalRouterPortStatisticsPerNodeBindingType), reflect.TypeOf([]LogicalRouterPortStatisticsPerNode{}))) + fieldNameMap["per_node_statistics"] = "PerNodeStatistics" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_port_statistics", fields, reflect.TypeOf(LogicalRouterPortStatistics{}), fieldNameMap, validators) +} + +func LogicalRouterPortStatisticsPerNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["rx"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalRouterPortCountersBindingType)) + fieldNameMap["rx"] = "Rx" + fields["tx"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalRouterPortCountersBindingType)) + fieldNameMap["tx"] = "Tx" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_port_statistics_per_node", fields, reflect.TypeOf(LogicalRouterPortStatisticsPerNode{}), fieldNameMap, validators) +} + +func LogicalRouterPortStatisticsSummaryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["rx"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalRouterPortCountersBindingType)) + fieldNameMap["rx"] = "Rx" + fields["tx"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalRouterPortCountersBindingType)) + fieldNameMap["tx"] = "Tx" + fields["logical_router_port_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_port_statistics_summary", fields, reflect.TypeOf(LogicalRouterPortStatisticsSummary{}), fieldNameMap, validators) +} + +func LogicalRouterRouteCsvRecordBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["admin_distance"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["admin_distance"] = "AdminDistance" + fields["logical_router_port_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + fields["lr_component_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lr_component_id"] = "LrComponentId" + fields["lr_component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lr_component_type"] = "LrComponentType" + fields["network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network"] = "Network" + fields["next_hop"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["next_hop"] = "NextHop" + fields["route_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["route_type"] = "RouteType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_route_csv_record", fields, reflect.TypeOf(LogicalRouterRouteCsvRecord{}), fieldNameMap, validators) +} + +func LogicalRouterRouteEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["admin_distance"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["admin_distance"] = "AdminDistance" + fields["logical_router_port_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + fields["lr_component_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lr_component_id"] = "LrComponentId" + fields["lr_component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lr_component_type"] = "LrComponentType" + fields["network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network"] = "Network" + fields["next_hop"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["next_hop"] = "NextHop" + fields["route_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["route_type"] = "RouteType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_route_entry", fields, reflect.TypeOf(LogicalRouterRouteEntry{}), fieldNameMap, validators) +} + +func LogicalRouterRouteTableBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["logical_router_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_name"] = "LogicalRouterName" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LogicalRouterRouteEntryBindingType), reflect.TypeOf([]LogicalRouterRouteEntry{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_route_table", fields, reflect.TypeOf(LogicalRouterRouteTable{}), fieldNameMap, validators) +} + +func LogicalRouterRouteTableInCsvFormatBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_name"] = "FileName" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LogicalRouterRouteCsvRecordBindingType), reflect.TypeOf([]LogicalRouterRouteCsvRecord{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_route_table_in_csv_format", fields, reflect.TypeOf(LogicalRouterRouteTableInCsvFormat{}), fieldNameMap, validators) +} + +func LogicalRouterStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ConfigurationStateElementBindingType), reflect.TypeOf([]ConfigurationStateElement{}))) + fieldNameMap["details"] = "Details" + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + fields["pending_change_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["pending_change_list"] = "PendingChangeList" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_state", fields, reflect.TypeOf(LogicalRouterState{}), fieldNameMap, validators) +} + +func LogicalRouterStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["locale_operation_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["locale_operation_mode"] = "LocaleOperationMode" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["per_node_status"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LogicalRouterStatusPerNodeBindingType), reflect.TypeOf([]LogicalRouterStatusPerNode{}))) + fieldNameMap["per_node_status"] = "PerNodeStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_status", fields, reflect.TypeOf(LogicalRouterStatus{}), fieldNameMap, validators) +} + +func LogicalRouterStatusPerNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["edge_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_path"] = "EdgePath" + fields["high_availability_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["high_availability_status"] = "HighAvailabilityStatus" + fields["service_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_router_id"] = "ServiceRouterId" + fields["sub_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sub_cluster_id"] = "SubClusterId" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_status_per_node", fields, reflect.TypeOf(LogicalRouterStatusPerNode{}), fieldNameMap, validators) +} + +func LogicalRouterUpLinkPortBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["edge_cluster_member_index"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewIntegerType(), reflect.TypeOf([]int64{}))) + fieldNameMap["edge_cluster_member_index"] = "EdgeClusterMemberIndex" + fields["igmp_config"] = bindings.NewOptionalType(bindings.NewReferenceType(InterfaceIgmpLocalGroupConfigBindingType)) + fieldNameMap["igmp_config"] = "IgmpConfig" + fields["linked_logical_switch_port_id"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["linked_logical_switch_port_id"] = "LinkedLogicalSwitchPortId" + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + fields["mtu"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mtu"] = "Mtu" + fields["ndra_prefix_config"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NDRAPrefixConfigBindingType), reflect.TypeOf([]NDRAPrefixConfig{}))) + fieldNameMap["ndra_prefix_config"] = "NdraPrefixConfig" + fields["ndra_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ndra_profile_id"] = "NdraProfileId" + fields["pim_config"] = bindings.NewOptionalType(bindings.NewReferenceType(InterfacePimConfigBindingType)) + fieldNameMap["pim_config"] = "PimConfig" + fields["subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSubnetBindingType), reflect.TypeOf([]IPSubnet{}))) + fieldNameMap["subnets"] = "Subnets" + fields["urpf_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["urpf_mode"] = "UrpfMode" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["service_bindings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceBindingBindingType), reflect.TypeOf([]ServiceBinding{}))) + fieldNameMap["service_bindings"] = "ServiceBindings" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_router_up_link_port", fields, reflect.TypeOf(LogicalRouterUpLinkPort{}), fieldNameMap, validators) +} + +func LogicalServiceRouterClusterStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ConfigurationStateElementBindingType), reflect.TypeOf([]ConfigurationStateElement{}))) + fieldNameMap["details"] = "Details" + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + fields["pending_change_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["pending_change_list"] = "PendingChangeList" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_service_router_cluster_state", fields, reflect.TypeOf(LogicalServiceRouterClusterState{}), fieldNameMap, validators) +} + +func LogicalSwitchBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["address_bindings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PacketAddressClassifierBindingType), reflect.TypeOf([]PacketAddressClassifier{}))) + fieldNameMap["address_bindings"] = "AddressBindings" + fields["admin_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["admin_state"] = "AdminState" + fields["extra_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ExtraConfigBindingType), reflect.TypeOf([]ExtraConfig{}))) + fieldNameMap["extra_configs"] = "ExtraConfigs" + fields["global_vni"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["global_vni"] = "GlobalVni" + fields["hybrid"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["hybrid"] = "Hybrid" + fields["ip_pool_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_pool_id"] = "IpPoolId" + fields["mac_pool_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_pool_id"] = "MacPoolId" + fields["node_local_switch"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["node_local_switch"] = "NodeLocalSwitch" + fields["origin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_id"] = "OriginId" + fields["origin_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_type"] = "OriginType" + fields["replication_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["replication_mode"] = "ReplicationMode" + fields["span"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["span"] = "Span" + fields["switch_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["switch_type"] = "SwitchType" + fields["switching_profile_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SwitchingProfileTypeIdEntryBindingType), reflect.TypeOf([]SwitchingProfileTypeIdEntry{}))) + fieldNameMap["switching_profile_ids"] = "SwitchingProfileIds" + fields["transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_zone_id"] = "TransportZoneId" + fields["uplink_teaming_policy_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uplink_teaming_policy_name"] = "UplinkTeamingPolicyName" + fields["vlan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vlan"] = "Vlan" + fields["vlan_trunk_spec"] = bindings.NewOptionalType(bindings.NewReferenceType(VlanTrunkSpecBindingType)) + fieldNameMap["vlan_trunk_spec"] = "VlanTrunkSpec" + fields["vni"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vni"] = "Vni" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_switch", fields, reflect.TypeOf(LogicalSwitch{}), fieldNameMap, validators) +} + +func LogicalSwitchListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LogicalSwitchBindingType), reflect.TypeOf([]LogicalSwitch{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_switch_list_result", fields, reflect.TypeOf(LogicalSwitchListResult{}), fieldNameMap, validators) +} + +func LogicalSwitchMirrorSourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["switch_id"] = "SwitchId" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_switch_mirror_source", fields, reflect.TypeOf(LogicalSwitchMirrorSource{}), fieldNameMap, validators) +} + +func LogicalSwitchStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ConfigurationStateElementBindingType), reflect.TypeOf([]ConfigurationStateElement{}))) + fieldNameMap["details"] = "Details" + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_switch_state", fields, reflect.TypeOf(LogicalSwitchState{}), fieldNameMap, validators) +} + +func LogicalSwitchStateListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LogicalSwitchStateBindingType), reflect.TypeOf([]LogicalSwitchState{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_switch_state_list_result", fields, reflect.TypeOf(LogicalSwitchStateListResult{}), fieldNameMap, validators) +} + +func LogicalSwitchStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["rx_bytes"] = "RxBytes" + fields["rx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["rx_packets"] = "RxPackets" + fields["tx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["tx_bytes"] = "TxBytes" + fields["tx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(DataCounterBindingType)) + fieldNameMap["tx_packets"] = "TxPackets" + fields["dropped_by_security_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(PacketsDroppedBySecurityBindingType)) + fieldNameMap["dropped_by_security_packets"] = "DroppedBySecurityPackets" + fields["mac_learning"] = bindings.NewOptionalType(bindings.NewReferenceType(MacLearningCountersBindingType)) + fieldNameMap["mac_learning"] = "MacLearning" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_switch_statistics", fields, reflect.TypeOf(LogicalSwitchStatistics{}), fieldNameMap, validators) +} + +func LogicalSwitchStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + fields["num_logical_ports"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["num_logical_ports"] = "NumLogicalPorts" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_switch_status", fields, reflect.TypeOf(LogicalSwitchStatus{}), fieldNameMap, validators) +} + +func LogicalSwitchStatusSummaryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FilterBindingType), reflect.TypeOf([]Filter{}))) + fieldNameMap["filters"] = "Filters" + fields["fully_realized_switches"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["fully_realized_switches"] = "FullyRealizedSwitches" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["total_switches"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_switches"] = "TotalSwitches" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.logical_switch_status_summary", fields, reflect.TypeOf(LogicalSwitchStatusSummary{}), fieldNameMap, validators) +} + +func LoginCredentialBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["credential_type"] = bindings.NewStringType() + fieldNameMap["credential_type"] = "CredentialType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.login_credential", fields, reflect.TypeOf(LoginCredential{}), fieldNameMap, validators) +} + +func MACAddressElementBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.MAC_address_element", fields, reflect.TypeOf(MACAddressElement{}), fieldNameMap, validators) +} + +func MACAddressElementListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MACAddressElementBindingType), reflect.TypeOf([]MACAddressElement{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.MAC_address_element_list_result", fields, reflect.TypeOf(MACAddressElementListResult{}), fieldNameMap, validators) +} + +func MACSetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["mac_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["mac_addresses"] = "MacAddresses" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.MAC_set", fields, reflect.TypeOf(MACSet{}), fieldNameMap, validators) +} + +func MACSetListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MACSetBindingType), reflect.TypeOf([]MACSet{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.MAC_set_list_result", fields, reflect.TypeOf(MACSetListResult{}), fieldNameMap, validators) +} + +func MPAConfigPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["RmqBrokerCluster"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(BrokerPropertiesBindingType), reflect.TypeOf([]BrokerProperties{}))) + fieldNameMap["RmqBrokerCluster"] = "RmqBrokerCluster" + fields["SharedSecret"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["SharedSecret"] = "SharedSecret" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.MPA_config_properties", fields, reflect.TypeOf(MPAConfigProperties{}), fieldNameMap, validators) +} + +func MPPolicyPromotionHistoryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["date_time"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["date_time"] = "DateTime" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.MP_policy_promotion_history", fields, reflect.TypeOf(MPPolicyPromotionHistory{}), fieldNameMap, validators) +} + +func MPPolicyPromotionHistoryListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MPPolicyPromotionHistoryBindingType), reflect.TypeOf([]MPPolicyPromotionHistory{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.MP_policy_promotion_history_list", fields, reflect.TypeOf(MPPolicyPromotionHistoryList{}), fieldNameMap, validators) +} + +func MPPolicyPromotionStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mp_policy_promotion"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mp_policy_promotion"] = "MpPolicyPromotion" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.MP_policy_promotion_state", fields, reflect.TypeOf(MPPolicyPromotionState{}), fieldNameMap, validators) +} + +func MPResourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MPResourceDetailsBindingType), reflect.TypeOf([]MPResourceDetails{}))) + fieldNameMap["resource_ids"] = "ResourceIds" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.MP_resource", fields, reflect.TypeOf(MPResource{}), fieldNameMap, validators) +} + +func MPResourceDetailsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["linked_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MPResourceLinkedDetailsBindingType), reflect.TypeOf([]MPResourceLinkedDetails{}))) + fieldNameMap["linked_ids"] = "LinkedIds" + fields["manager_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["manager_id"] = "ManagerId" + fields["metadata"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MPResourceMetadataBindingType), reflect.TypeOf([]MPResourceMetadata{}))) + fieldNameMap["metadata"] = "Metadata" + fields["override"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["override"] = "Override" + fields["policy_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["policy_id"] = "PolicyId" + fields["policy_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["policy_path"] = "PolicyPath" + fields["principle_identity"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["principle_identity"] = "PrincipleIdentity" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.MP_resource_details", fields, reflect.TypeOf(MPResourceDetails{}), fieldNameMap, validators) +} + +func MPResourceLinkedDetailsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key"] = "Key" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.MP_resource_linked_details", fields, reflect.TypeOf(MPResourceLinkedDetails{}), fieldNameMap, validators) +} + +func MPResourceMetadataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key"] = "Key" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.MP_resource_metadata", fields, reflect.TypeOf(MPResourceMetadata{}), fieldNameMap, validators) +} + +func MacAddressCsvListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_name"] = "FileName" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MacTableCsvRecordBindingType), reflect.TypeOf([]MacTableCsvRecord{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.mac_address_csv_list_result", fields, reflect.TypeOf(MacAddressCsvListResult{}), fieldNameMap, validators) +} + +func MacAddressListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MacTableEntryBindingType), reflect.TypeOf([]MacTableEntry{}))) + fieldNameMap["results"] = "Results" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.mac_address_list_result", fields, reflect.TypeOf(MacAddressListResult{}), fieldNameMap, validators) +} + +func MacLearningCountersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mac_not_learned_packets_allowed"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mac_not_learned_packets_allowed"] = "MacNotLearnedPacketsAllowed" + fields["mac_not_learned_packets_dropped"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mac_not_learned_packets_dropped"] = "MacNotLearnedPacketsDropped" + fields["macs_learned"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["macs_learned"] = "MacsLearned" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.mac_learning_counters", fields, reflect.TypeOf(MacLearningCounters{}), fieldNameMap, validators) +} + +func MacLearningSpecBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["aging_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["aging_time"] = "AgingTime" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["limit"] = "Limit" + fields["limit_policy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["limit_policy"] = "LimitPolicy" + fields["remote_overlay_mac_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["remote_overlay_mac_limit"] = "RemoteOverlayMacLimit" + fields["unicast_flooding_allowed"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["unicast_flooding_allowed"] = "UnicastFloodingAllowed" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.mac_learning_spec", fields, reflect.TypeOf(MacLearningSpec{}), fieldNameMap, validators) +} + +func MacManagementSwitchingProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mac_change_allowed"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["mac_change_allowed"] = "MacChangeAllowed" + fields["mac_learning"] = bindings.NewOptionalType(bindings.NewReferenceType(MacLearningSpecBindingType)) + fieldNameMap["mac_learning"] = "MacLearning" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["required_capabilities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["required_capabilities"] = "RequiredCapabilities" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.mac_management_switching_profile", fields, reflect.TypeOf(MacManagementSwitchingProfile{}), fieldNameMap, validators) +} + +func MacPoolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["ranges"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MacRangeBindingType), reflect.TypeOf([]MacRange{}))) + fieldNameMap["ranges"] = "Ranges" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.mac_pool", fields, reflect.TypeOf(MacPool{}), fieldNameMap, validators) +} + +func MacPoolListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MacPoolBindingType), reflect.TypeOf([]MacPool{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.mac_pool_list_result", fields, reflect.TypeOf(MacPoolListResult{}), fieldNameMap, validators) +} + +func MacRangeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["end"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["end"] = "End" + fields["start"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["start"] = "Start" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.mac_range", fields, reflect.TypeOf(MacRange{}), fieldNameMap, validators) +} + +func MacTableCsvRecordBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + fields["rtep_group_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rtep_group_id"] = "RtepGroupId" + fields["vtep_group_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vtep_group_id"] = "VtepGroupId" + fields["vtep_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vtep_ip"] = "VtepIp" + fields["vtep_mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vtep_mac_address"] = "VtepMacAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.mac_table_csv_record", fields, reflect.TypeOf(MacTableCsvRecord{}), fieldNameMap, validators) +} + +func MacTableEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + fields["rtep_group_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rtep_group_id"] = "RtepGroupId" + fields["vtep_group_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vtep_group_id"] = "VtepGroupId" + fields["vtep_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vtep_ip"] = "VtepIp" + fields["vtep_mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vtep_mac_address"] = "VtepMacAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.mac_table_entry", fields, reflect.TypeOf(MacTableEntry{}), fieldNameMap, validators) +} + +func ManagedResourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.managed_resource", fields, reflect.TypeOf(ManagedResource{}), fieldNameMap, validators) +} + +func ManagementClusterNodeStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mgmt_cluster_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mgmt_cluster_status"] = "MgmtClusterStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.management_cluster_node_status", fields, reflect.TypeOf(ManagementClusterNodeStatus{}), fieldNameMap, validators) +} + +func ManagementClusterRoleConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + fields["api_listen_addr"] = bindings.NewOptionalType(bindings.NewReferenceType(ServiceEndpointBindingType)) + fieldNameMap["api_listen_addr"] = "ApiListenAddr" + fields["appliance_connection_info"] = bindings.NewOptionalType(bindings.NewReferenceType(ServiceEndpointBindingType)) + fieldNameMap["appliance_connection_info"] = "ApplianceConnectionInfo" + fields["mgmt_cluster_listen_addr"] = bindings.NewOptionalType(bindings.NewReferenceType(ServiceEndpointBindingType)) + fieldNameMap["mgmt_cluster_listen_addr"] = "MgmtClusterListenAddr" + fields["mgmt_plane_listen_addr"] = bindings.NewOptionalType(bindings.NewReferenceType(ServiceEndpointBindingType)) + fieldNameMap["mgmt_plane_listen_addr"] = "MgmtPlaneListenAddr" + fields["mpa_msg_client_info"] = bindings.NewOptionalType(bindings.NewReferenceType(MsgClientInfoBindingType)) + fieldNameMap["mpa_msg_client_info"] = "MpaMsgClientInfo" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.management_cluster_role_config", fields, reflect.TypeOf(ManagementClusterRoleConfig{}), fieldNameMap, validators) +} + +func ManagementClusterStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["offline_nodes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ManagementPlaneBaseNodeInfoBindingType), reflect.TypeOf([]ManagementPlaneBaseNodeInfo{}))) + fieldNameMap["offline_nodes"] = "OfflineNodes" + fields["online_nodes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ManagementPlaneBaseNodeInfoBindingType), reflect.TypeOf([]ManagementPlaneBaseNodeInfo{}))) + fieldNameMap["online_nodes"] = "OnlineNodes" + fields["required_members_for_initialization"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ClusterInitializationNodeInfoBindingType), reflect.TypeOf([]ClusterInitializationNodeInfo{}))) + fieldNameMap["required_members_for_initialization"] = "RequiredMembersForInitialization" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.management_cluster_status", fields, reflect.TypeOf(ManagementClusterStatus{}), fieldNameMap, validators) +} + +func ManagementConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["publish_fqdns"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["publish_fqdns"] = "PublishFqdns" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.management_config", fields, reflect.TypeOf(ManagementConfig{}), fieldNameMap, validators) +} + +func ManagementNodeAggregateInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["node_interface_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeInterfacePropertiesBindingType), reflect.TypeOf([]NodeInterfaceProperties{}))) + fieldNameMap["node_interface_properties"] = "NodeInterfaceProperties" + fields["node_interface_statistics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeInterfaceStatisticsPropertiesBindingType), reflect.TypeOf([]NodeInterfaceStatisticsProperties{}))) + fieldNameMap["node_interface_statistics"] = "NodeInterfaceStatistics" + fields["node_status"] = bindings.NewOptionalType(bindings.NewReferenceType(ClusterNodeStatusBindingType)) + fieldNameMap["node_status"] = "NodeStatus" + fields["node_status_properties"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeStatusPropertiesBindingType), reflect.TypeOf([]NodeStatusProperties{}))) + fieldNameMap["node_status_properties"] = "NodeStatusProperties" + fields["role_config"] = bindings.NewOptionalType(bindings.NewReferenceType(ManagementClusterRoleConfigBindingType)) + fieldNameMap["role_config"] = "RoleConfig" + fields["transport_nodes_connected"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["transport_nodes_connected"] = "TransportNodesConnected" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.management_node_aggregate_info", fields, reflect.TypeOf(ManagementNodeAggregateInfo{}), fieldNameMap, validators) +} + +func ManagementPlaneBaseNodeInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mgmt_cluster_listen_ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mgmt_cluster_listen_ip_address"] = "MgmtClusterListenIpAddress" + fields["uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uuid"] = "Uuid" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.management_plane_base_node_info", fields, reflect.TypeOf(ManagementPlaneBaseNodeInfo{}), fieldNameMap, validators) +} + +func ManagementPlaneBrokerPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["host"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host"] = "Host" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["thumbprint"] = "Thumbprint" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.management_plane_broker_properties", fields, reflect.TypeOf(ManagementPlaneBrokerProperties{}), fieldNameMap, validators) +} + +func ManagementPlanePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["brokers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ManagementPlaneBrokerPropertiesBindingType), reflect.TypeOf([]ManagementPlaneBrokerProperties{}))) + fieldNameMap["brokers"] = "Brokers" + fields["secret"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["secret"] = "Secret" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.management_plane_properties", fields, reflect.TypeOf(ManagementPlaneProperties{}), fieldNameMap, validators) +} + +func MandatoryAccessControlPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.mandatory_access_control_properties", fields, reflect.TypeOf(MandatoryAccessControlProperties{}), fieldNameMap, validators) +} + +func ManualHealthCheckBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["operation_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["operation_status"] = "OperationStatus" + fields["result"] = bindings.NewOptionalType(bindings.NewReferenceType(HealthCheckResultBindingType)) + fieldNameMap["result"] = "Result" + fields["transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_zone_id"] = "TransportZoneId" + fields["vlans"] = bindings.NewOptionalType(bindings.NewReferenceType(HealthCheckSpecVlansBindingType)) + fieldNameMap["vlans"] = "Vlans" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.manual_health_check", fields, reflect.TypeOf(ManualHealthCheck{}), fieldNameMap, validators) +} + +func ManualHealthCheckListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ManualHealthCheckBindingType), reflect.TypeOf([]ManualHealthCheck{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.manual_health_check_list_result", fields, reflect.TypeOf(ManualHealthCheckListResult{}), fieldNameMap, validators) +} + +func MemoryReservationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["reservation_percentage"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["reservation_percentage"] = "ReservationPercentage" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.memory_reservation", fields, reflect.TypeOf(MemoryReservation{}), fieldNameMap, validators) +} + +func MessagingClientInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["account_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["account_name"] = "AccountName" + fields["client_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["client_type"] = "ClientType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.messaging_client_info", fields, reflect.TypeOf(MessagingClientInfo{}), fieldNameMap, validators) +} + +func MetadataProxyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["attached_logical_port_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["attached_logical_port_id"] = "AttachedLogicalPortId" + fields["crypto_protocols"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["crypto_protocols"] = "CryptoProtocols" + fields["edge_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + fields["edge_cluster_member_indexes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewIntegerType(), reflect.TypeOf([]int64{}))) + fieldNameMap["edge_cluster_member_indexes"] = "EdgeClusterMemberIndexes" + fields["enable_standby_relocation"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_standby_relocation"] = "EnableStandbyRelocation" + fields["metadata_server_ca_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["metadata_server_ca_ids"] = "MetadataServerCaIds" + fields["metadata_server_url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["metadata_server_url"] = "MetadataServerUrl" + fields["secret"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["secret"] = "Secret" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.metadata_proxy", fields, reflect.TypeOf(MetadataProxy{}), fieldNameMap, validators) +} + +func MetadataProxyListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MetadataProxyBindingType), reflect.TypeOf([]MetadataProxy{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.metadata_proxy_list_result", fields, reflect.TypeOf(MetadataProxyListResult{}), fieldNameMap, validators) +} + +func MetadataProxyStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["metadata_proxy_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["metadata_proxy_id"] = "MetadataProxyId" + fields["statistics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MetadataProxyStatisticsPerLogicalSwitchBindingType), reflect.TypeOf([]MetadataProxyStatisticsPerLogicalSwitch{}))) + fieldNameMap["statistics"] = "Statistics" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.metadata_proxy_statistics", fields, reflect.TypeOf(MetadataProxyStatistics{}), fieldNameMap, validators) +} + +func MetadataProxyStatisticsPerLogicalSwitchBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_responses_from_nova_server"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["error_responses_from_nova_server"] = "ErrorResponsesFromNovaServer" + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + fields["requests_from_clients"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["requests_from_clients"] = "RequestsFromClients" + fields["requests_to_nova_server"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["requests_to_nova_server"] = "RequestsToNovaServer" + fields["responses_to_clients"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["responses_to_clients"] = "ResponsesToClients" + fields["succeeded_responses_from_nova_server"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["succeeded_responses_from_nova_server"] = "SucceededResponsesFromNovaServer" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.metadata_proxy_statistics_per_logical_switch", fields, reflect.TypeOf(MetadataProxyStatisticsPerLogicalSwitch{}), fieldNameMap, validators) +} + +func MetadataProxyStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["proxy_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["proxy_status"] = "ProxyStatus" + fields["transport_nodes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["transport_nodes"] = "TransportNodes" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.metadata_proxy_status", fields, reflect.TypeOf(MetadataProxyStatus{}), fieldNameMap, validators) +} + +func MgmtConnStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["connectivity_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connectivity_status"] = "ConnectivityStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.mgmt_conn_status", fields, reflect.TypeOf(MgmtConnStatus{}), fieldNameMap, validators) +} + +func MigratedObjectBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["parent_resource_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_resource_id"] = "ParentResourceId" + fields["parent_resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_resource_type"] = "ParentResourceType" + fields["policy_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["policy_id"] = "PolicyId" + fields["policy_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["policy_path"] = "PolicyPath" + fields["resource_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_id"] = "ResourceId" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migrated_object", fields, reflect.TypeOf(MigratedObject{}), fieldNameMap, validators) +} + +func MigratedObjectListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MigratedObjectBindingType), reflect.TypeOf([]MigratedObject{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migrated_object_list_result", fields, reflect.TypeOf(MigratedObjectListResult{}), fieldNameMap, validators) +} + +func MigrationDataDownloadRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["federation_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["federation_site_id"] = "FederationSiteId" + fields["file_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_type"] = "FileType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_data_download_request", fields, reflect.TypeOf(MigrationDataDownloadRequest{}), fieldNameMap, validators) +} + +func MigrationDataInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["federation_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["federation_site_id"] = "FederationSiteId" + fields["file_location"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_location"] = "FileLocation" + fields["file_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_type"] = "FileType" + fields["is_present"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_present"] = "IsPresent" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_data_info", fields, reflect.TypeOf(MigrationDataInfo{}), fieldNameMap, validators) +} + +func MigrationFeedbackCategoryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["accepted_values"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["accepted_values"] = "AcceptedValues" + fields["category"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["category"] = "Category" + fields["count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["count"] = "Count" + fields["resolved"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["resolved"] = "Resolved" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_feedback_category", fields, reflect.TypeOf(MigrationFeedbackCategory{}), fieldNameMap, validators) +} + +func MigrationFeedbackRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["accepted_actions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["accepted_actions"] = "AcceptedActions" + fields["accepted_value_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["accepted_value_type"] = "AcceptedValueType" + fields["accepted_values"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["accepted_values"] = "AcceptedValues" + fields["federation_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["federation_site_id"] = "FederationSiteId" + fields["hash"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["hash"] = "Hash" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["message"] = "Message" + fields["multi_value"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["multi_value"] = "MultiValue" + fields["object_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["object_id"] = "ObjectId" + fields["rejected"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["rejected"] = "Rejected" + fields["resolution"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resolution"] = "Resolution" + fields["resolved"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["resolved"] = "Resolved" + fields["sub_vertical"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sub_vertical"] = "SubVertical" + fields["suggested_action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["suggested_action"] = "SuggestedAction" + fields["suggested_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["suggested_value"] = "SuggestedValue" + fields["v_object_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["v_object_id"] = "VObjectId" + fields["v_object_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["v_object_name"] = "VObjectName" + fields["vertical"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vertical"] = "Vertical" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_feedback_request", fields, reflect.TypeOf(MigrationFeedbackRequest{}), fieldNameMap, validators) +} + +func MigrationFeedbackRequestListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MigrationFeedbackRequestBindingType), reflect.TypeOf([]MigrationFeedbackRequest{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_feedback_request_list_result", fields, reflect.TypeOf(MigrationFeedbackRequestListResult{}), fieldNameMap, validators) +} + +func MigrationFeedbackResponseBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + fields["values"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["values"] = "Values" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_feedback_response", fields, reflect.TypeOf(MigrationFeedbackResponse{}), fieldNameMap, validators) +} + +func MigrationFeedbackResponseListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["response_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MigrationFeedbackResponseBindingType), reflect.TypeOf([]MigrationFeedbackResponse{}))) + fieldNameMap["response_list"] = "ResponseList" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_feedback_response_list", fields, reflect.TypeOf(MigrationFeedbackResponseList{}), fieldNameMap, validators) +} + +func MigrationFeedbackSummaryListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["feedback_resolution_job_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["feedback_resolution_job_status"] = "FeedbackResolutionJobStatus" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MigrationFeedbackCategoryBindingType), reflect.TypeOf([]MigrationFeedbackCategory{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_feedback_summary_list_result", fields, reflect.TypeOf(MigrationFeedbackSummaryListResult{}), fieldNameMap, validators) +} + +func MigrationPlanSettingsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["parallel"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["parallel"] = "Parallel" + fields["pause_after_each_group"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["pause_after_each_group"] = "PauseAfterEachGroup" + fields["pause_on_error"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["pause_on_error"] = "PauseOnError" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_plan_settings", fields, reflect.TypeOf(MigrationPlanSettings{}), fieldNameMap, validators) +} + +func MigrationSetupInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["avi_lb_endpoint"] = bindings.NewOptionalType(bindings.NewReferenceType(AviEndPointBindingType)) + fieldNameMap["avi_lb_endpoint"] = "AviLbEndpoint" + fields["create_segment_ports"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["create_segment_ports"] = "CreateSegmentPorts" + fields["destination_nsx"] = bindings.NewOptionalType(bindings.NewReferenceType(DestinationNsxApiEndpointBindingType)) + fieldNameMap["destination_nsx"] = "DestinationNsx" + fields["esg_to_router_mapping_option"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["esg_to_router_mapping_option"] = "EsgToRouterMappingOption" + fields["migration_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["migration_mode"] = "MigrationMode" + fields["nsxt_site_to_avi_mappings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NsxtSiteToAviMappingBindingType), reflect.TypeOf([]NsxtSiteToAviMapping{}))) + fieldNameMap["nsxt_site_to_avi_mappings"] = "NsxtSiteToAviMappings" + fields["nsxt_sites"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NsxtSiteBindingType), reflect.TypeOf([]NsxtSite{}))) + fieldNameMap["nsxt_sites"] = "NsxtSites" + fields["nsxv_sites"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SourceNsxApiEndpointBindingType), reflect.TypeOf([]SourceNsxApiEndpoint{}))) + fieldNameMap["nsxv_sites"] = "NsxvSites" + fields["source_nsx"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SourceNsxApiEndpointBindingType), reflect.TypeOf([]SourceNsxApiEndpoint{}))) + fieldNameMap["source_nsx"] = "SourceNsx" + fields["v2t_site_mappings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(V2tSiteMappingBindingType), reflect.TypeOf([]V2tSiteMapping{}))) + fieldNameMap["v2t_site_mappings"] = "V2tSiteMappings" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_setup_info", fields, reflect.TypeOf(MigrationSetupInfo{}), fieldNameMap, validators) +} + +func MigrationStatsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["failed_objects_count"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failed_objects_count"] = "FailedObjectsCount" + fields["promoted_objects_count"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["promoted_objects_count"] = "PromotedObjectsCount" + fields["promotion_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["promotion_status"] = "PromotionStatus" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["total_count"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["total_count"] = "TotalCount" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_stats", fields, reflect.TypeOf(MigrationStats{}), fieldNameMap, validators) +} + +func MigrationStatsResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["current_resource_type_in_promotion"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["current_resource_type_in_promotion"] = "CurrentResourceTypeInPromotion" + fields["migration_stats"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MigrationStatsBindingType), reflect.TypeOf([]MigrationStats{}))) + fieldNameMap["migration_stats"] = "MigrationStats" + fields["total_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_count"] = "TotalCount" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_stats_result", fields, reflect.TypeOf(MigrationStatsResult{}), fieldNameMap, validators) +} + +func MigrationStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_status"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ComponentMigrationStatusBindingType), reflect.TypeOf([]ComponentMigrationStatus{}))) + fieldNameMap["component_status"] = "ComponentStatus" + fields["overall_migration_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["overall_migration_status"] = "OverallMigrationStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_status", fields, reflect.TypeOf(MigrationStatus{}), fieldNameMap, validators) +} + +func MigrationSummaryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_target_versions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ComponentTargetVersionBindingType), reflect.TypeOf([]ComponentTargetVersion{}))) + fieldNameMap["component_target_versions"] = "ComponentTargetVersions" + fields["migration_coordinator_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["migration_coordinator_version"] = "MigrationCoordinatorVersion" + fields["migration_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["migration_status"] = "MigrationStatus" + fields["system_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["system_version"] = "SystemVersion" + fields["target_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_version"] = "TargetVersion" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_summary", fields, reflect.TypeOf(MigrationSummary{}), fieldNameMap, validators) +} + +func MigrationSwitchInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["kind"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["kind"] = "Kind" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["pnic_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["pnic_count"] = "PnicCount" + fields["version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["version"] = "Version" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_switch_info", fields, reflect.TypeOf(MigrationSwitchInfo{}), fieldNameMap, validators) +} + +func MigrationSwitchListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MigrationSwitchInfoBindingType), reflect.TypeOf([]MigrationSwitchInfo{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_switch_list_result", fields, reflect.TypeOf(MigrationSwitchListResult{}), fieldNameMap, validators) +} + +func MigrationUnitBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["current_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["current_version"] = "CurrentVersion" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["group"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["group"] = "Group" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["metadata"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["metadata"] = "Metadata" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + fields["warnings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["warnings"] = "Warnings" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_unit", fields, reflect.TypeOf(MigrationUnit{}), fieldNameMap, validators) +} + +func MigrationUnitAggregateInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["errors"] = "Errors" + fields["percent_complete"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["percent_complete"] = "PercentComplete" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["unit"] = bindings.NewOptionalType(bindings.NewReferenceType(MigrationUnitBindingType)) + fieldNameMap["unit"] = "Unit" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_unit_aggregate_info", fields, reflect.TypeOf(MigrationUnitAggregateInfo{}), fieldNameMap, validators) +} + +func MigrationUnitAggregateInfoListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MigrationUnitAggregateInfoBindingType), reflect.TypeOf([]MigrationUnitAggregateInfo{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_unit_aggregate_info_list_result", fields, reflect.TypeOf(MigrationUnitAggregateInfoListResult{}), fieldNameMap, validators) +} + +func MigrationUnitGroupBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["extended_configuration"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["extended_configuration"] = "ExtendedConfiguration" + fields["migration_unit_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["migration_unit_count"] = "MigrationUnitCount" + fields["migration_units"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MigrationUnitBindingType), reflect.TypeOf([]MigrationUnit{}))) + fieldNameMap["migration_units"] = "MigrationUnits" + fields["parallel"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["parallel"] = "Parallel" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_unit_group", fields, reflect.TypeOf(MigrationUnitGroup{}), fieldNameMap, validators) +} + +func MigrationUnitGroupAggregateInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["failed_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failed_count"] = "FailedCount" + fields["group"] = bindings.NewOptionalType(bindings.NewReferenceType(MigrationUnitGroupBindingType)) + fieldNameMap["group"] = "Group" + fields["percent_complete"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["percent_complete"] = "PercentComplete" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_unit_group_aggregate_info", fields, reflect.TypeOf(MigrationUnitGroupAggregateInfo{}), fieldNameMap, validators) +} + +func MigrationUnitGroupAggregateInfoListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MigrationUnitGroupAggregateInfoBindingType), reflect.TypeOf([]MigrationUnitGroupAggregateInfo{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_unit_group_aggregate_info_list_result", fields, reflect.TypeOf(MigrationUnitGroupAggregateInfoListResult{}), fieldNameMap, validators) +} + +func MigrationUnitGroupListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MigrationUnitGroupBindingType), reflect.TypeOf([]MigrationUnitGroup{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_unit_group_list_result", fields, reflect.TypeOf(MigrationUnitGroupListResult{}), fieldNameMap, validators) +} + +func MigrationUnitGroupStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["failed_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failed_count"] = "FailedCount" + fields["group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["group_id"] = "GroupId" + fields["group_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["group_name"] = "GroupName" + fields["migration_unit_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["migration_unit_count"] = "MigrationUnitCount" + fields["percent_complete"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["percent_complete"] = "PercentComplete" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_unit_group_status", fields, reflect.TypeOf(MigrationUnitGroupStatus{}), fieldNameMap, validators) +} + +func MigrationUnitGroupStatusListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MigrationUnitGroupStatusBindingType), reflect.TypeOf([]MigrationUnitGroupStatus{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_unit_group_status_list_result", fields, reflect.TypeOf(MigrationUnitGroupStatusListResult{}), fieldNameMap, validators) +} + +func MigrationUnitListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MigrationUnitBindingType), reflect.TypeOf([]MigrationUnit{}))) + fieldNameMap["list"] = "List" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_unit_list", fields, reflect.TypeOf(MigrationUnitList{}), fieldNameMap, validators) +} + +func MigrationUnitListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MigrationUnitBindingType), reflect.TypeOf([]MigrationUnit{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_unit_list_result", fields, reflect.TypeOf(MigrationUnitListResult{}), fieldNameMap, validators) +} + +func MigrationUnitStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["errors"] = "Errors" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["percent_complete"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["percent_complete"] = "PercentComplete" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_unit_status", fields, reflect.TypeOf(MigrationUnitStatus{}), fieldNameMap, validators) +} + +func MigrationUnitStatusListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MigrationUnitStatusBindingType), reflect.TypeOf([]MigrationUnitStatus{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_unit_status_list_result", fields, reflect.TypeOf(MigrationUnitStatusListResult{}), fieldNameMap, validators) +} + +func MigrationUnitTypeStatsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["node_count"] = "NodeCount" + fields["node_with_issues_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["node_with_issues_count"] = "NodeWithIssuesCount" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + fields["version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["version"] = "Version" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_unit_type_stats", fields, reflect.TypeOf(MigrationUnitTypeStats{}), fieldNameMap, validators) +} + +func MigrationUnitTypeStatsListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MigrationUnitTypeStatsBindingType), reflect.TypeOf([]MigrationUnitTypeStats{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.migration_unit_type_stats_list", fields, reflect.TypeOf(MigrationUnitTypeStatsList{}), fieldNameMap, validators) +} + +func MirrorDestinationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.mirror_destination", fields, reflect.TypeOf(MirrorDestination{}), fieldNameMap, validators) +} + +func MirrorSourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.mirror_source", fields, reflect.TypeOf(MirrorSource{}), fieldNameMap, validators) +} + +func MirrorStackStatusListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["overall_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["overall_status"] = "OverallStatus" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TnNodeStackSpanStatusBindingType), reflect.TypeOf([]TnNodeStackSpanStatus{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.mirror_stack_status_list_result", fields, reflect.TypeOf(MirrorStackStatusListResult{}), fieldNameMap, validators) +} + +func MonitoringEventBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["description_on_clear"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description_on_clear"] = "DescriptionOnClear" + fields["entity_resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["entity_resource_type"] = "EntityResourceType" + fields["event_false_snmp_oid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["event_false_snmp_oid"] = "EventFalseSnmpOid" + fields["event_true_snmp_oid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["event_true_snmp_oid"] = "EventTrueSnmpOid" + fields["event_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["event_type"] = "EventType" + fields["event_type_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["event_type_display_name"] = "EventTypeDisplayName" + fields["feature_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["feature_display_name"] = "FeatureDisplayName" + fields["feature_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["feature_name"] = "FeatureName" + fields["is_disabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_disabled"] = "IsDisabled" + fields["is_sensitivity_fixed"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_sensitivity_fixed"] = "IsSensitivityFixed" + fields["is_threshold_fixed"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_threshold_fixed"] = "IsThresholdFixed" + fields["is_threshold_floating_point"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_threshold_floating_point"] = "IsThresholdFloatingPoint" + fields["max_threshold"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_threshold"] = "MaxThreshold" + fields["min_threshold"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["min_threshold"] = "MinThreshold" + fields["node_types"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["node_types"] = "NodeTypes" + fields["recommended_action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["recommended_action"] = "RecommendedAction" + fields["sensitivity"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sensitivity"] = "Sensitivity" + fields["severity"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["severity"] = "Severity" + fields["summary"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["summary"] = "Summary" + fields["suppress_alarm"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["suppress_alarm"] = "SuppressAlarm" + fields["suppress_snmp_trap"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["suppress_snmp_trap"] = "SuppressSnmpTrap" + fields["threshold"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["threshold"] = "Threshold" + fields["threshold_floating_point"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["threshold_floating_point"] = "ThresholdFloatingPoint" + fields["threshold_unit_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["threshold_unit_type"] = "ThresholdUnitType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.monitoring_event", fields, reflect.TypeOf(MonitoringEvent{}), fieldNameMap, validators) +} + +func MonthlyTelemetryScheduleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["day_of_month"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["day_of_month"] = "DayOfMonth" + fields["hour_of_day"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["hour_of_day"] = "HourOfDay" + fields["minutes"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["minutes"] = "Minutes" + fields["frequency_type"] = bindings.NewStringType() + fieldNameMap["frequency_type"] = "FrequencyType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.monthly_telemetry_schedule", fields, reflect.TypeOf(MonthlyTelemetrySchedule{}), fieldNameMap, validators) +} + +func MpMigrationDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["migration_data"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MPResourceBindingType), reflect.TypeOf([]MPResource{}))) + fieldNameMap["migration_data"] = "MigrationData" + fields["mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mode"] = "Mode" + fields["setup_details"] = bindings.NewOptionalType(bindings.NewReferenceType(SetupDetailsBindingType)) + fieldNameMap["setup_details"] = "SetupDetails" + fields["skip_failed_resources"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["skip_failed_resources"] = "SkipFailedResources" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.mp_migration_data", fields, reflect.TypeOf(MpMigrationData{}), fieldNameMap, validators) +} + +func MsgClientInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["account_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["account_name"] = "AccountName" + fields["certificate"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["certificate"] = "Certificate" + fields["shared_secret"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["shared_secret"] = "SharedSecret" + fields["software_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["software_version"] = "SoftwareVersion" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.msg_client_info", fields, reflect.TypeOf(MsgClientInfo{}), fieldNameMap, validators) +} + +func MultiWidgetConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["navigation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["navigation"] = "Navigation" + fields["widgets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(WidgetItemBindingType), reflect.TypeOf([]WidgetItem{}))) + fieldNameMap["widgets"] = "Widgets" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["feature_set"] = bindings.NewOptionalType(bindings.NewReferenceType(FeatureSetBindingType)) + fieldNameMap["feature_set"] = "FeatureSet" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["filters"] = "Filters" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["plot_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(WidgetPlotConfigurationBindingType), reflect.TypeOf([]WidgetPlotConfiguration{}))) + fieldNameMap["plot_configs"] = "PlotConfigs" + fields["rowspan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rowspan"] = "Rowspan" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["show_header"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_header"] = "ShowHeader" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.multi_widget_configuration", fields, reflect.TypeOf(MultiWidgetConfiguration{}), fieldNameMap, validators) +} + +func NDRAAdvertisedRouteBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["route_lifetime"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["route_lifetime"] = "RouteLifetime" + fields["route_preference"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["route_preference"] = "RoutePreference" + fields["subnet"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["subnet"] = "Subnet" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NDRA_advertised_route", fields, reflect.TypeOf(NDRAAdvertisedRoute{}), fieldNameMap, validators) +} + +func NDRAPrefixConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["network_prefix"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network_prefix"] = "NetworkPrefix" + fields["prefix_preferred_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["prefix_preferred_time"] = "PrefixPreferredTime" + fields["prefix_valid_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["prefix_valid_time"] = "PrefixValidTime" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NDRA_prefix_config", fields, reflect.TypeOf(NDRAPrefixConfig{}), fieldNameMap, validators) +} + +func NDRAProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["dns_config"] = bindings.NewOptionalType(bindings.NewReferenceType(RaDNSConfigBindingType)) + fieldNameMap["dns_config"] = "DnsConfig" + fields["ndra_advertised_route"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NDRAAdvertisedRouteBindingType), reflect.TypeOf([]NDRAAdvertisedRoute{}))) + fieldNameMap["ndra_advertised_route"] = "NdraAdvertisedRoute" + fields["ra_config"] = bindings.NewOptionalType(bindings.NewReferenceType(RAConfigBindingType)) + fieldNameMap["ra_config"] = "RaConfig" + fields["ra_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ra_mode"] = "RaMode" + fields["reachable_timer"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["reachable_timer"] = "ReachableTimer" + fields["retransmit_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["retransmit_interval"] = "RetransmitInterval" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NDRA_profile", fields, reflect.TypeOf(NDRAProfile{}), fieldNameMap, validators) +} + +func NDRAProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NDRAProfileBindingType), reflect.TypeOf([]NDRAProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NDRA_profile_list_result", fields, reflect.TypeOf(NDRAProfileListResult{}), fieldNameMap, validators) +} + +func NSAttributesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["attributes_data"] = bindings.NewOptionalType(bindings.NewReferenceType(NSAttributesDataBindingType)) + fieldNameMap["attributes_data"] = "AttributesData" + fields["sub_attributes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NSAttributesDataBindingType), reflect.TypeOf([]NSAttributesData{}))) + fieldNameMap["sub_attributes"] = "SubAttributes" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NS_attributes", fields, reflect.TypeOf(NSAttributes{}), fieldNameMap, validators) +} + +func NSAttributesDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["attribute_source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["attribute_source"] = "AttributeSource" + fields["datatype"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["datatype"] = "Datatype" + fields["key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key"] = "Key" + fields["value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NS_attributes_data", fields, reflect.TypeOf(NSAttributesData{}), fieldNameMap, validators) +} + +func NSGroupBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["member_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["member_count"] = "MemberCount" + fields["members"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NSGroupSimpleExpressionBindingType), reflect.TypeOf([]NSGroupSimpleExpression{}))) + fieldNameMap["members"] = "Members" + fields["membership_criteria"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(NSGroupExpressionBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["membership_criteria"] = "MembershipCriteria" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NS_group", fields, reflect.TypeOf(NSGroup{}), fieldNameMap, validators) +} + +func NSGroupComplexExpressionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["expressions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(NSGroupExpressionBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["expressions"] = "Expressions" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NS_group_complex_expression", fields, reflect.TypeOf(NSGroupComplexExpression{}), fieldNameMap, validators) +} + +func NSGroupExpressionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NS_group_expression", fields, reflect.TypeOf(NSGroupExpression{}), fieldNameMap, validators) +} + +func NSGroupExpressionListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["members"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(NSGroupExpressionBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["members"] = "Members" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NS_group_expression_list", fields, reflect.TypeOf(NSGroupExpressionList{}), fieldNameMap, validators) +} + +func NSGroupInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["nsgroup"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["nsgroup"] = "Nsgroup" + fields["nsgroup_policy_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nsgroup_policy_path"] = "NsgroupPolicyPath" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NS_group_info", fields, reflect.TypeOf(NSGroupInfo{}), fieldNameMap, validators) +} + +func NSGroupListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NSGroupBindingType), reflect.TypeOf([]NSGroup{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NS_group_list_result", fields, reflect.TypeOf(NSGroupListResult{}), fieldNameMap, validators) +} + +func NSGroupSimpleExpressionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["op"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["op"] = "Op" + fields["target_property"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_property"] = "TargetProperty" + fields["target_resource"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["target_resource"] = "TargetResource" + fields["target_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_type"] = "TargetType" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NS_group_simple_expression", fields, reflect.TypeOf(NSGroupSimpleExpression{}), fieldNameMap, validators) +} + +func NSGroupTagExpressionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["scope"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scope"] = "Scope" + fields["scope_op"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scope_op"] = "ScopeOp" + fields["tag"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tag"] = "Tag" + fields["tag_op"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tag_op"] = "TagOp" + fields["target_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_type"] = "TargetType" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NS_group_tag_expression", fields, reflect.TypeOf(NSGroupTagExpression{}), fieldNameMap, validators) +} + +func NSProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["is_valid"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_valid"] = "IsValid" + fields["nsprofile_attribute"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NSAttributesBindingType), reflect.TypeOf([]NSAttributes{}))) + fieldNameMap["nsprofile_attribute"] = "NsprofileAttribute" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NS_profile", fields, reflect.TypeOf(NSProfile{}), fieldNameMap, validators) +} + +func NSProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NSProfileBindingType), reflect.TypeOf([]NSProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NS_profile_list_result", fields, reflect.TypeOf(NSProfileListResult{}), fieldNameMap, validators) +} + +func NSServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["default_service"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["default_service"] = "DefaultService" + fields["nsservice_element"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(NSServiceElementBindingType)}, bindings.REST)) + fieldNameMap["nsservice_element"] = "NsserviceElement" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NS_service", fields, reflect.TypeOf(NSService{}), fieldNameMap, validators) +} + +func NSServiceElementBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NS_service_element", fields, reflect.TypeOf(NSServiceElement{}), fieldNameMap, validators) +} + +func NSServiceGroupBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["default_service"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["default_service"] = "DefaultService" + fields["members"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["members"] = "Members" + fields["service_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_type"] = "ServiceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NS_service_group", fields, reflect.TypeOf(NSServiceGroup{}), fieldNameMap, validators) +} + +func NSServiceGroupListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NSServiceGroupBindingType), reflect.TypeOf([]NSServiceGroup{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NS_service_group_list_result", fields, reflect.TypeOf(NSServiceGroupListResult{}), fieldNameMap, validators) +} + +func NSServiceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NSServiceBindingType), reflect.TypeOf([]NSService{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NS_service_list_result", fields, reflect.TypeOf(NSServiceListResult{}), fieldNameMap, validators) +} + +func NSSupportedAttributeTypesResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["attribute_types"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["attribute_types"] = "AttributeTypes" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NS_supported_attribute_types_result", fields, reflect.TypeOf(NSSupportedAttributeTypesResult{}), fieldNameMap, validators) +} + +func NSSupportedAttributesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_attributes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NSAttributesBindingType), reflect.TypeOf([]NSAttributes{}))) + fieldNameMap["ns_attributes"] = "NsAttributes" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NS_supported_attributes", fields, reflect.TypeOf(NSSupportedAttributes{}), fieldNameMap, validators) +} + +func NSSupportedAttributesListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NSSupportedAttributesBindingType), reflect.TypeOf([]NSSupportedAttributes{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NS_supported_attributes_list_result", fields, reflect.TypeOf(NSSupportedAttributesListResult{}), fieldNameMap, validators) +} + +func NSXProfileReferenceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["is_valid"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_valid"] = "IsValid" + fields["target_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_display_name"] = "TargetDisplayName" + fields["target_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_id"] = "TargetId" + fields["target_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_type"] = "TargetType" + fields["profile_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["profile_type"] = "ProfileType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.NSX_profile_reference", fields, reflect.TypeOf(NSXProfileReference{}), fieldNameMap, validators) +} + +func NamedTeamingPolicyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UplinkBindingType), reflect.TypeOf([]Uplink{}))) + fieldNameMap["active_list"] = "ActiveList" + fields["policy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["policy"] = "Policy" + fields["rolling_order"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["rolling_order"] = "RollingOrder" + fields["standby_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UplinkBindingType), reflect.TypeOf([]Uplink{}))) + fieldNameMap["standby_list"] = "StandbyList" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.named_teaming_policy", fields, reflect.TypeOf(NamedTeamingPolicy{}), fieldNameMap, validators) +} + +func NatCountersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["active_sessions"] = "ActiveSessions" + fields["total_bytes"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_bytes"] = "TotalBytes" + fields["total_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_packets"] = "TotalPackets" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.nat_counters", fields, reflect.TypeOf(NatCounters{}), fieldNameMap, validators) +} + +func NatRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["applied_tos"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["applied_tos"] = "AppliedTos" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["firewall_match"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["firewall_match"] = "FirewallMatch" + fields["internal_rule_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["internal_rule_id"] = "InternalRuleId" + fields["logging"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["logging"] = "Logging" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["match_destination_network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_destination_network"] = "MatchDestinationNetwork" + fields["match_service"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(NSServiceElementBindingType)}, bindings.REST)) + fieldNameMap["match_service"] = "MatchService" + fields["match_source_network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["match_source_network"] = "MatchSourceNetwork" + fields["nat_pass"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["nat_pass"] = "NatPass" + fields["rule_priority"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rule_priority"] = "RulePriority" + fields["translated_network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["translated_network"] = "TranslatedNetwork" + fields["translated_ports"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["translated_ports"] = "TranslatedPorts" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.nat_rule", fields, reflect.TypeOf(NatRule{}), fieldNameMap, validators) +} + +func NatRuleListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NatRuleBindingType), reflect.TypeOf([]NatRule{}))) + fieldNameMap["rules"] = "Rules" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.nat_rule_list", fields, reflect.TypeOf(NatRuleList{}), fieldNameMap, validators) +} + +func NatRuleListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NatRuleBindingType), reflect.TypeOf([]NatRule{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.nat_rule_list_result", fields, reflect.TypeOf(NatRuleListResult{}), fieldNameMap, validators) +} + +func NatStatisticsPerLogicalRouterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["per_transport_node_statistics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NatStatisticsPerTransportNodeBindingType), reflect.TypeOf([]NatStatisticsPerTransportNode{}))) + fieldNameMap["per_transport_node_statistics"] = "PerTransportNodeStatistics" + fields["statistics_across_all_nodes"] = bindings.NewOptionalType(bindings.NewReferenceType(NatCountersBindingType)) + fieldNameMap["statistics_across_all_nodes"] = "StatisticsAcrossAllNodes" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.nat_statistics_per_logical_router", fields, reflect.TypeOf(NatStatisticsPerLogicalRouter{}), fieldNameMap, validators) +} + +func NatStatisticsPerRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["active_sessions"] = "ActiveSessions" + fields["total_bytes"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_bytes"] = "TotalBytes" + fields["total_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_packets"] = "TotalPackets" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["warning_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["warning_message"] = "WarningMessage" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.nat_statistics_per_rule", fields, reflect.TypeOf(NatStatisticsPerRule{}), fieldNameMap, validators) +} + +func NatStatisticsPerTransportNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_sessions"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["active_sessions"] = "ActiveSessions" + fields["total_bytes"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_bytes"] = "TotalBytes" + fields["total_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_packets"] = "TotalPackets" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.nat_statistics_per_transport_node", fields, reflect.TypeOf(NatStatisticsPerTransportNode{}), fieldNameMap, validators) +} + +func NdpHeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dst_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_ip"] = "DstIp" + fields["msg_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["msg_type"] = "MsgType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ndp_header", fields, reflect.TypeOf(NdpHeader{}), fieldNameMap, validators) +} + +func NeighborPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["capabilities"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["capabilities"] = "Capabilities" + fields["enabled_capabilities"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["enabled_capabilities"] = "EnabledCapabilities" + fields["ifindex"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ifindex"] = "Ifindex" + fields["link_aggregation_capable"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["link_aggregation_capable"] = "LinkAggregationCapable" + fields["link_aggregation_port_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["link_aggregation_port_id"] = "LinkAggregationPortId" + fields["link_aggregation_status"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["link_aggregation_status"] = "LinkAggregationStatus" + fields["mac"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac"] = "Mac" + fields["mgmt_addr"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mgmt_addr"] = "MgmtAddr" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["oid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["oid"] = "Oid" + fields["port_desc"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["port_desc"] = "PortDesc" + fields["system_desc"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["system_desc"] = "SystemDesc" + fields["system_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["system_name"] = "SystemName" + fields["system_port_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["system_port_number"] = "SystemPortNumber" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.neighbor_properties", fields, reflect.TypeOf(NeighborProperties{}), fieldNameMap, validators) +} + +func NetworkErrorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_code"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_code"] = "ErrorCode" + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["spec"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["spec"] = "Spec" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.network_error", fields, reflect.TypeOf(NetworkError{}), fieldNameMap, validators) +} + +func NewRoleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["new_role_description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["new_role_description"] = "NewRoleDescription" + fields["new_role_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["new_role_id"] = "NewRoleId" + fields["new_role_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["new_role_name"] = "NewRoleName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.new_role", fields, reflect.TypeOf(NewRole{}), fieldNameMap, validators) +} + +func NextHopPrefixListsMappingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["next_hop"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["next_hop"] = "NextHop" + fields["prefix_lists"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["prefix_lists"] = "PrefixLists" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.next_hop_prefix_lists_mapping", fields, reflect.TypeOf(NextHopPrefixListsMapping{}), fieldNameMap, validators) +} + +func NicInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["gateway_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["gateway_address"] = "GatewayAddress" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["ip_allocation_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_allocation_type"] = "IpAllocationType" + fields["ip_pool_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_pool_id"] = "IpPoolId" + fields["network_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network_id"] = "NetworkId" + fields["nic_metadata"] = bindings.NewOptionalType(bindings.NewReferenceType(NicMetadataBindingType)) + fieldNameMap["nic_metadata"] = "NicMetadata" + fields["subnet_mask"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["subnet_mask"] = "SubnetMask" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.nic_info", fields, reflect.TypeOf(NicInfo{}), fieldNameMap, validators) +} + +func NicMetadataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["interface_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interface_index"] = "InterfaceIndex" + fields["interface_label"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["interface_label"] = "InterfaceLabel" + fields["interface_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["interface_type"] = "InterfaceType" + fields["transports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["transports"] = "Transports" + fields["user_configurable"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["user_configurable"] = "UserConfigurable" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.nic_metadata", fields, reflect.TypeOf(NicMetadata{}), fieldNameMap, validators) +} + +func NiocProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["host_infra_traffic_res"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceAllocationBindingType), reflect.TypeOf([]ResourceAllocation{}))) + fieldNameMap["host_infra_traffic_res"] = "HostInfraTrafficRes" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["required_capabilities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["required_capabilities"] = "RequiredCapabilities" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.nioc_profile", fields, reflect.TypeOf(NiocProfile{}), fieldNameMap, validators) +} + +func NodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["discovered_ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["discovered_ip_addresses"] = "DiscoveredIpAddresses" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["fqdn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["fqdn"] = "Fqdn" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node", fields, reflect.TypeOf(Node{}), fieldNameMap, validators) +} + +func NodeAsyncReplicatorServicePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["service_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_name"] = "ServiceName" + fields["service_properties"] = bindings.NewOptionalType(bindings.NewReferenceType(LoggingServicePropertiesBindingType)) + fieldNameMap["service_properties"] = "ServiceProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_async_replicator_service_properties", fields, reflect.TypeOf(NodeAsyncReplicatorServiceProperties{}), fieldNameMap, validators) +} + +func NodeAuthProviderVidmPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["client_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["client_id"] = "ClientId" + fields["client_secret"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["client_secret"] = "ClientSecret" + fields["host_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_name"] = "HostName" + fields["lb_enable"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["lb_enable"] = "LbEnable" + fields["node_host_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_host_name"] = "NodeHostName" + fields["thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["thumbprint"] = "Thumbprint" + fields["vidm_enable"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["vidm_enable"] = "VidmEnable" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_auth_provider_vidm_properties", fields, reflect.TypeOf(NodeAuthProviderVidmProperties{}), fieldNameMap, validators) +} + +func NodeAuthProviderVidmStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["runtime_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["runtime_state"] = "RuntimeState" + fields["vidm_enable"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["vidm_enable"] = "VidmEnable" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_auth_provider_vidm_status", fields, reflect.TypeOf(NodeAuthProviderVidmStatus{}), fieldNameMap, validators) +} + +func NodeCapabilitiesResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["capabilities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeCapabilityBindingType), reflect.TypeOf([]NodeCapability{}))) + fieldNameMap["capabilities"] = "Capabilities" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_capabilities_result", fields, reflect.TypeOf(NodeCapabilitiesResult{}), fieldNameMap, validators) +} + +func NodeCapabilityBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key"] = "Key" + fields["provider"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["provider"] = "Provider" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + fields["version"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["version"] = "Version" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_capability", fields, reflect.TypeOf(NodeCapability{}), fieldNameMap, validators) +} + +func NodeCertificateInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["certificate"] = "Certificate" + fields["certificate_sha256_thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["certificate_sha256_thumbprint"] = "CertificateSha256Thumbprint" + fields["entity_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["entity_type"] = "EntityType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_certificate_info", fields, reflect.TypeOf(NodeCertificateInfo{}), fieldNameMap, validators) +} + +func NodeEntityInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["entity_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["entity_type"] = "EntityType" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_entity_info", fields, reflect.TypeOf(NodeEntityInfo{}), fieldNameMap, validators) +} + +func NodeFileSystemPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_system"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_system"] = "FileSystem" + fields["mount"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mount"] = "Mount" + fields["total"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total"] = "Total" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + fields["used"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["used"] = "Used" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_file_system_properties", fields, reflect.TypeOf(NodeFileSystemProperties{}), fieldNameMap, validators) +} + +func NodeHttpServicePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["service_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_name"] = "ServiceName" + fields["service_properties"] = bindings.NewOptionalType(bindings.NewReferenceType(HttpServicePropertiesBindingType)) + fieldNameMap["service_properties"] = "ServiceProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_http_service_properties", fields, reflect.TypeOf(NodeHttpServiceProperties{}), fieldNameMap, validators) +} + +func NodeIdServicesMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fields["service_types"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["service_types"] = "ServiceTypes" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_id_services_map", fields, reflect.TypeOf(NodeIdServicesMap{}), fieldNameMap, validators) +} + +func NodeInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["component_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_version"] = "ComponentVersion" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_info", fields, reflect.TypeOf(NodeInfo{}), fieldNameMap, validators) +} + +func NodeInfoListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeInfoBindingType), reflect.TypeOf([]NodeInfo{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_info_list_result", fields, reflect.TypeOf(NodeInfoListResult{}), fieldNameMap, validators) +} + +func NodeInstallUpgradeServicePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["service_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_name"] = "ServiceName" + fields["service_properties"] = bindings.NewOptionalType(bindings.NewReferenceType(InstallUpgradeServicePropertiesBindingType)) + fieldNameMap["service_properties"] = "ServiceProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_install_upgrade_service_properties", fields, reflect.TypeOf(NodeInstallUpgradeServiceProperties{}), fieldNameMap, validators) +} + +func NodeInterSiteStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["stats_per_site"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RemoteTunnelStatisticsPerSiteBindingType), reflect.TypeOf([]RemoteTunnelStatisticsPerSite{}))) + fieldNameMap["stats_per_site"] = "StatsPerSite" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_inter_site_statistics", fields, reflect.TypeOf(NodeInterSiteStatistics{}), fieldNameMap, validators) +} + +func NodeInterfaceAliasBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["broadcast_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["broadcast_address"] = "BroadcastAddress" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["ip_configuration"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_configuration"] = "IpConfiguration" + fields["netmask"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["netmask"] = "Netmask" + fields["physical_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["physical_address"] = "PhysicalAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_interface_alias", fields, reflect.TypeOf(NodeInterfaceAlias{}), fieldNameMap, validators) +} + +func NodeInterfacePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["admin_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["admin_status"] = "AdminStatus" + fields["backing_nsx_managed"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["backing_nsx_managed"] = "BackingNsxManaged" + fields["connected_switch"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connected_switch"] = "ConnectedSwitch" + fields["connected_switch_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connected_switch_type"] = "ConnectedSwitchType" + fields["device"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["device"] = "Device" + fields["driver"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["driver"] = "Driver" + fields["ens_capable"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ens_capable"] = "EnsCapable" + fields["ens_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ens_enabled"] = "EnsEnabled" + fields["ens_interrupt_capable"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ens_interrupt_capable"] = "EnsInterruptCapable" + fields["ens_interrupt_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ens_interrupt_enabled"] = "EnsInterruptEnabled" + fields["host_managed"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["host_managed"] = "HostManaged" + fields["interface_alias"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeInterfaceAliasBindingType), reflect.TypeOf([]NodeInterfaceAlias{}))) + fieldNameMap["interface_alias"] = "InterfaceAlias" + fields["interface_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["interface_id"] = "InterfaceId" + fields["interface_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["interface_type"] = "InterfaceType" + fields["interface_uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["interface_uuid"] = "InterfaceUuid" + fields["key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key"] = "Key" + fields["link_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["link_status"] = "LinkStatus" + fields["lport_attachment_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_attachment_id"] = "LportAttachmentId" + fields["mtu"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mtu"] = "Mtu" + fields["pci"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pci"] = "Pci" + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_interface_properties", fields, reflect.TypeOf(NodeInterfaceProperties{}), fieldNameMap, validators) +} + +func NodeInterfacePropertiesListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeInterfacePropertiesBindingType), reflect.TypeOf([]NodeInterfaceProperties{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_interface_properties_list_result", fields, reflect.TypeOf(NodeInterfacePropertiesListResult{}), fieldNameMap, validators) +} + +func NodeInterfaceStatisticsPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["interface_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["interface_id"] = "InterfaceId" + fields["rx_bytes"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rx_bytes"] = "RxBytes" + fields["rx_dropped"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rx_dropped"] = "RxDropped" + fields["rx_errors"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rx_errors"] = "RxErrors" + fields["rx_frame"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rx_frame"] = "RxFrame" + fields["rx_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rx_packets"] = "RxPackets" + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source"] = "Source" + fields["tx_bytes"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tx_bytes"] = "TxBytes" + fields["tx_carrier"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tx_carrier"] = "TxCarrier" + fields["tx_colls"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tx_colls"] = "TxColls" + fields["tx_dropped"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tx_dropped"] = "TxDropped" + fields["tx_errors"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tx_errors"] = "TxErrors" + fields["tx_packets"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tx_packets"] = "TxPackets" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_interface_statistics_properties", fields, reflect.TypeOf(NodeInterfaceStatisticsProperties{}), fieldNameMap, validators) +} + +func NodeLogPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_modified_time"] = "LastModifiedTime" + fields["log_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["log_name"] = "LogName" + fields["log_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["log_size"] = "LogSize" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_log_properties", fields, reflect.TypeOf(NodeLogProperties{}), fieldNameMap, validators) +} + +func NodeLogPropertiesListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeLogPropertiesBindingType), reflect.TypeOf([]NodeLogProperties{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_log_properties_list_result", fields, reflect.TypeOf(NodeLogPropertiesListResult{}), fieldNameMap, validators) +} + +func NodeMessagingClientInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["clients"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(MessagingClientInfoBindingType), reflect.TypeOf([]MessagingClientInfo{}))) + fieldNameMap["clients"] = "Clients" + fields["entity_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["entity_type"] = "EntityType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_messaging_client_info", fields, reflect.TypeOf(NodeMessagingClientInfo{}), fieldNameMap, validators) +} + +func NodeModeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mode_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mode_id"] = "ModeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_mode", fields, reflect.TypeOf(NodeMode{}), fieldNameMap, validators) +} + +func NodeNameServersPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["name_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["name_servers"] = "NameServers" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_name_servers_properties", fields, reflect.TypeOf(NodeNameServersProperties{}), fieldNameMap, validators) +} + +func NodeNetworkInterfacePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["admin_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["admin_status"] = "AdminStatus" + fields["bond_cur_active_slave"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["bond_cur_active_slave"] = "BondCurActiveSlave" + fields["bond_lacp_rate"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["bond_lacp_rate"] = "BondLacpRate" + fields["bond_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["bond_mode"] = "BondMode" + fields["bond_primary"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["bond_primary"] = "BondPrimary" + fields["bond_primary_slave"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["bond_primary_slave"] = "BondPrimarySlave" + fields["bond_slaves"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["bond_slaves"] = "BondSlaves" + fields["bond_xmit_hash_policy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["bond_xmit_hash_policy"] = "BondXmitHashPolicy" + fields["broadcast_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["broadcast_address"] = "BroadcastAddress" + fields["default_gateway"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["default_gateway"] = "DefaultGateway" + fields["interface_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["interface_id"] = "InterfaceId" + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPv4AddressPropertiesBindingType), reflect.TypeOf([]IPv4AddressProperties{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["ip_configuration"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_configuration"] = "IpConfiguration" + fields["is_kni"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_kni"] = "IsKni" + fields["link_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["link_status"] = "LinkStatus" + fields["mtu"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mtu"] = "Mtu" + fields["physical_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["physical_address"] = "PhysicalAddress" + fields["plane"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["plane"] = "Plane" + fields["vlan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vlan"] = "Vlan" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_network_interface_properties", fields, reflect.TypeOf(NodeNetworkInterfaceProperties{}), fieldNameMap, validators) +} + +func NodeNetworkInterfacePropertiesListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeNetworkInterfacePropertiesBindingType), reflect.TypeOf([]NodeNetworkInterfaceProperties{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_network_interface_properties_list_result", fields, reflect.TypeOf(NodeNetworkInterfacePropertiesListResult{}), fieldNameMap, validators) +} + +func NodeNetworkPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_network_properties", fields, reflect.TypeOf(NodeNetworkProperties{}), fieldNameMap, validators) +} + +func NodeNtpServicePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["service_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_name"] = "ServiceName" + fields["service_properties"] = bindings.NewOptionalType(bindings.NewReferenceType(NtpServicePropertiesBindingType)) + fieldNameMap["service_properties"] = "ServiceProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_ntp_service_properties", fields, reflect.TypeOf(NodeNtpServiceProperties{}), fieldNameMap, validators) +} + +func NodePolicyServicePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["service_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_name"] = "ServiceName" + fields["service_properties"] = bindings.NewOptionalType(bindings.NewReferenceType(LoggingServicePropertiesBindingType)) + fieldNameMap["service_properties"] = "ServiceProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_policy_service_properties", fields, reflect.TypeOf(NodePolicyServiceProperties{}), fieldNameMap, validators) +} + +func NodeProcessPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cpu_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cpu_time"] = "CpuTime" + fields["mem_resident"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mem_resident"] = "MemResident" + fields["mem_used"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mem_used"] = "MemUsed" + fields["pid"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["pid"] = "Pid" + fields["ppid"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ppid"] = "Ppid" + fields["process_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["process_name"] = "ProcessName" + fields["start_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["start_time"] = "StartTime" + fields["uptime"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["uptime"] = "Uptime" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_process_properties", fields, reflect.TypeOf(NodeProcessProperties{}), fieldNameMap, validators) +} + +func NodeProcessPropertiesListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeProcessPropertiesBindingType), reflect.TypeOf([]NodeProcessProperties{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_process_properties_list_result", fields, reflect.TypeOf(NodeProcessPropertiesListResult{}), fieldNameMap, validators) +} + +func NodePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cli_history_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cli_history_size"] = "CliHistorySize" + fields["cli_output_datetime"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["cli_output_datetime"] = "CliOutputDatetime" + fields["cli_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cli_timeout"] = "CliTimeout" + fields["export_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["export_type"] = "ExportType" + fields["fully_qualified_domain_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["fully_qualified_domain_name"] = "FullyQualifiedDomainName" + fields["hostname"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["hostname"] = "Hostname" + fields["kernel_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["kernel_version"] = "KernelVersion" + fields["node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_type"] = "NodeType" + fields["node_uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_uuid"] = "NodeUuid" + fields["node_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_version"] = "NodeVersion" + fields["product_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["product_version"] = "ProductVersion" + fields["system_datetime"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["system_datetime"] = "SystemDatetime" + fields["system_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["system_time"] = "SystemTime" + fields["timezone"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["timezone"] = "Timezone" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_properties", fields, reflect.TypeOf(NodeProperties{}), fieldNameMap, validators) +} + +func NodeProtonServicePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["service_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_name"] = "ServiceName" + fields["service_properties"] = bindings.NewOptionalType(bindings.NewReferenceType(LoggingServicePropertiesBindingType)) + fieldNameMap["service_properties"] = "ServiceProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_proton_service_properties", fields, reflect.TypeOf(NodeProtonServiceProperties{}), fieldNameMap, validators) +} + +func NodeRoutePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["destination"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["destination"] = "Destination" + fields["from_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["from_address"] = "FromAddress" + fields["gateway"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["gateway"] = "Gateway" + fields["interface_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["interface_id"] = "InterfaceId" + fields["metric"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["metric"] = "Metric" + fields["netmask"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["netmask"] = "Netmask" + fields["proto"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["proto"] = "Proto" + fields["route_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["route_id"] = "RouteId" + fields["route_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["route_type"] = "RouteType" + fields["scope"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scope"] = "Scope" + fields["src"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["src"] = "Src" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_route_properties", fields, reflect.TypeOf(NodeRouteProperties{}), fieldNameMap, validators) +} + +func NodeRoutePropertiesListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeRoutePropertiesBindingType), reflect.TypeOf([]NodeRouteProperties{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_route_properties_list_result", fields, reflect.TypeOf(NodeRoutePropertiesListResult{}), fieldNameMap, validators) +} + +func NodeRtepIpsConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["member_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["member_index"] = "MemberIndex" + fields["rtep_ips"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["rtep_ips"] = "RtepIps" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_rtep_ips_config", fields, reflect.TypeOf(NodeRtepIpsConfig{}), fieldNameMap, validators) +} + +func NodeSearchDomainsPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["search_domains"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["search_domains"] = "SearchDomains" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_search_domains_properties", fields, reflect.TypeOf(NodeSearchDomainsProperties{}), fieldNameMap, validators) +} + +func NodeServicePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["service_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_name"] = "ServiceName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_service_properties", fields, reflect.TypeOf(NodeServiceProperties{}), fieldNameMap, validators) +} + +func NodeServicePropertiesListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeServicePropertiesBindingType), reflect.TypeOf([]NodeServiceProperties{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_service_properties_list_result", fields, reflect.TypeOf(NodeServicePropertiesListResult{}), fieldNameMap, validators) +} + +func NodeServiceStatusPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["health"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["health"] = "Health" + fields["monitor_pid"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["monitor_pid"] = "MonitorPid" + fields["monitor_runtime_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["monitor_runtime_state"] = "MonitorRuntimeState" + fields["pids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewIntegerType(), reflect.TypeOf([]int64{}))) + fieldNameMap["pids"] = "Pids" + fields["reason"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["reason"] = "Reason" + fields["runtime_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["runtime_state"] = "RuntimeState" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_service_status_properties", fields, reflect.TypeOf(NodeServiceStatusProperties{}), fieldNameMap, validators) +} + +func NodeSnmpServicePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["service_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_name"] = "ServiceName" + fields["service_properties"] = bindings.NewOptionalType(bindings.NewReferenceType(SnmpServicePropertiesBindingType)) + fieldNameMap["service_properties"] = "ServiceProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_snmp_service_properties", fields, reflect.TypeOf(NodeSnmpServiceProperties{}), fieldNameMap, validators) +} + +func NodeSnmpV3EngineIDBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["service_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_name"] = "ServiceName" + fields["v3_engine_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["v3_engine_id"] = "V3EngineId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_snmp_v3_engine_ID", fields, reflect.TypeOf(NodeSnmpV3EngineID{}), fieldNameMap, validators) +} + +func NodeSshServicePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["service_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_name"] = "ServiceName" + fields["service_properties"] = bindings.NewOptionalType(bindings.NewReferenceType(SshServicePropertiesBindingType)) + fieldNameMap["service_properties"] = "ServiceProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_ssh_service_properties", fields, reflect.TypeOf(NodeSshServiceProperties{}), fieldNameMap, validators) +} + +func NodeStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["host_node_deployment_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_node_deployment_status"] = "HostNodeDeploymentStatus" + fields["inventory_sync_paused"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["inventory_sync_paused"] = "InventorySyncPaused" + fields["inventory_sync_reenable_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["inventory_sync_reenable_time"] = "InventorySyncReenableTime" + fields["last_heartbeat_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_heartbeat_timestamp"] = "LastHeartbeatTimestamp" + fields["last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_sync_time"] = "LastSyncTime" + fields["lcp_connectivity_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lcp_connectivity_status"] = "LcpConnectivityStatus" + fields["lcp_connectivity_status_details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ControlConnStatusBindingType), reflect.TypeOf([]ControlConnStatus{}))) + fieldNameMap["lcp_connectivity_status_details"] = "LcpConnectivityStatusDetails" + fields["maintenance_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["maintenance_mode"] = "MaintenanceMode" + fields["mpa_connectivity_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mpa_connectivity_status"] = "MpaConnectivityStatus" + fields["mpa_connectivity_status_details"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mpa_connectivity_status_details"] = "MpaConnectivityStatusDetails" + fields["software_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["software_version"] = "SoftwareVersion" + fields["system_status"] = bindings.NewOptionalType(bindings.NewReferenceType(NodeStatusPropertiesBindingType)) + fieldNameMap["system_status"] = "SystemStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_status", fields, reflect.TypeOf(NodeStatus{}), fieldNameMap, validators) +} + +func NodeStatusPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cpu_cores"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cpu_cores"] = "CpuCores" + fields["cpu_usage"] = bindings.NewOptionalType(bindings.NewReferenceType(CpuUsageBindingType)) + fieldNameMap["cpu_usage"] = "CpuUsage" + fields["disk_space_total"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["disk_space_total"] = "DiskSpaceTotal" + fields["disk_space_used"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["disk_space_used"] = "DiskSpaceUsed" + fields["dpdk_cpu_cores"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dpdk_cpu_cores"] = "DpdkCpuCores" + fields["edge_mem_usage"] = bindings.NewOptionalType(bindings.NewReferenceType(EdgeTransportNodeMemoryUsageBindingType)) + fieldNameMap["edge_mem_usage"] = "EdgeMemUsage" + fields["file_systems"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeFileSystemPropertiesBindingType), reflect.TypeOf([]NodeFileSystemProperties{}))) + fieldNameMap["file_systems"] = "FileSystems" + fields["hostname"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["hostname"] = "Hostname" + fields["load_average"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDoubleType(), reflect.TypeOf([]float64{}))) + fieldNameMap["load_average"] = "LoadAverage" + fields["mem_cache"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mem_cache"] = "MemCache" + fields["mem_total"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mem_total"] = "MemTotal" + fields["mem_used"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mem_used"] = "MemUsed" + fields["non_dpdk_cpu_cores"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["non_dpdk_cpu_cores"] = "NonDpdkCpuCores" + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source"] = "Source" + fields["swap_total"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["swap_total"] = "SwapTotal" + fields["swap_used"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["swap_used"] = "SwapUsed" + fields["system_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["system_time"] = "SystemTime" + fields["uptime"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["uptime"] = "Uptime" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_status_properties", fields, reflect.TypeOf(NodeStatusProperties{}), fieldNameMap, validators) +} + +func NodeSummaryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["component_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_version"] = "ComponentVersion" + fields["node_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["node_count"] = "NodeCount" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + fields["upgrade_unit_subtype"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["upgrade_unit_subtype"] = "UpgradeUnitSubtype" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_summary", fields, reflect.TypeOf(NodeSummary{}), fieldNameMap, validators) +} + +func NodeSummaryListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeSummaryBindingType), reflect.TypeOf([]NodeSummary{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_summary_list", fields, reflect.TypeOf(NodeSummaryList{}), fieldNameMap, validators) +} + +func NodeSyslogExporterPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["exporter_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["exporter_name"] = "ExporterName" + fields["facilities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["facilities"] = "Facilities" + fields["level"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["level"] = "Level" + fields["msgids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["msgids"] = "Msgids" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["protocol"] = "Protocol" + fields["server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server"] = "Server" + fields["structured_data"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["structured_data"] = "StructuredData" + fields["tls_ca_pem"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tls_ca_pem"] = "TlsCaPem" + fields["tls_cert_pem"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tls_cert_pem"] = "TlsCertPem" + fields["tls_client_ca_pem"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tls_client_ca_pem"] = "TlsClientCaPem" + fields["tls_key_pem"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tls_key_pem"] = "TlsKeyPem" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_syslog_exporter_properties", fields, reflect.TypeOf(NodeSyslogExporterProperties{}), fieldNameMap, validators) +} + +func NodeSyslogExporterPropertiesListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeSyslogExporterPropertiesBindingType), reflect.TypeOf([]NodeSyslogExporterProperties{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_syslog_exporter_properties_list_result", fields, reflect.TypeOf(NodeSyslogExporterPropertiesListResult{}), fieldNameMap, validators) +} + +func NodeTimeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["system_datetime"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["system_datetime"] = "SystemDatetime" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_time", fields, reflect.TypeOf(NodeTime{}), fieldNameMap, validators) +} + +func NodeUserPasswordPropertyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_user_password_property", fields, reflect.TypeOf(NodeUserPasswordProperty{}), fieldNameMap, validators) +} + +func NodeUserPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["full_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["full_name"] = "FullName" + fields["last_password_change"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_password_change"] = "LastPasswordChange" + fields["old_password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["old_password"] = "OldPassword" + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["password_change_frequency"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["password_change_frequency"] = "PasswordChangeFrequency" + fields["password_reset_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["password_reset_required"] = "PasswordResetRequired" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["userid"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["userid"] = "Userid" + fields["username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["username"] = "Username" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_user_properties", fields, reflect.TypeOf(NodeUserProperties{}), fieldNameMap, validators) +} + +func NodeUserPropertiesListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeUserPropertiesBindingType), reflect.TypeOf([]NodeUserProperties{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_user_properties_list_result", fields, reflect.TypeOf(NodeUserPropertiesListResult{}), fieldNameMap, validators) +} + +func NodeUserSettingsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["audit_password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["audit_password"] = "AuditPassword" + fields["audit_username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["audit_username"] = "AuditUsername" + fields["cli_password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cli_password"] = "CliPassword" + fields["cli_username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cli_username"] = "CliUsername" + fields["root_password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["root_password"] = "RootPassword" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_user_settings", fields, reflect.TypeOf(NodeUserSettings{}), fieldNameMap, validators) +} + +func NodeVersionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_version"] = "NodeVersion" + fields["product_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["product_version"] = "ProductVersion" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.node_version", fields, reflect.TypeOf(NodeVersion{}), fieldNameMap, validators) +} + +func NormalizedResourceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.normalized_resource_list_result", fields, reflect.TypeOf(NormalizedResourceListResult{}), fieldNameMap, validators) +} + +func NotificationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["notification_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["notification_id"] = "NotificationId" + fields["uri_filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["uri_filters"] = "UriFilters" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.notification", fields, reflect.TypeOf(Notification{}), fieldNameMap, validators) +} + +func NotificationAuthenticationSchemeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["certificate_id"] = "CertificateId" + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["scheme_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scheme_name"] = "SchemeName" + fields["username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["username"] = "Username" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.notification_authentication_scheme", fields, reflect.TypeOf(NotificationAuthenticationScheme{}), fieldNameMap, validators) +} + +func NotificationWatcherBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["authentication_scheme"] = bindings.NewOptionalType(bindings.NewReferenceType(NotificationAuthenticationSchemeBindingType)) + fieldNameMap["authentication_scheme"] = "AuthenticationScheme" + fields["certificate_sha256_thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["certificate_sha256_thumbprint"] = "CertificateSha256Thumbprint" + fields["max_send_uri_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_send_uri_count"] = "MaxSendUriCount" + fields["method"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["method"] = "Method" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["send_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["send_interval"] = "SendInterval" + fields["send_timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["send_timeout"] = "SendTimeout" + fields["server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server"] = "Server" + fields["uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uri"] = "Uri" + fields["use_https"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["use_https"] = "UseHttps" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.notification_watcher", fields, reflect.TypeOf(NotificationWatcher{}), fieldNameMap, validators) +} + +func NotificationWatcherListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NotificationWatcherBindingType), reflect.TypeOf([]NotificationWatcher{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.notification_watcher_list_result", fields, reflect.TypeOf(NotificationWatcherListResult{}), fieldNameMap, validators) +} + +func NotificationsListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["notifications"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NotificationBindingType), reflect.TypeOf([]Notification{}))) + fieldNameMap["notifications"] = "Notifications" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.notifications_list", fields, reflect.TypeOf(NotificationsList{}), fieldNameMap, validators) +} + +func NsxRoleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["permissions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["permissions"] = "Permissions" + fields["role"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["role"] = "Role" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.nsx_role", fields, reflect.TypeOf(NsxRole{}), fieldNameMap, validators) +} + +func NsxtSiteBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["federation_site_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["federation_site_display_name"] = "FederationSiteDisplayName" + fields["federation_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["federation_site_id"] = "FederationSiteId" + fields["federation_site_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["federation_site_type"] = "FederationSiteType" + fields["nsxt_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nsxt_ip"] = "NsxtIp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.nsxt_site", fields, reflect.TypeOf(NsxtSite{}), fieldNameMap, validators) +} + +func NsxtSiteToAviMappingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["avi_lb_endpoint"] = bindings.NewOptionalType(bindings.NewReferenceType(AviEndPointBindingType)) + fieldNameMap["avi_lb_endpoint"] = "AviLbEndpoint" + fields["federation_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["federation_site_id"] = "FederationSiteId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.nsxt_site_to_avi_mapping", fields, reflect.TypeOf(NsxtSiteToAviMapping{}), fieldNameMap, validators) +} + +func NtpPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["servers"] = "Servers" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ntp_properties", fields, reflect.TypeOf(NtpProperties{}), fieldNameMap, validators) +} + +func NtpServicePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["servers"] = "Servers" + fields["start_on_boot"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["start_on_boot"] = "StartOnBoot" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ntp_service_properties", fields, reflect.TypeOf(NtpServiceProperties{}), fieldNameMap, validators) +} + +func NvdsUpgradeConfigIssueBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["component"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component"] = "Component" + fields["error"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error"] = "Error_" + fields["objid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["objid"] = "Objid" + fields["recommendation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["recommendation"] = "Recommendation" + fields["warning"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["warning"] = "Warning" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.nvds_upgrade_config_issue", fields, reflect.TypeOf(NvdsUpgradeConfigIssue{}), fieldNameMap, validators) +} + +func NvdsUpgradeHostStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["dn_ext_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dn_ext_id"] = "DnExtId" + fields["host"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host"] = "Host" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["overall_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["overall_state"] = "OverallState" + fields["state_details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["state_details"] = "StateDetails" + fields["upgrade_stage"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["upgrade_stage"] = "UpgradeStage" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.nvds_upgrade_host_state", fields, reflect.TypeOf(NvdsUpgradeHostState{}), fieldNameMap, validators) +} + +func NvdsUpgradePrecheckIdBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["precheck_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["precheck_id"] = "PrecheckId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.nvds_upgrade_precheck_id", fields, reflect.TypeOf(NvdsUpgradePrecheckId{}), fieldNameMap, validators) +} + +func NvdsUpgradeStatusSummaryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["migration_state"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NvdsUpgradeHostStateBindingType), reflect.TypeOf([]NvdsUpgradeHostState{}))) + fieldNameMap["migration_state"] = "MigrationState" + fields["precheck_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["precheck_id"] = "PrecheckId" + fields["precheck_issue"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NvdsUpgradeConfigIssueBindingType), reflect.TypeOf([]NvdsUpgradeConfigIssue{}))) + fieldNameMap["precheck_issue"] = "PrecheckIssue" + fields["precheck_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["precheck_status"] = "PrecheckStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.nvds_upgrade_status_summary", fields, reflect.TypeOf(NvdsUpgradeStatusSummary{}), fieldNameMap, validators) +} + +func NvdsUpgradeTopologyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["compute_manager_topology"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ComputeManagerTopologyBindingType), reflect.TypeOf([]ComputeManagerTopology{}))) + fieldNameMap["compute_manager_topology"] = "ComputeManagerTopology" + fields["nvds_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nvds_id"] = "NvdsId" + fields["nvds_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nvds_name"] = "NvdsName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.nvds_upgrade_topology", fields, reflect.TypeOf(NvdsUpgradeTopology{}), fieldNameMap, validators) +} + +func Oauth2CredentialsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["client_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["client_id"] = "ClientId" + fields["client_secret"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["client_secret"] = "ClientSecret" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.oauth2_credentials", fields, reflect.TypeOf(Oauth2Credentials{}), fieldNameMap, validators) +} + +func OidcEndPointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["authorization_endpoint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["authorization_endpoint"] = "AuthorizationEndpoint" + fields["claims_supported"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["claims_supported"] = "ClaimsSupported" + fields["issuer"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["issuer"] = "Issuer" + fields["jwks_uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["jwks_uri"] = "JwksUri" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["oidc_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["oidc_type"] = "OidcType" + fields["oidc_uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["oidc_uri"] = "OidcUri" + fields["override_roles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["override_roles"] = "OverrideRoles" + fields["thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["thumbprint"] = "Thumbprint" + fields["token_endpoint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["token_endpoint"] = "TokenEndpoint" + fields["userinfo_endpoint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["userinfo_endpoint"] = "UserinfoEndpoint" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.oidc_end_point", fields, reflect.TypeOf(OidcEndPoint{}), fieldNameMap, validators) +} + +func OidcEndPointListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(OidcEndPointBindingType), reflect.TypeOf([]OidcEndPoint{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.oidc_end_point_list_result", fields, reflect.TypeOf(OidcEndPointListResult{}), fieldNameMap, validators) +} + +func OperationCollectorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["collector_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["collector_ip"] = "CollectorIp" + fields["collector_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["collector_port"] = "CollectorPort" + fields["collector_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["collector_type"] = "CollectorType" + fields["tracing_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tracing_port"] = "TracingPort" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.operation_collector", fields, reflect.TypeOf(OperationCollector{}), fieldNameMap, validators) +} + +func OperationCollectorGlobalConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["collectors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(OperationCollectorBindingType), reflect.TypeOf([]OperationCollector{}))) + fieldNameMap["collectors"] = "Collectors" + fields["report_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["report_interval"] = "ReportInterval" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.operation_collector_global_config", fields, reflect.TypeOf(OperationCollectorGlobalConfig{}), fieldNameMap, validators) +} + +func OrgInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["org_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["org_id"] = "OrgId" + fields["org_role"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["org_role"] = "OrgRole" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.org_info", fields, reflect.TypeOf(OrgInfo{}), fieldNameMap, validators) +} + +func OvfInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ovf_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ovf_name"] = "OvfName" + fields["version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["version"] = "Version" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ovf_info", fields, reflect.TypeOf(OvfInfo{}), fieldNameMap, validators) +} + +func OwnerResourceLinkBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["href"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["href"] = "Href" + fields["rel"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["rel"] = "Rel" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.owner_resource_link", fields, reflect.TypeOf(OwnerResourceLink{}), fieldNameMap, validators) +} + +func PackageLoggingLevelsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logging_level"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logging_level"] = "LoggingLevel" + fields["package_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["package_name"] = "PackageName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.package_logging_levels", fields, reflect.TypeOf(PackageLoggingLevels{}), fieldNameMap, validators) +} + +func PacketAddressClassifierBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + fields["vlan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vlan"] = "Vlan" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.packet_address_classifier", fields, reflect.TypeOf(PacketAddressClassifier{}), fieldNameMap, validators) +} + +func PacketCaptureOptionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.packet_capture_option", fields, reflect.TypeOf(PacketCaptureOption{}), fieldNameMap, validators) +} + +func PacketCaptureOptionListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["values"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PacketCaptureOptionBindingType), reflect.TypeOf([]PacketCaptureOption{}))) + fieldNameMap["values"] = "Values" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.packet_capture_option_list", fields, reflect.TypeOf(PacketCaptureOptionList{}), fieldNameMap, validators) +} + +func PacketCaptureRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["capamount"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["capamount"] = "Capamount" + fields["capcore"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["capcore"] = "Capcore" + fields["capduration"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["capduration"] = "Capduration" + fields["capfilesize"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["capfilesize"] = "Capfilesize" + fields["capmode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["capmode"] = "Capmode" + fields["cappoint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cappoint"] = "Cappoint" + fields["caprate"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["caprate"] = "Caprate" + fields["capsnaplen"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["capsnaplen"] = "Capsnaplen" + fields["capsource"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["capsource"] = "Capsource" + fields["capvalue"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["capvalue"] = "Capvalue" + fields["direction"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["direction"] = "Direction" + fields["filtertype"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filtertype"] = "Filtertype" + fields["node"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node"] = "Node" + fields["node_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_ip"] = "NodeIp" + fields["options"] = bindings.NewOptionalType(bindings.NewReferenceType(PacketCaptureOptionListBindingType)) + fieldNameMap["options"] = "Options" + fields["streamaddress"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["streamaddress"] = "Streamaddress" + fields["streamport"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["streamport"] = "Streamport" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.packet_capture_request", fields, reflect.TypeOf(PacketCaptureRequest{}), fieldNameMap, validators) +} + +func PacketCaptureSessionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["endtime"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["endtime"] = "Endtime" + fields["errormsg"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["errormsg"] = "Errormsg" + fields["filelocation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filelocation"] = "Filelocation" + fields["filesize"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["filesize"] = "Filesize" + fields["request"] = bindings.NewOptionalType(bindings.NewReferenceType(PacketCaptureRequestBindingType)) + fieldNameMap["request"] = "Request" + fields["sessionid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sessionid"] = "Sessionid" + fields["sessionname"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sessionname"] = "Sessionname" + fields["sessionstatus"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sessionstatus"] = "Sessionstatus" + fields["starttime"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["starttime"] = "Starttime" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.packet_capture_session", fields, reflect.TypeOf(PacketCaptureSession{}), fieldNameMap, validators) +} + +func PacketCaptureSessionListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PacketCaptureSessionBindingType), reflect.TypeOf([]PacketCaptureSession{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.packet_capture_session_list", fields, reflect.TypeOf(PacketCaptureSessionList{}), fieldNameMap, validators) +} + +func PacketDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["frame_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["frame_size"] = "FrameSize" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["routed"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["routed"] = "Routed" + fields["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_type"] = "TransportType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.packet_data", fields, reflect.TypeOf(PacketData{}), fieldNameMap, validators) +} + +func PacketNumberSamplingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["sampling_rate"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sampling_rate"] = "SamplingRate" + fields["sampling_type"] = bindings.NewStringType() + fieldNameMap["sampling_type"] = "SamplingType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.packet_number_sampling", fields, reflect.TypeOf(PacketNumberSampling{}), fieldNameMap, validators) +} + +func PacketTypeAndCounterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["counter"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["counter"] = "Counter" + fields["packet_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["packet_type"] = "PacketType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.packet_type_and_counter", fields, reflect.TypeOf(PacketTypeAndCounter{}), fieldNameMap, validators) +} + +func PacketsDroppedBySecurityBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bpdu_filter_dropped"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bpdu_filter_dropped"] = "BpduFilterDropped" + fields["dhcp_client_dropped_ipv4"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dhcp_client_dropped_ipv4"] = "DhcpClientDroppedIpv4" + fields["dhcp_client_dropped_ipv6"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dhcp_client_dropped_ipv6"] = "DhcpClientDroppedIpv6" + fields["dhcp_server_dropped_ipv4"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dhcp_server_dropped_ipv4"] = "DhcpServerDroppedIpv4" + fields["dhcp_server_dropped_ipv6"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dhcp_server_dropped_ipv6"] = "DhcpServerDroppedIpv6" + fields["spoof_guard_dropped"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PacketTypeAndCounterBindingType), reflect.TypeOf([]PacketTypeAndCounter{}))) + fieldNameMap["spoof_guard_dropped"] = "SpoofGuardDropped" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.packets_dropped_by_security", fields, reflect.TypeOf(PacketsDroppedBySecurity{}), fieldNameMap, validators) +} + +func PasswordAuthenticationSchemeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["scheme_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scheme_name"] = "SchemeName" + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["username"] = "Username" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.password_authentication_scheme", fields, reflect.TypeOf(PasswordAuthenticationScheme{}), fieldNameMap, validators) +} + +func PendingChangeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_id"] = "RequestId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.pending_change", fields, reflect.TypeOf(PendingChange{}), fieldNameMap, validators) +} + +func PerForwarderStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["domain_names"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["domain_names"] = "DomainNames" + fields["upstream_statistics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PerUpstreamServerStatisticsBindingType), reflect.TypeOf([]PerUpstreamServerStatistics{}))) + fieldNameMap["upstream_statistics"] = "UpstreamStatistics" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.per_forwarder_statistics", fields, reflect.TypeOf(PerForwarderStatistics{}), fieldNameMap, validators) +} + +func PerNodeDnsFailedQueriesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DnsFailedQueryBindingType), reflect.TypeOf([]DnsFailedQuery{}))) + fieldNameMap["results"] = "Results" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["timestamp"] = "Timestamp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.per_node_dns_failed_queries", fields, reflect.TypeOf(PerNodeDnsFailedQueries{}), fieldNameMap, validators) +} + +func PerNodeUsedCacheStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cached_entries"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cached_entries"] = "CachedEntries" + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fields["used_cache_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["used_cache_size"] = "UsedCacheSize" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.per_node_used_cache_statistics", fields, reflect.TypeOf(PerNodeUsedCacheStatistics{}), fieldNameMap, validators) +} + +func PerStepRestoreStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.per_step_restore_status", fields, reflect.TypeOf(PerStepRestoreStatus{}), fieldNameMap, validators) +} + +func PerUpstreamServerStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["queries_failed"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["queries_failed"] = "QueriesFailed" + fields["queries_succeeded"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["queries_succeeded"] = "QueriesSucceeded" + fields["upstream_server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["upstream_server"] = "UpstreamServer" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.per_upstream_server_statistics", fields, reflect.TypeOf(PerUpstreamServerStatistics{}), fieldNameMap, validators) +} + +func PhysicalServerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["os_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["os_type"] = "OsType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.physical_server", fields, reflect.TypeOf(PhysicalServer{}), fieldNameMap, validators) +} + +func PhysicalServerListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PhysicalServerBindingType), reflect.TypeOf([]PhysicalServer{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.physical_server_list_result", fields, reflect.TypeOf(PhysicalServerListResult{}), fieldNameMap, validators) +} + +func PktCapResourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["pktcap_file_download_url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pktcap_file_download_url"] = "PktcapFileDownloadUrl" + fields["port_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["port_id"] = "PortId" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.pkt_cap_resource", fields, reflect.TypeOf(PktCapResource{}), fieldNameMap, validators) +} + +func PktCapResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["pktcap_resource_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PktCapResourceBindingType), reflect.TypeOf([]PktCapResource{}))) + fieldNameMap["pktcap_resource_list"] = "PktcapResourceList" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fields["transport_node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_type"] = "TransportNodeType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.pkt_cap_result", fields, reflect.TypeOf(PktCapResult{}), fieldNameMap, validators) +} + +func PktcapActionArgumentBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dest_lport"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dest_lport"] = "DestLport" + fields["pktcap_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pktcap_type"] = "PktcapType" + fields["reverse_filter"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LiveTraceFilterDataBindingType)}, bindings.REST)) + fieldNameMap["reverse_filter"] = "ReverseFilter" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.pktcap_action_argument", fields, reflect.TypeOf(PktcapActionArgument{}), fieldNameMap, validators) +} + +func PktcapActionConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["action_argument"] = bindings.NewOptionalType(bindings.NewReferenceType(PktcapActionArgumentBindingType)) + fieldNameMap["action_argument"] = "ActionArgument" + fields["sampling_argument"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(SamplingArgumentBindingType)}, bindings.REST)) + fieldNameMap["sampling_argument"] = "SamplingArgument" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.pktcap_action_config", fields, reflect.TypeOf(PktcapActionConfig{}), fieldNameMap, validators) +} + +func PlainFilterDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["basic_filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["basic_filter"] = "BasicFilter" + fields["extend_filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["extend_filter"] = "ExtendFilter" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.plain_filter_data", fields, reflect.TypeOf(PlainFilterData{}), fieldNameMap, validators) +} + +func PluginFilePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["file_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_name"] = "FileName" + fields["plugin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["plugin_id"] = "PluginId" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.plugin_file_properties", fields, reflect.TypeOf(PluginFileProperties{}), fieldNameMap, validators) +} + +func PluginStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["detail"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["detail"] = "Detail" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["profile"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["profile"] = "Profile" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.plugin_status", fields, reflect.TypeOf(PluginStatus{}), fieldNameMap, validators) +} + +func PluginStatusListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PluginStatusBindingType), reflect.TypeOf([]PluginStatus{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.plugin_status_list", fields, reflect.TypeOf(PluginStatusList{}), fieldNameMap, validators) +} + +func PnicBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["device_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["device_name"] = "DeviceName" + fields["uplink_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uplink_name"] = "UplinkName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.pnic", fields, reflect.TypeOf(Pnic{}), fieldNameMap, validators) +} + +func PnicBondStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.pnic_bond_status", fields, reflect.TypeOf(PnicBondStatus{}), fieldNameMap, validators) +} + +func PnicBondStatusListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PnicBondStatusBindingType), reflect.TypeOf([]PnicBondStatus{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.pnic_bond_status_list_result", fields, reflect.TypeOf(PnicBondStatusListResult{}), fieldNameMap, validators) +} + +func PnicMirrorDestinationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dest_pnics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dest_pnics"] = "DestPnics" + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.pnic_mirror_destination", fields, reflect.TypeOf(PnicMirrorDestination{}), fieldNameMap, validators) +} + +func PnicMirrorSourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["encapsulated"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["encapsulated"] = "Encapsulated" + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fields["source_pnics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["source_pnics"] = "SourcePnics" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.pnic_mirror_source", fields, reflect.TypeOf(PnicMirrorSource{}), fieldNameMap, validators) +} + +func PointDefinitionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["field"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["field"] = "Field" + fields["navigation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["navigation"] = "Navigation" + fields["tooltip"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TooltipBindingType), reflect.TypeOf([]Tooltip{}))) + fieldNameMap["tooltip"] = "Tooltip" + fields["x_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["x_value"] = "XValue" + fields["y_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["y_value"] = "YValue" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.point_definition", fields, reflect.TypeOf(PointDefinition{}), fieldNameMap, validators) +} + +func PolicyBasedIPSecVPNSessionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["policy_rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSecVPNPolicyRuleBindingType), reflect.TypeOf([]IPSecVPNPolicyRule{}))) + fieldNameMap["policy_rules"] = "PolicyRules" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["ipsec_vpn_service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ipsec_vpn_service_id"] = "IpsecVpnServiceId" + fields["local_endpoint_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_endpoint_id"] = "LocalEndpointId" + fields["peer_endpoint_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["peer_endpoint_id"] = "PeerEndpointId" + fields["tcp_mss_clamping"] = bindings.NewOptionalType(bindings.NewReferenceType(TcpMssClampingBindingType)) + fieldNameMap["tcp_mss_clamping"] = "TcpMssClamping" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.policy_based_IP_sec_VPN_session", fields, reflect.TypeOf(PolicyBasedIPSecVPNSession{}), fieldNameMap, validators) +} + +func PolicyPktCapResourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_port_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_port_path"] = "LogicalPortPath" + fields["pktcap_file_download_url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pktcap_file_download_url"] = "PktcapFileDownloadUrl" + fields["port_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["port_id"] = "PortId" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.policy_pkt_cap_resource", fields, reflect.TypeOf(PolicyPktCapResource{}), fieldNameMap, validators) +} + +func PolicyTraceflowObservationDeliveredBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["interface_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["interface_path"] = "InterfacePath" + fields["segment_port_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_port_path"] = "SegmentPortPath" + fields["lport_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_id"] = "LportId" + fields["lport_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_name"] = "LportName" + fields["resolution_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resolution_type"] = "ResolutionType" + fields["target_mac"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_mac"] = "TargetMac" + fields["vlan_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vlan_id"] = "VlanId" + fields["component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_name"] = "ComponentName" + fields["component_sub_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_sub_type"] = "ComponentSubType" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["sequence_no"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_no"] = "SequenceNo" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["timestamp_micro"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp_micro"] = "TimestampMicro" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fields["transport_node_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_name"] = "TransportNodeName" + fields["transport_node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_type"] = "TransportNodeType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.policy_traceflow_observation_delivered", fields, reflect.TypeOf(PolicyTraceflowObservationDelivered{}), fieldNameMap, validators) +} + +func PolicyTraceflowObservationDroppedBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["acl_rule_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["acl_rule_path"] = "AclRulePath" + fields["interface_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["interface_path"] = "InterfacePath" + fields["nat_rule_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nat_rule_path"] = "NatRulePath" + fields["segment_port_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_port_path"] = "SegmentPortPath" + fields["acl_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["acl_rule_id"] = "AclRuleId" + fields["arp_fail_reason"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["arp_fail_reason"] = "ArpFailReason" + fields["jumpto_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["jumpto_rule_id"] = "JumptoRuleId" + fields["l2_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["l2_rule_id"] = "L2RuleId" + fields["lport_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_id"] = "LportId" + fields["lport_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_name"] = "LportName" + fields["nat_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["nat_rule_id"] = "NatRuleId" + fields["reason"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["reason"] = "Reason" + fields["component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_name"] = "ComponentName" + fields["component_sub_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_sub_type"] = "ComponentSubType" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["sequence_no"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_no"] = "SequenceNo" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["timestamp_micro"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp_micro"] = "TimestampMicro" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fields["transport_node_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_name"] = "TransportNodeName" + fields["transport_node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_type"] = "TransportNodeType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.policy_traceflow_observation_dropped", fields, reflect.TypeOf(PolicyTraceflowObservationDropped{}), fieldNameMap, validators) +} + +func PolicyTraceflowObservationDroppedLogicalBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["acl_rule_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["acl_rule_path"] = "AclRulePath" + fields["component_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_path"] = "ComponentPath" + fields["interface_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["interface_path"] = "InterfacePath" + fields["jumpto_rule_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["jumpto_rule_path"] = "JumptoRulePath" + fields["l2_rule_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["l2_rule_path"] = "L2RulePath" + fields["nat_rule_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nat_rule_path"] = "NatRulePath" + fields["segment_port_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_port_path"] = "SegmentPortPath" + fields["component_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_id"] = "ComponentId" + fields["service_path_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["service_path_index"] = "ServicePathIndex" + fields["acl_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["acl_rule_id"] = "AclRuleId" + fields["arp_fail_reason"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["arp_fail_reason"] = "ArpFailReason" + fields["jumpto_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["jumpto_rule_id"] = "JumptoRuleId" + fields["l2_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["l2_rule_id"] = "L2RuleId" + fields["lport_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_id"] = "LportId" + fields["lport_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_name"] = "LportName" + fields["nat_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["nat_rule_id"] = "NatRuleId" + fields["reason"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["reason"] = "Reason" + fields["component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_name"] = "ComponentName" + fields["component_sub_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_sub_type"] = "ComponentSubType" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["sequence_no"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_no"] = "SequenceNo" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["timestamp_micro"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp_micro"] = "TimestampMicro" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fields["transport_node_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_name"] = "TransportNodeName" + fields["transport_node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_type"] = "TransportNodeType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.policy_traceflow_observation_dropped_logical", fields, reflect.TypeOf(PolicyTraceflowObservationDroppedLogical{}), fieldNameMap, validators) +} + +func PolicyTraceflowObservationForwardedLogicalBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["acl_rule_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["acl_rule_path"] = "AclRulePath" + fields["component_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_path"] = "ComponentPath" + fields["dst_component_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_component_path"] = "DstComponentPath" + fields["interface_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["interface_path"] = "InterfacePath" + fields["jumpto_rule_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["jumpto_rule_path"] = "JumptoRulePath" + fields["l2_rule_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["l2_rule_path"] = "L2RulePath" + fields["nat_rule_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nat_rule_path"] = "NatRulePath" + fields["segment_port_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_port_path"] = "SegmentPortPath" + fields["acl_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["acl_rule_id"] = "AclRuleId" + fields["component_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_id"] = "ComponentId" + fields["dst_component_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_component_id"] = "DstComponentId" + fields["dst_component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_component_name"] = "DstComponentName" + fields["dst_component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_component_type"] = "DstComponentType" + fields["jumpto_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["jumpto_rule_id"] = "JumptoRuleId" + fields["l2_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["l2_rule_id"] = "L2RuleId" + fields["lport_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_id"] = "LportId" + fields["lport_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_name"] = "LportName" + fields["nat_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["nat_rule_id"] = "NatRuleId" + fields["resend_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resend_type"] = "ResendType" + fields["service_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["service_index"] = "ServiceIndex" + fields["service_path_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["service_path_index"] = "ServicePathIndex" + fields["service_ttl"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["service_ttl"] = "ServiceTtl" + fields["spoofguard_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["spoofguard_ip"] = "SpoofguardIp" + fields["spoofguard_mac"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["spoofguard_mac"] = "SpoofguardMac" + fields["spoofguard_vlan_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["spoofguard_vlan_id"] = "SpoofguardVlanId" + fields["svc_nh_mac"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["svc_nh_mac"] = "SvcNhMac" + fields["translated_dst_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["translated_dst_ip"] = "TranslatedDstIp" + fields["translated_src_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["translated_src_ip"] = "TranslatedSrcIp" + fields["vlan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vlan"] = "Vlan" + fields["vni"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vni"] = "Vni" + fields["component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_name"] = "ComponentName" + fields["component_sub_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_sub_type"] = "ComponentSubType" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["sequence_no"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_no"] = "SequenceNo" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["timestamp_micro"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp_micro"] = "TimestampMicro" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fields["transport_node_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_name"] = "TransportNodeName" + fields["transport_node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_type"] = "TransportNodeType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.policy_traceflow_observation_forwarded_logical", fields, reflect.TypeOf(PolicyTraceflowObservationForwardedLogical{}), fieldNameMap, validators) +} + +func PolicyTraceflowObservationReceivedLogicalBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_path"] = "ComponentPath" + fields["interface_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["interface_path"] = "InterfacePath" + fields["segment_port_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_port_path"] = "SegmentPortPath" + fields["src_component_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["src_component_path"] = "SrcComponentPath" + fields["component_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_id"] = "ComponentId" + fields["lport_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_id"] = "LportId" + fields["lport_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_name"] = "LportName" + fields["src_component_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["src_component_id"] = "SrcComponentId" + fields["src_component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["src_component_name"] = "SrcComponentName" + fields["src_component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["src_component_type"] = "SrcComponentType" + fields["svc_mac"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["svc_mac"] = "SvcMac" + fields["vlan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vlan"] = "Vlan" + fields["vni"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vni"] = "Vni" + fields["component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_name"] = "ComponentName" + fields["component_sub_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_sub_type"] = "ComponentSubType" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["sequence_no"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_no"] = "SequenceNo" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["timestamp_micro"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp_micro"] = "TimestampMicro" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fields["transport_node_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_name"] = "TransportNodeName" + fields["transport_node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_type"] = "TransportNodeType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.policy_traceflow_observation_received_logical", fields, reflect.TypeOf(PolicyTraceflowObservationReceivedLogical{}), fieldNameMap, validators) +} + +func PolicyTraceflowObservationRelayedLogicalBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_component_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_component_path"] = "LogicalComponentPath" + fields["dst_server_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_server_address"] = "DstServerAddress" + fields["logical_comp_uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_comp_uuid"] = "LogicalCompUuid" + fields["message_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["message_type"] = "MessageType" + fields["relay_server_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relay_server_address"] = "RelayServerAddress" + fields["component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_name"] = "ComponentName" + fields["component_sub_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_sub_type"] = "ComponentSubType" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["sequence_no"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_no"] = "SequenceNo" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["timestamp_micro"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp_micro"] = "TimestampMicro" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fields["transport_node_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_name"] = "TransportNodeName" + fields["transport_node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_type"] = "TransportNodeType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.policy_traceflow_observation_relayed_logical", fields, reflect.TypeOf(PolicyTraceflowObservationRelayedLogical{}), fieldNameMap, validators) +} + +func PoolMemberBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["admin_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["admin_state"] = "AdminState" + fields["backup_member"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["backup_member"] = "BackupMember" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["max_concurrent_connections"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_concurrent_connections"] = "MaxConcurrentConnections" + fields["port"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["port"] = "Port" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.pool_member", fields, reflect.TypeOf(PoolMember{}), fieldNameMap, validators) +} + +func PoolMemberGroupBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["customized_members"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PoolMemberSettingBindingType), reflect.TypeOf([]PoolMemberSetting{}))) + fieldNameMap["customized_members"] = "CustomizedMembers" + fields["grouping_object"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["grouping_object"] = "GroupingObject" + fields["ip_revision_filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_revision_filter"] = "IpRevisionFilter" + fields["max_ip_list_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_ip_list_size"] = "MaxIpListSize" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.pool_member_group", fields, reflect.TypeOf(PoolMemberGroup{}), fieldNameMap, validators) +} + +func PoolMemberSettingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["admin_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["admin_state"] = "AdminState" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["port"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["port"] = "Port" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.pool_member_setting", fields, reflect.TypeOf(PoolMemberSetting{}), fieldNameMap, validators) +} + +func PoolMemberSettingListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["members"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PoolMemberSettingBindingType), reflect.TypeOf([]PoolMemberSetting{}))) + fieldNameMap["members"] = "Members" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.pool_member_setting_list", fields, reflect.TypeOf(PoolMemberSettingList{}), fieldNameMap, validators) +} + +func PoolUsageBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allocated_ids"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["allocated_ids"] = "AllocatedIds" + fields["free_ids"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["free_ids"] = "FreeIds" + fields["total_ids"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_ids"] = "TotalIds" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.pool_usage", fields, reflect.TypeOf(PoolUsage{}), fieldNameMap, validators) +} + +func PortAttacherBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["entity"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["entity"] = "Entity" + fields["host"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host"] = "Host" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.port_attacher", fields, reflect.TypeOf(PortAttacher{}), fieldNameMap, validators) +} + +func PortConnectionBMEntitiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dst_port"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalPortBindingType)) + fieldNameMap["dst_port"] = "DstPort" + fields["src_port"] = bindings.NewOptionalType(bindings.NewReferenceType(LogicalPortBindingType)) + fieldNameMap["src_port"] = "SrcPort" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.port_connection_BM_entities", fields, reflect.TypeOf(PortConnectionBMEntities{}), fieldNameMap, validators) +} + +func PortConnectionContainersEntitiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["logical_ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LogicalPortBindingType), reflect.TypeOf([]LogicalPort{}))) + fieldNameMap["logical_ports"] = "LogicalPorts" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.port_connection_containers_entities", fields, reflect.TypeOf(PortConnectionContainersEntities{}), fieldNameMap, validators) +} + +func PortConnectionEdgeNodeGroupBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource"] = bindings.NewOptionalType(bindings.NewReferenceType(ManagedResourceBindingType)) + fieldNameMap["resource"] = "Resource" + fields["edge_nodes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TransportNodeBindingType), reflect.TypeOf([]TransportNode{}))) + fieldNameMap["edge_nodes"] = "EdgeNodes" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.port_connection_edge_node_group", fields, reflect.TypeOf(PortConnectionEdgeNodeGroup{}), fieldNameMap, validators) +} + +func PortConnectionEntitiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["containers"] = bindings.NewOptionalType(bindings.NewReferenceType(PortConnectionContainersEntitiesBindingType)) + fieldNameMap["containers"] = "Containers" + fields["edge_node_groups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PortConnectionEdgeNodeGroupBindingType), reflect.TypeOf([]PortConnectionEdgeNodeGroup{}))) + fieldNameMap["edge_node_groups"] = "EdgeNodeGroups" + fields["errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PortConnectionErrorBindingType), reflect.TypeOf([]PortConnectionError{}))) + fieldNameMap["errors"] = "Errors" + fields["hypervisors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PortConnectionHypervisorBindingType), reflect.TypeOf([]PortConnectionHypervisor{}))) + fieldNameMap["hypervisors"] = "Hypervisors" + fields["logical_switches"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PortConnectionLogicalSwitchBindingType), reflect.TypeOf([]PortConnectionLogicalSwitch{}))) + fieldNameMap["logical_switches"] = "LogicalSwitches" + fields["physical_hosts"] = bindings.NewOptionalType(bindings.NewReferenceType(PortConnectionBMEntitiesBindingType)) + fieldNameMap["physical_hosts"] = "PhysicalHosts" + fields["routers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PortConnectionRouterBindingType), reflect.TypeOf([]PortConnectionRouter{}))) + fieldNameMap["routers"] = "Routers" + fields["tunnels"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PortConnectionTunnelBindingType), reflect.TypeOf([]PortConnectionTunnel{}))) + fieldNameMap["tunnels"] = "Tunnels" + fields["vms"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VirtualMachineBindingType), reflect.TypeOf([]VirtualMachine{}))) + fieldNameMap["vms"] = "Vms" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.port_connection_entities", fields, reflect.TypeOf(PortConnectionEntities{}), fieldNameMap, validators) +} + +func PortConnectionEntityBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource"] = bindings.NewOptionalType(bindings.NewReferenceType(ManagedResourceBindingType)) + fieldNameMap["resource"] = "Resource" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.port_connection_entity", fields, reflect.TypeOf(PortConnectionEntity{}), fieldNameMap, validators) +} + +func PortConnectionErrorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["entity_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["entity_type"] = "EntityType" + fields["error_details"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["error_details"] = "ErrorDetails" + fields["error_summary"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_summary"] = "ErrorSummary" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.port_connection_error", fields, reflect.TypeOf(PortConnectionError{}), fieldNameMap, validators) +} + +func PortConnectionHypervisorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource"] = bindings.NewOptionalType(bindings.NewReferenceType(ManagedResourceBindingType)) + fieldNameMap["resource"] = "Resource" + fields["neighbors_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(InterfaceNeighborPropertiesBindingType), reflect.TypeOf([]InterfaceNeighborProperties{}))) + fieldNameMap["neighbors_list"] = "NeighborsList" + fields["pnics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PnicBindingType), reflect.TypeOf([]Pnic{}))) + fieldNameMap["pnics"] = "Pnics" + fields["pnics_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NodeInterfacePropertiesBindingType), reflect.TypeOf([]NodeInterfaceProperties{}))) + fieldNameMap["pnics_list"] = "PnicsList" + fields["profiles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(BaseHostSwitchProfileBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["profiles"] = "Profiles" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.port_connection_hypervisor", fields, reflect.TypeOf(PortConnectionHypervisor{}), fieldNameMap, validators) +} + +func PortConnectionLogicalSwitchBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource"] = bindings.NewOptionalType(bindings.NewReferenceType(ManagedResourceBindingType)) + fieldNameMap["resource"] = "Resource" + fields["router_ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LogicalPortBindingType), reflect.TypeOf([]LogicalPort{}))) + fieldNameMap["router_ports"] = "RouterPorts" + fields["vm_ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LogicalPortBindingType), reflect.TypeOf([]LogicalPort{}))) + fieldNameMap["vm_ports"] = "VmPorts" + fields["vm_ports_states"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LogicalPortStateBindingType), reflect.TypeOf([]LogicalPortState{}))) + fieldNameMap["vm_ports_states"] = "VmPortsStates" + fields["vm_vnics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VirtualNetworkInterfaceBindingType), reflect.TypeOf([]VirtualNetworkInterface{}))) + fieldNameMap["vm_vnics"] = "VmVnics" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.port_connection_logical_switch", fields, reflect.TypeOf(PortConnectionLogicalSwitch{}), fieldNameMap, validators) +} + +func PortConnectionRouterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource"] = bindings.NewOptionalType(bindings.NewReferenceType(ManagedResourceBindingType)) + fieldNameMap["resource"] = "Resource" + fields["downlink_ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LogicalRouterPortBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["downlink_ports"] = "DownlinkPorts" + fields["uplink_ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LogicalRouterPortBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["uplink_ports"] = "UplinkPorts" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.port_connection_router", fields, reflect.TypeOf(PortConnectionRouter{}), fieldNameMap, validators) +} + +func PortConnectionTunnelBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["src_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["src_node_id"] = "SrcNodeId" + fields["tunnel_properties"] = bindings.NewOptionalType(bindings.NewReferenceType(TunnelPropertiesBindingType)) + fieldNameMap["tunnel_properties"] = "TunnelProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.port_connection_tunnel", fields, reflect.TypeOf(PortConnectionTunnel{}), fieldNameMap, validators) +} + +func PortMirroringFilterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dst_ips"] = bindings.NewOptionalType(bindings.NewReferenceType(IPAddressesBindingType)) + fieldNameMap["dst_ips"] = "DstIps" + fields["dst_ports"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_ports"] = "DstPorts" + fields["filter_action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter_action"] = "FilterAction" + fields["ip_protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_protocol"] = "IpProtocol" + fields["src_ips"] = bindings.NewOptionalType(bindings.NewReferenceType(IPAddressesBindingType)) + fieldNameMap["src_ips"] = "SrcIps" + fields["src_ports"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["src_ports"] = "SrcPorts" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.port_mirroring_filter", fields, reflect.TypeOf(PortMirroringFilter{}), fieldNameMap, validators) +} + +func PortMirroringSessionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["direction"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["direction"] = "Direction" + fields["encapsulation_vlan_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["encapsulation_vlan_id"] = "EncapsulationVlanId" + fields["mirror_destination"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(MirrorDestinationBindingType)}, bindings.REST)) + fieldNameMap["mirror_destination"] = "MirrorDestination" + fields["mirror_sources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(MirrorSourceBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["mirror_sources"] = "MirrorSources" + fields["port_mirroring_filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PortMirroringFilterBindingType), reflect.TypeOf([]PortMirroringFilter{}))) + fieldNameMap["port_mirroring_filters"] = "PortMirroringFilters" + fields["preserve_original_vlan"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["preserve_original_vlan"] = "PreserveOriginalVlan" + fields["session_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["session_type"] = "SessionType" + fields["snap_length"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["snap_length"] = "SnapLength" + fields["tcp_ip_stack"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tcp_ip_stack"] = "TcpIpStack" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.port_mirroring_session", fields, reflect.TypeOf(PortMirroringSession{}), fieldNameMap, validators) +} + +func PortMirroringSessionListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PortMirroringSessionBindingType), reflect.TypeOf([]PortMirroringSession{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.port_mirroring_session_list_result", fields, reflect.TypeOf(PortMirroringSessionListResult{}), fieldNameMap, validators) +} + +func PostVmGroupMigrationSpecBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allow_override"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["allow_override"] = "AllowOverride" + fields["failed_vm_instance_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["failed_vm_instance_ids"] = "FailedVmInstanceIds" + fields["federation_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["federation_site_id"] = "FederationSiteId" + fields["group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["group_id"] = "GroupId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.post_vm_group_migration_spec", fields, reflect.TypeOf(PostVmGroupMigrationSpec{}), fieldNameMap, validators) +} + +func PreVmGroupMigrationSpecBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allow_override"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["allow_override"] = "AllowOverride" + fields["federation_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["federation_site_id"] = "FederationSiteId" + fields["group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["group_id"] = "GroupId" + fields["vm_instance_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["vm_instance_ids"] = "VmInstanceIds" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.pre_vm_group_migration_spec", fields, reflect.TypeOf(PreVmGroupMigrationSpec{}), fieldNameMap, validators) +} + +func PrecheckParametersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cluster_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["cluster_ids"] = "ClusterIds" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.precheck_parameters", fields, reflect.TypeOf(PrecheckParameters{}), fieldNameMap, validators) +} + +func PreconfiguredEndpointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["device_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["device_name"] = "DeviceName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.preconfigured_endpoint", fields, reflect.TypeOf(PreconfiguredEndpoint{}), fieldNameMap, validators) +} + +func PreconfiguredHostSwitchBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["endpoints"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PreconfiguredEndpointBindingType), reflect.TypeOf([]PreconfiguredEndpoint{}))) + fieldNameMap["endpoints"] = "Endpoints" + fields["host_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_switch_id"] = "HostSwitchId" + fields["transport_zone_endpoints"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TransportZoneEndPointBindingType), reflect.TypeOf([]TransportZoneEndPoint{}))) + fieldNameMap["transport_zone_endpoints"] = "TransportZoneEndpoints" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.preconfigured_host_switch", fields, reflect.TypeOf(PreconfiguredHostSwitch{}), fieldNameMap, validators) +} + +func PreconfiguredHostSwitchSpecBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["host_switches"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PreconfiguredHostSwitchBindingType), reflect.TypeOf([]PreconfiguredHostSwitch{}))) + fieldNameMap["host_switches"] = "HostSwitches" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.preconfigured_host_switch_spec", fields, reflect.TypeOf(PreconfiguredHostSwitchSpec{}), fieldNameMap, validators) +} + +func PrefixConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["ge"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ge"] = "Ge" + fields["le"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["le"] = "Le" + fields["network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network"] = "Network" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.prefix_config", fields, reflect.TypeOf(PrefixConfig{}), fieldNameMap, validators) +} + +func PrincipalBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["attributes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValueBindingType), reflect.TypeOf([]KeyValue{}))) + fieldNameMap["attributes"] = "Attributes" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.principal", fields, reflect.TypeOf(Principal{}), fieldNameMap, validators) +} + +func PrincipalIdentityBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["certificate_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["certificate_id"] = "CertificateId" + fields["is_protected"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_protected"] = "IsProtected" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fields["role"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["role"] = "Role" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.principal_identity", fields, reflect.TypeOf(PrincipalIdentity{}), fieldNameMap, validators) +} + +func PrincipalIdentityListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PrincipalIdentityBindingType), reflect.TypeOf([]PrincipalIdentity{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.principal_identity_list", fields, reflect.TypeOf(PrincipalIdentityList{}), fieldNameMap, validators) +} + +func PrincipalIdentityWithCertificateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["certificate_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["certificate_id"] = "CertificateId" + fields["is_protected"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_protected"] = "IsProtected" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fields["role"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["role"] = "Role" + fields["certificate_pem"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["certificate_pem"] = "CertificatePem" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.principal_identity_with_certificate", fields, reflect.TypeOf(PrincipalIdentityWithCertificate{}), fieldNameMap, validators) +} + +func ProcessInformationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["command"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["command"] = "Command" + fields["cpu_usage"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["cpu_usage"] = "CpuUsage" + fields["memory_usage"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["memory_usage"] = "MemoryUsage" + fields["nice_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nice_value"] = "NiceValue" + fields["process_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["process_id"] = "ProcessId" + fields["resident_memory_size"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["resident_memory_size"] = "ResidentMemorySize" + fields["shared_memory_size"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["shared_memory_size"] = "SharedMemorySize" + fields["user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["user"] = "User" + fields["virtual_memory_size"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["virtual_memory_size"] = "VirtualMemorySize" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.process_information", fields, reflect.TypeOf(ProcessInformation{}), fieldNameMap, validators) +} + +func ProgressItemBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["parts"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ProgressItemPartBindingType), reflect.TypeOf([]ProgressItemPart{}))) + fieldNameMap["parts"] = "Parts" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.progress_item", fields, reflect.TypeOf(ProgressItem{}), fieldNameMap, validators) +} + +func ProgressItemPartBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["error"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error"] = "Error_" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["percentage"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["percentage"] = "Percentage" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.progress_item_part", fields, reflect.TypeOf(ProgressItemPart{}), fieldNameMap, validators) +} + +func PropertyItemBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["field"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["field"] = "Field" + fields["heading"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["heading"] = "Heading" + fields["label"] = bindings.NewOptionalType(bindings.NewReferenceType(LabelBindingType)) + fieldNameMap["label"] = "Label" + fields["label_value_separator"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["label_value_separator"] = "LabelValueSeparator" + fields["navigation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["navigation"] = "Navigation" + fields["render_configuration"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RenderConfigurationBindingType), reflect.TypeOf([]RenderConfiguration{}))) + fieldNameMap["render_configuration"] = "RenderConfiguration" + fields["rowspan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rowspan"] = "Rowspan" + fields["separator"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["separator"] = "Separator" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["style"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["style"] = "Style" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.property_item", fields, reflect.TypeOf(PropertyItem{}), fieldNameMap, validators) +} + +func ProtocolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["name"] = bindings.NewStringType() + fieldNameMap["name"] = "Name" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.protocol", fields, reflect.TypeOf(Protocol{}), fieldNameMap, validators) +} + +func ProtocolVersionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.protocol_version", fields, reflect.TypeOf(ProtocolVersion{}), fieldNameMap, validators) +} + +func ProxyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["host"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host"] = "Host" + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["scheme"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scheme"] = "Scheme" + fields["username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["username"] = "Username" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.proxy", fields, reflect.TypeOf(Proxy{}), fieldNameMap, validators) +} + +func PublicClientInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["base_url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["base_url"] = "BaseUrl" + fields["client_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["client_id"] = "ClientId" + fields["default_org_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["default_org_id"] = "DefaultOrgId" + fields["ea_org_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ea_org_id"] = "EaOrgId" + fields["gss_org_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["gss_org_id"] = "GssOrgId" + fields["redirect_uris"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["redirect_uris"] = "RedirectUris" + fields["sre_org_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sre_org_id"] = "SreOrgId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.public_client_info", fields, reflect.TypeOf(PublicClientInfo{}), fieldNameMap, validators) +} + +func PublicCloudGatewayNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allocation_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["allocation_list"] = "AllocationList" + fields["deployment_config"] = bindings.NewOptionalType(bindings.NewReferenceType(EdgeNodeDeploymentConfigBindingType)) + fieldNameMap["deployment_config"] = "DeploymentConfig" + fields["deployment_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["deployment_type"] = "DeploymentType" + fields["node_settings"] = bindings.NewOptionalType(bindings.NewReferenceType(EdgeNodeSettingsBindingType)) + fieldNameMap["node_settings"] = "NodeSettings" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["discovered_ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["discovered_ip_addresses"] = "DiscoveredIpAddresses" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["fqdn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["fqdn"] = "Fqdn" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.public_cloud_gateway_node", fields, reflect.TypeOf(PublicCloudGatewayNode{}), fieldNameMap, validators) +} + +func QosBaseRateShaperBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.qos_base_rate_shaper", fields, reflect.TypeOf(QosBaseRateShaper{}), fieldNameMap, validators) +} + +func QosSwitchingProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["class_of_service"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["class_of_service"] = "ClassOfService" + fields["dscp"] = bindings.NewOptionalType(bindings.NewReferenceType(DscpBindingType)) + fieldNameMap["dscp"] = "Dscp" + fields["shaper_configuration"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(QosBaseRateShaperBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["shaper_configuration"] = "ShaperConfiguration" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["required_capabilities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["required_capabilities"] = "RequiredCapabilities" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.qos_switching_profile", fields, reflect.TypeOf(QosSwitchingProfile{}), fieldNameMap, validators) +} + +func RAConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["hop_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["hop_limit"] = "HopLimit" + fields["prefix_lifetime"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["prefix_lifetime"] = "PrefixLifetime" + fields["prefix_preferred_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["prefix_preferred_time"] = "PrefixPreferredTime" + fields["ra_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ra_interval"] = "RaInterval" + fields["router_lifetime"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["router_lifetime"] = "RouterLifetime" + fields["router_preference"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["router_preference"] = "RouterPreference" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.RA_config", fields, reflect.TypeOf(RAConfig{}), fieldNameMap, validators) +} + +func RaDNSConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dns_server"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dns_server"] = "DnsServer" + fields["dns_server_lifetime"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dns_server_lifetime"] = "DnsServerLifetime" + fields["domain_name"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["domain_name"] = "DomainName" + fields["domain_name_lifetime"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["domain_name_lifetime"] = "DomainNameLifetime" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ra_DNS_config", fields, reflect.TypeOf(RaDNSConfig{}), fieldNameMap, validators) +} + +func RateLimitsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["rx_broadcast"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rx_broadcast"] = "RxBroadcast" + fields["rx_multicast"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rx_multicast"] = "RxMulticast" + fields["tx_broadcast"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tx_broadcast"] = "TxBroadcast" + fields["tx_multicast"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tx_multicast"] = "TxMulticast" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.rate_limits", fields, reflect.TypeOf(RateLimits{}), fieldNameMap, validators) +} + +func RealizationStateBarrierConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interval"] = "Interval" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.realization_state_barrier_config", fields, reflect.TypeOf(RealizationStateBarrierConfig{}), fieldNameMap, validators) +} + +func RecommendedFeaturePermissionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["recommended_permissions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["recommended_permissions"] = "RecommendedPermissions" + fields["src_features"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["src_features"] = "SrcFeatures" + fields["target_feature"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_feature"] = "TargetFeature" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.recommended_feature_permission", fields, reflect.TypeOf(RecommendedFeaturePermission{}), fieldNameMap, validators) +} + +func RecommendedFeaturePermissionListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RecommendedFeaturePermissionBindingType), reflect.TypeOf([]RecommendedFeaturePermission{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.recommended_feature_permission_list_result", fields, reflect.TypeOf(RecommendedFeaturePermissionListResult{}), fieldNameMap, validators) +} + +func RedistributionConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["bgp_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["bgp_enabled"] = "BgpEnabled" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.redistribution_config", fields, reflect.TypeOf(RedistributionConfig{}), fieldNameMap, validators) +} + +func RedistributionRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["address_family"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["address_family"] = "AddressFamily" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["destination"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["destination"] = "Destination" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["route_map_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["route_map_id"] = "RouteMapId" + fields["sources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["sources"] = "Sources" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.redistribution_rule", fields, reflect.TypeOf(RedistributionRule{}), fieldNameMap, validators) +} + +func RedistributionRuleListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RedistributionRuleBindingType), reflect.TypeOf([]RedistributionRule{}))) + fieldNameMap["rules"] = "Rules" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.redistribution_rule_list", fields, reflect.TypeOf(RedistributionRuleList{}), fieldNameMap, validators) +} + +func RegistrationTokenBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["roles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["roles"] = "Roles" + fields["token"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["token"] = "Token" + fields["user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["user"] = "User" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.registration_token", fields, reflect.TypeOf(RegistrationToken{}), fieldNameMap, validators) +} + +func RelatedApiErrorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["details"] = "Details" + fields["error_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["error_code"] = "ErrorCode" + fields["error_data"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["error_data"] = "ErrorData" + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["module_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["module_name"] = "ModuleName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.related_api_error", fields, reflect.TypeOf(RelatedApiError{}), fieldNameMap, validators) +} + +func RemainingSupportBundleNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_display_name"] = "NodeDisplayName" + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.remaining_support_bundle_node", fields, reflect.TypeOf(RemainingSupportBundleNode{}), fieldNameMap, validators) +} + +func RemoteBundleUrlBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["url"] = "Url" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.remote_bundle_url", fields, reflect.TypeOf(RemoteBundleUrl{}), fieldNameMap, validators) +} + +func RemoteFileServerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["directory_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["directory_path"] = "DirectoryPath" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["protocol"] = bindings.NewOptionalType(bindings.NewReferenceType(FileTransferProtocolBindingType)) + fieldNameMap["protocol"] = "Protocol" + fields["server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server"] = "Server" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.remote_file_server", fields, reflect.TypeOf(RemoteFileServer{}), fieldNameMap, validators) +} + +func RemoteServerFingerprintBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server"] = "Server" + fields["ssh_fingerprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ssh_fingerprint"] = "SshFingerprint" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.remote_server_fingerprint", fields, reflect.TypeOf(RemoteServerFingerprint{}), fieldNameMap, validators) +} + +func RemoteServerFingerprintRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server"] = "Server" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.remote_server_fingerprint_request", fields, reflect.TypeOf(RemoteServerFingerprintRequest{}), fieldNameMap, validators) +} + +func RemoteSiteCompatibilityInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["is_compatible"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_compatible"] = "IsCompatible" + fields["local_site"] = bindings.NewOptionalType(bindings.NewReferenceType(SiteCompatibilityInfoBindingType)) + fieldNameMap["local_site"] = "LocalSite" + fields["remote_site"] = bindings.NewOptionalType(bindings.NewReferenceType(SiteCompatibilityInfoBindingType)) + fieldNameMap["remote_site"] = "RemoteSite" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.remote_site_compatibility_info", fields, reflect.TypeOf(RemoteSiteCompatibilityInfo{}), fieldNameMap, validators) +} + +func RemoteSiteCredentialBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["address"] = "Address" + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["thumbprint"] = "Thumbprint" + fields["username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["username"] = "Username" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.remote_site_credential", fields, reflect.TypeOf(RemoteSiteCredential{}), fieldNameMap, validators) +} + +func RemoteTunnelEndpointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["default_gateway"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["default_gateway"] = "DefaultGateway" + fields["device_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["device_name"] = "DeviceName" + fields["ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip"] = "Ip" + fields["label"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["label"] = "Label" + fields["mac"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac"] = "Mac" + fields["subnet_mask"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["subnet_mask"] = "SubnetMask" + fields["vlan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vlan"] = "Vlan" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.remote_tunnel_endpoint", fields, reflect.TypeOf(RemoteTunnelEndpoint{}), fieldNameMap, validators) +} + +func RemoteTunnelEndpointConfigStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["endpoints"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RemoteTunnelEndpointBindingType), reflect.TypeOf([]RemoteTunnelEndpoint{}))) + fieldNameMap["endpoints"] = "Endpoints" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.remote_tunnel_endpoint_config_state", fields, reflect.TypeOf(RemoteTunnelEndpointConfigState{}), fieldNameMap, validators) +} + +func RemoteTunnelStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rx"] = bindings.NewOptionalType(bindings.NewReferenceType(InterSitePortCountersBindingType)) + fieldNameMap["rx"] = "Rx" + fields["tunnel_destination_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tunnel_destination_address"] = "TunnelDestinationAddress" + fields["tunnel_source_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tunnel_source_address"] = "TunnelSourceAddress" + fields["tx"] = bindings.NewOptionalType(bindings.NewReferenceType(InterSitePortCountersBindingType)) + fieldNameMap["tx"] = "Tx" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.remote_tunnel_statistics", fields, reflect.TypeOf(RemoteTunnelStatistics{}), fieldNameMap, validators) +} + +func RemoteTunnelStatisticsPerSiteBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["remote_site"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["remote_site"] = "RemoteSite" + fields["rx"] = bindings.NewOptionalType(bindings.NewReferenceType(InterSitePortCountersBindingType)) + fieldNameMap["rx"] = "Rx" + fields["stats_per_tunnel"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RemoteTunnelStatisticsBindingType), reflect.TypeOf([]RemoteTunnelStatistics{}))) + fieldNameMap["stats_per_tunnel"] = "StatsPerTunnel" + fields["tx"] = bindings.NewOptionalType(bindings.NewReferenceType(InterSitePortCountersBindingType)) + fieldNameMap["tx"] = "Tx" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.remote_tunnel_statistics_per_site", fields, reflect.TypeOf(RemoteTunnelStatisticsPerSite{}), fieldNameMap, validators) +} + +func RenderConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["color"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["color"] = "Color" + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["display_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_value"] = "DisplayValue" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["tooltip"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TooltipBindingType), reflect.TypeOf([]Tooltip{}))) + fieldNameMap["tooltip"] = "Tooltip" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.render_configuration", fields, reflect.TypeOf(RenderConfiguration{}), fieldNameMap, validators) +} + +func ReorderMigrationRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["is_before"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_before"] = "IsBefore" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.reorder_migration_request", fields, reflect.TypeOf(ReorderMigrationRequest{}), fieldNameMap, validators) +} + +func ReorderRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["is_before"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_before"] = "IsBefore" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.reorder_request", fields, reflect.TypeOf(ReorderRequest{}), fieldNameMap, validators) +} + +func RepoSyncStatusReportBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["status_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status_message"] = "StatusMessage" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.repo_sync_status_report", fields, reflect.TypeOf(RepoSyncStatusReport{}), fieldNameMap, validators) +} + +func ReservationInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cpu_reservation"] = bindings.NewOptionalType(bindings.NewReferenceType(CPUReservationBindingType)) + fieldNameMap["cpu_reservation"] = "CpuReservation" + fields["memory_reservation"] = bindings.NewOptionalType(bindings.NewReferenceType(MemoryReservationBindingType)) + fieldNameMap["memory_reservation"] = "MemoryReservation" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.reservation_info", fields, reflect.TypeOf(ReservationInfo{}), fieldNameMap, validators) +} + +func ResetNodeUserOwnPasswordPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["old_password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["old_password"] = "OldPassword" + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.reset_node_user_own_password_properties", fields, reflect.TypeOf(ResetNodeUserOwnPasswordProperties{}), fieldNameMap, validators) +} + +func ResourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.resource", fields, reflect.TypeOf(Resource{}), fieldNameMap, validators) +} + +func ResourceAllocationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["limit"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["limit"] = "Limit" + fields["reservation"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["reservation"] = "Reservation" + fields["shares"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["shares"] = "Shares" + fields["traffic_type"] = bindings.NewOptionalType(bindings.NewReferenceType(HostInfraTrafficTypeBindingType)) + fieldNameMap["traffic_type"] = "TrafficType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.resource_allocation", fields, reflect.TypeOf(ResourceAllocation{}), fieldNameMap, validators) +} + +func ResourceAssignmentBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cpu_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["cpu_count"] = "CpuCount" + fields["memory_allocation_in_mb"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["memory_allocation_in_mb"] = "MemoryAllocationInMb" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.resource_assignment", fields, reflect.TypeOf(ResourceAssignment{}), fieldNameMap, validators) +} + +func ResourceLinkBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["href"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["href"] = "Href" + fields["rel"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["rel"] = "Rel" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.resource_link", fields, reflect.TypeOf(ResourceLink{}), fieldNameMap, validators) +} + +func ResourceReferenceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["is_valid"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_valid"] = "IsValid" + fields["target_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_display_name"] = "TargetDisplayName" + fields["target_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_id"] = "TargetId" + fields["target_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_type"] = "TargetType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.resource_reference", fields, reflect.TypeOf(ResourceReference{}), fieldNameMap, validators) +} + +func RestoreConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["passphrase"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["passphrase"] = "Passphrase" + fields["remote_file_server"] = bindings.NewOptionalType(bindings.NewReferenceType(RemoteFileServerBindingType)) + fieldNameMap["remote_file_server"] = "RemoteFileServer" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.restore_configuration", fields, reflect.TypeOf(RestoreConfiguration{}), fieldNameMap, validators) +} + +func RestoreStepBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["status"] = bindings.NewOptionalType(bindings.NewReferenceType(PerStepRestoreStatusBindingType)) + fieldNameMap["status"] = "Status" + fields["step_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["step_number"] = "StepNumber" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.restore_step", fields, reflect.TypeOf(RestoreStep{}), fieldNameMap, validators) +} + +func RevisionedResourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.revisioned_resource", fields, reflect.TypeOf(RevisionedResource{}), fieldNameMap, validators) +} + +func RoleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["role"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["role"] = "Role" + fields["role_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["role_display_name"] = "RoleDisplayName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.role", fields, reflect.TypeOf(Role{}), fieldNameMap, validators) +} + +func RoleBindingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["identity_source_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["identity_source_id"] = "IdentitySourceId" + fields["identity_source_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["identity_source_type"] = "IdentitySourceType" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["roles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RoleBindingType), reflect.TypeOf([]Role{}))) + fieldNameMap["roles"] = "Roles" + fields["stale"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["stale"] = "Stale" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + fields["user_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["user_id"] = "UserId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.role_binding", fields, reflect.TypeOf(RoleBinding{}), fieldNameMap, validators) +} + +func RoleBindingListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RoleBindingBindingType), reflect.TypeOf([]RoleBinding{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.role_binding_list_result", fields, reflect.TypeOf(RoleBindingListResult{}), fieldNameMap, validators) +} + +func RoleListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RoleBindingType), reflect.TypeOf([]Role{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.role_list_result", fields, reflect.TypeOf(RoleListResult{}), fieldNameMap, validators) +} + +func RoleWithFeaturesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["features"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FeaturePermissionBindingType), reflect.TypeOf([]FeaturePermission{}))) + fieldNameMap["features"] = "Features" + fields["role"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["role"] = "Role" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.role_with_features", fields, reflect.TypeOf(RoleWithFeatures{}), fieldNameMap, validators) +} + +func RoleWithFeaturesListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RoleWithFeaturesBindingType), reflect.TypeOf([]RoleWithFeatures{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.role_with_features_list_result", fields, reflect.TypeOf(RoleWithFeaturesListResult{}), fieldNameMap, validators) +} + +func RouteBasedIPSecVPNSessionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tunnel_ports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TunnelPortConfigBindingType), reflect.TypeOf([]TunnelPortConfig{}))) + fieldNameMap["tunnel_ports"] = "TunnelPorts" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["ipsec_vpn_service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ipsec_vpn_service_id"] = "IpsecVpnServiceId" + fields["local_endpoint_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_endpoint_id"] = "LocalEndpointId" + fields["peer_endpoint_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["peer_endpoint_id"] = "PeerEndpointId" + fields["tcp_mss_clamping"] = bindings.NewOptionalType(bindings.NewReferenceType(TcpMssClampingBindingType)) + fieldNameMap["tcp_mss_clamping"] = "TcpMssClamping" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.route_based_IP_sec_VPN_session", fields, reflect.TypeOf(RouteBasedIPSecVPNSession{}), fieldNameMap, validators) +} + +func RouteDetailsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["as_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["as_path"] = "AsPath" + fields["local_pref"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["local_pref"] = "LocalPref" + fields["med"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["med"] = "Med" + fields["network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network"] = "Network" + fields["next_hop"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["next_hop"] = "NextHop" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.route_details", fields, reflect.TypeOf(RouteDetails{}), fieldNameMap, validators) +} + +func RouteMapBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["sequences"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RouteMapSequenceBindingType), reflect.TypeOf([]RouteMapSequence{}))) + fieldNameMap["sequences"] = "Sequences" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.route_map", fields, reflect.TypeOf(RouteMap{}), fieldNameMap, validators) +} + +func RouteMapListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RouteMapBindingType), reflect.TypeOf([]RouteMap{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.route_map_list_result", fields, reflect.TypeOf(RouteMapListResult{}), fieldNameMap, validators) +} + +func RouteMapSequenceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["match_criteria"] = bindings.NewOptionalType(bindings.NewReferenceType(RouteMapSequenceMatchBindingType)) + fieldNameMap["match_criteria"] = "MatchCriteria" + fields["set_criteria"] = bindings.NewOptionalType(bindings.NewReferenceType(RouteMapSequenceSetBindingType)) + fieldNameMap["set_criteria"] = "SetCriteria" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.route_map_sequence", fields, reflect.TypeOf(RouteMapSequence{}), fieldNameMap, validators) +} + +func RouteMapSequenceMatchBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_prefix_lists"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_prefix_lists"] = "IpPrefixLists" + fields["match_community_expression"] = bindings.NewOptionalType(bindings.NewReferenceType(CommunityMatchExpressionBindingType)) + fieldNameMap["match_community_expression"] = "MatchCommunityExpression" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.route_map_sequence_match", fields, reflect.TypeOf(RouteMapSequenceMatch{}), fieldNameMap, validators) +} + +func RouteMapSequenceSetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["as_path_prepend"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["as_path_prepend"] = "AsPathPrepend" + fields["community"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["community"] = "Community" + fields["large_community"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["large_community"] = "LargeCommunity" + fields["local_preference"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["local_preference"] = "LocalPreference" + fields["multi_exit_discriminator"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["multi_exit_discriminator"] = "MultiExitDiscriminator" + fields["prefer_global_v6_next_hop"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["prefer_global_v6_next_hop"] = "PreferGlobalV6NextHop" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.route_map_sequence_set", fields, reflect.TypeOf(RouteMapSequenceSet{}), fieldNameMap, validators) +} + +func RoutesPerTransportNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["routes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RouteDetailsBindingType), reflect.TypeOf([]RouteDetails{}))) + fieldNameMap["routes"] = "Routes" + fields["source_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_address"] = "SourceAddress" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.routes_per_transport_node", fields, reflect.TypeOf(RoutesPerTransportNode{}), fieldNameMap, validators) +} + +func RoutingConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["forwarding_up_timer"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["forwarding_up_timer"] = "ForwardingUpTimer" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.routing_config", fields, reflect.TypeOf(RoutingConfig{}), fieldNameMap, validators) +} + +func RoutingGlobalConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allow_changing_vdr_mac_in_use"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["allow_changing_vdr_mac_in_use"] = "AllowChangingVdrMacInUse" + fields["l3_forwarding_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["l3_forwarding_mode"] = "L3ForwardingMode" + fields["logical_uplink_mtu"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["logical_uplink_mtu"] = "LogicalUplinkMtu" + fields["vdr_mac"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vdr_mac"] = "VdrMac" + fields["vdr_mac_nested"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vdr_mac_nested"] = "VdrMacNested" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.routing_global_config", fields, reflect.TypeOf(RoutingGlobalConfig{}), fieldNameMap, validators) +} + +func RoutingPolicyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["next_hop_prefix_lists_mappings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NextHopPrefixListsMappingBindingType), reflect.TypeOf([]NextHopPrefixListsMapping{}))) + fieldNameMap["next_hop_prefix_lists_mappings"] = "NextHopPrefixListsMappings" + fields["routing_policy_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["routing_policy_type"] = "RoutingPolicyType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.routing_policy", fields, reflect.TypeOf(RoutingPolicy{}), fieldNameMap, validators) +} + +func RowListFieldBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["alias"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["alias"] = "Alias" + fields["path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path"] = "Path" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.row_list_field", fields, reflect.TypeOf(RowListField{}), fieldNameMap, validators) +} + +func RuleStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ConfigurationStateElementBindingType), reflect.TypeOf([]ConfigurationStateElement{}))) + fieldNameMap["details"] = "Details" + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + fields["revision_desired"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["revision_desired"] = "RevisionDesired" + fields["pending_change_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PendingChangeBindingType), reflect.TypeOf([]PendingChange{}))) + fieldNameMap["pending_change_list"] = "PendingChangeList" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.rule_state", fields, reflect.TypeOf(RuleState{}), fieldNameMap, validators) +} + +func RuntimeInterfaceOperationalStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["interface_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interface_index"] = "InterfaceIndex" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.runtime_interface_operational_status", fields, reflect.TypeOf(RuntimeInterfaceOperationalStatus{}), fieldNameMap, validators) +} + +func RuntimeInterfaceStatisticsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(SIDataCounterBindingType)) + fieldNameMap["rx_bytes"] = "RxBytes" + fields["rx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(SIDataCounterBindingType)) + fieldNameMap["rx_packets"] = "RxPackets" + fields["tx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(SIDataCounterBindingType)) + fieldNameMap["tx_bytes"] = "TxBytes" + fields["tx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(SIDataCounterBindingType)) + fieldNameMap["tx_packets"] = "TxPackets" + fields["dropped_by_security_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(SIPacketsDroppedBySecurityBindingType)) + fieldNameMap["dropped_by_security_packets"] = "DroppedBySecurityPackets" + fields["mac_learning"] = bindings.NewOptionalType(bindings.NewReferenceType(SIMacLearningCountersBindingType)) + fieldNameMap["mac_learning"] = "MacLearning" + fields["interface_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["interface_index"] = "InterfaceIndex" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.runtime_interface_statistics", fields, reflect.TypeOf(RuntimeInterfaceStatistics{}), fieldNameMap, validators) +} + +func SHAPredefinedPluginProfileDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["check_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["check_interval"] = "CheckInterval" + fields["report_interval"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["report_interval"] = "ReportInterval" + fields["smallest_report_interval_if_change"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["smallest_report_interval_if_change"] = "SmallestReportIntervalIfChange" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.SHA_predefined_plugin_profile_data", fields, reflect.TypeOf(SHAPredefinedPluginProfileData{}), fieldNameMap, validators) +} + +func SIAggregatedDataCounterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(SIDataCounterBindingType)) + fieldNameMap["rx_bytes"] = "RxBytes" + fields["rx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(SIDataCounterBindingType)) + fieldNameMap["rx_packets"] = "RxPackets" + fields["tx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(SIDataCounterBindingType)) + fieldNameMap["tx_bytes"] = "TxBytes" + fields["tx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(SIDataCounterBindingType)) + fieldNameMap["tx_packets"] = "TxPackets" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.SI_aggregated_data_counter", fields, reflect.TypeOf(SIAggregatedDataCounter{}), fieldNameMap, validators) +} + +func SIAggregatedDataCounterExBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(SIDataCounterBindingType)) + fieldNameMap["rx_bytes"] = "RxBytes" + fields["rx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(SIDataCounterBindingType)) + fieldNameMap["rx_packets"] = "RxPackets" + fields["tx_bytes"] = bindings.NewOptionalType(bindings.NewReferenceType(SIDataCounterBindingType)) + fieldNameMap["tx_bytes"] = "TxBytes" + fields["tx_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(SIDataCounterBindingType)) + fieldNameMap["tx_packets"] = "TxPackets" + fields["dropped_by_security_packets"] = bindings.NewOptionalType(bindings.NewReferenceType(SIPacketsDroppedBySecurityBindingType)) + fieldNameMap["dropped_by_security_packets"] = "DroppedBySecurityPackets" + fields["mac_learning"] = bindings.NewOptionalType(bindings.NewReferenceType(SIMacLearningCountersBindingType)) + fieldNameMap["mac_learning"] = "MacLearning" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.SI_aggregated_data_counter_ex", fields, reflect.TypeOf(SIAggregatedDataCounterEx{}), fieldNameMap, validators) +} + +func SIDataCounterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dropped"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dropped"] = "Dropped" + fields["multicast_broadcast"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["multicast_broadcast"] = "MulticastBroadcast" + fields["total"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total"] = "Total" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.SI_data_counter", fields, reflect.TypeOf(SIDataCounter{}), fieldNameMap, validators) +} + +func SIErrorClassBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["error_id"] = "ErrorId" + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.SI_error_class", fields, reflect.TypeOf(SIErrorClass{}), fieldNameMap, validators) +} + +func SIExcludeListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["member_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["member_count"] = "MemberCount" + fields["members"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["members"] = "Members" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.SI_exclude_list", fields, reflect.TypeOf(SIExcludeList{}), fieldNameMap, validators) +} + +func SIMacLearningCountersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mac_not_learned_packets_allowed"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mac_not_learned_packets_allowed"] = "MacNotLearnedPacketsAllowed" + fields["mac_not_learned_packets_dropped"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mac_not_learned_packets_dropped"] = "MacNotLearnedPacketsDropped" + fields["macs_learned"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["macs_learned"] = "MacsLearned" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.SI_mac_learning_counters", fields, reflect.TypeOf(SIMacLearningCounters{}), fieldNameMap, validators) +} + +func SIPacketTypeAndCounterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["counter"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["counter"] = "Counter" + fields["packet_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["packet_type"] = "PacketType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.SI_packet_type_and_counter", fields, reflect.TypeOf(SIPacketTypeAndCounter{}), fieldNameMap, validators) +} + +func SIPacketsDroppedBySecurityBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bpdu_filter_dropped"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bpdu_filter_dropped"] = "BpduFilterDropped" + fields["dhcp_client_dropped_ipv4"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dhcp_client_dropped_ipv4"] = "DhcpClientDroppedIpv4" + fields["dhcp_client_dropped_ipv6"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dhcp_client_dropped_ipv6"] = "DhcpClientDroppedIpv6" + fields["dhcp_server_dropped_ipv4"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dhcp_server_dropped_ipv4"] = "DhcpServerDroppedIpv4" + fields["dhcp_server_dropped_ipv6"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dhcp_server_dropped_ipv6"] = "DhcpServerDroppedIpv6" + fields["spoof_guard_dropped"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SIPacketTypeAndCounterBindingType), reflect.TypeOf([]SIPacketTypeAndCounter{}))) + fieldNameMap["spoof_guard_dropped"] = "SpoofGuardDropped" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.SI_packets_dropped_by_security", fields, reflect.TypeOf(SIPacketsDroppedBySecurity{}), fieldNameMap, validators) +} + +func SIServiceProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(BaseServiceProfileBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.SI_service_profile_list_result", fields, reflect.TypeOf(SIServiceProfileListResult{}), fieldNameMap, validators) +} + +func SVMConfigureIssueBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SIErrorClassBindingType), reflect.TypeOf([]SIErrorClass{}))) + fieldNameMap["errors"] = "Errors" + fields["service_instance_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.SVM_configure_issue", fields, reflect.TypeOf(SVMConfigureIssue{}), fieldNameMap, validators) +} + +func SVMDeploymentSpecBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["host_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_type"] = "HostType" + fields["min_host_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["min_host_version"] = "MinHostVersion" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["ovf_url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ovf_url"] = "OvfUrl" + fields["service_form_factor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_form_factor"] = "ServiceFormFactor" + fields["svm_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["svm_version"] = "SvmVersion" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.SVM_deployment_spec", fields, reflect.TypeOf(SVMDeploymentSpec{}), fieldNameMap, validators) +} + +func SamlTokenLoginCredentialBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["thumbprint"] = "Thumbprint" + fields["token"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["token"] = "Token" + fields["credential_type"] = bindings.NewStringType() + fieldNameMap["credential_type"] = "CredentialType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.saml_token_login_credential", fields, reflect.TypeOf(SamlTokenLoginCredential{}), fieldNameMap, validators) +} + +func SamplingArgumentBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["sampling_type"] = bindings.NewStringType() + fieldNameMap["sampling_type"] = "SamplingType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.sampling_argument", fields, reflect.TypeOf(SamplingArgument{}), fieldNameMap, validators) +} + +func ScpProtocolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["authentication_scheme"] = bindings.NewOptionalType(bindings.NewReferenceType(PasswordAuthenticationSchemeBindingType)) + fieldNameMap["authentication_scheme"] = "AuthenticationScheme" + fields["ssh_fingerprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ssh_fingerprint"] = "SshFingerprint" + fields["name"] = bindings.NewStringType() + fieldNameMap["name"] = "Name" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.scp_protocol", fields, reflect.TypeOf(ScpProtocol{}), fieldNameMap, validators) +} + +func SearchResponseBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType(nil, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.search_response", fields, reflect.TypeOf(SearchResponse{}), fieldNameMap, validators) +} + +func SecurityCertificateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["pem_encoded"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pem_encoded"] = "PemEncoded" + fields["ssh_public_key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ssh_public_key"] = "SshPublicKey" + fields["text"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["text"] = "Text" + fields["valid_from"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["valid_from"] = "ValidFrom" + fields["valid_to"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["valid_to"] = "ValidTo" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.security_certificate", fields, reflect.TypeOf(SecurityCertificate{}), fieldNameMap, validators) +} + +func SecurityGlobalConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ca_signed_only"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ca_signed_only"] = "CaSignedOnly" + fields["crl_checking_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["crl_checking_enabled"] = "CrlCheckingEnabled" + fields["eku_checking_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["eku_checking_enabled"] = "EkuCheckingEnabled" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.security_global_config", fields, reflect.TypeOf(SecurityGlobalConfig{}), fieldNameMap, validators) +} + +func SelectableResourceReferenceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["is_valid"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_valid"] = "IsValid" + fields["target_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_display_name"] = "TargetDisplayName" + fields["target_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_id"] = "TargetId" + fields["target_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_type"] = "TargetType" + fields["selected"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["selected"] = "Selected" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.selectable_resource_reference", fields, reflect.TypeOf(SelectableResourceReference{}), fieldNameMap, validators) +} + +func SelectiveSyncSettingsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["selected_org_units"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["selected_org_units"] = "SelectedOrgUnits" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.selective_sync_settings", fields, reflect.TypeOf(SelectiveSyncSettings{}), fieldNameMap, validators) +} + +func SelfResourceLinkBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["href"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["href"] = "Href" + fields["rel"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["rel"] = "Rel" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.self_resource_link", fields, reflect.TypeOf(SelfResourceLink{}), fieldNameMap, validators) +} + +func ServerSslProfileBindingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate_chain_depth"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["certificate_chain_depth"] = "CertificateChainDepth" + fields["client_certificate_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["client_certificate_id"] = "ClientCertificateId" + fields["server_auth"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server_auth"] = "ServerAuth" + fields["server_auth_ca_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["server_auth_ca_ids"] = "ServerAuthCaIds" + fields["server_auth_crl_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["server_auth_crl_ids"] = "ServerAuthCrlIds" + fields["ssl_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ssl_profile_id"] = "SslProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.server_ssl_profile_binding", fields, reflect.TypeOf(ServerSslProfileBinding{}), fieldNameMap, validators) +} + +func ServiceAssociationListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["service_type"] = bindings.NewStringType() + fieldNameMap["service_type"] = "ServiceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_association_list_result", fields, reflect.TypeOf(ServiceAssociationListResult{}), fieldNameMap, validators) +} + +func ServiceAttachmentBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["attachment_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["attachment_status"] = "AttachmentStatus" + fields["deployed_to"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["deployed_to"] = "DeployedTo" + fields["local_ips"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPInfoBindingType), reflect.TypeOf([]IPInfo{}))) + fieldNameMap["local_ips"] = "LocalIps" + fields["logical_routers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["logical_routers"] = "LogicalRouters" + fields["logical_switch"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["logical_switch"] = "LogicalSwitch" + fields["service_port"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["service_port"] = "ServicePort" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_attachment", fields, reflect.TypeOf(ServiceAttachment{}), fieldNameMap, validators) +} + +func ServiceAttachmentListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceAttachmentBindingType), reflect.TypeOf([]ServiceAttachment{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_attachment_list_result", fields, reflect.TypeOf(ServiceAttachmentListResult{}), fieldNameMap, validators) +} + +func ServiceBindingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["service_id"] = "ServiceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_binding", fields, reflect.TypeOf(ServiceBinding{}), fieldNameMap, validators) +} + +func ServiceCapabilityBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["can_decrement_si"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["can_decrement_si"] = "CanDecrementSi" + fields["nsh_liveness_support_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["nsh_liveness_support_enabled"] = "NshLivenessSupportEnabled" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_capability", fields, reflect.TypeOf(ServiceCapability{}), fieldNameMap, validators) +} + +func ServiceChainBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["forward_path_service_profiles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["forward_path_service_profiles"] = "ForwardPathServiceProfiles" + fields["on_failure_policy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["on_failure_policy"] = "OnFailurePolicy" + fields["path_selection_policy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["path_selection_policy"] = "PathSelectionPolicy" + fields["reverse_path_service_profiles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["reverse_path_service_profiles"] = "ReversePathServiceProfiles" + fields["service_attachments"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["service_attachments"] = "ServiceAttachments" + fields["service_chain_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_chain_id"] = "ServiceChainId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_chain", fields, reflect.TypeOf(ServiceChain{}), fieldNameMap, validators) +} + +func ServiceChainListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceChainBindingType), reflect.TypeOf([]ServiceChain{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_chain_list_result", fields, reflect.TypeOf(ServiceChainListResult{}), fieldNameMap, validators) +} + +func ServiceChainMappingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["direction"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["direction"] = "Direction" + fields["service_chain_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_chain_id"] = "ServiceChainId" + fields["service_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["service_index"] = "ServiceIndex" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_chain_mapping", fields, reflect.TypeOf(ServiceChainMapping{}), fieldNameMap, validators) +} + +func ServiceChainMappingListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceChainMappingBindingType), reflect.TypeOf([]ServiceChainMapping{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_chain_mapping_list_result", fields, reflect.TypeOf(ServiceChainMappingListResult{}), fieldNameMap, validators) +} + +func ServiceConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["applied_to"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["applied_to"] = "AppliedTo" + fields["precedence"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["precedence"] = "Precedence" + fields["profiles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NSXProfileReferenceBindingType), reflect.TypeOf([]NSXProfileReference{}))) + fieldNameMap["profiles"] = "Profiles" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_config", fields, reflect.TypeOf(ServiceConfig{}), fieldNameMap, validators) +} + +func ServiceConfigListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceConfigBindingType), reflect.TypeOf([]ServiceConfig{}))) + fieldNameMap["service_configs"] = "ServiceConfigs" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_config_list", fields, reflect.TypeOf(ServiceConfigList{}), fieldNameMap, validators) +} + +func ServiceConfigListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceConfigBindingType), reflect.TypeOf([]ServiceConfig{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_config_list_result", fields, reflect.TypeOf(ServiceConfigListResult{}), fieldNameMap, validators) +} + +func ServiceDefinitionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["attachment_point"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["attachment_point"] = "AttachmentPoint" + fields["functionalities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["functionalities"] = "Functionalities" + fields["implementations"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["implementations"] = "Implementations" + fields["on_failure_policy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["on_failure_policy"] = "OnFailurePolicy" + fields["service_capability"] = bindings.NewOptionalType(bindings.NewReferenceType(ServiceCapabilityBindingType)) + fieldNameMap["service_capability"] = "ServiceCapability" + fields["service_deployment_spec"] = bindings.NewOptionalType(bindings.NewReferenceType(ServiceDeploymentSpecBindingType)) + fieldNameMap["service_deployment_spec"] = "ServiceDeploymentSpec" + fields["service_manager_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_manager_id"] = "ServiceManagerId" + fields["transports"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["transports"] = "Transports" + fields["vendor_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vendor_id"] = "VendorId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_definition", fields, reflect.TypeOf(ServiceDefinition{}), fieldNameMap, validators) +} + +func ServiceDeploymentBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["clustered_deployment_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["clustered_deployment_count"] = "ClusteredDeploymentCount" + fields["deployed_to"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["deployed_to"] = "DeployedTo" + fields["deployment_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["deployment_mode"] = "DeploymentMode" + fields["deployment_spec_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["deployment_spec_name"] = "DeploymentSpecName" + fields["deployment_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["deployment_type"] = "DeploymentType" + fields["instance_deployment_template"] = bindings.NewOptionalType(bindings.NewReferenceType(DeploymentTemplateBindingType)) + fieldNameMap["instance_deployment_template"] = "InstanceDeploymentTemplate" + fields["perimeter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["perimeter"] = "Perimeter" + fields["service_deployment_config"] = bindings.NewOptionalType(bindings.NewReferenceType(ServiceDeploymentConfigBindingType)) + fieldNameMap["service_deployment_config"] = "ServiceDeploymentConfig" + fields["service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_deployment", fields, reflect.TypeOf(ServiceDeployment{}), fieldNameMap, validators) +} + +func ServiceDeploymentConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["compute_collection_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["compute_collection_id"] = "ComputeCollectionId" + fields["compute_manager_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["compute_manager_id"] = "ComputeManagerId" + fields["host_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_id"] = "HostId" + fields["storage_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["storage_id"] = "StorageId" + fields["vm_nic_info"] = bindings.NewOptionalType(bindings.NewReferenceType(VmNicInfoBindingType)) + fieldNameMap["vm_nic_info"] = "VmNicInfo" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_deployment_config", fields, reflect.TypeOf(ServiceDeploymentConfig{}), fieldNameMap, validators) +} + +func ServiceDeploymentIssueBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["issue_description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["issue_description"] = "IssueDescription" + fields["issue_timestamp"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["issue_timestamp"] = "IssueTimestamp" + fields["issue_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["issue_type"] = "IssueType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_deployment_issue", fields, reflect.TypeOf(ServiceDeploymentIssue{}), fieldNameMap, validators) +} + +func ServiceDeploymentListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceDeploymentBindingType), reflect.TypeOf([]ServiceDeployment{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_deployment_list_result", fields, reflect.TypeOf(ServiceDeploymentListResult{}), fieldNameMap, validators) +} + +func ServiceDeploymentSpecBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["deployment_specs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SVMDeploymentSpecBindingType), reflect.TypeOf([]SVMDeploymentSpec{}))) + fieldNameMap["deployment_specs"] = "DeploymentSpecs" + fields["deployment_template"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DeploymentTemplateBindingType), reflect.TypeOf([]DeploymentTemplate{}))) + fieldNameMap["deployment_template"] = "DeploymentTemplate" + fields["nic_metadata_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NicMetadataBindingType), reflect.TypeOf([]NicMetadata{}))) + fieldNameMap["nic_metadata_list"] = "NicMetadataList" + fields["svm_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["svm_version"] = "SvmVersion" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_deployment_spec", fields, reflect.TypeOf(ServiceDeploymentSpec{}), fieldNameMap, validators) +} + +func ServiceDeploymentStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["deployment_issues"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceDeploymentIssueBindingType), reflect.TypeOf([]ServiceDeploymentIssue{}))) + fieldNameMap["deployment_issues"] = "DeploymentIssues" + fields["deployment_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["deployment_status"] = "DeploymentStatus" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["service_deployment_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_deployment_id"] = "ServiceDeploymentId" + fields["sva_current_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sva_current_version"] = "SvaCurrentVersion" + fields["sva_max_available_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sva_max_available_version"] = "SvaMaxAvailableVersion" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_deployment_status", fields, reflect.TypeOf(ServiceDeploymentStatus{}), fieldNameMap, validators) +} + +func ServiceEndpointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["certificate"] = "Certificate" + fields["certificate_sha256_thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["certificate_sha256_thumbprint"] = "CertificateSha256Thumbprint" + fields["entities_hosted"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(HostedEntityInfoBindingType), reflect.TypeOf([]HostedEntityInfo{}))) + fieldNameMap["entities_hosted"] = "EntitiesHosted" + fields["fqdn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["fqdn"] = "Fqdn" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["service_endpoint_uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_endpoint_uuid"] = "ServiceEndpointUuid" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_endpoint", fields, reflect.TypeOf(ServiceEndpoint{}), fieldNameMap, validators) +} + +func ServiceInsertionRuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_owner"] = bindings.NewOptionalType(bindings.NewReferenceType(OwnerResourceLinkBindingType)) + fieldNameMap["_owner"] = "Owner" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["applied_tos"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["applied_tos"] = "AppliedTos" + fields["destinations"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["destinations"] = "Destinations" + fields["destinations_excluded"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["destinations_excluded"] = "DestinationsExcluded" + fields["direction"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["direction"] = "Direction" + fields["disabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["disabled"] = "Disabled" + fields["ip_protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_protocol"] = "IpProtocol" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["logged"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["logged"] = "Logged" + fields["notes"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["notes"] = "Notes" + fields["priority"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["priority"] = "Priority" + fields["rule_tag"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["rule_tag"] = "RuleTag" + fields["sources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["sources"] = "Sources" + fields["sources_excluded"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sources_excluded"] = "SourcesExcluded" + fields["redirect_tos"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["redirect_tos"] = "RedirectTos" + fields["section_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fields["services"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceInsertionServiceBindingType), reflect.TypeOf([]ServiceInsertionService{}))) + fieldNameMap["services"] = "Services" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_insertion_rule", fields, reflect.TypeOf(ServiceInsertionRule{}), fieldNameMap, validators) +} + +func ServiceInsertionRuleListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceInsertionRuleBindingType), reflect.TypeOf([]ServiceInsertionRule{}))) + fieldNameMap["rules"] = "Rules" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_insertion_rule_list", fields, reflect.TypeOf(ServiceInsertionRuleList{}), fieldNameMap, validators) +} + +func ServiceInsertionRuleListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceInsertionRuleBindingType), reflect.TypeOf([]ServiceInsertionRule{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_insertion_rule_list_result", fields, reflect.TypeOf(ServiceInsertionRuleListResult{}), fieldNameMap, validators) +} + +func ServiceInsertionSectionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["applied_tos"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["applied_tos"] = "AppliedTos" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["rule_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rule_count"] = "RuleCount" + fields["section_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_type"] = "SectionType" + fields["stateful"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["stateful"] = "Stateful" + fields["tcp_strict"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["tcp_strict"] = "TcpStrict" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_insertion_section", fields, reflect.TypeOf(ServiceInsertionSection{}), fieldNameMap, validators) +} + +func ServiceInsertionSectionListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceInsertionSectionBindingType), reflect.TypeOf([]ServiceInsertionSection{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_insertion_section_list_result", fields, reflect.TypeOf(ServiceInsertionSectionListResult{}), fieldNameMap, validators) +} + +func ServiceInsertionSectionRuleListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["applied_tos"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["applied_tos"] = "AppliedTos" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["rule_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rule_count"] = "RuleCount" + fields["section_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_type"] = "SectionType" + fields["stateful"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["stateful"] = "Stateful" + fields["tcp_strict"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["tcp_strict"] = "TcpStrict" + fields["rules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceInsertionRuleBindingType), reflect.TypeOf([]ServiceInsertionRule{}))) + fieldNameMap["rules"] = "Rules" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_insertion_section_rule_list", fields, reflect.TypeOf(ServiceInsertionSectionRuleList{}), fieldNameMap, validators) +} + +func ServiceInsertionServiceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["is_valid"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_valid"] = "IsValid" + fields["target_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_display_name"] = "TargetDisplayName" + fields["target_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_id"] = "TargetId" + fields["target_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_type"] = "TargetType" + fields["service"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(NSServiceElementBindingType)}, bindings.REST)) + fieldNameMap["service"] = "Service" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_insertion_service", fields, reflect.TypeOf(ServiceInsertionService{}), fieldNameMap, validators) +} + +func ServiceInsertionServiceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceDefinitionBindingType), reflect.TypeOf([]ServiceDefinition{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_insertion_service_list_result", fields, reflect.TypeOf(ServiceInsertionServiceListResult{}), fieldNameMap, validators) +} + +func ServiceInsertionServiceProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["attributes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AttributeBindingType), reflect.TypeOf([]Attribute{}))) + fieldNameMap["attributes"] = "Attributes" + fields["redirection_action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["redirection_action"] = "RedirectionAction" + fields["service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fields["vendor_template_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vendor_template_id"] = "VendorTemplateId" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_insertion_service_profile", fields, reflect.TypeOf(ServiceInsertionServiceProfile{}), fieldNameMap, validators) +} + +func ServiceInsertionStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["context"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["context"] = "Context" + fields["global_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["global_status"] = "GlobalStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_insertion_status", fields, reflect.TypeOf(ServiceInsertionStatus{}), fieldNameMap, validators) +} + +func ServiceInsertionStatusListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceInsertionStatusBindingType), reflect.TypeOf([]ServiceInsertionStatus{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_insertion_status_list_result", fields, reflect.TypeOf(ServiceInsertionStatusListResult{}), fieldNameMap, validators) +} + +func ServiceInstanceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["attachment_point"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["attachment_point"] = "AttachmentPoint" + fields["deployed_to"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["deployed_to"] = "DeployedTo" + fields["deployment_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["deployment_mode"] = "DeploymentMode" + fields["deployment_spec_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["deployment_spec_name"] = "DeploymentSpecName" + fields["implementation_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["implementation_type"] = "ImplementationType" + fields["instance_deployment_config"] = bindings.NewOptionalType(bindings.NewReferenceType(InstanceDeploymentConfigBindingType)) + fieldNameMap["instance_deployment_config"] = "InstanceDeploymentConfig" + fields["instance_deployment_template"] = bindings.NewOptionalType(bindings.NewReferenceType(DeploymentTemplateBindingType)) + fieldNameMap["instance_deployment_template"] = "InstanceDeploymentTemplate" + fields["service_deployment_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_deployment_id"] = "ServiceDeploymentId" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["on_failure_policy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["on_failure_policy"] = "OnFailurePolicy" + fields["service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fields["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_type"] = "TransportType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_instance", fields, reflect.TypeOf(ServiceInstance{}), fieldNameMap, validators) +} + +func ServiceInstanceHealthStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["connect_timestamp"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["connect_timestamp"] = "ConnectTimestamp" + fields["is_stale"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_stale"] = "IsStale" + fields["is_sva_mux_incompatible"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_sva_mux_incompatible"] = "IsSvaMuxIncompatible" + fields["mux_connected_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mux_connected_status"] = "MuxConnectedStatus" + fields["mux_incompatible_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mux_incompatible_version"] = "MuxIncompatibleVersion" + fields["solution_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["solution_status"] = "SolutionStatus" + fields["solution_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["solution_version"] = "SolutionVersion" + fields["sync_time"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sync_time"] = "SyncTime" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_instance_health_status", fields, reflect.TypeOf(ServiceInstanceHealthStatus{}), fieldNameMap, validators) +} + +func ServiceInstanceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(BaseServiceInstanceBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_instance_list_result", fields, reflect.TypeOf(ServiceInstanceListResult{}), fieldNameMap, validators) +} + +func ServiceInstanceNSGroupsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["nsroups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NSGroupInfoBindingType), reflect.TypeOf([]NSGroupInfo{}))) + fieldNameMap["nsroups"] = "Nsroups" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_instance_NS_groups", fields, reflect.TypeOf(ServiceInstanceNSGroups{}), fieldNameMap, validators) +} + +func ServiceInstanceStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["configuration_issue"] = bindings.NewOptionalType(bindings.NewReferenceType(SVMConfigureIssueBindingType)) + fieldNameMap["configuration_issue"] = "ConfigurationIssue" + fields["instance_deployment_status"] = bindings.NewOptionalType(bindings.NewReferenceType(ServiceDeploymentStatusBindingType)) + fieldNameMap["instance_deployment_status"] = "InstanceDeploymentStatus" + fields["instance_health_status"] = bindings.NewOptionalType(bindings.NewReferenceType(ServiceInstanceHealthStatusBindingType)) + fieldNameMap["instance_health_status"] = "InstanceHealthStatus" + fields["service_instance_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_instance_status", fields, reflect.TypeOf(ServiceInstanceStatus{}), fieldNameMap, validators) +} + +func ServiceManagerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["authentication_scheme"] = bindings.NewOptionalType(bindings.NewReferenceType(CallbackAuthenticationSchemeBindingType)) + fieldNameMap["authentication_scheme"] = "AuthenticationScheme" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server"] = "Server" + fields["service_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceReferenceBindingType), reflect.TypeOf([]ResourceReference{}))) + fieldNameMap["service_ids"] = "ServiceIds" + fields["thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["thumbprint"] = "Thumbprint" + fields["uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uri"] = "Uri" + fields["vendor_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vendor_id"] = "VendorId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_manager", fields, reflect.TypeOf(ServiceManager{}), fieldNameMap, validators) +} + +func ServiceManagerListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServiceManagerBindingType), reflect.TypeOf([]ServiceManager{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_manager_list_result", fields, reflect.TypeOf(ServiceManagerListResult{}), fieldNameMap, validators) +} + +func ServicePathBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["forward_path"] = bindings.NewOptionalType(bindings.NewReferenceType(UnidirectionalServicePathBindingType)) + fieldNameMap["forward_path"] = "ForwardPath" + fields["reverse_path"] = bindings.NewOptionalType(bindings.NewReferenceType(UnidirectionalServicePathBindingType)) + fieldNameMap["reverse_path"] = "ReversePath" + fields["service_chain_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["service_chain_id"] = "ServiceChainId" + fields["service_chain_uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_chain_uuid"] = "ServiceChainUuid" + fields["service_path_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["service_path_id"] = "ServicePathId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_path", fields, reflect.TypeOf(ServicePath{}), fieldNameMap, validators) +} + +func ServicePathHopBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["action"] = "Action" + fields["can_decrement_si"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["can_decrement_si"] = "CanDecrementSi" + fields["in_maintenance_mode"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["in_maintenance_mode"] = "InMaintenanceMode" + fields["is_active_from_ccp"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_active_from_ccp"] = "IsActiveFromCcp" + fields["is_active_from_dp"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_active_from_dp"] = "IsActiveFromDp" + fields["is_active_from_mp"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_active_from_mp"] = "IsActiveFromMp" + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + fields["nsh_liveness_support"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["nsh_liveness_support"] = "NshLivenessSupport" + fields["vif"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vif"] = "Vif" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_path_hop", fields, reflect.TypeOf(ServicePathHop{}), fieldNameMap, validators) +} + +func ServicePathListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServicePathBindingType), reflect.TypeOf([]ServicePath{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_path_list_result", fields, reflect.TypeOf(ServicePathListResult{}), fieldNameMap, validators) +} + +func ServiceProfileNSGroupsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["nsroups"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NSGroupInfoBindingType), reflect.TypeOf([]NSGroupInfo{}))) + fieldNameMap["nsroups"] = "Nsroups" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_profile_NS_groups", fields, reflect.TypeOf(ServiceProfileNSGroups{}), fieldNameMap, validators) +} + +func ServiceRouterAllocationConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allocation_pool"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(EdgeClusterMemberAllocationPoolBindingType)}, bindings.REST)) + fieldNameMap["allocation_pool"] = "AllocationPool" + fields["edge_cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_cluster_id"] = "EdgeClusterId" + fields["edge_cluster_member_indices"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewIntegerType(), reflect.TypeOf([]int64{}))) + fieldNameMap["edge_cluster_member_indices"] = "EdgeClusterMemberIndices" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.service_router_allocation_config", fields, reflect.TypeOf(ServiceRouterAllocationConfig{}), fieldNameMap, validators) +} + +func SessionLoginCredentialBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["session_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["session_id"] = "SessionId" + fields["thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["thumbprint"] = "Thumbprint" + fields["credential_type"] = bindings.NewStringType() + fieldNameMap["credential_type"] = "CredentialType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.session_login_credential", fields, reflect.TypeOf(SessionLoginCredential{}), fieldNameMap, validators) +} + +func SetInterSiteAphCertificateRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cert_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cert_id"] = "CertId" + fields["used_by_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["used_by_id"] = "UsedById" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.set_inter_site_aph_certificate_request", fields, reflect.TypeOf(SetInterSiteAphCertificateRequest{}), fieldNameMap, validators) +} + +func SetPrincipalIdentityCertificateForFederationRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cert_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cert_id"] = "CertId" + fields["service_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_type"] = "ServiceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.set_principal_identity_certificate_for_federation_request", fields, reflect.TypeOf(SetPrincipalIdentityCertificateForFederationRequest{}), fieldNameMap, validators) +} + +func SetupDetailsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["principal_identity"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["principal_identity"] = "PrincipalIdentity" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.setup_details", fields, reflect.TypeOf(SetupDetails{}), fieldNameMap, validators) +} + +func SftpProtocolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["authentication_scheme"] = bindings.NewOptionalType(bindings.NewReferenceType(PasswordAuthenticationSchemeBindingType)) + fieldNameMap["authentication_scheme"] = "AuthenticationScheme" + fields["ssh_fingerprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ssh_fingerprint"] = "SshFingerprint" + fields["name"] = bindings.NewStringType() + fieldNameMap["name"] = "Name" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.sftp_protocol", fields, reflect.TypeOf(SftpProtocol{}), fieldNameMap, validators) +} + +func SiteCompatibilityInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["compatibility_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["compatibility_list"] = "CompatibilityList" + fields["site_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_version"] = "SiteVersion" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.site_compatibility_info", fields, reflect.TypeOf(SiteCompatibilityInfo{}), fieldNameMap, validators) +} + +func SiteStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["site_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_name"] = "SiteName" + fields["stubs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(StubStatusBindingType), reflect.TypeOf([]StubStatus{}))) + fieldNameMap["stubs"] = "Stubs" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.site_status", fields, reflect.TypeOf(SiteStatus{}), fieldNameMap, validators) +} + +func SnmpPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["v2c"] = bindings.NewOptionalType(bindings.NewReferenceType(Snmpv2cPropertiesBindingType)) + fieldNameMap["v2c"] = "V2c" + fields["v3"] = bindings.NewOptionalType(bindings.NewReferenceType(Snmpv3PropertiesBindingType)) + fieldNameMap["v3"] = "V3" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.snmp_properties", fields, reflect.TypeOf(SnmpProperties{}), fieldNameMap, validators) +} + +func SnmpServicePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["communities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["communities"] = "Communities" + fields["start_on_boot"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["start_on_boot"] = "StartOnBoot" + fields["v2_configured"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["v2_configured"] = "V2Configured" + fields["v3_auth_protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["v3_auth_protocol"] = "V3AuthProtocol" + fields["v3_configured"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["v3_configured"] = "V3Configured" + fields["v3_priv_protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["v3_priv_protocol"] = "V3PrivProtocol" + fields["v3_users"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SnmpV3UserBindingType), reflect.TypeOf([]SnmpV3User{}))) + fieldNameMap["v3_users"] = "V3Users" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.snmp_service_properties", fields, reflect.TypeOf(SnmpServiceProperties{}), fieldNameMap, validators) +} + +func SnmpV3UserBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["auth_password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["auth_password"] = "AuthPassword" + fields["priv_password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["priv_password"] = "PrivPassword" + fields["user_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["user_id"] = "UserId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.snmp_v3_user", fields, reflect.TypeOf(SnmpV3User{}), fieldNameMap, validators) +} + +func Snmpv2cCommunityBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["access"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["access"] = "Access" + fields["community_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["community_name"] = "CommunityName" + fields["community_string"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["community_string"] = "CommunityString" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.snmpv2c_community", fields, reflect.TypeOf(Snmpv2cCommunity{}), fieldNameMap, validators) +} + +func Snmpv2cPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["communities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(Snmpv2cCommunityBindingType), reflect.TypeOf([]Snmpv2cCommunity{}))) + fieldNameMap["communities"] = "Communities" + fields["targets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(Snmpv2cTargetBindingType), reflect.TypeOf([]Snmpv2cTarget{}))) + fieldNameMap["targets"] = "Targets" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.snmpv2c_properties", fields, reflect.TypeOf(Snmpv2cProperties{}), fieldNameMap, validators) +} + +func Snmpv2cTargetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["community_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["community_name"] = "CommunityName" + fields["community_string"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["community_string"] = "CommunityString" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server"] = "Server" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.snmpv2c_target", fields, reflect.TypeOf(Snmpv2cTarget{}), fieldNameMap, validators) +} + +func Snmpv3PropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["auth_protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["auth_protocol"] = "AuthProtocol" + fields["priv_protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["priv_protocol"] = "PrivProtocol" + fields["targets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(Snmpv3TargetBindingType), reflect.TypeOf([]Snmpv3Target{}))) + fieldNameMap["targets"] = "Targets" + fields["users"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(Snmpv3UserBindingType), reflect.TypeOf([]Snmpv3User{}))) + fieldNameMap["users"] = "Users" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.snmpv3_properties", fields, reflect.TypeOf(Snmpv3Properties{}), fieldNameMap, validators) +} + +func Snmpv3TargetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["security_level"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["security_level"] = "SecurityLevel" + fields["server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server"] = "Server" + fields["user_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["user_id"] = "UserId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.snmpv3_target", fields, reflect.TypeOf(Snmpv3Target{}), fieldNameMap, validators) +} + +func Snmpv3UserBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["access"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["access"] = "Access" + fields["auth_password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["auth_password"] = "AuthPassword" + fields["priv_password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["priv_password"] = "PrivPassword" + fields["security_level"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["security_level"] = "SecurityLevel" + fields["user_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["user_id"] = "UserId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.snmpv3_user", fields, reflect.TypeOf(Snmpv3User{}), fieldNameMap, validators) +} + +func SoftwareModuleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["module_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["module_name"] = "ModuleName" + fields["module_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["module_version"] = "ModuleVersion" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.software_module", fields, reflect.TypeOf(SoftwareModule{}), fieldNameMap, validators) +} + +func SoftwareModuleResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["software_modules"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SoftwareModuleBindingType), reflect.TypeOf([]SoftwareModule{}))) + fieldNameMap["software_modules"] = "SoftwareModules" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.software_module_result", fields, reflect.TypeOf(SoftwareModuleResult{}), fieldNameMap, validators) +} + +func SolutionConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["control_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["control_ip"] = "ControlIp" + fields["listen_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["listen_port"] = "ListenPort" + fields["service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fields["solution_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["solution_id"] = "SolutionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.solution_config", fields, reflect.TypeOf(SolutionConfig{}), fieldNameMap, validators) +} + +func SolutionConfigListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SolutionConfigBindingType), reflect.TypeOf([]SolutionConfig{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.solution_config_list_result", fields, reflect.TypeOf(SolutionConfigListResult{}), fieldNameMap, validators) +} + +func SourceEntityBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["source_entity_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_entity_id"] = "SourceEntityId" + fields["source_entity_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source_entity_type"] = "SourceEntityType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.source_entity", fields, reflect.TypeOf(SourceEntity{}), fieldNameMap, validators) +} + +func SourceEntityResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SourceEntityBindingType), reflect.TypeOf([]SourceEntity{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.source_entity_result", fields, reflect.TypeOf(SourceEntityResult{}), fieldNameMap, validators) +} + +func SourceNsxApiEndpointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["auth_token"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["auth_token"] = "AuthToken" + fields["ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip"] = "Ip" + fields["nsx_password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nsx_password"] = "NsxPassword" + fields["nsx_syncrole"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nsx_syncrole"] = "NsxSyncrole" + fields["nsx_username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nsx_username"] = "NsxUsername" + fields["nsx_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nsx_version"] = "NsxVersion" + fields["vc_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vc_ip"] = "VcIp" + fields["vc_password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vc_password"] = "VcPassword" + fields["vc_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vc_port"] = "VcPort" + fields["vc_username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vc_username"] = "VcUsername" + fields["vc_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vc_version"] = "VcVersion" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.source_nsx_api_endpoint", fields, reflect.TypeOf(SourceNsxApiEndpoint{}), fieldNameMap, validators) +} + +func SpacerWidgetConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["feature_set"] = bindings.NewOptionalType(bindings.NewReferenceType(FeatureSetBindingType)) + fieldNameMap["feature_set"] = "FeatureSet" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["filters"] = "Filters" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["plot_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(WidgetPlotConfigurationBindingType), reflect.TypeOf([]WidgetPlotConfiguration{}))) + fieldNameMap["plot_configs"] = "PlotConfigs" + fields["rowspan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rowspan"] = "Rowspan" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["show_header"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_header"] = "ShowHeader" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.spacer_widget_configuration", fields, reflect.TypeOf(SpacerWidgetConfiguration{}), fieldNameMap, validators) +} + +func SpoofGuardSwitchingProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["white_list_providers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["white_list_providers"] = "WhiteListProviders" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["required_capabilities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["required_capabilities"] = "RequiredCapabilities" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.spoof_guard_switching_profile", fields, reflect.TypeOf(SpoofGuardSwitchingProfile{}), fieldNameMap, validators) +} + +func SshKeyBasePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["label"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["label"] = "Label" + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ssh_key_base_properties", fields, reflect.TypeOf(SshKeyBaseProperties{}), fieldNameMap, validators) +} + +func SshKeyPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["label"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["label"] = "Label" + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ssh_key_properties", fields, reflect.TypeOf(SshKeyProperties{}), fieldNameMap, validators) +} + +func SshKeyPropertiesListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SshKeyPropertiesBindingType), reflect.TypeOf([]SshKeyProperties{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ssh_key_properties_list_result", fields, reflect.TypeOf(SshKeyPropertiesListResult{}), fieldNameMap, validators) +} + +func SshServicePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["root_login"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["root_login"] = "RootLogin" + fields["start_on_boot"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["start_on_boot"] = "StartOnBoot" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.ssh_service_properties", fields, reflect.TypeOf(SshServiceProperties{}), fieldNameMap, validators) +} + +func StandardHostSwitchBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cpu_config"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(CpuCoreConfigForEnhancedNetworkingStackSwitchBindingType), reflect.TypeOf([]CpuCoreConfigForEnhancedNetworkingStackSwitch{}))) + fieldNameMap["cpu_config"] = "CpuConfig" + fields["host_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_switch_id"] = "HostSwitchId" + fields["host_switch_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_switch_mode"] = "HostSwitchMode" + fields["host_switch_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_switch_name"] = "HostSwitchName" + fields["host_switch_profile_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(HostSwitchProfileTypeIdEntryBindingType), reflect.TypeOf([]HostSwitchProfileTypeIdEntry{}))) + fieldNameMap["host_switch_profile_ids"] = "HostSwitchProfileIds" + fields["host_switch_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_switch_type"] = "HostSwitchType" + fields["ip_assignment_spec"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(IpAssignmentSpecBindingType)}, bindings.REST)) + fieldNameMap["ip_assignment_spec"] = "IpAssignmentSpec" + fields["is_migrate_pnics"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_migrate_pnics"] = "IsMigratePnics" + fields["pnics"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PnicBindingType), reflect.TypeOf([]Pnic{}))) + fieldNameMap["pnics"] = "Pnics" + fields["pnics_uninstall_migration"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(PnicBindingType), reflect.TypeOf([]Pnic{}))) + fieldNameMap["pnics_uninstall_migration"] = "PnicsUninstallMigration" + fields["portgroup_transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["portgroup_transport_zone_id"] = "PortgroupTransportZoneId" + fields["transport_zone_endpoints"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TransportZoneEndPointBindingType), reflect.TypeOf([]TransportZoneEndPoint{}))) + fieldNameMap["transport_zone_endpoints"] = "TransportZoneEndpoints" + fields["uplinks"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VdsUplinkBindingType), reflect.TypeOf([]VdsUplink{}))) + fieldNameMap["uplinks"] = "Uplinks" + fields["vmk_install_migration"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VmknicNetworkBindingType), reflect.TypeOf([]VmknicNetwork{}))) + fieldNameMap["vmk_install_migration"] = "VmkInstallMigration" + fields["vmk_uninstall_migration"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VmknicNetworkBindingType), reflect.TypeOf([]VmknicNetwork{}))) + fieldNameMap["vmk_uninstall_migration"] = "VmkUninstallMigration" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.standard_host_switch", fields, reflect.TypeOf(StandardHostSwitch{}), fieldNameMap, validators) +} + +func StandardHostSwitchSpecBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["host_switches"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(StandardHostSwitchBindingType), reflect.TypeOf([]StandardHostSwitch{}))) + fieldNameMap["host_switches"] = "HostSwitches" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.standard_host_switch_spec", fields, reflect.TypeOf(StandardHostSwitchSpec{}), fieldNameMap, validators) +} + +func StandbyRelocationConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["standby_relocation_threshold"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["standby_relocation_threshold"] = "StandbyRelocationThreshold" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.standby_relocation_config", fields, reflect.TypeOf(StandbyRelocationConfig{}), fieldNameMap, validators) +} + +func StatItemBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["tooltip"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TooltipBindingType), reflect.TypeOf([]Tooltip{}))) + fieldNameMap["tooltip"] = "Tooltip" + fields["total"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["total"] = "Total" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.stat_item", fields, reflect.TypeOf(StatItem{}), fieldNameMap, validators) +} + +func StaticFilterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["additional_value"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["additional_value"] = "AdditionalValue" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["short_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["short_display_name"] = "ShortDisplayName" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.static_filter", fields, reflect.TypeOf(StaticFilter{}), fieldNameMap, validators) +} + +func StaticHopBfdPeerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["bfd_config"] = bindings.NewOptionalType(bindings.NewReferenceType(BfdConfigParametersBindingType)) + fieldNameMap["bfd_config"] = "BfdConfig" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["peer_ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["peer_ip_address"] = "PeerIpAddress" + fields["source_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["source_addresses"] = "SourceAddresses" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.static_hop_bfd_peer", fields, reflect.TypeOf(StaticHopBfdPeer{}), fieldNameMap, validators) +} + +func StaticHopBfdPeerListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(StaticHopBfdPeerBindingType), reflect.TypeOf([]StaticHopBfdPeer{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.static_hop_bfd_peer_list_result", fields, reflect.TypeOf(StaticHopBfdPeerListResult{}), fieldNameMap, validators) +} + +func StaticIpListSpecBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["default_gateway"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["default_gateway"] = "DefaultGateway" + fields["ip_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_list"] = "IpList" + fields["subnet_mask"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["subnet_mask"] = "SubnetMask" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.static_ip_list_spec", fields, reflect.TypeOf(StaticIpListSpec{}), fieldNameMap, validators) +} + +func StaticIpMacListSpecBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["default_gateway"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["default_gateway"] = "DefaultGateway" + fields["ip_mac_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IpMacPairBindingType), reflect.TypeOf([]IpMacPair{}))) + fieldNameMap["ip_mac_list"] = "IpMacList" + fields["subnet_mask"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["subnet_mask"] = "SubnetMask" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.static_ip_mac_list_spec", fields, reflect.TypeOf(StaticIpMacListSpec{}), fieldNameMap, validators) +} + +func StaticIpPoolSpecBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_pool_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_pool_id"] = "IpPoolId" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.static_ip_pool_spec", fields, reflect.TypeOf(StaticIpPoolSpec{}), fieldNameMap, validators) +} + +func StaticRouteBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fields["network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network"] = "Network" + fields["next_hops"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(StaticRouteNextHopBindingType), reflect.TypeOf([]StaticRouteNextHop{}))) + fieldNameMap["next_hops"] = "NextHops" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.static_route", fields, reflect.TypeOf(StaticRoute{}), fieldNameMap, validators) +} + +func StaticRouteListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(StaticRouteBindingType), reflect.TypeOf([]StaticRoute{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.static_route_list_result", fields, reflect.TypeOf(StaticRouteListResult{}), fieldNameMap, validators) +} + +func StaticRouteNextHopBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["administrative_distance"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["administrative_distance"] = "AdministrativeDistance" + fields["bfd_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["bfd_enabled"] = "BfdEnabled" + fields["blackhole_action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["blackhole_action"] = "BlackholeAction" + fields["ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ip_address"] = "IpAddress" + fields["logical_router_port_id"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["logical_router_port_id"] = "LogicalRouterPortId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.static_route_next_hop", fields, reflect.TypeOf(StaticRouteNextHop{}), fieldNameMap, validators) +} + +func StatsConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["label"] = bindings.NewOptionalType(bindings.NewReferenceType(LabelBindingType)) + fieldNameMap["label"] = "Label" + fields["navigation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["navigation"] = "Navigation" + fields["sections"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DonutSectionBindingType), reflect.TypeOf([]DonutSection{}))) + fieldNameMap["sections"] = "Sections" + fields["stat"] = bindings.NewOptionalType(bindings.NewReferenceType(StatItemBindingType)) + fieldNameMap["stat"] = "Stat" + fields["sub_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sub_type"] = "SubType" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["feature_set"] = bindings.NewOptionalType(bindings.NewReferenceType(FeatureSetBindingType)) + fieldNameMap["feature_set"] = "FeatureSet" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["filters"] = "Filters" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["plot_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(WidgetPlotConfigurationBindingType), reflect.TypeOf([]WidgetPlotConfiguration{}))) + fieldNameMap["plot_configs"] = "PlotConfigs" + fields["rowspan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rowspan"] = "Rowspan" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["show_header"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_header"] = "ShowHeader" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.stats_configuration", fields, reflect.TypeOf(StatsConfiguration{}), fieldNameMap, validators) +} + +func StatusCountBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["degraded_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["degraded_count"] = "DegradedCount" + fields["down_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["down_count"] = "DownCount" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["up_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["up_count"] = "UpCount" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.status_count", fields, reflect.TypeOf(StatusCount{}), fieldNameMap, validators) +} + +func StructuredDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["audit"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["audit"] = "Audit" + fields["comp"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["comp"] = "Comp" + fields["ent_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ent_id"] = "EntId" + fields["ereq_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ereq_id"] = "EreqId" + fields["error_code"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_code"] = "ErrorCode" + fields["level"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["level"] = "Level" + fields["req_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["req_id"] = "ReqId" + fields["s2comp"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["s2comp"] = "S2comp" + fields["security"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["security"] = "Security" + fields["subcomp"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["subcomp"] = "Subcomp" + fields["username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["username"] = "Username" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.structured_data", fields, reflect.TypeOf(StructuredData{}), fieldNameMap, validators) +} + +func StubStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["address"] = "Address" + fields["connection_up"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["connection_up"] = "ConnectionUp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.stub_status", fields, reflect.TypeOf(StubStatus{}), fieldNameMap, validators) +} + +func SubPoolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["remaining_credit_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["remaining_credit_number"] = "RemainingCreditNumber" + fields["sub_pool_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sub_pool_type"] = "SubPoolType" + fields["usage_percentage"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["usage_percentage"] = "UsagePercentage" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.sub_pool", fields, reflect.TypeOf(SubPool{}), fieldNameMap, validators) +} + +func SubjectAltNamesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dns_names"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dns_names"] = "DnsNames" + fields["ip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ip_addresses"] = "IpAddresses" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.subject_alt_names", fields, reflect.TypeOf(SubjectAltNames{}), fieldNameMap, validators) +} + +func SubjectPublicKeyHashBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["public_key_sha256_hashes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["public_key_sha256_hashes"] = "PublicKeySha256Hashes" + fields["subject"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["subject"] = "Subject" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.subject_public_key_hash", fields, reflect.TypeOf(SubjectPublicKeyHash{}), fieldNameMap, validators) +} + +func SuccessNodeSupportBundleResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bundle_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["bundle_name"] = "BundleName" + fields["bundle_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["bundle_size"] = "BundleSize" + fields["node_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_display_name"] = "NodeDisplayName" + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fields["sha256_thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sha256_thumbprint"] = "Sha256Thumbprint" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.success_node_support_bundle_result", fields, reflect.TypeOf(SuccessNodeSupportBundleResult{}), fieldNameMap, validators) +} + +func SummaryMigrationFeedbackRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["details"] = "Details" + fields["federation_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["federation_site_id"] = "FederationSiteId" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["object_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["object_id"] = "ObjectId" + fields["rejected"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["rejected"] = "Rejected" + fields["resolution"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resolution"] = "Resolution" + fields["resolved"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["resolved"] = "Resolved" + fields["v_object_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["v_object_id"] = "VObjectId" + fields["v_object_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["v_object_name"] = "VObjectName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.summary_migration_feedback_request", fields, reflect.TypeOf(SummaryMigrationFeedbackRequest{}), fieldNameMap, validators) +} + +func SupportBundleContainerNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_type"] = bindings.NewStringType() + fieldNameMap["container_type"] = "ContainerType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.support_bundle_container_node", fields, reflect.TypeOf(SupportBundleContainerNode{}), fieldNameMap, validators) +} + +func SupportBundleFileTransferAuthenticationSchemeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["scheme_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scheme_name"] = "SchemeName" + fields["username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["username"] = "Username" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.support_bundle_file_transfer_authentication_scheme", fields, reflect.TypeOf(SupportBundleFileTransferAuthenticationScheme{}), fieldNameMap, validators) +} + +func SupportBundleFileTransferProtocolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["authentication_scheme"] = bindings.NewOptionalType(bindings.NewReferenceType(SupportBundleFileTransferAuthenticationSchemeBindingType)) + fieldNameMap["authentication_scheme"] = "AuthenticationScheme" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["ssh_fingerprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ssh_fingerprint"] = "SshFingerprint" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.support_bundle_file_transfer_protocol", fields, reflect.TypeOf(SupportBundleFileTransferProtocol{}), fieldNameMap, validators) +} + +func SupportBundleQueryParametersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["all"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["all"] = "All" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.support_bundle_query_parameters", fields, reflect.TypeOf(SupportBundleQueryParameters{}), fieldNameMap, validators) +} + +func SupportBundleRemoteFileServerBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["directory_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["directory_path"] = "DirectoryPath" + fields["manager_upload_only"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["manager_upload_only"] = "ManagerUploadOnly" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["protocol"] = bindings.NewOptionalType(bindings.NewReferenceType(SupportBundleFileTransferProtocolBindingType)) + fieldNameMap["protocol"] = "Protocol" + fields["server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server"] = "Server" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.support_bundle_remote_file_server", fields, reflect.TypeOf(SupportBundleRemoteFileServer{}), fieldNameMap, validators) +} + +func SupportBundleRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_nodes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(SupportBundleContainerNodeBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["container_nodes"] = "ContainerNodes" + fields["content_filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["content_filters"] = "ContentFilters" + fields["dynamic_content_filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dynamic_content_filters"] = "DynamicContentFilters" + fields["log_age_limit"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["log_age_limit"] = "LogAgeLimit" + fields["nodes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["nodes"] = "Nodes" + fields["remote_file_server"] = bindings.NewOptionalType(bindings.NewReferenceType(SupportBundleRemoteFileServerBindingType)) + fieldNameMap["remote_file_server"] = "RemoteFileServer" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.support_bundle_request", fields, reflect.TypeOf(SupportBundleRequest{}), fieldNameMap, validators) +} + +func SupportBundleResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["failed_nodes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(FailedNodeSupportBundleResultBindingType), reflect.TypeOf([]FailedNodeSupportBundleResult{}))) + fieldNameMap["failed_nodes"] = "FailedNodes" + fields["remaining_nodes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(RemainingSupportBundleNodeBindingType), reflect.TypeOf([]RemainingSupportBundleNode{}))) + fieldNameMap["remaining_nodes"] = "RemainingNodes" + fields["request_properties"] = bindings.NewOptionalType(bindings.NewReferenceType(SupportBundleRequestBindingType)) + fieldNameMap["request_properties"] = "RequestProperties" + fields["success_nodes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SuccessNodeSupportBundleResultBindingType), reflect.TypeOf([]SuccessNodeSupportBundleResult{}))) + fieldNameMap["success_nodes"] = "SuccessNodes" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.support_bundle_result", fields, reflect.TypeOf(SupportBundleResult{}), fieldNameMap, validators) +} + +func SupportedHostOSListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.supported_host_OS_list_result", fields, reflect.TypeOf(SupportedHostOSListResult{}), fieldNameMap, validators) +} + +func SvmConnectivityStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["connectivity_status"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["connectivity_status"] = "ConnectivityStatus" + fields["service_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_name"] = "ServiceName" + fields["solution_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["solution_id"] = "SolutionId" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredResourceScopeBindingType), reflect.TypeOf([]DiscoveredResourceScope{}))) + fieldNameMap["scope"] = "Scope" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.svm_connectivity_status", fields, reflect.TypeOf(SvmConnectivityStatus{}), fieldNameMap, validators) +} + +func SwitchSecuritySwitchingProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["block_non_ip_traffic"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["block_non_ip_traffic"] = "BlockNonIpTraffic" + fields["bpdu_filter"] = bindings.NewOptionalType(bindings.NewReferenceType(BpduFilterBindingType)) + fieldNameMap["bpdu_filter"] = "BpduFilter" + fields["dhcp_filter"] = bindings.NewOptionalType(bindings.NewReferenceType(DhcpFilterBindingType)) + fieldNameMap["dhcp_filter"] = "DhcpFilter" + fields["ra_guard_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ra_guard_enabled"] = "RaGuardEnabled" + fields["rate_limits"] = bindings.NewOptionalType(bindings.NewReferenceType(RateLimitsBindingType)) + fieldNameMap["rate_limits"] = "RateLimits" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["required_capabilities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["required_capabilities"] = "RequiredCapabilities" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.switch_security_switching_profile", fields, reflect.TypeOf(SwitchSecuritySwitchingProfile{}), fieldNameMap, validators) +} + +func SwitchingGlobalConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["arp_limit_per_lr"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["arp_limit_per_lr"] = "ArpLimitPerLr" + fields["global_replication_mode_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["global_replication_mode_enabled"] = "GlobalReplicationModeEnabled" + fields["physical_uplink_mtu"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["physical_uplink_mtu"] = "PhysicalUplinkMtu" + fields["remote_tunnel_physical_mtu"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["remote_tunnel_physical_mtu"] = "RemoteTunnelPhysicalMtu" + fields["uplink_mtu_threshold"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["uplink_mtu_threshold"] = "UplinkMtuThreshold" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.switching_global_config", fields, reflect.TypeOf(SwitchingGlobalConfig{}), fieldNameMap, validators) +} + +func SwitchingProfileStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["num_logical_ports"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["num_logical_ports"] = "NumLogicalPorts" + fields["num_logical_switches"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["num_logical_switches"] = "NumLogicalSwitches" + fields["switching_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["switching_profile_id"] = "SwitchingProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.switching_profile_status", fields, reflect.TypeOf(SwitchingProfileStatus{}), fieldNameMap, validators) +} + +func SwitchingProfileTypeIdEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key"] = "Key" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.switching_profile_type_id_entry", fields, reflect.TypeOf(SwitchingProfileTypeIdEntry{}), fieldNameMap, validators) +} + +func SwitchingProfilesListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(BaseSwitchingProfileBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.switching_profiles_list_result", fields, reflect.TypeOf(SwitchingProfilesListResult{}), fieldNameMap, validators) +} + +func SwitchingToVmcModeParametersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mode_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mode_id"] = "ModeId" + fields["auth_code"] = bindings.NewOptionalType(bindings.NewReferenceType(Oauth2CredentialsBindingType)) + fieldNameMap["auth_code"] = "AuthCode" + fields["base_url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["base_url"] = "BaseUrl" + fields["basic_auth_whitelist_ips"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["basic_auth_whitelist_ips"] = "BasicAuthWhitelistIps" + fields["csp_access_token_uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["csp_access_token_uri"] = "CspAccessTokenUri" + fields["csp_client_credential"] = bindings.NewOptionalType(bindings.NewReferenceType(Oauth2CredentialsBindingType)) + fieldNameMap["csp_client_credential"] = "CspClientCredential" + fields["csp_client_incoming_credentials"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["csp_client_incoming_credentials"] = "CspClientIncomingCredentials" + fields["csp_logout_uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["csp_logout_uri"] = "CspLogoutUri" + fields["csp_org_uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["csp_org_uri"] = "CspOrgUri" + fields["csp_public_key_uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["csp_public_key_uri"] = "CspPublicKeyUri" + fields["csp_time_drift"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["csp_time_drift"] = "CspTimeDrift" + fields["csp_user_authorization_uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["csp_user_authorization_uri"] = "CspUserAuthorizationUri" + fields["csp_user_info_uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["csp_user_info_uri"] = "CspUserInfoUri" + fields["default_org_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["default_org_id"] = "DefaultOrgId" + fields["ea_org"] = bindings.NewOptionalType(bindings.NewReferenceType(OrgInfoBindingType)) + fieldNameMap["ea_org"] = "EaOrg" + fields["gss_org"] = bindings.NewOptionalType(bindings.NewReferenceType(OrgInfoBindingType)) + fieldNameMap["gss_org"] = "GssOrg" + fields["mode_change_only"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["mode_change_only"] = "ModeChangeOnly" + fields["proxy_host"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["proxy_host"] = "ProxyHost" + fields["proxy_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["proxy_port"] = "ProxyPort" + fields["public_client_info"] = bindings.NewOptionalType(bindings.NewReferenceType(PublicClientInfoBindingType)) + fieldNameMap["public_client_info"] = "PublicClientInfo" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["sddc_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sddc_id"] = "SddcId" + fields["service_definition_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_definition_id"] = "ServiceDefinitionId" + fields["sre_org"] = bindings.NewOptionalType(bindings.NewReferenceType(OrgInfoBindingType)) + fieldNameMap["sre_org"] = "SreOrg" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.switching_to_vmc_mode_parameters", fields, reflect.TypeOf(SwitchingToVmcModeParameters{}), fieldNameMap, validators) +} + +func SwitchoverStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["current_step"] = bindings.NewOptionalType(bindings.NewReferenceType(ProgressItemBindingType)) + fieldNameMap["current_step"] = "CurrentStep" + fields["current_step_number"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["current_step_number"] = "CurrentStepNumber" + fields["note"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["note"] = "Note" + fields["number_of_steps"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["number_of_steps"] = "NumberOfSteps" + fields["overall_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["overall_status"] = "OverallStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.switchover_status", fields, reflect.TypeOf(SwitchoverStatus{}), fieldNameMap, validators) +} + +func SyslogConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["log_level"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["log_level"] = "LogLevel" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["port"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["port"] = "Port" + fields["protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["protocol"] = "Protocol" + fields["server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server"] = "Server" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.syslog_configuration", fields, reflect.TypeOf(SyslogConfiguration{}), fieldNameMap, validators) +} + +func SyslogExporterBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["max_log_level"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["max_log_level"] = "MaxLogLevel" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["protocol"] = "Protocol" + fields["server"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["server"] = "Server" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.syslog_exporter", fields, reflect.TypeOf(SyslogExporter{}), fieldNameMap, validators) +} + +func SyslogPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["exporters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SyslogExporterBindingType), reflect.TypeOf([]SyslogExporter{}))) + fieldNameMap["exporters"] = "Exporters" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.syslog_properties", fields, reflect.TypeOf(SyslogProperties{}), fieldNameMap, validators) +} + +func SystemHealthAgentProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["config"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["config"] = "Config" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["plugin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["plugin_id"] = "PluginId" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.system_health_agent_profile", fields, reflect.TypeOf(SystemHealthAgentProfile{}), fieldNameMap, validators) +} + +func SystemHealthAgentProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SystemHealthAgentProfileBindingType), reflect.TypeOf([]SystemHealthAgentProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.system_health_agent_profile_list_result", fields, reflect.TypeOf(SystemHealthAgentProfileListResult{}), fieldNameMap, validators) +} + +func SystemHealthPluginProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["config"] = bindings.NewOptionalType(bindings.NewReferenceType(SHAPredefinedPluginProfileDataBindingType)) + fieldNameMap["config"] = "Config" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["node_types"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["node_types"] = "NodeTypes" + fields["publisher"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["publisher"] = "Publisher" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.system_health_plugin_profile", fields, reflect.TypeOf(SystemHealthPluginProfile{}), fieldNameMap, validators) +} + +func SystemHealthPluginProfileListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SystemHealthPluginProfileBindingType), reflect.TypeOf([]SystemHealthPluginProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.system_health_plugin_profile_list", fields, reflect.TypeOf(SystemHealthPluginProfileList{}), fieldNameMap, validators) +} + +func TagBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["scope"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scope"] = "Scope" + fields["tag"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tag"] = "Tag" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.tag", fields, reflect.TypeOf(Tag{}), fieldNameMap, validators) +} + +func TargetResourceStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["target_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_id"] = "TargetId" + fields["target_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_status"] = "TargetStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.target_resource_status", fields, reflect.TypeOf(TargetResourceStatus{}), fieldNameMap, validators) +} + +func TaskListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TaskPropertiesBindingType), reflect.TypeOf([]TaskProperties{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.task_list_result", fields, reflect.TypeOf(TaskListResult{}), fieldNameMap, validators) +} + +func TaskPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["async_response_available"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["async_response_available"] = "AsyncResponseAvailable" + fields["cancelable"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["cancelable"] = "Cancelable" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["end_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["end_time"] = "EndTime" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["message"] = "Message" + fields["progress"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["progress"] = "Progress" + fields["request_method"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_method"] = "RequestMethod" + fields["request_uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_uri"] = "RequestUri" + fields["start_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["start_time"] = "StartTime" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["user"] = "User" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.task_properties", fields, reflect.TypeOf(TaskProperties{}), fieldNameMap, validators) +} + +func TcpHeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dst_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dst_port"] = "DstPort" + fields["src_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["src_port"] = "SrcPort" + fields["tcp_flags"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["tcp_flags"] = "TcpFlags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.tcp_header", fields, reflect.TypeOf(TcpHeader{}), fieldNameMap, validators) +} + +func TcpMssClampingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["direction"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["direction"] = "Direction" + fields["max_segment_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["max_segment_size"] = "MaxSegmentSize" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.tcp_mss_clamping", fields, reflect.TypeOf(TcpMssClamping{}), fieldNameMap, validators) +} + +func TeamingPolicyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UplinkBindingType), reflect.TypeOf([]Uplink{}))) + fieldNameMap["active_list"] = "ActiveList" + fields["policy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["policy"] = "Policy" + fields["rolling_order"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["rolling_order"] = "RollingOrder" + fields["standby_list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UplinkBindingType), reflect.TypeOf([]Uplink{}))) + fieldNameMap["standby_list"] = "StandbyList" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.teaming_policy", fields, reflect.TypeOf(TeamingPolicy{}), fieldNameMap, validators) +} + +func TelemetryAgreementBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["telemetry_agreement_displayed"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["telemetry_agreement_displayed"] = "TelemetryAgreementDisplayed" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.telemetry_agreement", fields, reflect.TypeOf(TelemetryAgreement{}), fieldNameMap, validators) +} + +func TelemetryConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["ceip_acceptance"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ceip_acceptance"] = "CeipAcceptance" + fields["proxy_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["proxy_enabled"] = "ProxyEnabled" + fields["schedule_enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["schedule_enabled"] = "ScheduleEnabled" + fields["telemetry_deployment_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["telemetry_deployment_id"] = "TelemetryDeploymentId" + fields["telemetry_proxy"] = bindings.NewOptionalType(bindings.NewReferenceType(TelemetryProxyBindingType)) + fieldNameMap["telemetry_proxy"] = "TelemetryProxy" + fields["telemetry_schedule"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(TelemetryScheduleBindingType)}, bindings.REST)) + fieldNameMap["telemetry_schedule"] = "TelemetrySchedule" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.telemetry_config", fields, reflect.TypeOf(TelemetryConfig{}), fieldNameMap, validators) +} + +func TelemetryProxyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["hostname"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["hostname"] = "Hostname" + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["port"] = "Port" + fields["scheme"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["scheme"] = "Scheme" + fields["username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["username"] = "Username" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.telemetry_proxy", fields, reflect.TypeOf(TelemetryProxy{}), fieldNameMap, validators) +} + +func TelemetryScheduleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["frequency_type"] = bindings.NewStringType() + fieldNameMap["frequency_type"] = "FrequencyType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.telemetry_schedule", fields, reflect.TypeOf(TelemetrySchedule{}), fieldNameMap, validators) +} + +func ThreatStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.threat_status", fields, reflect.TypeOf(ThreatStatus{}), fieldNameMap, validators) +} + +func TimeRangeDropdownFilterWidgetConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["time_range_filter_info"] = bindings.NewOptionalType(bindings.NewReferenceType(TimeRangeFilterInfoBindingType)) + fieldNameMap["time_range_filter_info"] = "TimeRangeFilterInfo" + fields["default_value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["default_value"] = "DefaultValue" + fields["dropdown_filter_plot_config"] = bindings.NewOptionalType(bindings.NewReferenceType(DropdownFilterPlotConfigurationBindingType)) + fieldNameMap["dropdown_filter_plot_config"] = "DropdownFilterPlotConfig" + fields["dropdown_item"] = bindings.NewOptionalType(bindings.NewReferenceType(DropdownItemBindingType)) + fieldNameMap["dropdown_item"] = "DropdownItem" + fields["placeholder_msg"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["placeholder_msg"] = "PlaceholderMsg" + fields["static_filter_condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["static_filter_condition"] = "StaticFilterCondition" + fields["static_filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(StaticFilterBindingType), reflect.TypeOf([]StaticFilter{}))) + fieldNameMap["static_filters"] = "StaticFilters" + fields["alias"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["alias"] = "Alias" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["feature_set"] = bindings.NewOptionalType(bindings.NewReferenceType(FeatureSetBindingType)) + fieldNameMap["feature_set"] = "FeatureSet" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["filters"] = "Filters" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["plot_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(WidgetPlotConfigurationBindingType), reflect.TypeOf([]WidgetPlotConfiguration{}))) + fieldNameMap["plot_configs"] = "PlotConfigs" + fields["rowspan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rowspan"] = "Rowspan" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["show_header"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_header"] = "ShowHeader" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.time_range_dropdown_filter_widget_configuration", fields, reflect.TypeOf(TimeRangeDropdownFilterWidgetConfiguration{}), fieldNameMap, validators) +} + +func TimeRangeFilterInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["from_param_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["from_param_name"] = "FromParamName" + fields["to_param_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["to_param_name"] = "ToParamName" + fields["value_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value_type"] = "ValueType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.time_range_filter_info", fields, reflect.TypeOf(TimeRangeFilterInfo{}), fieldNameMap, validators) +} + +func TnHyperbusStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["hyperbus_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["hyperbus_status"] = "HyperbusStatus" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.tn_hyperbus_status", fields, reflect.TypeOf(TnHyperbusStatus{}), fieldNameMap, validators) +} + +func TnNodeAgentStatusListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TnNodeAgentstatusBindingType), reflect.TypeOf([]TnNodeAgentstatus{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.tn_node_agent_status_list_result", fields, reflect.TypeOf(TnNodeAgentStatusListResult{}), fieldNameMap, validators) +} + +func TnNodeAgentstatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["hyperbus_connection_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["hyperbus_connection_status"] = "HyperbusConnectionStatus" + fields["vif_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vif_id"] = "VifId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.tn_node_agentstatus", fields, reflect.TypeOf(TnNodeAgentstatus{}), fieldNameMap, validators) +} + +func TnNodeStackSpanStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dedicated_stack_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dedicated_stack_status"] = "DedicatedStackStatus" + fields["detail"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["detail"] = "Detail" + fields["last_updated_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_updated_time"] = "LastUpdatedTime" + fields["tn_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tn_node_id"] = "TnNodeId" + fields["tn_node_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tn_node_name"] = "TnNodeName" + fields["vmknic_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vmknic_status"] = "VmknicStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.tn_node_stack_span_status", fields, reflect.TypeOf(TnNodeStackSpanStatus{}), fieldNameMap, validators) +} + +func TokenBasedPrincipalIdentityBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["is_protected"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_protected"] = "IsProtected" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.token_based_principal_identity", fields, reflect.TypeOf(TokenBasedPrincipalIdentity{}), fieldNameMap, validators) +} + +func TokenBasedPrincipalIdentityListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TokenBasedPrincipalIdentityBindingType), reflect.TypeOf([]TokenBasedPrincipalIdentity{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.token_based_principal_identity_list_result", fields, reflect.TypeOf(TokenBasedPrincipalIdentityListResult{}), fieldNameMap, validators) +} + +func TooltipBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["heading"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["heading"] = "Heading" + fields["text"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["text"] = "Text" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.tooltip", fields, reflect.TypeOf(Tooltip{}), fieldNameMap, validators) +} + +func TraceActionArgumentBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dest_lport"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dest_lport"] = "DestLport" + fields["reverse_filter"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(LiveTraceFilterDataBindingType)}, bindings.REST)) + fieldNameMap["reverse_filter"] = "ReverseFilter" + fields["trace_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["trace_type"] = "TraceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.trace_action_argument", fields, reflect.TypeOf(TraceActionArgument{}), fieldNameMap, validators) +} + +func TraceActionConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["action_argument"] = bindings.NewOptionalType(bindings.NewReferenceType(TraceActionArgumentBindingType)) + fieldNameMap["action_argument"] = "ActionArgument" + fields["sampling_argument"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(SamplingArgumentBindingType)}, bindings.REST)) + fieldNameMap["sampling_argument"] = "SamplingArgument" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.trace_action_config", fields, reflect.TypeOf(TraceActionConfig{}), fieldNameMap, validators) +} + +func TraceResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["analysis"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["analysis"] = "Analysis" + fields["counters"] = bindings.NewOptionalType(bindings.NewReferenceType(TraceflowObservationCountersBindingType)) + fieldNameMap["counters"] = "Counters" + fields["direction"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["direction"] = "Direction" + fields["logical_counters"] = bindings.NewOptionalType(bindings.NewReferenceType(TraceflowObservationCountersBindingType)) + fieldNameMap["logical_counters"] = "LogicalCounters" + fields["observations"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(TraceflowObservationBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["observations"] = "Observations" + fields["packet_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["packet_id"] = "PacketId" + fields["result_overflowed"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["result_overflowed"] = "ResultOverflowed" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.trace_result", fields, reflect.TypeOf(TraceResult{}), fieldNameMap, validators) +} + +func TraceflowBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["analysis"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["analysis"] = "Analysis" + fields["counters"] = bindings.NewOptionalType(bindings.NewReferenceType(TraceflowObservationCountersBindingType)) + fieldNameMap["counters"] = "Counters" + fields["logical_counters"] = bindings.NewOptionalType(bindings.NewReferenceType(TraceflowObservationCountersBindingType)) + fieldNameMap["logical_counters"] = "LogicalCounters" + fields["lport_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_id"] = "LportId" + fields["operation_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["operation_state"] = "OperationState" + fields["request_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_status"] = "RequestStatus" + fields["result_overflowed"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["result_overflowed"] = "ResultOverflowed" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.traceflow", fields, reflect.TypeOf(Traceflow{}), fieldNameMap, validators) +} + +func TraceflowListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TraceflowBindingType), reflect.TypeOf([]Traceflow{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.traceflow_list_result", fields, reflect.TypeOf(TraceflowListResult{}), fieldNameMap, validators) +} + +func TraceflowObservationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_name"] = "ComponentName" + fields["component_sub_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_sub_type"] = "ComponentSubType" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["sequence_no"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_no"] = "SequenceNo" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["timestamp_micro"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp_micro"] = "TimestampMicro" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fields["transport_node_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_name"] = "TransportNodeName" + fields["transport_node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_type"] = "TransportNodeType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.traceflow_observation", fields, reflect.TypeOf(TraceflowObservation{}), fieldNameMap, validators) +} + +func TraceflowObservationCountersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["delivered_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["delivered_count"] = "DeliveredCount" + fields["dropped_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dropped_count"] = "DroppedCount" + fields["forwarded_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["forwarded_count"] = "ForwardedCount" + fields["received_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["received_count"] = "ReceivedCount" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.traceflow_observation_counters", fields, reflect.TypeOf(TraceflowObservationCounters{}), fieldNameMap, validators) +} + +func TraceflowObservationDeliveredBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lport_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_id"] = "LportId" + fields["lport_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_name"] = "LportName" + fields["resolution_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resolution_type"] = "ResolutionType" + fields["target_mac"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_mac"] = "TargetMac" + fields["vlan_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vlan_id"] = "VlanId" + fields["component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_name"] = "ComponentName" + fields["component_sub_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_sub_type"] = "ComponentSubType" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["sequence_no"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_no"] = "SequenceNo" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["timestamp_micro"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp_micro"] = "TimestampMicro" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fields["transport_node_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_name"] = "TransportNodeName" + fields["transport_node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_type"] = "TransportNodeType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.traceflow_observation_delivered", fields, reflect.TypeOf(TraceflowObservationDelivered{}), fieldNameMap, validators) +} + +func TraceflowObservationDroppedBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["acl_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["acl_rule_id"] = "AclRuleId" + fields["arp_fail_reason"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["arp_fail_reason"] = "ArpFailReason" + fields["jumpto_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["jumpto_rule_id"] = "JumptoRuleId" + fields["l2_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["l2_rule_id"] = "L2RuleId" + fields["lport_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_id"] = "LportId" + fields["lport_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_name"] = "LportName" + fields["nat_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["nat_rule_id"] = "NatRuleId" + fields["reason"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["reason"] = "Reason" + fields["component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_name"] = "ComponentName" + fields["component_sub_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_sub_type"] = "ComponentSubType" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["sequence_no"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_no"] = "SequenceNo" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["timestamp_micro"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp_micro"] = "TimestampMicro" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fields["transport_node_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_name"] = "TransportNodeName" + fields["transport_node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_type"] = "TransportNodeType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.traceflow_observation_dropped", fields, reflect.TypeOf(TraceflowObservationDropped{}), fieldNameMap, validators) +} + +func TraceflowObservationDroppedLogicalBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_id"] = "ComponentId" + fields["service_path_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["service_path_index"] = "ServicePathIndex" + fields["acl_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["acl_rule_id"] = "AclRuleId" + fields["arp_fail_reason"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["arp_fail_reason"] = "ArpFailReason" + fields["jumpto_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["jumpto_rule_id"] = "JumptoRuleId" + fields["l2_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["l2_rule_id"] = "L2RuleId" + fields["lport_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_id"] = "LportId" + fields["lport_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_name"] = "LportName" + fields["nat_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["nat_rule_id"] = "NatRuleId" + fields["reason"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["reason"] = "Reason" + fields["component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_name"] = "ComponentName" + fields["component_sub_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_sub_type"] = "ComponentSubType" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["sequence_no"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_no"] = "SequenceNo" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["timestamp_micro"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp_micro"] = "TimestampMicro" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fields["transport_node_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_name"] = "TransportNodeName" + fields["transport_node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_type"] = "TransportNodeType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.traceflow_observation_dropped_logical", fields, reflect.TypeOf(TraceflowObservationDroppedLogical{}), fieldNameMap, validators) +} + +func TraceflowObservationForwardedBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["context"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["context"] = "Context" + fields["dst_transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_transport_node_id"] = "DstTransportNodeId" + fields["dst_transport_node_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_transport_node_name"] = "DstTransportNodeName" + fields["local_ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_ip_address"] = "LocalIpAddress" + fields["remote_ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["remote_ip_address"] = "RemoteIpAddress" + fields["uplink_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uplink_name"] = "UplinkName" + fields["vtep_label"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vtep_label"] = "VtepLabel" + fields["component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_name"] = "ComponentName" + fields["component_sub_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_sub_type"] = "ComponentSubType" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["sequence_no"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_no"] = "SequenceNo" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["timestamp_micro"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp_micro"] = "TimestampMicro" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fields["transport_node_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_name"] = "TransportNodeName" + fields["transport_node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_type"] = "TransportNodeType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.traceflow_observation_forwarded", fields, reflect.TypeOf(TraceflowObservationForwarded{}), fieldNameMap, validators) +} + +func TraceflowObservationForwardedLogicalBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["acl_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["acl_rule_id"] = "AclRuleId" + fields["component_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_id"] = "ComponentId" + fields["dst_component_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_component_id"] = "DstComponentId" + fields["dst_component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_component_name"] = "DstComponentName" + fields["dst_component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_component_type"] = "DstComponentType" + fields["jumpto_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["jumpto_rule_id"] = "JumptoRuleId" + fields["l2_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["l2_rule_id"] = "L2RuleId" + fields["lport_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_id"] = "LportId" + fields["lport_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_name"] = "LportName" + fields["nat_rule_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["nat_rule_id"] = "NatRuleId" + fields["resend_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resend_type"] = "ResendType" + fields["service_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["service_index"] = "ServiceIndex" + fields["service_path_index"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["service_path_index"] = "ServicePathIndex" + fields["service_ttl"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["service_ttl"] = "ServiceTtl" + fields["spoofguard_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["spoofguard_ip"] = "SpoofguardIp" + fields["spoofguard_mac"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["spoofguard_mac"] = "SpoofguardMac" + fields["spoofguard_vlan_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["spoofguard_vlan_id"] = "SpoofguardVlanId" + fields["svc_nh_mac"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["svc_nh_mac"] = "SvcNhMac" + fields["translated_dst_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["translated_dst_ip"] = "TranslatedDstIp" + fields["translated_src_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["translated_src_ip"] = "TranslatedSrcIp" + fields["vlan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vlan"] = "Vlan" + fields["vni"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vni"] = "Vni" + fields["component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_name"] = "ComponentName" + fields["component_sub_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_sub_type"] = "ComponentSubType" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["sequence_no"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_no"] = "SequenceNo" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["timestamp_micro"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp_micro"] = "TimestampMicro" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fields["transport_node_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_name"] = "TransportNodeName" + fields["transport_node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_type"] = "TransportNodeType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.traceflow_observation_forwarded_logical", fields, reflect.TypeOf(TraceflowObservationForwardedLogical{}), fieldNameMap, validators) +} + +func TraceflowObservationListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(TraceflowObservationBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.traceflow_observation_list_result", fields, reflect.TypeOf(TraceflowObservationListResult{}), fieldNameMap, validators) +} + +func TraceflowObservationReceivedBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["local_ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_ip_address"] = "LocalIpAddress" + fields["remote_ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["remote_ip_address"] = "RemoteIpAddress" + fields["uplink_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uplink_name"] = "UplinkName" + fields["vtep_label"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vtep_label"] = "VtepLabel" + fields["component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_name"] = "ComponentName" + fields["component_sub_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_sub_type"] = "ComponentSubType" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["sequence_no"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_no"] = "SequenceNo" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["timestamp_micro"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp_micro"] = "TimestampMicro" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fields["transport_node_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_name"] = "TransportNodeName" + fields["transport_node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_type"] = "TransportNodeType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.traceflow_observation_received", fields, reflect.TypeOf(TraceflowObservationReceived{}), fieldNameMap, validators) +} + +func TraceflowObservationReceivedLogicalBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_id"] = "ComponentId" + fields["lport_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_id"] = "LportId" + fields["lport_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_name"] = "LportName" + fields["src_component_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["src_component_id"] = "SrcComponentId" + fields["src_component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["src_component_name"] = "SrcComponentName" + fields["src_component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["src_component_type"] = "SrcComponentType" + fields["svc_mac"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["svc_mac"] = "SvcMac" + fields["vlan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vlan"] = "Vlan" + fields["vni"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vni"] = "Vni" + fields["component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_name"] = "ComponentName" + fields["component_sub_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_sub_type"] = "ComponentSubType" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["sequence_no"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_no"] = "SequenceNo" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["timestamp_micro"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp_micro"] = "TimestampMicro" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fields["transport_node_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_name"] = "TransportNodeName" + fields["transport_node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_type"] = "TransportNodeType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.traceflow_observation_received_logical", fields, reflect.TypeOf(TraceflowObservationReceivedLogical{}), fieldNameMap, validators) +} + +func TraceflowObservationRelayedLogicalBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dst_server_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dst_server_address"] = "DstServerAddress" + fields["logical_comp_uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_comp_uuid"] = "LogicalCompUuid" + fields["message_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["message_type"] = "MessageType" + fields["relay_server_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["relay_server_address"] = "RelayServerAddress" + fields["component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_name"] = "ComponentName" + fields["component_sub_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_sub_type"] = "ComponentSubType" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["sequence_no"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_no"] = "SequenceNo" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["timestamp_micro"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp_micro"] = "TimestampMicro" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fields["transport_node_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_name"] = "TransportNodeName" + fields["transport_node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_type"] = "TransportNodeType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.traceflow_observation_relayed_logical", fields, reflect.TypeOf(TraceflowObservationRelayedLogical{}), fieldNameMap, validators) +} + +func TraceflowObservationReplicationLogicalBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["local_ip_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_ip_address"] = "LocalIpAddress" + fields["replication_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["replication_type"] = "ReplicationType" + fields["uplink_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uplink_name"] = "UplinkName" + fields["vtep_label"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vtep_label"] = "VtepLabel" + fields["component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_name"] = "ComponentName" + fields["component_sub_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_sub_type"] = "ComponentSubType" + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["sequence_no"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["sequence_no"] = "SequenceNo" + fields["site_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_path"] = "SitePath" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["timestamp_micro"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp_micro"] = "TimestampMicro" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fields["transport_node_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_name"] = "TransportNodeName" + fields["transport_node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_type"] = "TransportNodeType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.traceflow_observation_replication_logical", fields, reflect.TypeOf(TraceflowObservationReplicationLogical{}), fieldNameMap, validators) +} + +func TraceflowRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["lport_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_id"] = "LportId" + fields["packet"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(PacketDataBindingType)}, bindings.REST)) + fieldNameMap["packet"] = "Packet" + fields["timeout"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timeout"] = "Timeout" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.traceflow_request", fields, reflect.TypeOf(TraceflowRequest{}), fieldNameMap, validators) +} + +func TransportInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dst_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dst_port"] = "DstPort" + fields["protocol"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["protocol"] = "Protocol" + fields["src_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["src_port"] = "SrcPort" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_info", fields, reflect.TypeOf(TransportInfo{}), fieldNameMap, validators) +} + +func TransportNodeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["failure_domain_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_domain_id"] = "FailureDomainId" + fields["host_switch_spec"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(HostSwitchSpecBindingType)}, bindings.REST)) + fieldNameMap["host_switch_spec"] = "HostSwitchSpec" + fields["is_overridden"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_overridden"] = "IsOverridden" + fields["maintenance_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["maintenance_mode"] = "MaintenanceMode" + fields["node_deployment_info"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(NodeBindingType)}, bindings.REST)) + fieldNameMap["node_deployment_info"] = "NodeDeploymentInfo" + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fields["remote_tunnel_endpoint"] = bindings.NewOptionalType(bindings.NewReferenceType(TransportNodeRemoteTunnelEndpointConfigBindingType)) + fieldNameMap["remote_tunnel_endpoint"] = "RemoteTunnelEndpoint" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_node", fields, reflect.TypeOf(TransportNode{}), fieldNameMap, validators) +} + +func TransportNodeCollectionBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["compute_collection_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["compute_collection_id"] = "ComputeCollectionId" + fields["has_nvds"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["has_nvds"] = "HasNvds" + fields["install_mode"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["install_mode"] = "InstallMode" + fields["transport_node_profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_profile_id"] = "TransportNodeProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_node_collection", fields, reflect.TypeOf(TransportNodeCollection{}), fieldNameMap, validators) +} + +func TransportNodeCollectionListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TransportNodeCollectionBindingType), reflect.TypeOf([]TransportNodeCollection{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_node_collection_list_result", fields, reflect.TypeOf(TransportNodeCollectionListResult{}), fieldNameMap, validators) +} + +func TransportNodeCollectionStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["aggregate_progress_percentage"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["aggregate_progress_percentage"] = "AggregateProgressPercentage" + fields["cluster_level_error"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cluster_level_error"] = "ClusterLevelError" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + fields["validation_errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ValidationErrorBindingType), reflect.TypeOf([]ValidationError{}))) + fieldNameMap["validation_errors"] = "ValidationErrors" + fields["vlcm_transition_error"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vlcm_transition_error"] = "VlcmTransitionError" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_node_collection_state", fields, reflect.TypeOf(TransportNodeCollectionState{}), fieldNameMap, validators) +} + +func TransportNodeDeploymentProgressStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["current_step_title"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["current_step_title"] = "CurrentStepTitle" + fields["progress"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["progress"] = "Progress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_node_deployment_progress_state", fields, reflect.TypeOf(TransportNodeDeploymentProgressState{}), fieldNameMap, validators) +} + +func TransportNodeListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TransportNodeBindingType), reflect.TypeOf([]TransportNode{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_node_list_result", fields, reflect.TypeOf(TransportNodeListResult{}), fieldNameMap, validators) +} + +func TransportNodeMemberInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["compute_collection_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["compute_collection_id"] = "ComputeCollectionId" + fields["host_switches"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(HostSwitchInfoBindingType), reflect.TypeOf([]HostSwitchInfo{}))) + fieldNameMap["host_switches"] = "HostSwitches" + fields["transport_node_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_display_name"] = "TransportNodeDisplayName" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_node_member_info", fields, reflect.TypeOf(TransportNodeMemberInfo{}), fieldNameMap, validators) +} + +func TransportNodeProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["host_switch_spec"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(HostSwitchSpecBindingType)}, bindings.REST)) + fieldNameMap["host_switch_spec"] = "HostSwitchSpec" + fields["ignore_overridden_hosts"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ignore_overridden_hosts"] = "IgnoreOverriddenHosts" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_node_profile", fields, reflect.TypeOf(TransportNodeProfile{}), fieldNameMap, validators) +} + +func TransportNodeProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TransportNodeProfileBindingType), reflect.TypeOf([]TransportNodeProfile{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_node_profile_list_result", fields, reflect.TypeOf(TransportNodeProfileListResult{}), fieldNameMap, validators) +} + +func TransportNodeRemoteTunnelEndpointConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["host_switch_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_switch_name"] = "HostSwitchName" + fields["ip_assignment_spec"] = bindings.NewOptionalType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(IpAssignmentSpecBindingType)}, bindings.REST)) + fieldNameMap["ip_assignment_spec"] = "IpAssignmentSpec" + fields["named_teaming_policy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["named_teaming_policy"] = "NamedTeamingPolicy" + fields["rtep_vlan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rtep_vlan"] = "RtepVlan" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_node_remote_tunnel_endpoint_config", fields, reflect.TypeOf(TransportNodeRemoteTunnelEndpointConfig{}), fieldNameMap, validators) +} + +func TransportNodeStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ConfigurationStateElementBindingType), reflect.TypeOf([]ConfigurationStateElement{}))) + fieldNameMap["details"] = "Details" + fields["failure_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_code"] = "FailureCode" + fields["failure_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_message"] = "FailureMessage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + fields["deployment_progress_state"] = bindings.NewOptionalType(bindings.NewReferenceType(TransportNodeDeploymentProgressStateBindingType)) + fieldNameMap["deployment_progress_state"] = "DeploymentProgressState" + fields["host_switch_states"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(HostSwitchStateBindingType), reflect.TypeOf([]HostSwitchState{}))) + fieldNameMap["host_switch_states"] = "HostSwitchStates" + fields["maintenance_mode_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["maintenance_mode_state"] = "MaintenanceModeState" + fields["node_deployment_state"] = bindings.NewOptionalType(bindings.NewReferenceType(ConfigurationStateBindingType)) + fieldNameMap["node_deployment_state"] = "NodeDeploymentState" + fields["remote_tunnel_endpoint_state"] = bindings.NewOptionalType(bindings.NewReferenceType(RemoteTunnelEndpointConfigStateBindingType)) + fieldNameMap["remote_tunnel_endpoint_state"] = "RemoteTunnelEndpointState" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_node_state", fields, reflect.TypeOf(TransportNodeState{}), fieldNameMap, validators) +} + +func TransportNodeStateListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TransportNodeStateBindingType), reflect.TypeOf([]TransportNodeState{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_node_state_list_result", fields, reflect.TypeOf(TransportNodeStateListResult{}), fieldNameMap, validators) +} + +func TransportNodeStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["agent_status"] = bindings.NewOptionalType(bindings.NewReferenceType(AgentStatusCountBindingType)) + fieldNameMap["agent_status"] = "AgentStatus" + fields["control_connection_status"] = bindings.NewOptionalType(bindings.NewReferenceType(StatusCountBindingType)) + fieldNameMap["control_connection_status"] = "ControlConnectionStatus" + fields["mgmt_connection_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mgmt_connection_status"] = "MgmtConnectionStatus" + fields["node_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_display_name"] = "NodeDisplayName" + fields["node_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_path"] = "NodePath" + fields["node_status"] = bindings.NewOptionalType(bindings.NewReferenceType(NodeStatusBindingType)) + fieldNameMap["node_status"] = "NodeStatus" + fields["node_uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_uuid"] = "NodeUuid" + fields["pnic_status"] = bindings.NewOptionalType(bindings.NewReferenceType(StatusCountBindingType)) + fieldNameMap["pnic_status"] = "PnicStatus" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["threat_status"] = bindings.NewOptionalType(bindings.NewReferenceType(ThreatStatusBindingType)) + fieldNameMap["threat_status"] = "ThreatStatus" + fields["tunnel_status"] = bindings.NewOptionalType(bindings.NewReferenceType(TunnelStatusCountBindingType)) + fieldNameMap["tunnel_status"] = "TunnelStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_node_status", fields, reflect.TypeOf(TransportNodeStatus{}), fieldNameMap, validators) +} + +func TransportNodeStatusListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TransportNodeStatusBindingType), reflect.TypeOf([]TransportNodeStatus{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_node_status_list_result", fields, reflect.TypeOf(TransportNodeStatusListResult{}), fieldNameMap, validators) +} + +func TransportProtocolHeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dhcp_header"] = bindings.NewOptionalType(bindings.NewReferenceType(DhcpHeaderBindingType)) + fieldNameMap["dhcp_header"] = "DhcpHeader" + fields["dhcpv6_header"] = bindings.NewOptionalType(bindings.NewReferenceType(Dhcpv6HeaderBindingType)) + fieldNameMap["dhcpv6_header"] = "Dhcpv6Header" + fields["dns_header"] = bindings.NewOptionalType(bindings.NewReferenceType(DnsHeaderBindingType)) + fieldNameMap["dns_header"] = "DnsHeader" + fields["icmp_echo_request_header"] = bindings.NewOptionalType(bindings.NewReferenceType(IcmpEchoRequestHeaderBindingType)) + fieldNameMap["icmp_echo_request_header"] = "IcmpEchoRequestHeader" + fields["ndp_header"] = bindings.NewOptionalType(bindings.NewReferenceType(NdpHeaderBindingType)) + fieldNameMap["ndp_header"] = "NdpHeader" + fields["tcp_header"] = bindings.NewOptionalType(bindings.NewReferenceType(TcpHeaderBindingType)) + fieldNameMap["tcp_header"] = "TcpHeader" + fields["udp_header"] = bindings.NewOptionalType(bindings.NewReferenceType(UdpHeaderBindingType)) + fieldNameMap["udp_header"] = "UdpHeader" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_protocol_header", fields, reflect.TypeOf(TransportProtocolHeader{}), fieldNameMap, validators) +} + +func TransportZoneBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["is_default"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_default"] = "IsDefault" + fields["nested_nsx"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["nested_nsx"] = "NestedNsx" + fields["origin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_id"] = "OriginId" + fields["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_type"] = "TransportType" + fields["transport_zone_profile_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TransportZoneProfileTypeIdEntryBindingType), reflect.TypeOf([]TransportZoneProfileTypeIdEntry{}))) + fieldNameMap["transport_zone_profile_ids"] = "TransportZoneProfileIds" + fields["uplink_teaming_policy_names"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["uplink_teaming_policy_names"] = "UplinkTeamingPolicyNames" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_zone", fields, reflect.TypeOf(TransportZone{}), fieldNameMap, validators) +} + +func TransportZoneEndPointBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_zone_id"] = "TransportZoneId" + fields["transport_zone_profile_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TransportZoneProfileTypeIdEntryBindingType), reflect.TypeOf([]TransportZoneProfileTypeIdEntry{}))) + fieldNameMap["transport_zone_profile_ids"] = "TransportZoneProfileIds" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_zone_end_point", fields, reflect.TypeOf(TransportZoneEndPoint{}), fieldNameMap, validators) +} + +func TransportZoneListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TransportZoneBindingType), reflect.TypeOf([]TransportZone{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_zone_list_result", fields, reflect.TypeOf(TransportZoneListResult{}), fieldNameMap, validators) +} + +func TransportZoneProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_zone_profile", fields, reflect.TypeOf(TransportZoneProfile{}), fieldNameMap, validators) +} + +func TransportZoneProfileListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(TransportZoneProfileBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_zone_profile_list_result", fields, reflect.TypeOf(TransportZoneProfileListResult{}), fieldNameMap, validators) +} + +func TransportZoneProfileTypeIdEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["profile_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["profile_id"] = "ProfileId" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_zone_profile_type_id_entry", fields, reflect.TypeOf(TransportZoneProfileTypeIdEntry{}), fieldNameMap, validators) +} + +func TransportZoneStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["num_logical_ports"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["num_logical_ports"] = "NumLogicalPorts" + fields["num_logical_switches"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["num_logical_switches"] = "NumLogicalSwitches" + fields["num_transport_nodes"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["num_transport_nodes"] = "NumTransportNodes" + fields["transport_node_members"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TransportNodeMemberInfoBindingType), reflect.TypeOf([]TransportNodeMemberInfo{}))) + fieldNameMap["transport_node_members"] = "TransportNodeMembers" + fields["transport_zone_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_zone_id"] = "TransportZoneId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.transport_zone_status", fields, reflect.TypeOf(TransportZoneStatus{}), fieldNameMap, validators) +} + +func TriggerUcUpgradeParametersBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["product_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["product_version"] = "ProductVersion" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.trigger_uc_upgrade_parameters", fields, reflect.TypeOf(TriggerUcUpgradeParameters{}), fieldNameMap, validators) +} + +func TrunkVlanRangeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["end"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["end"] = "End" + fields["start"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["start"] = "Start" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.trunk_vlan_range", fields, reflect.TypeOf(TrunkVlanRange{}), fieldNameMap, validators) +} + +func TrustManagementDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["supported_algorithms"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(CryptoAlgorithmBindingType), reflect.TypeOf([]CryptoAlgorithm{}))) + fieldNameMap["supported_algorithms"] = "SupportedAlgorithms" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.trust_management_data", fields, reflect.TypeOf(TrustManagementData{}), fieldNameMap, validators) +} + +func TrustObjectDataBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["key_algo"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key_algo"] = "KeyAlgo" + fields["passphrase"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["passphrase"] = "Passphrase" + fields["pem_encoded"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["pem_encoded"] = "PemEncoded" + fields["private_key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["private_key"] = "PrivateKey" + fields["purpose"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["purpose"] = "Purpose" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.trust_object_data", fields, reflect.TypeOf(TrustObjectData{}), fieldNameMap, validators) +} + +func TunnelListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["tunnels"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TunnelPropertiesBindingType), reflect.TypeOf([]TunnelProperties{}))) + fieldNameMap["tunnels"] = "Tunnels" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.tunnel_list", fields, reflect.TypeOf(TunnelList{}), fieldNameMap, validators) +} + +func TunnelPortConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSubnetBindingType), reflect.TypeOf([]IPSubnet{}))) + fieldNameMap["ip_subnets"] = "IpSubnets" + fields["tunnel_port_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tunnel_port_id"] = "TunnelPortId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.tunnel_port_config", fields, reflect.TypeOf(TunnelPortConfig{}), fieldNameMap, validators) +} + +func TunnelPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["bfd"] = bindings.NewOptionalType(bindings.NewReferenceType(BFDPropertiesBindingType)) + fieldNameMap["bfd"] = "Bfd" + fields["egress_interface"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["egress_interface"] = "EgressInterface" + fields["encap"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["encap"] = "Encap" + fields["last_updated_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_updated_time"] = "LastUpdatedTime" + fields["latency_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["latency_type"] = "LatencyType" + fields["latency_value"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["latency_value"] = "LatencyValue" + fields["local_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_ip"] = "LocalIp" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["remote_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["remote_ip"] = "RemoteIp" + fields["remote_node_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["remote_node_display_name"] = "RemoteNodeDisplayName" + fields["remote_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["remote_node_id"] = "RemoteNodeId" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.tunnel_properties", fields, reflect.TypeOf(TunnelProperties{}), fieldNameMap, validators) +} + +func TunnelStatusCountBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["degraded_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["degraded_count"] = "DegradedCount" + fields["down_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["down_count"] = "DownCount" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["up_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["up_count"] = "UpCount" + fields["bfd_diagnostic"] = bindings.NewOptionalType(bindings.NewReferenceType(BFDDiagnosticCountBindingType)) + fieldNameMap["bfd_diagnostic"] = "BfdDiagnostic" + fields["bfd_status"] = bindings.NewOptionalType(bindings.NewReferenceType(BFDStatusCountBindingType)) + fieldNameMap["bfd_status"] = "BfdStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.tunnel_status_count", fields, reflect.TypeOf(TunnelStatusCount{}), fieldNameMap, validators) +} + +func UcFunctionalStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.uc_functional_state", fields, reflect.TypeOf(UcFunctionalState{}), fieldNameMap, validators) +} + +func UcStatePropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["update_uc_state_properties"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["update_uc_state_properties"] = "UpdateUcStateProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.uc_state_properties", fields, reflect.TypeOf(UcStateProperties{}), fieldNameMap, validators) +} + +func UcUpgradeStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["errors"] = "Errors" + fields["progress_messages"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["progress_messages"] = "ProgressMessages" + fields["progress_percentage"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["progress_percentage"] = "ProgressPercentage" + fields["state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["state"] = "State" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.uc_upgrade_status", fields, reflect.TypeOf(UcUpgradeStatus{}), fieldNameMap, validators) +} + +func UdpHeaderBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dst_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["dst_port"] = "DstPort" + fields["src_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["src_port"] = "SrcPort" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.udp_header", fields, reflect.TypeOf(UdpHeader{}), fieldNameMap, validators) +} + +func UnassociatedVMListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VirtualMachineBindingType), reflect.TypeOf([]VirtualMachine{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.unassociated_VM_list_result", fields, reflect.TypeOf(UnassociatedVMListResult{}), fieldNameMap, validators) +} + +func UnboundedKeyValuePairBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["key"] = "Key" + fields["value"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["value"] = "Value" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.unbounded_key_value_pair", fields, reflect.TypeOf(UnboundedKeyValuePair{}), fieldNameMap, validators) +} + +func UnidirectionalServicePathBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["hops"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ServicePathHopBindingType), reflect.TypeOf([]ServicePathHop{}))) + fieldNameMap["hops"] = "Hops" + fields["host_cross_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["host_cross_count"] = "HostCrossCount" + fields["in_maintenance_mode"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["in_maintenance_mode"] = "InMaintenanceMode" + fields["is_active"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_active"] = "IsActive" + fields["unidir_service_path_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["unidir_service_path_id"] = "UnidirServicePathId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.unidirectional_service_path", fields, reflect.TypeOf(UnidirectionalServicePath{}), fieldNameMap, validators) +} + +func UpdateOidcEndPointThumbprintRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["oidc_uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["oidc_uri"] = "OidcUri" + fields["thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["thumbprint"] = "Thumbprint" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.update_oidc_end_point_thumbprint_request", fields, reflect.TypeOf(UpdateOidcEndPointThumbprintRequest{}), fieldNameMap, validators) +} + +func UpdatePrincipalIdentityCertificateRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["certificate_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["certificate_id"] = "CertificateId" + fields["principal_identity_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["principal_identity_id"] = "PrincipalIdentityId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.update_principal_identity_certificate_request", fields, reflect.TypeOf(UpdatePrincipalIdentityCertificateRequest{}), fieldNameMap, validators) +} + +func UpgradeBundleFetchRequestBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["url"] = "Url" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_bundle_fetch_request", fields, reflect.TypeOf(UpgradeBundleFetchRequest{}), fieldNameMap, validators) +} + +func UpgradeBundleIdBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bundle_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["bundle_id"] = "BundleId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_bundle_id", fields, reflect.TypeOf(UpgradeBundleId{}), fieldNameMap, validators) +} + +func UpgradeBundleInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bundle_size"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["bundle_size"] = "BundleSize" + fields["url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["url"] = "Url" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_bundle_info", fields, reflect.TypeOf(UpgradeBundleInfo{}), fieldNameMap, validators) +} + +func UpgradeBundleUploadStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["detailed_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["detailed_status"] = "DetailedStatus" + fields["percent"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["percent"] = "Percent" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["url"] = "Url" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_bundle_upload_status", fields, reflect.TypeOf(UpgradeBundleUploadStatus{}), fieldNameMap, validators) +} + +func UpgradeCheckBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["failure_messages"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["failure_messages"] = "FailureMessages" + fields["failures"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UpgradeCheckFailureMessageBindingType), reflect.TypeOf([]UpgradeCheckFailureMessage{}))) + fieldNameMap["failures"] = "Failures" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_check", fields, reflect.TypeOf(UpgradeCheck{}), fieldNameMap, validators) +} + +func UpgradeCheckCsvListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_name"] = "FileName" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UpgradeCheckCsvRecordBindingType), reflect.TypeOf([]UpgradeCheckCsvRecord{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_check_csv_list_result", fields, reflect.TypeOf(UpgradeCheckCsvListResult{}), fieldNameMap, validators) +} + +func UpgradeCheckCsvRecordBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["check_description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["check_description"] = "CheckDescription" + fields["check_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["check_name"] = "CheckName" + fields["failure_messages"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["failure_messages"] = "FailureMessages" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["upgrade_unit_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["upgrade_unit_id"] = "UpgradeUnitId" + fields["upgrade_unit_metadata"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["upgrade_unit_metadata"] = "UpgradeUnitMetadata" + fields["upgrade_unit_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["upgrade_unit_type"] = "UpgradeUnitType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_check_csv_record", fields, reflect.TypeOf(UpgradeCheckCsvRecord{}), fieldNameMap, validators) +} + +func UpgradeCheckFailureBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["group_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["group_name"] = "GroupName" + fields["message"] = bindings.NewOptionalType(bindings.NewReferenceType(UpgradeCheckFailureMessageBindingType)) + fieldNameMap["message"] = "Message" + fields["origin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_id"] = "OriginId" + fields["origin_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_name"] = "OriginName" + fields["origin_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_type"] = "OriginType" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_check_failure", fields, reflect.TypeOf(UpgradeCheckFailure{}), fieldNameMap, validators) +} + +func UpgradeCheckFailureListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UpgradeCheckFailureBindingType), reflect.TypeOf([]UpgradeCheckFailure{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_check_failure_list_result", fields, reflect.TypeOf(UpgradeCheckFailureListResult{}), fieldNameMap, validators) +} + +func UpgradeCheckFailureMessageBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["error_code"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["error_code"] = "ErrorCode" + fields["message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["message"] = "Message" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_check_failure_message", fields, reflect.TypeOf(UpgradeCheckFailureMessage{}), fieldNameMap, validators) +} + +func UpgradeCheckInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_check_info", fields, reflect.TypeOf(UpgradeCheckInfo{}), fieldNameMap, validators) +} + +func UpgradeCheckListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["checks"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UpgradeCheckBindingType), reflect.TypeOf([]UpgradeCheck{}))) + fieldNameMap["checks"] = "Checks" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_check_list_result", fields, reflect.TypeOf(UpgradeCheckListResult{}), fieldNameMap, validators) +} + +func UpgradeCheckListResultsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["checks_with_warnings"] = bindings.NewOptionalType(bindings.NewReferenceType(UpgradeCheckListResultBindingType)) + fieldNameMap["checks_with_warnings"] = "ChecksWithWarnings" + fields["failed_checks"] = bindings.NewOptionalType(bindings.NewReferenceType(UpgradeCheckListResultBindingType)) + fieldNameMap["failed_checks"] = "FailedChecks" + fields["successful_checks"] = bindings.NewOptionalType(bindings.NewReferenceType(UpgradeCheckListResultBindingType)) + fieldNameMap["successful_checks"] = "SuccessfulChecks" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_check_list_results", fields, reflect.TypeOf(UpgradeCheckListResults{}), fieldNameMap, validators) +} + +func UpgradeChecksExecutionStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["details"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["details"] = "Details" + fields["end_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["end_time"] = "EndTime" + fields["failure_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failure_count"] = "FailureCount" + fields["node_with_issues_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["node_with_issues_count"] = "NodeWithIssuesCount" + fields["start_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["start_time"] = "StartTime" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_checks_execution_status", fields, reflect.TypeOf(UpgradeChecksExecutionStatus{}), fieldNameMap, validators) +} + +func UpgradeHistoryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["initial_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["initial_version"] = "InitialVersion" + fields["target_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_version"] = "TargetVersion" + fields["timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["timestamp"] = "Timestamp" + fields["upgrade_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["upgrade_status"] = "UpgradeStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_history", fields, reflect.TypeOf(UpgradeHistory{}), fieldNameMap, validators) +} + +func UpgradeHistoryListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UpgradeHistoryBindingType), reflect.TypeOf([]UpgradeHistory{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_history_list", fields, reflect.TypeOf(UpgradeHistoryList{}), fieldNameMap, validators) +} + +func UpgradePlanSettingsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["parallel"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["parallel"] = "Parallel" + fields["pause_after_each_group"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["pause_after_each_group"] = "PauseAfterEachGroup" + fields["pause_on_error"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["pause_on_error"] = "PauseOnError" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_plan_settings", fields, reflect.TypeOf(UpgradePlanSettings{}), fieldNameMap, validators) +} + +func UpgradeProgressStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["last_upgrade_step_status"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["last_upgrade_step_status"] = "LastUpgradeStepStatus" + fields["upgrade_bundle_present"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["upgrade_bundle_present"] = "UpgradeBundlePresent" + fields["upgrade_metadata"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["upgrade_metadata"] = "UpgradeMetadata" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_progress_status", fields, reflect.TypeOf(UpgradeProgressStatus{}), fieldNameMap, validators) +} + +func UpgradeStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ccp_status"] = bindings.NewOptionalType(bindings.NewReferenceType(CCPUpgradeStatusBindingType)) + fieldNameMap["ccp_status"] = "CcpStatus" + fields["component_status"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ComponentUpgradeStatusBindingType), reflect.TypeOf([]ComponentUpgradeStatus{}))) + fieldNameMap["component_status"] = "ComponentStatus" + fields["edge_status"] = bindings.NewOptionalType(bindings.NewReferenceType(EdgeUpgradeStatusBindingType)) + fieldNameMap["edge_status"] = "EdgeStatus" + fields["host_status"] = bindings.NewOptionalType(bindings.NewReferenceType(HostUpgradeStatusBindingType)) + fieldNameMap["host_status"] = "HostStatus" + fields["overall_upgrade_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["overall_upgrade_status"] = "OverallUpgradeStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_status", fields, reflect.TypeOf(UpgradeStatus{}), fieldNameMap, validators) +} + +func UpgradeStatusSummaryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["upgrade_bundle_present"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["upgrade_bundle_present"] = "UpgradeBundlePresent" + fields["upgrade_metadata"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["upgrade_metadata"] = "UpgradeMetadata" + fields["upgrade_steps"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType(nil, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["upgrade_steps"] = "UpgradeSteps" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_status_summary", fields, reflect.TypeOf(UpgradeStatusSummary{}), fieldNameMap, validators) +} + +func UpgradeSummaryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_target_versions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ComponentTargetVersionBindingType), reflect.TypeOf([]ComponentTargetVersion{}))) + fieldNameMap["component_target_versions"] = "ComponentTargetVersions" + fields["system_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["system_version"] = "SystemVersion" + fields["target_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["target_version"] = "TargetVersion" + fields["upgrade_bundle_file_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["upgrade_bundle_file_name"] = "UpgradeBundleFileName" + fields["upgrade_coordinator_updated"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["upgrade_coordinator_updated"] = "UpgradeCoordinatorUpdated" + fields["upgrade_coordinator_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["upgrade_coordinator_version"] = "UpgradeCoordinatorVersion" + fields["upgrade_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["upgrade_status"] = "UpgradeStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_summary", fields, reflect.TypeOf(UpgradeSummary{}), fieldNameMap, validators) +} + +func UpgradeTaskPropertiesBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bundle_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["bundle_name"] = "BundleName" + fields["parameters"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["parameters"] = "Parameters" + fields["step"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["step"] = "Step" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_task_properties", fields, reflect.TypeOf(UpgradeTaskProperties{}), fieldNameMap, validators) +} + +func UpgradeTopologyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["topology"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NvdsUpgradeTopologyBindingType), reflect.TypeOf([]NvdsUpgradeTopology{}))) + fieldNameMap["topology"] = "Topology" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_topology", fields, reflect.TypeOf(UpgradeTopology{}), fieldNameMap, validators) +} + +func UpgradeUnitBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["current_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["current_version"] = "CurrentVersion" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["group"] = bindings.NewOptionalType(bindings.NewReferenceType(UpgradeUnitGroupInfoBindingType)) + fieldNameMap["group"] = "Group" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["metadata"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["metadata"] = "Metadata" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + fields["warnings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["warnings"] = "Warnings" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_unit", fields, reflect.TypeOf(UpgradeUnit{}), fieldNameMap, validators) +} + +func UpgradeUnitAggregateInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["current_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["current_version"] = "CurrentVersion" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["errors"] = "Errors" + fields["group"] = bindings.NewOptionalType(bindings.NewReferenceType(UpgradeUnitGroupInfoBindingType)) + fieldNameMap["group"] = "Group" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["metadata"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["metadata"] = "Metadata" + fields["percent_complete"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["percent_complete"] = "PercentComplete" + fields["post_upgrade_checks"] = bindings.NewOptionalType(bindings.NewReferenceType(UpgradeCheckListResultsBindingType)) + fieldNameMap["post_upgrade_checks"] = "PostUpgradeChecks" + fields["pre_upgrade_checks"] = bindings.NewOptionalType(bindings.NewReferenceType(UpgradeCheckListResultsBindingType)) + fieldNameMap["pre_upgrade_checks"] = "PreUpgradeChecks" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + fields["warnings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["warnings"] = "Warnings" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_unit_aggregate_info", fields, reflect.TypeOf(UpgradeUnitAggregateInfo{}), fieldNameMap, validators) +} + +func UpgradeUnitAggregateInfoListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UpgradeUnitAggregateInfoBindingType), reflect.TypeOf([]UpgradeUnitAggregateInfo{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_unit_aggregate_info_list_result", fields, reflect.TypeOf(UpgradeUnitAggregateInfoListResult{}), fieldNameMap, validators) +} + +func UpgradeUnitGroupBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["extended_configuration"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["extended_configuration"] = "ExtendedConfiguration" + fields["parallel"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["parallel"] = "Parallel" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + fields["upgrade_unit_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["upgrade_unit_count"] = "UpgradeUnitCount" + fields["upgrade_units"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UpgradeUnitBindingType), reflect.TypeOf([]UpgradeUnit{}))) + fieldNameMap["upgrade_units"] = "UpgradeUnits" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_unit_group", fields, reflect.TypeOf(UpgradeUnitGroup{}), fieldNameMap, validators) +} + +func UpgradeUnitGroupAggregateInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["enabled"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enabled"] = "Enabled" + fields["extended_configuration"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["extended_configuration"] = "ExtendedConfiguration" + fields["failed_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failed_count"] = "FailedCount" + fields["group_level_failure"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["group_level_failure"] = "GroupLevelFailure" + fields["parallel"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["parallel"] = "Parallel" + fields["percent_complete"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["percent_complete"] = "PercentComplete" + fields["post_upgrade_status"] = bindings.NewOptionalType(bindings.NewReferenceType(UpgradeChecksExecutionStatusBindingType)) + fieldNameMap["post_upgrade_status"] = "PostUpgradeStatus" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + fields["upgrade_unit_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["upgrade_unit_count"] = "UpgradeUnitCount" + fields["upgrade_units"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UpgradeUnitBindingType), reflect.TypeOf([]UpgradeUnit{}))) + fieldNameMap["upgrade_units"] = "UpgradeUnits" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_unit_group_aggregate_info", fields, reflect.TypeOf(UpgradeUnitGroupAggregateInfo{}), fieldNameMap, validators) +} + +func UpgradeUnitGroupAggregateInfoListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UpgradeUnitGroupAggregateInfoBindingType), reflect.TypeOf([]UpgradeUnitGroupAggregateInfo{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_unit_group_aggregate_info_list_result", fields, reflect.TypeOf(UpgradeUnitGroupAggregateInfoListResult{}), fieldNameMap, validators) +} + +func UpgradeUnitGroupInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_unit_group_info", fields, reflect.TypeOf(UpgradeUnitGroupInfo{}), fieldNameMap, validators) +} + +func UpgradeUnitGroupListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UpgradeUnitGroupBindingType), reflect.TypeOf([]UpgradeUnitGroup{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_unit_group_list_result", fields, reflect.TypeOf(UpgradeUnitGroupListResult{}), fieldNameMap, validators) +} + +func UpgradeUnitGroupStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["failed_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["failed_count"] = "FailedCount" + fields["group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["group_id"] = "GroupId" + fields["group_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["group_name"] = "GroupName" + fields["percent_complete"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["percent_complete"] = "PercentComplete" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + fields["upgrade_unit_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["upgrade_unit_count"] = "UpgradeUnitCount" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_unit_group_status", fields, reflect.TypeOf(UpgradeUnitGroupStatus{}), fieldNameMap, validators) +} + +func UpgradeUnitGroupStatusListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UpgradeUnitGroupStatusBindingType), reflect.TypeOf([]UpgradeUnitGroupStatus{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_unit_group_status_list_result", fields, reflect.TypeOf(UpgradeUnitGroupStatusListResult{}), fieldNameMap, validators) +} + +func UpgradeUnitListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["list"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UpgradeUnitBindingType), reflect.TypeOf([]UpgradeUnit{}))) + fieldNameMap["list"] = "List" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_unit_list", fields, reflect.TypeOf(UpgradeUnitList{}), fieldNameMap, validators) +} + +func UpgradeUnitListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UpgradeUnitBindingType), reflect.TypeOf([]UpgradeUnit{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_unit_list_result", fields, reflect.TypeOf(UpgradeUnitListResult{}), fieldNameMap, validators) +} + +func UpgradeUnitStatusBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["errors"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["errors"] = "Errors" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["metadata"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["metadata"] = "Metadata" + fields["percent_complete"] = bindings.NewOptionalType(bindings.NewDoubleType()) + fieldNameMap["percent_complete"] = "PercentComplete" + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_unit_status", fields, reflect.TypeOf(UpgradeUnitStatus{}), fieldNameMap, validators) +} + +func UpgradeUnitStatusListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UpgradeUnitStatusBindingType), reflect.TypeOf([]UpgradeUnitStatus{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_unit_status_list_result", fields, reflect.TypeOf(UpgradeUnitStatusListResult{}), fieldNameMap, validators) +} + +func UpgradeUnitTypeStatsBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["node_count"] = "NodeCount" + fields["node_with_issues_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["node_with_issues_count"] = "NodeWithIssuesCount" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + fields["upgrade_unit_subtype"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["upgrade_unit_subtype"] = "UpgradeUnitSubtype" + fields["version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["version"] = "Version" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_unit_type_stats", fields, reflect.TypeOf(UpgradeUnitTypeStats{}), fieldNameMap, validators) +} + +func UpgradeUnitTypeStatsListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(UpgradeUnitTypeStatsBindingType), reflect.TypeOf([]UpgradeUnitTypeStats{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.upgrade_unit_type_stats_list", fields, reflect.TypeOf(UpgradeUnitTypeStatsList{}), fieldNameMap, validators) +} + +func UplinkBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["uplink_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uplink_name"] = "UplinkName" + fields["uplink_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uplink_type"] = "UplinkType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.uplink", fields, reflect.TypeOf(Uplink{}), fieldNameMap, validators) +} + +func UplinkHostSwitchProfileBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["lags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(LagBindingType), reflect.TypeOf([]Lag{}))) + fieldNameMap["lags"] = "Lags" + fields["mtu"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["mtu"] = "Mtu" + fields["named_teamings"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NamedTeamingPolicyBindingType), reflect.TypeOf([]NamedTeamingPolicy{}))) + fieldNameMap["named_teamings"] = "NamedTeamings" + fields["overlay_encap"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["overlay_encap"] = "OverlayEncap" + fields["teaming"] = bindings.NewOptionalType(bindings.NewReferenceType(TeamingPolicyBindingType)) + fieldNameMap["teaming"] = "Teaming" + fields["transport_vlan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["transport_vlan"] = "TransportVlan" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["required_capabilities"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["required_capabilities"] = "RequiredCapabilities" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.uplink_host_switch_profile", fields, reflect.TypeOf(UplinkHostSwitchProfile{}), fieldNameMap, validators) +} + +func UrlAliasBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["alias"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["alias"] = "Alias" + fields["keystore_info"] = bindings.NewOptionalType(bindings.NewReferenceType(KeyStoreInfoBindingType)) + fieldNameMap["keystore_info"] = "KeystoreInfo" + fields["query"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["query"] = "Query" + fields["request_body"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["request_body"] = "RequestBody" + fields["request_headers"] = bindings.NewOptionalType(bindings.NewDynamicStructType(nil, bindings.REST)) + fieldNameMap["request_headers"] = "RequestHeaders" + fields["request_method"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["request_method"] = "RequestMethod" + fields["url"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["url"] = "Url" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.url_alias", fields, reflect.TypeOf(UrlAlias{}), fieldNameMap, validators) +} + +func UserInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["roles"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NsxRoleBindingType), reflect.TypeOf([]NsxRole{}))) + fieldNameMap["roles"] = "Roles" + fields["user_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["user_name"] = "UserName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.user_info", fields, reflect.TypeOf(UserInfo{}), fieldNameMap, validators) +} + +func UsernamePasswordLoginCredentialBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["password"] = "Password" + fields["thumbprint"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["thumbprint"] = "Thumbprint" + fields["username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["username"] = "Username" + fields["credential_type"] = bindings.NewStringType() + fieldNameMap["credential_type"] = "CredentialType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.username_password_login_credential", fields, reflect.TypeOf(UsernamePasswordLoginCredential{}), fieldNameMap, validators) +} + +func V2tSiteMappingBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["federation_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["federation_site_id"] = "FederationSiteId" + fields["nsxv_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nsxv_ip"] = "NsxvIp" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.v2t_site_mapping", fields, reflect.TypeOf(V2tSiteMapping{}), fieldNameMap, validators) +} + +func V2tSiteMappingSpecBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["federation_site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["federation_site_id"] = "FederationSiteId" + fields["nsxv_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nsxv_ip"] = "NsxvIp" + fields["nsxv_password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nsxv_password"] = "NsxvPassword" + fields["nsxv_username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nsxv_username"] = "NsxvUsername" + fields["vc_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vc_ip"] = "VcIp" + fields["vc_password"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vc_password"] = "VcPassword" + fields["vc_port"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vc_port"] = "VcPort" + fields["vc_username"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vc_username"] = "VcUsername" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.v2t_site_mapping_spec", fields, reflect.TypeOf(V2tSiteMappingSpec{}), fieldNameMap, validators) +} + +func VIPSubnetBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["active_vip_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["active_vip_addresses"] = "ActiveVipAddresses" + fields["prefix_length"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["prefix_length"] = "PrefixLength" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.VIP_subnet", fields, reflect.TypeOf(VIPSubnet{}), fieldNameMap, validators) +} + +func VMDeploymentProgressStateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["current_step_title"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["current_step_title"] = "CurrentStepTitle" + fields["progress"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["progress"] = "Progress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.VM_deployment_progress_state", fields, reflect.TypeOf(VMDeploymentProgressState{}), fieldNameMap, validators) +} + +func ValidationErrorBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["discovered_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["discovered_node_id"] = "DiscoveredNodeId" + fields["error_message"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["error_message"] = "ErrorMessage" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.validation_error", fields, reflect.TypeOf(ValidationError{}), fieldNameMap, validators) +} + +func VdsTopologyBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cluster_id"] = "ClusterId" + fields["data_center_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["data_center_id"] = "DataCenterId" + fields["status_details"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["status_details"] = "StatusDetails" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fields["vds_config"] = bindings.NewOptionalType(bindings.NewReferenceType(DVSConfigBindingType)) + fieldNameMap["vds_config"] = "VdsConfig" + fields["vds_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vds_name"] = "VdsName" + fields["vds_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vds_status"] = "VdsStatus" + fields["vmknic"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["vmknic"] = "Vmknic" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vds_topology", fields, reflect.TypeOf(VdsTopology{}), fieldNameMap, validators) +} + +func VdsUplinkBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["uplink_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["uplink_name"] = "UplinkName" + fields["vds_lag_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vds_lag_name"] = "VdsLagName" + fields["vds_uplink_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vds_uplink_name"] = "VdsUplinkName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vds_uplink", fields, reflect.TypeOf(VdsUplink{}), fieldNameMap, validators) +} + +func VendorTemplateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["attributes"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(AttributeBindingType), reflect.TypeOf([]Attribute{}))) + fieldNameMap["attributes"] = "Attributes" + fields["functionality"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["functionality"] = "Functionality" + fields["redirection_action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["redirection_action"] = "RedirectionAction" + fields["service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fields["vendor_template_key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vendor_template_key"] = "VendorTemplateKey" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vendor_template", fields, reflect.TypeOf(VendorTemplate{}), fieldNameMap, validators) +} + +func VendorTemplateListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VendorTemplateBindingType), reflect.TypeOf([]VendorTemplate{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vendor_template_list_result", fields, reflect.TypeOf(VendorTemplateListResult{}), fieldNameMap, validators) +} + +func VerifiableAsymmetricLoginCredentialBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["asymmetric_credential"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["asymmetric_credential"] = "AsymmetricCredential" + fields["credential_key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["credential_key"] = "CredentialKey" + fields["credential_verifier"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["credential_verifier"] = "CredentialVerifier" + fields["credential_type"] = bindings.NewStringType() + fieldNameMap["credential_type"] = "CredentialType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.verifiable_asymmetric_login_credential", fields, reflect.TypeOf(VerifiableAsymmetricLoginCredential{}), fieldNameMap, validators) +} + +func VersionListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["acceptable_versions"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["acceptable_versions"] = "AcceptableVersions" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.version_list", fields, reflect.TypeOf(VersionList{}), fieldNameMap, validators) +} + +func VidmInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["name"] = "Name" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vidm_info", fields, reflect.TypeOf(VidmInfo{}), fieldNameMap, validators) +} + +func VidmInfoListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VidmInfoBindingType), reflect.TypeOf([]VidmInfo{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vidm_info_list_result", fields, reflect.TypeOf(VidmInfoListResult{}), fieldNameMap, validators) +} + +func ViewBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["exclude_roles"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["exclude_roles"] = "ExcludeRoles" + fields["include_roles"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["include_roles"] = "IncludeRoles" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + fields["widgets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(WidgetItemBindingType), reflect.TypeOf([]WidgetItem{}))) + fieldNameMap["widgets"] = "Widgets" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.view", fields, reflect.TypeOf(View{}), fieldNameMap, validators) +} + +func ViewListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["views"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ViewBindingType), reflect.TypeOf([]View{}))) + fieldNameMap["views"] = "Views" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.view_list", fields, reflect.TypeOf(ViewList{}), fieldNameMap, validators) +} + +func VifAttachmentContextBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["app_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["app_id"] = "AppId" + fields["bms_interface_config"] = bindings.NewOptionalType(bindings.NewReferenceType(AttachedInterfaceBindingType)) + fieldNameMap["bms_interface_config"] = "BmsInterfaceConfig" + fields["parent_vif_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["parent_vif_id"] = "ParentVifId" + fields["traffic_tag"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["traffic_tag"] = "TrafficTag" + fields["transport_node_uuid"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_uuid"] = "TransportNodeUuid" + fields["vif_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vif_type"] = "VifType" + fields["allocate_addresses"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["allocate_addresses"] = "AllocateAddresses" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vif_attachment_context", fields, reflect.TypeOf(VifAttachmentContext{}), fieldNameMap, validators) +} + +func VirtualMachineBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["compute_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["compute_ids"] = "ComputeIds" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["guest_info"] = bindings.NewOptionalType(bindings.NewReferenceType(GuestInfoBindingType)) + fieldNameMap["guest_info"] = "GuestInfo" + fields["host_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_id"] = "HostId" + fields["local_id_on_host"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["local_id_on_host"] = "LocalIdOnHost" + fields["power_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["power_state"] = "PowerState" + fields["source"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["source"] = "Source" + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["type"] = "Type_" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredResourceScopeBindingType), reflect.TypeOf([]DiscoveredResourceScope{}))) + fieldNameMap["scope"] = "Scope" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.virtual_machine", fields, reflect.TypeOf(VirtualMachine{}), fieldNameMap, validators) +} + +func VirtualMachineListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VirtualMachineBindingType), reflect.TypeOf([]VirtualMachine{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.virtual_machine_list_result", fields, reflect.TypeOf(VirtualMachineListResult{}), fieldNameMap, validators) +} + +func VirtualMachineTagUpdateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.virtual_machine_tag_update", fields, reflect.TypeOf(VirtualMachineTagUpdate{}), fieldNameMap, validators) +} + +func VirtualNetworkInterfaceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["device_key"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["device_key"] = "DeviceKey" + fields["device_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["device_name"] = "DeviceName" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["host_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_id"] = "HostId" + fields["ip_address_info"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IpAddressInfoBindingType), reflect.TypeOf([]IpAddressInfo{}))) + fieldNameMap["ip_address_info"] = "IpAddressInfo" + fields["lport_attachment_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["lport_attachment_id"] = "LportAttachmentId" + fields["mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mac_address"] = "MacAddress" + fields["owner_vm_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["owner_vm_id"] = "OwnerVmId" + fields["owner_vm_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["owner_vm_type"] = "OwnerVmType" + fields["vm_local_id_on_host"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vm_local_id_on_host"] = "VmLocalIdOnHost" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredResourceScopeBindingType), reflect.TypeOf([]DiscoveredResourceScope{}))) + fieldNameMap["scope"] = "Scope" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.virtual_network_interface", fields, reflect.TypeOf(VirtualNetworkInterface{}), fieldNameMap, validators) +} + +func VirtualNetworkInterfaceListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VirtualNetworkInterfaceBindingType), reflect.TypeOf([]VirtualNetworkInterface{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.virtual_network_interface_list_result", fields, reflect.TypeOf(VirtualNetworkInterfaceListResult{}), fieldNameMap, validators) +} + +func VirtualPortgroupBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cm_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cm_local_id"] = "CmLocalId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["origin_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_type"] = "OriginType" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredResourceScopeBindingType), reflect.TypeOf([]DiscoveredResourceScope{}))) + fieldNameMap["scope"] = "Scope" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.virtual_portgroup", fields, reflect.TypeOf(VirtualPortgroup{}), fieldNameMap, validators) +} + +func VirtualServiceInstanceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["on_failure_policy"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["on_failure_policy"] = "OnFailurePolicy" + fields["service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fields["transport_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_type"] = "TransportType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.virtual_service_instance", fields, reflect.TypeOf(VirtualServiceInstance{}), fieldNameMap, validators) +} + +func VirtualSwitchBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cm_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cm_local_id"] = "CmLocalId" + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["origin_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_id"] = "OriginId" + fields["origin_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["origin_type"] = "OriginType" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredResourceScopeBindingType), reflect.TypeOf([]DiscoveredResourceScope{}))) + fieldNameMap["scope"] = "Scope" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.virtual_switch", fields, reflect.TypeOf(VirtualSwitch{}), fieldNameMap, validators) +} + +func VirtualSwitchListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VirtualSwitchBindingType), reflect.TypeOf([]VirtualSwitch{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.virtual_switch_list_result", fields, reflect.TypeOf(VirtualSwitchListResult{}), fieldNameMap, validators) +} + +func VlanMirrorSourceBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["vlan_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewIntegerType(), reflect.TypeOf([]int64{}))) + fieldNameMap["vlan_ids"] = "VlanIds" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vlan_mirror_source", fields, reflect.TypeOf(VlanMirrorSource{}), fieldNameMap, validators) +} + +func VlanTrunkSpecBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["vlan_ranges"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TrunkVlanRangeBindingType), reflect.TypeOf([]TrunkVlanRange{}))) + fieldNameMap["vlan_ranges"] = "VlanRanges" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vlan_trunk_spec", fields, reflect.TypeOf(VlanTrunkSpec{}), fieldNameMap, validators) +} + +func VmNicInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["nic_infos"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(NicInfoBindingType), reflect.TypeOf([]NicInfo{}))) + fieldNameMap["nic_infos"] = "NicInfos" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vm_nic_info", fields, reflect.TypeOf(VmNicInfo{}), fieldNameMap, validators) +} + +func VmToolsInfoBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["external_id"] = "ExternalId" + fields["file_agent_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_agent_version"] = "FileAgentVersion" + fields["host_local_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_local_id"] = "HostLocalId" + fields["network_agent_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["network_agent_version"] = "NetworkAgentVersion" + fields["source"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceReferenceBindingType)) + fieldNameMap["source"] = "Source" + fields["svmStatus"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(SvmConnectivityStatusBindingType), reflect.TypeOf([]SvmConnectivityStatus{}))) + fieldNameMap["svmStatus"] = "SvmStatus" + fields["svm_connectivity"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["svm_connectivity"] = "SvmConnectivity" + fields["tools_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["tools_version"] = "ToolsVersion" + fields["vm_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vm_type"] = "VmType" + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_last_sync_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_sync_time"] = "LastSyncTime" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["scope"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DiscoveredResourceScopeBindingType), reflect.TypeOf([]DiscoveredResourceScope{}))) + fieldNameMap["scope"] = "Scope" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vm_tools_info", fields, reflect.TypeOf(VmToolsInfo{}), fieldNameMap, validators) +} + +func VmToolsInfoListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VmToolsInfoBindingType), reflect.TypeOf([]VmToolsInfo{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vm_tools_info_list_result", fields, reflect.TypeOf(VmToolsInfoListResult{}), fieldNameMap, validators) +} + +func VmknicNetworkBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["destination_network"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["destination_network"] = "DestinationNetwork" + fields["device_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["device_name"] = "DeviceName" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vmknic_network", fields, reflect.TypeOf(VmknicNetwork{}), fieldNameMap, validators) +} + +func VniPoolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["ranges"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VniRangeBindingType), reflect.TypeOf([]VniRange{}))) + fieldNameMap["ranges"] = "Ranges" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vni_pool", fields, reflect.TypeOf(VniPool{}), fieldNameMap, validators) +} + +func VniPoolListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VniPoolBindingType), reflect.TypeOf([]VniPool{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vni_pool_list_result", fields, reflect.TypeOf(VniPoolListResult{}), fieldNameMap, validators) +} + +func VniRangeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["end"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["end"] = "End" + fields["start"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["start"] = "Start" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vni_range", fields, reflect.TypeOf(VniRange{}), fieldNameMap, validators) +} + +func VsphereClusterNodeVMDeploymentConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allow_ssh_root_login"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["allow_ssh_root_login"] = "AllowSshRootLogin" + fields["compute_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["compute_id"] = "ComputeId" + fields["default_gateway_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["default_gateway_addresses"] = "DefaultGatewayAddresses" + fields["disk_provisioning"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["disk_provisioning"] = "DiskProvisioning" + fields["dns_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["dns_servers"] = "DnsServers" + fields["enable_ssh"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["enable_ssh"] = "EnableSsh" + fields["folder_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["folder_id"] = "FolderId" + fields["host_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_id"] = "HostId" + fields["hostname"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["hostname"] = "Hostname" + fields["management_network_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["management_network_id"] = "ManagementNetworkId" + fields["management_port_subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSubnetBindingType), reflect.TypeOf([]IPSubnet{}))) + fieldNameMap["management_port_subnets"] = "ManagementPortSubnets" + fields["ntp_servers"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ntp_servers"] = "NtpServers" + fields["search_domains"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["search_domains"] = "SearchDomains" + fields["storage_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["storage_id"] = "StorageId" + fields["vc_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vc_id"] = "VcId" + fields["placement_type"] = bindings.NewStringType() + fieldNameMap["placement_type"] = "PlacementType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vsphere_cluster_node_VM_deployment_config", fields, reflect.TypeOf(VsphereClusterNodeVMDeploymentConfig{}), fieldNameMap, validators) +} + +func VsphereDeploymentConfigBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["advanced_configuration"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(KeyValuePairBindingType), reflect.TypeOf([]KeyValuePair{}))) + fieldNameMap["advanced_configuration"] = "AdvancedConfiguration" + fields["compute_folder_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["compute_folder_id"] = "ComputeFolderId" + fields["compute_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["compute_id"] = "ComputeId" + fields["data_network_ids"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["data_network_ids"] = "DataNetworkIds" + fields["default_gateway_addresses"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["default_gateway_addresses"] = "DefaultGatewayAddresses" + fields["host_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["host_id"] = "HostId" + fields["management_network_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["management_network_id"] = "ManagementNetworkId" + fields["management_port_subnets"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IPSubnetBindingType), reflect.TypeOf([]IPSubnet{}))) + fieldNameMap["management_port_subnets"] = "ManagementPortSubnets" + fields["reservation_info"] = bindings.NewOptionalType(bindings.NewReferenceType(ReservationInfoBindingType)) + fieldNameMap["reservation_info"] = "ReservationInfo" + fields["resource_allocation"] = bindings.NewOptionalType(bindings.NewReferenceType(ResourceAssignmentBindingType)) + fieldNameMap["resource_allocation"] = "ResourceAllocation" + fields["storage_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["storage_id"] = "StorageId" + fields["vc_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vc_id"] = "VcId" + fields["placement_type"] = bindings.NewStringType() + fieldNameMap["placement_type"] = "PlacementType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vsphere_deployment_config", fields, reflect.TypeOf(VsphereDeploymentConfig{}), fieldNameMap, validators) +} + +func VtepCsvListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["file_name"] = "FileName" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VtepTableCsvRecordBindingType), reflect.TypeOf([]VtepTableCsvRecord{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vtep_csv_list_result", fields, reflect.TypeOf(VtepCsvListResult{}), fieldNameMap, validators) +} + +func VtepLabelPoolBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["pool_usage"] = bindings.NewOptionalType(bindings.NewReferenceType(VtepLabelPoolUsageBindingType)) + fieldNameMap["pool_usage"] = "PoolUsage" + fields["ranges"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VtepLabelRangeBindingType), reflect.TypeOf([]VtepLabelRange{}))) + fieldNameMap["ranges"] = "Ranges" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vtep_label_pool", fields, reflect.TypeOf(VtepLabelPool{}), fieldNameMap, validators) +} + +func VtepLabelPoolListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VtepLabelPoolBindingType), reflect.TypeOf([]VtepLabelPool{}))) + fieldNameMap["results"] = "Results" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vtep_label_pool_list_result", fields, reflect.TypeOf(VtepLabelPoolListResult{}), fieldNameMap, validators) +} + +func VtepLabelPoolUsageBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allocated_ids"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["allocated_ids"] = "AllocatedIds" + fields["free_ids"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["free_ids"] = "FreeIds" + fields["total_ids"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["total_ids"] = "TotalIds" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vtep_label_pool_usage", fields, reflect.TypeOf(VtepLabelPoolUsage{}), fieldNameMap, validators) +} + +func VtepLabelRangeBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["end"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["end"] = "End" + fields["start"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["start"] = "Start" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vtep_label_range", fields, reflect.TypeOf(VtepLabelRange{}), fieldNameMap, validators) +} + +func VtepListResultBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fields["result_count"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["result_count"] = "ResultCount" + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["sort_ascending"] = "SortAscending" + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["sort_by"] = "SortBy" + fields["last_update_timestamp"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["last_update_timestamp"] = "LastUpdateTimestamp" + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + fields["results"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(VtepTableEntryBindingType), reflect.TypeOf([]VtepTableEntry{}))) + fieldNameMap["results"] = "Results" + fields["transport_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vtep_list_result", fields, reflect.TypeOf(VtepListResult{}), fieldNameMap, validators) +} + +func VtepTableCsvRecordBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_id"] = "SegmentId" + fields["vtep_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vtep_ip"] = "VtepIp" + fields["vtep_label"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vtep_label"] = "VtepLabel" + fields["vtep_mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vtep_mac_address"] = "VtepMacAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vtep_table_csv_record", fields, reflect.TypeOf(VtepTableCsvRecord{}), fieldNameMap, validators) +} + +func VtepTableEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["segment_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["segment_id"] = "SegmentId" + fields["vtep_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vtep_ip"] = "VtepIp" + fields["vtep_label"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["vtep_label"] = "VtepLabel" + fields["vtep_mac_address"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["vtep_mac_address"] = "VtepMacAddress" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.vtep_table_entry", fields, reflect.TypeOf(VtepTableEntry{}), fieldNameMap, validators) +} + +func WeeklyBackupScheduleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["days_of_week"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewIntegerType(), reflect.TypeOf([]int64{}))) + fieldNameMap["days_of_week"] = "DaysOfWeek" + fields["hour_of_day"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["hour_of_day"] = "HourOfDay" + fields["minute_of_day"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["minute_of_day"] = "MinuteOfDay" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.weekly_backup_schedule", fields, reflect.TypeOf(WeeklyBackupSchedule{}), fieldNameMap, validators) +} + +func WeeklyTelemetryScheduleBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["day_of_week"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["day_of_week"] = "DayOfWeek" + fields["hour_of_day"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["hour_of_day"] = "HourOfDay" + fields["minutes"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["minutes"] = "Minutes" + fields["frequency_type"] = bindings.NewStringType() + fieldNameMap["frequency_type"] = "FrequencyType" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.weekly_telemetry_schedule", fields, reflect.TypeOf(WeeklyTelemetrySchedule{}), fieldNameMap, validators) +} + +func WidgetConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["_links"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(ResourceLinkBindingType), reflect.TypeOf([]ResourceLink{}))) + fieldNameMap["_links"] = "Links" + fields["_schema"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_schema"] = "Schema" + fields["_self"] = bindings.NewOptionalType(bindings.NewReferenceType(SelfResourceLinkBindingType)) + fieldNameMap["_self"] = "Self" + fields["_revision"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_revision"] = "Revision" + fields["_create_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_create_time"] = "CreateTime" + fields["_create_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_create_user"] = "CreateUser" + fields["_last_modified_time"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["_last_modified_time"] = "LastModifiedTime" + fields["_last_modified_user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_last_modified_user"] = "LastModifiedUser" + fields["_protection"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["_protection"] = "Protection" + fields["_system_owned"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["_system_owned"] = "SystemOwned" + fields["description"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["description"] = "Description" + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["display_name"] = "DisplayName" + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["id"] = "Id" + fields["resource_type"] = bindings.NewStringType() + fieldNameMap["resource_type"] = "ResourceType" + fields["tags"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(TagBindingType), reflect.TypeOf([]Tag{}))) + fieldNameMap["tags"] = "Tags" + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + fields["datasources"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DatasourceBindingType), reflect.TypeOf([]Datasource{}))) + fieldNameMap["datasources"] = "Datasources" + fields["default_filter_value"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(DefaultFilterValueBindingType), reflect.TypeOf([]DefaultFilterValue{}))) + fieldNameMap["default_filter_value"] = "DefaultFilterValue" + fields["drilldown_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["drilldown_id"] = "DrilldownId" + fields["feature_set"] = bindings.NewOptionalType(bindings.NewReferenceType(FeatureSetBindingType)) + fieldNameMap["feature_set"] = "FeatureSet" + fields["filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["filter"] = "Filter" + fields["filter_value_required"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["filter_value_required"] = "FilterValueRequired" + fields["filters"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["filters"] = "Filters" + fields["footer"] = bindings.NewOptionalType(bindings.NewReferenceType(FooterBindingType)) + fieldNameMap["footer"] = "Footer" + fields["icons"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(IconBindingType), reflect.TypeOf([]Icon{}))) + fieldNameMap["icons"] = "Icons" + fields["is_drilldown"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_drilldown"] = "IsDrilldown" + fields["legend"] = bindings.NewOptionalType(bindings.NewReferenceType(LegendBindingType)) + fieldNameMap["legend"] = "Legend" + fields["plot_configs"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(WidgetPlotConfigurationBindingType), reflect.TypeOf([]WidgetPlotConfiguration{}))) + fieldNameMap["plot_configs"] = "PlotConfigs" + fields["rowspan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rowspan"] = "Rowspan" + fields["shared"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["shared"] = "Shared" + fields["show_header"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_header"] = "ShowHeader" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.widget_configuration", fields, reflect.TypeOf(WidgetConfiguration{}), fieldNameMap, validators) +} + +func WidgetConfigurationListBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["widgetconfigurations"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(WidgetConfigurationBindingType)}, bindings.REST), reflect.TypeOf([]*data.StructValue{}))) + fieldNameMap["widgetconfigurations"] = "Widgetconfigurations" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.widget_configuration_list", fields, reflect.TypeOf(WidgetConfigurationList{}), fieldNameMap, validators) +} + +func WidgetItemBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["alignment"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["alignment"] = "Alignment" + fields["label"] = bindings.NewOptionalType(bindings.NewReferenceType(LabelBindingType)) + fieldNameMap["label"] = "Label" + fields["rowspan"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["rowspan"] = "Rowspan" + fields["separator"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["separator"] = "Separator" + fields["span"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["span"] = "Span" + fields["weight"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["weight"] = "Weight" + fields["widget_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["widget_id"] = "WidgetId" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.widget_item", fields, reflect.TypeOf(WidgetItem{}), fieldNameMap, validators) +} + +func WidgetPlotConfigurationBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["allow_maximize"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["allow_maximize"] = "AllowMaximize" + fields["condition"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["condition"] = "Condition" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.widget_plot_configuration", fields, reflect.TypeOf(WidgetPlotConfiguration{}), fieldNameMap, validators) +} + +func X509CertificateBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["dsa_public_key_g"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dsa_public_key_g"] = "DsaPublicKeyg" + fields["dsa_public_key_p"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dsa_public_key_p"] = "DsaPublicKeyp" + fields["dsa_public_key_q"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dsa_public_key_q"] = "DsaPublicKeyq" + fields["dsa_public_key_y"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["dsa_public_key_y"] = "DsaPublicKeyy" + fields["ecdsa_curve_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ecdsa_curve_name"] = "EcdsaCurveName" + fields["ecdsa_ec_field"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ecdsa_ec_field"] = "EcdsaEcField" + fields["ecdsa_ec_field_f2mks"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewIntegerType(), reflect.TypeOf([]int64{}))) + fieldNameMap["ecdsa_ec_field_f2mks"] = "EcdsaEcFieldF2mks" + fields["ecdsa_ec_field_f2mm"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ecdsa_ec_field_f2mm"] = "EcdsaEcFieldF2mm" + fields["ecdsa_ec_field_f2mrp"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ecdsa_ec_field_f2mrp"] = "EcdsaEcFieldF2mrp" + fields["ecdsa_ec_field_f2pp"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ecdsa_ec_field_f2pp"] = "EcdsaEcFieldF2pp" + fields["ecdsa_public_key_a"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ecdsa_public_key_a"] = "EcdsaPublicKeya" + fields["ecdsa_public_key_b"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ecdsa_public_key_b"] = "EcdsaPublicKeyb" + fields["ecdsa_public_key_cofactor"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["ecdsa_public_key_cofactor"] = "EcdsaPublicKeyCofactor" + fields["ecdsa_public_key_generator_x"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ecdsa_public_key_generator_x"] = "EcdsaPublicKeyGeneratorx" + fields["ecdsa_public_key_generator_y"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ecdsa_public_key_generator_y"] = "EcdsaPublicKeyGeneratory" + fields["ecdsa_public_key_order"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ecdsa_public_key_order"] = "EcdsaPublicKeyOrder" + fields["ecdsa_public_key_seed"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewStringType(), reflect.TypeOf([]string{}))) + fieldNameMap["ecdsa_public_key_seed"] = "EcdsaPublicKeySeed" + fields["is_ca"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_ca"] = "IsCa" + fields["is_valid"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["is_valid"] = "IsValid" + fields["issuer"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["issuer"] = "Issuer" + fields["issuer_cn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["issuer_cn"] = "IssuerCn" + fields["not_after"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["not_after"] = "NotAfter" + fields["not_before"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["not_before"] = "NotBefore" + fields["public_key_algo"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["public_key_algo"] = "PublicKeyAlgo" + fields["public_key_length"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fieldNameMap["public_key_length"] = "PublicKeyLength" + fields["rsa_public_key_exponent"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["rsa_public_key_exponent"] = "RsaPublicKeyExponent" + fields["rsa_public_key_modulus"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["rsa_public_key_modulus"] = "RsaPublicKeyModulus" + fields["serial_number"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["serial_number"] = "SerialNumber" + fields["signature"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["signature"] = "Signature" + fields["signature_algorithm"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["signature_algorithm"] = "SignatureAlgorithm" + fields["subject"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["subject"] = "Subject" + fields["subject_cn"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["subject_cn"] = "SubjectCn" + fields["version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["version"] = "Version" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.x509_certificate", fields, reflect.TypeOf(X509Certificate{}), fieldNameMap, validators) +} + +func X509CrlBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["crl_entries"] = bindings.NewOptionalType(bindings.NewListType(bindings.NewReferenceType(X509CrlEntryBindingType), reflect.TypeOf([]X509CrlEntry{}))) + fieldNameMap["crl_entries"] = "CrlEntries" + fields["issuer"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["issuer"] = "Issuer" + fields["next_update"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["next_update"] = "NextUpdate" + fields["version"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["version"] = "Version" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.x509_crl", fields, reflect.TypeOf(X509Crl{}), fieldNameMap, validators) +} + +func X509CrlEntryBindingType() bindings.BindingType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["revocation_date"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["revocation_date"] = "RevocationDate" + fields["serial_number"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["serial_number"] = "SerialNumber" + var validators = []bindings.Validator{} + return bindings.NewStructType("com.vmware.nsx.model.x509_crl_entry", fields, reflect.TypeOf(X509CrlEntry{}), fieldNameMap, validators) +} diff --git a/services/nsxt-mp/nsx/node/CentralConfigClient.go b/services/nsxt-mp/nsx/node/CentralConfigClient.go new file mode 100644 index 000000000..02360f15f --- /dev/null +++ b/services/nsxt-mp/nsx/node/CentralConfigClient.go @@ -0,0 +1,130 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: CentralConfig +// Used by client-side stubs. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type CentralConfigClient interface { + + // Read Central Config properties + // @return com.vmware.nsx.model.CentralConfigProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.CentralConfigProperties, error) + + // Update Central Config properties + // + // @param centralConfigPropertiesParam (required) + // @return com.vmware.nsx.model.CentralConfigProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(centralConfigPropertiesParam model.CentralConfigProperties) (model.CentralConfigProperties, error) +} + +type centralConfigClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewCentralConfigClient(connector client.Connector) *centralConfigClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.central_config") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := centralConfigClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *centralConfigClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *centralConfigClient) Get() (model.CentralConfigProperties, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(centralConfigGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CentralConfigProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := centralConfigGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.central_config", "get", inputDataValue, executionContext) + var emptyOutput model.CentralConfigProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), centralConfigGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CentralConfigProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *centralConfigClient) Update(centralConfigPropertiesParam model.CentralConfigProperties) (model.CentralConfigProperties, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(centralConfigUpdateInputType(), typeConverter) + sv.AddStructField("CentralConfigProperties", centralConfigPropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CentralConfigProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := centralConfigUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.central_config", "update", inputDataValue, executionContext) + var emptyOutput model.CentralConfigProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), centralConfigUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CentralConfigProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/CentralConfigTypes.go b/services/nsxt-mp/nsx/node/CentralConfigTypes.go new file mode 100644 index 000000000..c6ef6c834 --- /dev/null +++ b/services/nsxt-mp/nsx/node/CentralConfigTypes.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: CentralConfig. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func centralConfigGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func centralConfigGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CentralConfigPropertiesBindingType) +} + +func centralConfigGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/central-config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func centralConfigUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["central_config_properties"] = bindings.NewReferenceType(model.CentralConfigPropertiesBindingType) + fieldNameMap["central_config_properties"] = "CentralConfigProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func centralConfigUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CentralConfigPropertiesBindingType) +} + +func centralConfigUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["central_config_properties"] = bindings.NewReferenceType(model.CentralConfigPropertiesBindingType) + fieldNameMap["central_config_properties"] = "CentralConfigProperties" + paramsTypeMap["central_config_properties"] = bindings.NewReferenceType(model.CentralConfigPropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "central_config_properties", + "PUT", + "/api/v1/node/central-config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/CoreDumpsClient.go b/services/nsxt-mp/nsx/node/CoreDumpsClient.go new file mode 100644 index 000000000..ea5fc3ad4 --- /dev/null +++ b/services/nsxt-mp/nsx/node/CoreDumpsClient.go @@ -0,0 +1,126 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: CoreDumps +// Used by client-side stubs. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type CoreDumpsClient interface { + + // Copy system generated core dump file to a remote server. If you use scp or sftp, you must provide the remote server's SSH fingerprint. See the *NSX-T Administration Guide* for information and instructions about finding the SSH fingerprint. + // + // @param fileNameParam Destination filename (required) + // @param copyToRemoteFilePropertiesParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws TimedOut Gateway Timeout + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Copytoremotefile(fileNameParam string, copyToRemoteFilePropertiesParam model.CopyToRemoteFileProperties) error + + // List system core dumps + // @return com.vmware.nsx.model.FilePropertiesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.FilePropertiesListResult, error) +} + +type coreDumpsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewCoreDumpsClient(connector client.Connector) *coreDumpsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.core_dumps") + methodIdentifiers := map[string]core.MethodIdentifier{ + "copytoremotefile": core.NewMethodIdentifier(interfaceIdentifier, "copytoremotefile"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := coreDumpsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *coreDumpsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *coreDumpsClient) Copytoremotefile(fileNameParam string, copyToRemoteFilePropertiesParam model.CopyToRemoteFileProperties) error { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(coreDumpsCopytoremotefileInputType(), typeConverter) + sv.AddStructField("FileName", fileNameParam) + sv.AddStructField("CopyToRemoteFileProperties", copyToRemoteFilePropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := coreDumpsCopytoremotefileRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.core_dumps", "copytoremotefile", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *coreDumpsClient) List() (model.FilePropertiesListResult, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(coreDumpsListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FilePropertiesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := coreDumpsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.core_dumps", "list", inputDataValue, executionContext) + var emptyOutput model.FilePropertiesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), coreDumpsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FilePropertiesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/CoreDumpsTypes.go b/services/nsxt-mp/nsx/node/CoreDumpsTypes.go new file mode 100644 index 000000000..3180601ea --- /dev/null +++ b/services/nsxt-mp/nsx/node/CoreDumpsTypes.go @@ -0,0 +1,117 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: CoreDumps. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func coreDumpsCopytoremotefileInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_name"] = bindings.NewStringType() + fields["copy_to_remote_file_properties"] = bindings.NewReferenceType(model.CopyToRemoteFilePropertiesBindingType) + fieldNameMap["file_name"] = "FileName" + fieldNameMap["copy_to_remote_file_properties"] = "CopyToRemoteFileProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func coreDumpsCopytoremotefileOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func coreDumpsCopytoremotefileRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["file_name"] = bindings.NewStringType() + fields["copy_to_remote_file_properties"] = bindings.NewReferenceType(model.CopyToRemoteFilePropertiesBindingType) + fieldNameMap["file_name"] = "FileName" + fieldNameMap["copy_to_remote_file_properties"] = "CopyToRemoteFileProperties" + paramsTypeMap["copy_to_remote_file_properties"] = bindings.NewReferenceType(model.CopyToRemoteFilePropertiesBindingType) + paramsTypeMap["file_name"] = bindings.NewStringType() + paramsTypeMap["fileName"] = bindings.NewStringType() + pathParams["file_name"] = "fileName" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=copy_to_remote_file", + "copy_to_remote_file_properties", + "POST", + "/api/v1/node/core-dumps/{fileName}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.timed_out": 500, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func coreDumpsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func coreDumpsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FilePropertiesListResultBindingType) +} + +func coreDumpsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/core-dumps", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/FileStoreClient.go b/services/nsxt-mp/nsx/node/FileStoreClient.go new file mode 100644 index 000000000..2fb92a431 --- /dev/null +++ b/services/nsxt-mp/nsx/node/FileStoreClient.go @@ -0,0 +1,289 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: FileStore +// Used by client-side stubs. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type FileStoreClient interface { + + // Copy a remote file to the file store. If you use scp or sftp, you must provide the remote server's SSH fingerprint. See the *NSX-T Administration Guide* for information and instructions about finding the SSH fingerprint. + // + // @param fileNameParam Destination filename (required) + // @param copyFromRemoteFilePropertiesParam (required) + // @return com.vmware.nsx.model.FileProperties + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws TimedOut Gateway Timeout + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Copyfromremotefile(fileNameParam string, copyFromRemoteFilePropertiesParam model.CopyFromRemoteFileProperties) (model.FileProperties, error) + + // Copy a file in the file store to a remote server. If you use scp or sftp, you must provide the remote server's SSH fingerprint. See the *NSX-T Administration Guide* for information and instructions about finding the SSH fingerprint. + // + // @param fileNameParam Destination filename (required) + // @param copyToRemoteFilePropertiesParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws TimedOut Gateway Timeout + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Copytoremotefile(fileNameParam string, copyToRemoteFilePropertiesParam model.CopyToRemoteFileProperties) error + + // Create a directory on the remote remote server. Supports only SFTP. You must provide the remote server's SSH fingerprint. See the *NSX Administration Guide* for information and instructions about finding the SSH fingerprint. + // + // @param createRemoteDirectoryPropertiesParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws TimedOut Gateway Timeout + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Createremotedirectory(createRemoteDirectoryPropertiesParam model.CreateRemoteDirectoryProperties) error + + // Delete file + // + // @param fileNameParam Name of the file to delete (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(fileNameParam string) error + + // Read file properties + // + // @param fileNameParam Name of the file to retrieve information about (required) + // @return com.vmware.nsx.model.FileProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(fileNameParam string) (model.FileProperties, error) + + // List node files + // @return com.vmware.nsx.model.FilePropertiesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.FilePropertiesListResult, error) +} + +type fileStoreClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewFileStoreClient(connector client.Connector) *fileStoreClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.file_store") + methodIdentifiers := map[string]core.MethodIdentifier{ + "copyfromremotefile": core.NewMethodIdentifier(interfaceIdentifier, "copyfromremotefile"), + "copytoremotefile": core.NewMethodIdentifier(interfaceIdentifier, "copytoremotefile"), + "createremotedirectory": core.NewMethodIdentifier(interfaceIdentifier, "createremotedirectory"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + fIface := fileStoreClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &fIface +} + +func (fIface *fileStoreClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := fIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (fIface *fileStoreClient) Copyfromremotefile(fileNameParam string, copyFromRemoteFilePropertiesParam model.CopyFromRemoteFileProperties) (model.FileProperties, error) { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(fileStoreCopyfromremotefileInputType(), typeConverter) + sv.AddStructField("FileName", fileNameParam) + sv.AddStructField("CopyFromRemoteFileProperties", copyFromRemoteFilePropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FileProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := fileStoreCopyfromremotefileRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.file_store", "copyfromremotefile", inputDataValue, executionContext) + var emptyOutput model.FileProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), fileStoreCopyfromremotefileOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FileProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (fIface *fileStoreClient) Copytoremotefile(fileNameParam string, copyToRemoteFilePropertiesParam model.CopyToRemoteFileProperties) error { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(fileStoreCopytoremotefileInputType(), typeConverter) + sv.AddStructField("FileName", fileNameParam) + sv.AddStructField("CopyToRemoteFileProperties", copyToRemoteFilePropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := fileStoreCopytoremotefileRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.file_store", "copytoremotefile", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (fIface *fileStoreClient) Createremotedirectory(createRemoteDirectoryPropertiesParam model.CreateRemoteDirectoryProperties) error { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(fileStoreCreateremotedirectoryInputType(), typeConverter) + sv.AddStructField("CreateRemoteDirectoryProperties", createRemoteDirectoryPropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := fileStoreCreateremotedirectoryRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.file_store", "createremotedirectory", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (fIface *fileStoreClient) Delete(fileNameParam string) error { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(fileStoreDeleteInputType(), typeConverter) + sv.AddStructField("FileName", fileNameParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := fileStoreDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.file_store", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (fIface *fileStoreClient) Get(fileNameParam string) (model.FileProperties, error) { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(fileStoreGetInputType(), typeConverter) + sv.AddStructField("FileName", fileNameParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FileProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := fileStoreGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.file_store", "get", inputDataValue, executionContext) + var emptyOutput model.FileProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), fileStoreGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FileProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (fIface *fileStoreClient) List() (model.FilePropertiesListResult, error) { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(fileStoreListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FilePropertiesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := fileStoreListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.file_store", "list", inputDataValue, executionContext) + var emptyOutput model.FilePropertiesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), fileStoreListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FilePropertiesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/FileStoreTypes.go b/services/nsxt-mp/nsx/node/FileStoreTypes.go new file mode 100644 index 000000000..c9ae67edb --- /dev/null +++ b/services/nsxt-mp/nsx/node/FileStoreTypes.go @@ -0,0 +1,320 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: FileStore. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func fileStoreCopyfromremotefileInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_name"] = bindings.NewStringType() + fields["copy_from_remote_file_properties"] = bindings.NewReferenceType(model.CopyFromRemoteFilePropertiesBindingType) + fieldNameMap["file_name"] = "FileName" + fieldNameMap["copy_from_remote_file_properties"] = "CopyFromRemoteFileProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func fileStoreCopyfromremotefileOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FilePropertiesBindingType) +} + +func fileStoreCopyfromremotefileRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["file_name"] = bindings.NewStringType() + fields["copy_from_remote_file_properties"] = bindings.NewReferenceType(model.CopyFromRemoteFilePropertiesBindingType) + fieldNameMap["file_name"] = "FileName" + fieldNameMap["copy_from_remote_file_properties"] = "CopyFromRemoteFileProperties" + paramsTypeMap["file_name"] = bindings.NewStringType() + paramsTypeMap["copy_from_remote_file_properties"] = bindings.NewReferenceType(model.CopyFromRemoteFilePropertiesBindingType) + paramsTypeMap["fileName"] = bindings.NewStringType() + pathParams["file_name"] = "fileName" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=copy_from_remote_file", + "copy_from_remote_file_properties", + "POST", + "/api/v1/node/file-store/{fileName}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.timed_out": 500, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func fileStoreCopytoremotefileInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_name"] = bindings.NewStringType() + fields["copy_to_remote_file_properties"] = bindings.NewReferenceType(model.CopyToRemoteFilePropertiesBindingType) + fieldNameMap["file_name"] = "FileName" + fieldNameMap["copy_to_remote_file_properties"] = "CopyToRemoteFileProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func fileStoreCopytoremotefileOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func fileStoreCopytoremotefileRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["file_name"] = bindings.NewStringType() + fields["copy_to_remote_file_properties"] = bindings.NewReferenceType(model.CopyToRemoteFilePropertiesBindingType) + fieldNameMap["file_name"] = "FileName" + fieldNameMap["copy_to_remote_file_properties"] = "CopyToRemoteFileProperties" + paramsTypeMap["copy_to_remote_file_properties"] = bindings.NewReferenceType(model.CopyToRemoteFilePropertiesBindingType) + paramsTypeMap["file_name"] = bindings.NewStringType() + paramsTypeMap["fileName"] = bindings.NewStringType() + pathParams["file_name"] = "fileName" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=copy_to_remote_file", + "copy_to_remote_file_properties", + "POST", + "/api/v1/node/file-store/{fileName}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.timed_out": 500, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func fileStoreCreateremotedirectoryInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["create_remote_directory_properties"] = bindings.NewReferenceType(model.CreateRemoteDirectoryPropertiesBindingType) + fieldNameMap["create_remote_directory_properties"] = "CreateRemoteDirectoryProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func fileStoreCreateremotedirectoryOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func fileStoreCreateremotedirectoryRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["create_remote_directory_properties"] = bindings.NewReferenceType(model.CreateRemoteDirectoryPropertiesBindingType) + fieldNameMap["create_remote_directory_properties"] = "CreateRemoteDirectoryProperties" + paramsTypeMap["create_remote_directory_properties"] = bindings.NewReferenceType(model.CreateRemoteDirectoryPropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=create_remote_directory", + "create_remote_directory_properties", + "POST", + "/api/v1/node/file-store", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.timed_out": 500, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func fileStoreDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_name"] = bindings.NewStringType() + fieldNameMap["file_name"] = "FileName" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func fileStoreDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func fileStoreDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["file_name"] = bindings.NewStringType() + fieldNameMap["file_name"] = "FileName" + paramsTypeMap["file_name"] = bindings.NewStringType() + paramsTypeMap["fileName"] = bindings.NewStringType() + pathParams["file_name"] = "fileName" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/node/file-store/{fileName}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func fileStoreGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_name"] = bindings.NewStringType() + fieldNameMap["file_name"] = "FileName" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func fileStoreGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FilePropertiesBindingType) +} + +func fileStoreGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["file_name"] = bindings.NewStringType() + fieldNameMap["file_name"] = "FileName" + paramsTypeMap["file_name"] = bindings.NewStringType() + paramsTypeMap["fileName"] = bindings.NewStringType() + pathParams["file_name"] = "fileName" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/file-store/{fileName}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func fileStoreListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func fileStoreListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FilePropertiesListResultBindingType) +} + +func fileStoreListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/file-store", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/LogsClient.go b/services/nsxt-mp/nsx/node/LogsClient.go new file mode 100644 index 000000000..38b286fe0 --- /dev/null +++ b/services/nsxt-mp/nsx/node/LogsClient.go @@ -0,0 +1,130 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Logs +// Used by client-side stubs. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type LogsClient interface { + + // For a single specified log file, lists the filename, file size, and last-modified time. + // + // @param logNameParam Name of log file to read properties (required) + // @return com.vmware.nsx.model.NodeLogProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(logNameParam string) (model.NodeLogProperties, error) + + // Returns the number of log files and lists the log files that reside on the NSX virtual appliance. The list includes the filename, file size, and last-modified time in milliseconds since epoch (1 January 1970) for each log file. Knowing the last-modified time with millisecond accuracy since epoch is helpful when you are comparing two times, such as the time of a POST request and the end time on a server. + // @return com.vmware.nsx.model.NodeLogPropertiesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.NodeLogPropertiesListResult, error) +} + +type logsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewLogsClient(connector client.Connector) *logsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.logs") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + lIface := logsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &lIface +} + +func (lIface *logsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := lIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (lIface *logsClient) Get(logNameParam string) (model.NodeLogProperties, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logsGetInputType(), typeConverter) + sv.AddStructField("LogName", logNameParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeLogProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.logs", "get", inputDataValue, executionContext) + var emptyOutput model.NodeLogProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), logsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeLogProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *logsClient) List() (model.NodeLogPropertiesListResult, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(logsListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeLogPropertiesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := logsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.logs", "list", inputDataValue, executionContext) + var emptyOutput model.NodeLogPropertiesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), logsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeLogPropertiesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/LogsTypes.go b/services/nsxt-mp/nsx/node/LogsTypes.go new file mode 100644 index 000000000..f697b7b1d --- /dev/null +++ b/services/nsxt-mp/nsx/node/LogsTypes.go @@ -0,0 +1,112 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Logs. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func logsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["log_name"] = bindings.NewStringType() + fieldNameMap["log_name"] = "LogName" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeLogPropertiesBindingType) +} + +func logsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["log_name"] = bindings.NewStringType() + fieldNameMap["log_name"] = "LogName" + paramsTypeMap["log_name"] = bindings.NewStringType() + paramsTypeMap["logName"] = bindings.NewStringType() + pathParams["log_name"] = "logName" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/logs/{logName}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func logsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func logsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeLogPropertiesListResultBindingType) +} + +func logsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/logs", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/ManagementPlaneClient.go b/services/nsxt-mp/nsx/node/ManagementPlaneClient.go new file mode 100644 index 000000000..c59a87d5f --- /dev/null +++ b/services/nsxt-mp/nsx/node/ManagementPlaneClient.go @@ -0,0 +1,163 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ManagementPlane +// Used by client-side stubs. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ManagementPlaneClient interface { + + // Delete the management plane configuration for this node. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete() error + + // Retrieve the management plane configuration for this node to identify the Manager node with which the controller service is communicating. + // @return com.vmware.nsx.model.ManagementPlaneProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.ManagementPlaneProperties, error) + + // Update the management plane configuration for this node. + // + // @param managementPlanePropertiesParam (required) + // @return com.vmware.nsx.model.ManagementPlaneProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(managementPlanePropertiesParam model.ManagementPlaneProperties) (model.ManagementPlaneProperties, error) +} + +type managementPlaneClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewManagementPlaneClient(connector client.Connector) *managementPlaneClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.management_plane") + methodIdentifiers := map[string]core.MethodIdentifier{ + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := managementPlaneClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *managementPlaneClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *managementPlaneClient) Delete() error { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(managementPlaneDeleteInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := managementPlaneDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.management_plane", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (mIface *managementPlaneClient) Get() (model.ManagementPlaneProperties, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(managementPlaneGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ManagementPlaneProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := managementPlaneGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.management_plane", "get", inputDataValue, executionContext) + var emptyOutput model.ManagementPlaneProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), managementPlaneGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ManagementPlaneProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *managementPlaneClient) Update(managementPlanePropertiesParam model.ManagementPlaneProperties) (model.ManagementPlaneProperties, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(managementPlaneUpdateInputType(), typeConverter) + sv.AddStructField("ManagementPlaneProperties", managementPlanePropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ManagementPlaneProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := managementPlaneUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.management_plane", "update", inputDataValue, executionContext) + var emptyOutput model.ManagementPlaneProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), managementPlaneUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ManagementPlaneProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/ManagementPlaneTypes.go b/services/nsxt-mp/nsx/node/ManagementPlaneTypes.go new file mode 100644 index 000000000..b1e0267eb --- /dev/null +++ b/services/nsxt-mp/nsx/node/ManagementPlaneTypes.go @@ -0,0 +1,153 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ManagementPlane. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func managementPlaneDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func managementPlaneDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func managementPlaneDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/node/management-plane", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func managementPlaneGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func managementPlaneGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ManagementPlanePropertiesBindingType) +} + +func managementPlaneGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/management-plane", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func managementPlaneUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["management_plane_properties"] = bindings.NewReferenceType(model.ManagementPlanePropertiesBindingType) + fieldNameMap["management_plane_properties"] = "ManagementPlaneProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func managementPlaneUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ManagementPlanePropertiesBindingType) +} + +func managementPlaneUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["management_plane_properties"] = bindings.NewReferenceType(model.ManagementPlanePropertiesBindingType) + fieldNameMap["management_plane_properties"] = "ManagementPlaneProperties" + paramsTypeMap["management_plane_properties"] = bindings.NewReferenceType(model.ManagementPlanePropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "management_plane_properties", + "PUT", + "/api/v1/node/management-plane", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/ModeClient.go b/services/nsxt-mp/nsx/node/ModeClient.go new file mode 100644 index 000000000..0a814db27 --- /dev/null +++ b/services/nsxt-mp/nsx/node/ModeClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Mode +// Used by client-side stubs. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ModeClient interface { + + // Returns current Node Mode. + // @return com.vmware.nsx.model.NodeMode + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeMode, error) +} + +type modeClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewModeClient(connector client.Connector) *modeClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.mode") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := modeClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *modeClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *modeClient) Get() (model.NodeMode, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(modeGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeMode + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := modeGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.mode", "get", inputDataValue, executionContext) + var emptyOutput model.NodeMode + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), modeGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeMode), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/ModeTypes.go b/services/nsxt-mp/nsx/node/ModeTypes.go new file mode 100644 index 000000000..02ecbada3 --- /dev/null +++ b/services/nsxt-mp/nsx/node/ModeTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Mode. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func modeGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func modeGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeModeBindingType) +} + +func modeGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/mode", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/MpaConfigClient.go b/services/nsxt-mp/nsx/node/MpaConfigClient.go new file mode 100644 index 000000000..2ada9f431 --- /dev/null +++ b/services/nsxt-mp/nsx/node/MpaConfigClient.go @@ -0,0 +1,163 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MpaConfig +// Used by client-side stubs. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MpaConfigClient interface { + + // Delete the MPA configuration for this node. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete() error + + // Retrieve the MPA configuration for this node to identify the Manager nodes with which this node is communicating. + // @return com.vmware.nsx.model.MPAConfigProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.MPAConfigProperties, error) + + // Update the MPA configuration for this node. + // + // @param mPAConfigPropertiesParam (required) + // @return com.vmware.nsx.model.MPAConfigProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(mPAConfigPropertiesParam model.MPAConfigProperties) (model.MPAConfigProperties, error) +} + +type mpaConfigClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMpaConfigClient(connector client.Connector) *mpaConfigClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.mpa_config") + methodIdentifiers := map[string]core.MethodIdentifier{ + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := mpaConfigClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *mpaConfigClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *mpaConfigClient) Delete() error { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(mpaConfigDeleteInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := mpaConfigDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.mpa_config", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (mIface *mpaConfigClient) Get() (model.MPAConfigProperties, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(mpaConfigGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MPAConfigProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := mpaConfigGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.mpa_config", "get", inputDataValue, executionContext) + var emptyOutput model.MPAConfigProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), mpaConfigGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MPAConfigProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *mpaConfigClient) Update(mPAConfigPropertiesParam model.MPAConfigProperties) (model.MPAConfigProperties, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(mpaConfigUpdateInputType(), typeConverter) + sv.AddStructField("MPAConfigProperties", mPAConfigPropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MPAConfigProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := mpaConfigUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.mpa_config", "update", inputDataValue, executionContext) + var emptyOutput model.MPAConfigProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), mpaConfigUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MPAConfigProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/MpaConfigTypes.go b/services/nsxt-mp/nsx/node/MpaConfigTypes.go new file mode 100644 index 000000000..2199632f3 --- /dev/null +++ b/services/nsxt-mp/nsx/node/MpaConfigTypes.go @@ -0,0 +1,153 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MpaConfig. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func mpaConfigDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func mpaConfigDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func mpaConfigDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/node/mpa-config", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func mpaConfigGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func mpaConfigGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MPAConfigPropertiesBindingType) +} + +func mpaConfigGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/mpa-config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func mpaConfigUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["m_PA_config_properties"] = bindings.NewReferenceType(model.MPAConfigPropertiesBindingType) + fieldNameMap["m_PA_config_properties"] = "MPAConfigProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func mpaConfigUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MPAConfigPropertiesBindingType) +} + +func mpaConfigUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["m_PA_config_properties"] = bindings.NewReferenceType(model.MPAConfigPropertiesBindingType) + fieldNameMap["m_PA_config_properties"] = "MPAConfigProperties" + paramsTypeMap["m_PA_config_properties"] = bindings.NewReferenceType(model.MPAConfigPropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "m_PA_config_properties", + "PUT", + "/api/v1/node/mpa-config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/NetworkClient.go b/services/nsxt-mp/nsx/node/NetworkClient.go new file mode 100644 index 000000000..2ef3c9edc --- /dev/null +++ b/services/nsxt-mp/nsx/node/NetworkClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Network +// Used by client-side stubs. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NetworkClient interface { + + // Read network configuration properties + // @return com.vmware.nsx.model.NodeNetworkProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeNetworkProperties, error) +} + +type networkClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNetworkClient(connector client.Connector) *networkClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.network") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := networkClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *networkClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *networkClient) Get() (model.NodeNetworkProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(networkGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeNetworkProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := networkGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.network", "get", inputDataValue, executionContext) + var emptyOutput model.NodeNetworkProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), networkGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeNetworkProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/NetworkTypes.go b/services/nsxt-mp/nsx/node/NetworkTypes.go new file mode 100644 index 000000000..920392284 --- /dev/null +++ b/services/nsxt-mp/nsx/node/NetworkTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Network. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func networkGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func networkGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeNetworkPropertiesBindingType) +} + +func networkGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/network", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/NodePackageTypes.go b/services/nsxt-mp/nsx/node/NodePackageTypes.go new file mode 100644 index 000000000..638384e2d --- /dev/null +++ b/services/nsxt-mp/nsx/node/NodePackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package node diff --git a/services/nsxt-mp/nsx/node/ProcessesClient.go b/services/nsxt-mp/nsx/node/ProcessesClient.go new file mode 100644 index 000000000..52446b3bd --- /dev/null +++ b/services/nsxt-mp/nsx/node/ProcessesClient.go @@ -0,0 +1,130 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Processes +// Used by client-side stubs. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ProcessesClient interface { + + // Returns information for a specified process ID (pid). + // + // @param processIdParam ID of process to read (required) + // @return com.vmware.nsx.model.NodeProcessProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(processIdParam string) (model.NodeProcessProperties, error) + + // Returns the number of processes and information about each process. Process information includes 1) mem_resident, which is roughly equivalent to the amount of RAM, in bytes, currently used by the process, 2) parent process ID (ppid), 3) process name, 4) process up time in milliseconds, 5) mem_used, wich is the amount of virtual memory used by the process, in bytes, 6) process start time, in milliseconds since epoch, 7) process ID (pid), 8) CPU time, both user and the system, consumed by the process in milliseconds. + // @return com.vmware.nsx.model.NodeProcessPropertiesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.NodeProcessPropertiesListResult, error) +} + +type processesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewProcessesClient(connector client.Connector) *processesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.processes") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + pIface := processesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &pIface +} + +func (pIface *processesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := pIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (pIface *processesClient) Get(processIdParam string) (model.NodeProcessProperties, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(processesGetInputType(), typeConverter) + sv.AddStructField("ProcessId", processIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeProcessProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := processesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.processes", "get", inputDataValue, executionContext) + var emptyOutput model.NodeProcessProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), processesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeProcessProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *processesClient) List() (model.NodeProcessPropertiesListResult, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(processesListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeProcessPropertiesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := processesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.processes", "list", inputDataValue, executionContext) + var emptyOutput model.NodeProcessPropertiesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), processesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeProcessPropertiesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/ProcessesTypes.go b/services/nsxt-mp/nsx/node/ProcessesTypes.go new file mode 100644 index 000000000..8daac8692 --- /dev/null +++ b/services/nsxt-mp/nsx/node/ProcessesTypes.go @@ -0,0 +1,112 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Processes. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func processesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["process_id"] = bindings.NewStringType() + fieldNameMap["process_id"] = "ProcessId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func processesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeProcessPropertiesBindingType) +} + +func processesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["process_id"] = bindings.NewStringType() + fieldNameMap["process_id"] = "ProcessId" + paramsTypeMap["process_id"] = bindings.NewStringType() + paramsTypeMap["processId"] = bindings.NewStringType() + pathParams["process_id"] = "processId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/processes/{processId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func processesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func processesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeProcessPropertiesListResultBindingType) +} + +func processesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/processes", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/ServicesClient.go b/services/nsxt-mp/nsx/node/ServicesClient.go new file mode 100644 index 000000000..0e587681b --- /dev/null +++ b/services/nsxt-mp/nsx/node/ServicesClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Services +// Used by client-side stubs. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ServicesClient interface { + + // Returns a list of all services available on the node applicance. + // @return com.vmware.nsx.model.NodeServicePropertiesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.NodeServicePropertiesListResult, error) +} + +type servicesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewServicesClient(connector client.Connector) *servicesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := servicesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *servicesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *servicesClient) List() (model.NodeServicePropertiesListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(servicesListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServicePropertiesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services", "list", inputDataValue, executionContext) + var emptyOutput model.NodeServicePropertiesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), servicesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServicePropertiesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/ServicesTypes.go b/services/nsxt-mp/nsx/node/ServicesTypes.go new file mode 100644 index 000000000..71a4f3e85 --- /dev/null +++ b/services/nsxt-mp/nsx/node/ServicesTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Services. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func servicesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServicePropertiesListResultBindingType) +} + +func servicesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/StatusClient.go b/services/nsxt-mp/nsx/node/StatusClient.go new file mode 100644 index 000000000..b473f158c --- /dev/null +++ b/services/nsxt-mp/nsx/node/StatusClient.go @@ -0,0 +1,127 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Clear node bootup status + // @return com.vmware.nsx.model.NodeStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Clearbootuperror() (model.NodeStatusProperties, error) + + // Returns information about the node appliance's file system, CPU, memory, disk usage, and uptime. + // @return com.vmware.nsx.model.NodeStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "clearbootuperror": core.NewMethodIdentifier(interfaceIdentifier, "clearbootuperror"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Clearbootuperror() (model.NodeStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusClearbootuperrorInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusClearbootuperrorRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.status", "clearbootuperror", inputDataValue, executionContext) + var emptyOutput model.NodeStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusClearbootuperrorOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statusClient) Get() (model.NodeStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/StatusTypes.go b/services/nsxt-mp/nsx/node/StatusTypes.go new file mode 100644 index 000000000..9f1be08d5 --- /dev/null +++ b/services/nsxt-mp/nsx/node/StatusTypes.go @@ -0,0 +1,105 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusClearbootuperrorInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusClearbootuperrorOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeStatusPropertiesBindingType) +} + +func statusClearbootuperrorRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=clear_bootup_error", + "", + "POST", + "/api/v1/node/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/TasksClient.go b/services/nsxt-mp/nsx/node/TasksClient.go new file mode 100644 index 000000000..92b2c6fb7 --- /dev/null +++ b/services/nsxt-mp/nsx/node/TasksClient.go @@ -0,0 +1,218 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Tasks +// Used by client-side stubs. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type TasksClient interface { + + // Cancel specified task + // + // @param taskIdParam ID of task to delete (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Cancel(taskIdParam string) error + + // Delete task + // + // @param taskIdParam ID of task to delete (required) + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(taskIdParam string) error + + // Read task properties + // + // @param taskIdParam ID of task to read (required) + // @param suppressRedirectParam Suppress redirect status if applicable (optional, default to false) + // @return com.vmware.nsx.model.ApplianceManagementTaskProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(taskIdParam string, suppressRedirectParam *bool) (model.ApplianceManagementTaskProperties, error) + + // List appliance management tasks + // + // @param fieldsParam Fields to include in query results (optional) + // @param requestMethodParam Request method(s) to include in query result (optional) + // @param requestPathParam Request URI path(s) to include in query result (optional) + // @param requestUriParam Request URI(s) to include in query result (optional) + // @param statusParam Status(es) to include in query result (optional) + // @param userParam Names of users to include in query result (optional) + // @return com.vmware.nsx.model.ApplianceManagementTaskListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(fieldsParam *string, requestMethodParam *string, requestPathParam *string, requestUriParam *string, statusParam *string, userParam *string) (model.ApplianceManagementTaskListResult, error) +} + +type tasksClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewTasksClient(connector client.Connector) *tasksClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.tasks") + methodIdentifiers := map[string]core.MethodIdentifier{ + "cancel": core.NewMethodIdentifier(interfaceIdentifier, "cancel"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + tIface := tasksClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &tIface +} + +func (tIface *tasksClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := tIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (tIface *tasksClient) Cancel(taskIdParam string) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(tasksCancelInputType(), typeConverter) + sv.AddStructField("TaskId", taskIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tasksCancelRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.tasks", "cancel", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *tasksClient) Delete(taskIdParam string) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(tasksDeleteInputType(), typeConverter) + sv.AddStructField("TaskId", taskIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tasksDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.tasks", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *tasksClient) Get(taskIdParam string, suppressRedirectParam *bool) (model.ApplianceManagementTaskProperties, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(tasksGetInputType(), typeConverter) + sv.AddStructField("TaskId", taskIdParam) + sv.AddStructField("SuppressRedirect", suppressRedirectParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ApplianceManagementTaskProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tasksGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.tasks", "get", inputDataValue, executionContext) + var emptyOutput model.ApplianceManagementTaskProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), tasksGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ApplianceManagementTaskProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *tasksClient) List(fieldsParam *string, requestMethodParam *string, requestPathParam *string, requestUriParam *string, statusParam *string, userParam *string) (model.ApplianceManagementTaskListResult, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(tasksListInputType(), typeConverter) + sv.AddStructField("Fields", fieldsParam) + sv.AddStructField("RequestMethod", requestMethodParam) + sv.AddStructField("RequestPath", requestPathParam) + sv.AddStructField("RequestUri", requestUriParam) + sv.AddStructField("Status", statusParam) + sv.AddStructField("User", userParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ApplianceManagementTaskListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tasksListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.tasks", "list", inputDataValue, executionContext) + var emptyOutput model.ApplianceManagementTaskListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), tasksListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ApplianceManagementTaskListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/TasksTypes.go b/services/nsxt-mp/nsx/node/TasksTypes.go new file mode 100644 index 000000000..dcde3ae36 --- /dev/null +++ b/services/nsxt-mp/nsx/node/TasksTypes.go @@ -0,0 +1,254 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Tasks. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func tasksCancelInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["task_id"] = bindings.NewStringType() + fieldNameMap["task_id"] = "TaskId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tasksCancelOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func tasksCancelRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["task_id"] = bindings.NewStringType() + fieldNameMap["task_id"] = "TaskId" + paramsTypeMap["task_id"] = bindings.NewStringType() + paramsTypeMap["taskId"] = bindings.NewStringType() + pathParams["task_id"] = "taskId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=cancel", + "", + "POST", + "/api/v1/node/tasks/{taskId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func tasksDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["task_id"] = bindings.NewStringType() + fieldNameMap["task_id"] = "TaskId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tasksDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func tasksDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["task_id"] = bindings.NewStringType() + fieldNameMap["task_id"] = "TaskId" + paramsTypeMap["task_id"] = bindings.NewStringType() + paramsTypeMap["taskId"] = bindings.NewStringType() + pathParams["task_id"] = "taskId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/node/tasks/{taskId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func tasksGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["task_id"] = bindings.NewStringType() + fields["suppress_redirect"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["task_id"] = "TaskId" + fieldNameMap["suppress_redirect"] = "SuppressRedirect" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tasksGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ApplianceManagementTaskPropertiesBindingType) +} + +func tasksGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["task_id"] = bindings.NewStringType() + fields["suppress_redirect"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["task_id"] = "TaskId" + fieldNameMap["suppress_redirect"] = "SuppressRedirect" + paramsTypeMap["suppress_redirect"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["task_id"] = bindings.NewStringType() + paramsTypeMap["taskId"] = bindings.NewStringType() + pathParams["task_id"] = "taskId" + queryParams["suppress_redirect"] = "suppress_redirect" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/tasks/{taskId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func tasksListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["request_method"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["request_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["request_uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["fields"] = "Fields" + fieldNameMap["request_method"] = "RequestMethod" + fieldNameMap["request_path"] = "RequestPath" + fieldNameMap["request_uri"] = "RequestUri" + fieldNameMap["status"] = "Status" + fieldNameMap["user"] = "User" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tasksListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ApplianceManagementTaskListResultBindingType) +} + +func tasksListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["request_method"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["request_path"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["request_uri"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["user"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["fields"] = "Fields" + fieldNameMap["request_method"] = "RequestMethod" + fieldNameMap["request_path"] = "RequestPath" + fieldNameMap["request_uri"] = "RequestUri" + fieldNameMap["status"] = "Status" + fieldNameMap["user"] = "User" + paramsTypeMap["request_uri"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["request_path"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["user"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["status"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["request_method"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["request_path"] = "request_path" + queryParams["request_method"] = "request_method" + queryParams["fields"] = "fields" + queryParams["user"] = "user" + queryParams["request_uri"] = "request_uri" + queryParams["status"] = "status" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/tasks", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/UpgradeClient.go b/services/nsxt-mp/nsx/node/UpgradeClient.go new file mode 100644 index 000000000..aaf7ab7c5 --- /dev/null +++ b/services/nsxt-mp/nsx/node/UpgradeClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Upgrade +// Used by client-side stubs. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UpgradeClient interface { + + // Get upgrade task status for the given task of the given bundle. Both bundle_name and task_id must be provided, otherwise you will receive a 404 NOT FOUND response. This api is deprecated. Please use API GET /node/upgrade/status-summary to get upgrade status when upgrade is in progress. + // + // @param bundleNameParam Bundle Name (optional) + // @param upgradeTaskIdParam Upgrade Task ID (optional) + // @return com.vmware.nsx.model.UpgradeTaskProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(bundleNameParam *string, upgradeTaskIdParam *string) (model.UpgradeTaskProperties, error) +} + +type upgradeClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUpgradeClient(connector client.Connector) *upgradeClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.upgrade") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := upgradeClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *upgradeClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *upgradeClient) Get(bundleNameParam *string, upgradeTaskIdParam *string) (model.UpgradeTaskProperties, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(upgradeGetInputType(), typeConverter) + sv.AddStructField("BundleName", bundleNameParam) + sv.AddStructField("UpgradeTaskId", upgradeTaskIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeTaskProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := upgradeGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.upgrade", "get", inputDataValue, executionContext) + var emptyOutput model.UpgradeTaskProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), upgradeGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeTaskProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/UpgradeTypes.go b/services/nsxt-mp/nsx/node/UpgradeTypes.go new file mode 100644 index 000000000..d599d7acc --- /dev/null +++ b/services/nsxt-mp/nsx/node/UpgradeTypes.go @@ -0,0 +1,74 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Upgrade. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func upgradeGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bundle_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["upgrade_task_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["bundle_name"] = "BundleName" + fieldNameMap["upgrade_task_id"] = "UpgradeTaskId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func upgradeGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeTaskPropertiesBindingType) +} + +func upgradeGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["bundle_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["upgrade_task_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["bundle_name"] = "BundleName" + fieldNameMap["upgrade_task_id"] = "UpgradeTaskId" + paramsTypeMap["bundle_name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["upgrade_task_id"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["bundle_name"] = "bundle_name" + queryParams["upgrade_task_id"] = "upgrade_task_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/upgrade", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/UsersClient.go b/services/nsxt-mp/nsx/node/UsersClient.go new file mode 100644 index 000000000..4bac6f760 --- /dev/null +++ b/services/nsxt-mp/nsx/node/UsersClient.go @@ -0,0 +1,342 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Users +// Used by client-side stubs. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UsersClient interface { + + // Activates the account for this user. When an account is successfully activated, the \"status\" field in the response is \"ACTIVE\". This API is not supported for userid 0 and userid 10000. + // + // @param useridParam User id of the user (required) + // @param nodeUserPasswordPropertyParam (required) + // @return com.vmware.nsx.model.NodeUserProperties + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Activate(useridParam string, nodeUserPasswordPropertyParam model.NodeUserPasswordProperty) (model.NodeUserProperties, error) + + // Deactivates the account for this user. Deactivating an account is permanent, unlike an account that is temporarily locked because of too many password failures. A deactivated account has to be explicitly activated. When an account is successfully deactivated, the \"status\" field in the response is \"NOT_ACTIVATED\". This API is not supported for userid 0 and userid 10000. + // + // @param useridParam User id of the user (required) + // @return com.vmware.nsx.model.NodeUserProperties + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Deactivate(useridParam string) (model.NodeUserProperties, error) + + // Returns information about a specified user who is configured to log in to the NSX appliance. The valid user IDs are: 0, 10000, 10002. + // + // @param useridParam User id of the user (required) + // @return com.vmware.nsx.model.NodeUserProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(useridParam string) (model.NodeUserProperties, error) + + // Returns the list of users configured to log in to the NSX appliance. + // @return com.vmware.nsx.model.NodeUserPropertiesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.NodeUserPropertiesListResult, error) + + // Enables a user to reset their own password. + // + // @param resetNodeUserOwnPasswordPropertiesParam (required) + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Resetownpassword(resetNodeUserOwnPasswordPropertiesParam model.ResetNodeUserOwnPasswordProperties) error + + // Unlike the PUT version of this call (PUT /node/users/), this API does not require that the current password for the user be provided. The account of the target user must be \"ACTIVE\" for the call to succeed. This API only supports user IDs 10002, 10003, and 10004. + // + // @param useridParam User id of the user (required) + // @param nodeUserPasswordPropertyParam (required) + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Resetpassword(useridParam string, nodeUserPasswordPropertyParam model.NodeUserPasswordProperty) error + + // Updates attributes of an existing NSX appliance user. This method cannot be used to add a new user. Modifiable attributes include the username, full name of the user, and password. If you specify a password in a PUT request, it is not returned in the response. Nor is it returned in a GET request. The specified password does not meet the following complexity requirements: - minimum 12 characters in length - minimum 1 uppercase character - minimum 1 lowercase character - minimum 1 numeric character - minimum 1 special character - minimum 5 unique characters - default password complexity rules as enforced by the Linux PAM module The valid user IDs are: 0, 10000, 10002. Note that invoking this API does not update any user-related properties of existing objects in the system and does not modify the username field in existing audit log entries. + // + // @param useridParam User id of the user (required) + // @param nodeUserPropertiesParam (required) + // @return com.vmware.nsx.model.NodeUserProperties + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(useridParam string, nodeUserPropertiesParam model.NodeUserProperties) (model.NodeUserProperties, error) +} + +type usersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUsersClient(connector client.Connector) *usersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.users") + methodIdentifiers := map[string]core.MethodIdentifier{ + "activate": core.NewMethodIdentifier(interfaceIdentifier, "activate"), + "deactivate": core.NewMethodIdentifier(interfaceIdentifier, "deactivate"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "resetownpassword": core.NewMethodIdentifier(interfaceIdentifier, "resetownpassword"), + "resetpassword": core.NewMethodIdentifier(interfaceIdentifier, "resetpassword"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := usersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *usersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *usersClient) Activate(useridParam string, nodeUserPasswordPropertyParam model.NodeUserPasswordProperty) (model.NodeUserProperties, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(usersActivateInputType(), typeConverter) + sv.AddStructField("Userid", useridParam) + sv.AddStructField("NodeUserPasswordProperty", nodeUserPasswordPropertyParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeUserProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := usersActivateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.users", "activate", inputDataValue, executionContext) + var emptyOutput model.NodeUserProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), usersActivateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeUserProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (uIface *usersClient) Deactivate(useridParam string) (model.NodeUserProperties, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(usersDeactivateInputType(), typeConverter) + sv.AddStructField("Userid", useridParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeUserProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := usersDeactivateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.users", "deactivate", inputDataValue, executionContext) + var emptyOutput model.NodeUserProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), usersDeactivateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeUserProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (uIface *usersClient) Get(useridParam string) (model.NodeUserProperties, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(usersGetInputType(), typeConverter) + sv.AddStructField("Userid", useridParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeUserProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := usersGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.users", "get", inputDataValue, executionContext) + var emptyOutput model.NodeUserProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), usersGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeUserProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (uIface *usersClient) List() (model.NodeUserPropertiesListResult, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(usersListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeUserPropertiesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := usersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.users", "list", inputDataValue, executionContext) + var emptyOutput model.NodeUserPropertiesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), usersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeUserPropertiesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (uIface *usersClient) Resetownpassword(resetNodeUserOwnPasswordPropertiesParam model.ResetNodeUserOwnPasswordProperties) error { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(usersResetownpasswordInputType(), typeConverter) + sv.AddStructField("ResetNodeUserOwnPasswordProperties", resetNodeUserOwnPasswordPropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := usersResetownpasswordRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.users", "resetownpassword", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (uIface *usersClient) Resetpassword(useridParam string, nodeUserPasswordPropertyParam model.NodeUserPasswordProperty) error { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(usersResetpasswordInputType(), typeConverter) + sv.AddStructField("Userid", useridParam) + sv.AddStructField("NodeUserPasswordProperty", nodeUserPasswordPropertyParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := usersResetpasswordRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.users", "resetpassword", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (uIface *usersClient) Update(useridParam string, nodeUserPropertiesParam model.NodeUserProperties) (model.NodeUserProperties, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(usersUpdateInputType(), typeConverter) + sv.AddStructField("Userid", useridParam) + sv.AddStructField("NodeUserProperties", nodeUserPropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeUserProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := usersUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.users", "update", inputDataValue, executionContext) + var emptyOutput model.NodeUserProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), usersUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeUserProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/UsersTypes.go b/services/nsxt-mp/nsx/node/UsersTypes.go new file mode 100644 index 000000000..2ab96cb2f --- /dev/null +++ b/services/nsxt-mp/nsx/node/UsersTypes.go @@ -0,0 +1,375 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Users. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func usersActivateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["userid"] = bindings.NewStringType() + fields["node_user_password_property"] = bindings.NewReferenceType(model.NodeUserPasswordPropertyBindingType) + fieldNameMap["userid"] = "Userid" + fieldNameMap["node_user_password_property"] = "NodeUserPasswordProperty" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func usersActivateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeUserPropertiesBindingType) +} + +func usersActivateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["userid"] = bindings.NewStringType() + fields["node_user_password_property"] = bindings.NewReferenceType(model.NodeUserPasswordPropertyBindingType) + fieldNameMap["userid"] = "Userid" + fieldNameMap["node_user_password_property"] = "NodeUserPasswordProperty" + paramsTypeMap["node_user_password_property"] = bindings.NewReferenceType(model.NodeUserPasswordPropertyBindingType) + paramsTypeMap["userid"] = bindings.NewStringType() + paramsTypeMap["userid"] = bindings.NewStringType() + pathParams["userid"] = "userid" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=activate", + "node_user_password_property", + "POST", + "/api/v1/node/users/{userid}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func usersDeactivateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["userid"] = bindings.NewStringType() + fieldNameMap["userid"] = "Userid" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func usersDeactivateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeUserPropertiesBindingType) +} + +func usersDeactivateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["userid"] = bindings.NewStringType() + fieldNameMap["userid"] = "Userid" + paramsTypeMap["userid"] = bindings.NewStringType() + paramsTypeMap["userid"] = bindings.NewStringType() + pathParams["userid"] = "userid" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=deactivate", + "", + "POST", + "/api/v1/node/users/{userid}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func usersGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["userid"] = bindings.NewStringType() + fieldNameMap["userid"] = "Userid" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func usersGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeUserPropertiesBindingType) +} + +func usersGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["userid"] = bindings.NewStringType() + fieldNameMap["userid"] = "Userid" + paramsTypeMap["userid"] = bindings.NewStringType() + paramsTypeMap["userid"] = bindings.NewStringType() + pathParams["userid"] = "userid" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/users/{userid}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func usersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func usersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeUserPropertiesListResultBindingType) +} + +func usersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/users", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func usersResetownpasswordInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["reset_node_user_own_password_properties"] = bindings.NewReferenceType(model.ResetNodeUserOwnPasswordPropertiesBindingType) + fieldNameMap["reset_node_user_own_password_properties"] = "ResetNodeUserOwnPasswordProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func usersResetownpasswordOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func usersResetownpasswordRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["reset_node_user_own_password_properties"] = bindings.NewReferenceType(model.ResetNodeUserOwnPasswordPropertiesBindingType) + fieldNameMap["reset_node_user_own_password_properties"] = "ResetNodeUserOwnPasswordProperties" + paramsTypeMap["reset_node_user_own_password_properties"] = bindings.NewReferenceType(model.ResetNodeUserOwnPasswordPropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=reset_own_password", + "reset_node_user_own_password_properties", + "POST", + "/api/v1/node/users", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func usersResetpasswordInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["userid"] = bindings.NewStringType() + fields["node_user_password_property"] = bindings.NewReferenceType(model.NodeUserPasswordPropertyBindingType) + fieldNameMap["userid"] = "Userid" + fieldNameMap["node_user_password_property"] = "NodeUserPasswordProperty" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func usersResetpasswordOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func usersResetpasswordRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["userid"] = bindings.NewStringType() + fields["node_user_password_property"] = bindings.NewReferenceType(model.NodeUserPasswordPropertyBindingType) + fieldNameMap["userid"] = "Userid" + fieldNameMap["node_user_password_property"] = "NodeUserPasswordProperty" + paramsTypeMap["node_user_password_property"] = bindings.NewReferenceType(model.NodeUserPasswordPropertyBindingType) + paramsTypeMap["userid"] = bindings.NewStringType() + paramsTypeMap["userid"] = bindings.NewStringType() + pathParams["userid"] = "userid" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=reset_password", + "node_user_password_property", + "POST", + "/api/v1/node/users/{userid}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func usersUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["userid"] = bindings.NewStringType() + fields["node_user_properties"] = bindings.NewReferenceType(model.NodeUserPropertiesBindingType) + fieldNameMap["userid"] = "Userid" + fieldNameMap["node_user_properties"] = "NodeUserProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func usersUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeUserPropertiesBindingType) +} + +func usersUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["userid"] = bindings.NewStringType() + fields["node_user_properties"] = bindings.NewReferenceType(model.NodeUserPropertiesBindingType) + fieldNameMap["userid"] = "Userid" + fieldNameMap["node_user_properties"] = "NodeUserProperties" + paramsTypeMap["node_user_properties"] = bindings.NewReferenceType(model.NodeUserPropertiesBindingType) + paramsTypeMap["userid"] = bindings.NewStringType() + paramsTypeMap["userid"] = bindings.NewStringType() + pathParams["userid"] = "userid" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "node_user_properties", + "PUT", + "/api/v1/node/users/{userid}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/VersionClient.go b/services/nsxt-mp/nsx/node/VersionClient.go new file mode 100644 index 000000000..c72dc896e --- /dev/null +++ b/services/nsxt-mp/nsx/node/VersionClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Version +// Used by client-side stubs. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type VersionClient interface { + + // Read node version + // @return com.vmware.nsx.model.NodeVersion + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeVersion, error) +} + +type versionClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewVersionClient(connector client.Connector) *versionClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.version") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + vIface := versionClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &vIface +} + +func (vIface *versionClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := vIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (vIface *versionClient) Get() (model.NodeVersion, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(versionGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeVersion + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := versionGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.version", "get", inputDataValue, executionContext) + var emptyOutput model.NodeVersion + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), versionGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeVersion), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/VersionTypes.go b/services/nsxt-mp/nsx/node/VersionTypes.go new file mode 100644 index 000000000..4d9367951 --- /dev/null +++ b/services/nsxt-mp/nsx/node/VersionTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Version. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package node + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func versionGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func versionGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeVersionBindingType) +} + +func versionGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/version", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/aaa/AaaPackageTypes.go b/services/nsxt-mp/nsx/node/aaa/AaaPackageTypes.go new file mode 100644 index 000000000..3691355bf --- /dev/null +++ b/services/nsxt-mp/nsx/node/aaa/AaaPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.aaa. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package aaa diff --git a/services/nsxt-mp/nsx/node/aaa/AuthPolicyClient.go b/services/nsxt-mp/nsx/node/aaa/AuthPolicyClient.go new file mode 100644 index 000000000..714f6082e --- /dev/null +++ b/services/nsxt-mp/nsx/node/aaa/AuthPolicyClient.go @@ -0,0 +1,130 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: AuthPolicy +// Used by client-side stubs. + +package aaa + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AuthPolicyClient interface { + + // Returns information about the currently configured authentication policies on the node. + // @return com.vmware.nsx.model.AuthenticationPolicyProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.AuthenticationPolicyProperties, error) + + // Update the currently configured authentication policy on the node. If any of api_max_auth_failures, api_failed_auth_reset_period, or api_failed_auth_lockout_period are modified, the http service is automatically restarted. + // + // @param authenticationPolicyPropertiesParam (required) + // @return com.vmware.nsx.model.AuthenticationPolicyProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(authenticationPolicyPropertiesParam model.AuthenticationPolicyProperties) (model.AuthenticationPolicyProperties, error) +} + +type authPolicyClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAuthPolicyClient(connector client.Connector) *authPolicyClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.aaa.auth_policy") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := authPolicyClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *authPolicyClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *authPolicyClient) Get() (model.AuthenticationPolicyProperties, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(authPolicyGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.AuthenticationPolicyProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := authPolicyGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.aaa.auth_policy", "get", inputDataValue, executionContext) + var emptyOutput model.AuthenticationPolicyProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), authPolicyGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.AuthenticationPolicyProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (aIface *authPolicyClient) Update(authenticationPolicyPropertiesParam model.AuthenticationPolicyProperties) (model.AuthenticationPolicyProperties, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(authPolicyUpdateInputType(), typeConverter) + sv.AddStructField("AuthenticationPolicyProperties", authenticationPolicyPropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.AuthenticationPolicyProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := authPolicyUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.aaa.auth_policy", "update", inputDataValue, executionContext) + var emptyOutput model.AuthenticationPolicyProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), authPolicyUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.AuthenticationPolicyProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/aaa/AuthPolicyTypes.go b/services/nsxt-mp/nsx/node/aaa/AuthPolicyTypes.go new file mode 100644 index 000000000..a1d00f0fa --- /dev/null +++ b/services/nsxt-mp/nsx/node/aaa/AuthPolicyTypes.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: AuthPolicy. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package aaa + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func authPolicyGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func authPolicyGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.AuthenticationPolicyPropertiesBindingType) +} + +func authPolicyGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/aaa/auth-policy", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func authPolicyUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["authentication_policy_properties"] = bindings.NewReferenceType(model.AuthenticationPolicyPropertiesBindingType) + fieldNameMap["authentication_policy_properties"] = "AuthenticationPolicyProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func authPolicyUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.AuthenticationPolicyPropertiesBindingType) +} + +func authPolicyUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["authentication_policy_properties"] = bindings.NewReferenceType(model.AuthenticationPolicyPropertiesBindingType) + fieldNameMap["authentication_policy_properties"] = "AuthenticationPolicyProperties" + paramsTypeMap["authentication_policy_properties"] = bindings.NewReferenceType(model.AuthenticationPolicyPropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "authentication_policy_properties", + "PUT", + "/api/v1/node/aaa/auth-policy", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/aaa/providers/ProvidersPackageTypes.go b/services/nsxt-mp/nsx/node/aaa/providers/ProvidersPackageTypes.go new file mode 100644 index 000000000..41111b86d --- /dev/null +++ b/services/nsxt-mp/nsx/node/aaa/providers/ProvidersPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.aaa.providers. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package providers diff --git a/services/nsxt-mp/nsx/node/aaa/providers/VidmClient.go b/services/nsxt-mp/nsx/node/aaa/providers/VidmClient.go new file mode 100644 index 000000000..2ce44ebf9 --- /dev/null +++ b/services/nsxt-mp/nsx/node/aaa/providers/VidmClient.go @@ -0,0 +1,130 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Vidm +// Used by client-side stubs. + +package providers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type VidmClient interface { + + // Read AAA provider vIDM properties + // @return com.vmware.nsx.model.NodeAuthProviderVidmProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeAuthProviderVidmProperties, error) + + // Update AAA provider vIDM properties + // + // @param nodeAuthProviderVidmPropertiesParam (required) + // @return com.vmware.nsx.model.NodeAuthProviderVidmProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(nodeAuthProviderVidmPropertiesParam model.NodeAuthProviderVidmProperties) (model.NodeAuthProviderVidmProperties, error) +} + +type vidmClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewVidmClient(connector client.Connector) *vidmClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.aaa.providers.vidm") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + vIface := vidmClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &vIface +} + +func (vIface *vidmClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := vIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (vIface *vidmClient) Get() (model.NodeAuthProviderVidmProperties, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(vidmGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeAuthProviderVidmProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := vidmGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.aaa.providers.vidm", "get", inputDataValue, executionContext) + var emptyOutput model.NodeAuthProviderVidmProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), vidmGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeAuthProviderVidmProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (vIface *vidmClient) Update(nodeAuthProviderVidmPropertiesParam model.NodeAuthProviderVidmProperties) (model.NodeAuthProviderVidmProperties, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(vidmUpdateInputType(), typeConverter) + sv.AddStructField("NodeAuthProviderVidmProperties", nodeAuthProviderVidmPropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeAuthProviderVidmProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := vidmUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.aaa.providers.vidm", "update", inputDataValue, executionContext) + var emptyOutput model.NodeAuthProviderVidmProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), vidmUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeAuthProviderVidmProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/aaa/providers/VidmTypes.go b/services/nsxt-mp/nsx/node/aaa/providers/VidmTypes.go new file mode 100644 index 000000000..603e41bbe --- /dev/null +++ b/services/nsxt-mp/nsx/node/aaa/providers/VidmTypes.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Vidm. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package providers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func vidmGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func vidmGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeAuthProviderVidmPropertiesBindingType) +} + +func vidmGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/aaa/providers/vidm", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func vidmUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_auth_provider_vidm_properties"] = bindings.NewReferenceType(model.NodeAuthProviderVidmPropertiesBindingType) + fieldNameMap["node_auth_provider_vidm_properties"] = "NodeAuthProviderVidmProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func vidmUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeAuthProviderVidmPropertiesBindingType) +} + +func vidmUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_auth_provider_vidm_properties"] = bindings.NewReferenceType(model.NodeAuthProviderVidmPropertiesBindingType) + fieldNameMap["node_auth_provider_vidm_properties"] = "NodeAuthProviderVidmProperties" + paramsTypeMap["node_auth_provider_vidm_properties"] = bindings.NewReferenceType(model.NodeAuthProviderVidmPropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "node_auth_provider_vidm_properties", + "PUT", + "/api/v1/node/aaa/providers/vidm", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/aaa/providers/vidm/StatusClient.go b/services/nsxt-mp/nsx/node/aaa/providers/vidm/StatusClient.go new file mode 100644 index 000000000..cc0b30095 --- /dev/null +++ b/services/nsxt-mp/nsx/node/aaa/providers/vidm/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package vidm + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read AAA provider vIDM status + // @return com.vmware.nsx.model.NodeAuthProviderVidmStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeAuthProviderVidmStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.aaa.providers.vidm.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeAuthProviderVidmStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeAuthProviderVidmStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.aaa.providers.vidm.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeAuthProviderVidmStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeAuthProviderVidmStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/aaa/providers/vidm/StatusTypes.go b/services/nsxt-mp/nsx/node/aaa/providers/vidm/StatusTypes.go new file mode 100644 index 000000000..49aa5c0d7 --- /dev/null +++ b/services/nsxt-mp/nsx/node/aaa/providers/vidm/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package vidm + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeAuthProviderVidmStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/aaa/providers/vidm/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/aaa/providers/vidm/VidmPackageTypes.go b/services/nsxt-mp/nsx/node/aaa/providers/vidm/VidmPackageTypes.go new file mode 100644 index 000000000..4ebf00785 --- /dev/null +++ b/services/nsxt-mp/nsx/node/aaa/providers/vidm/VidmPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.aaa.providers.vidm. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package vidm diff --git a/services/nsxt-mp/nsx/node/file_store/FileStorePackageTypes.go b/services/nsxt-mp/nsx/node/file_store/FileStorePackageTypes.go new file mode 100644 index 000000000..6d5d33929 --- /dev/null +++ b/services/nsxt-mp/nsx/node/file_store/FileStorePackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.file_store. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package file_store diff --git a/services/nsxt-mp/nsx/node/file_store/ThumbprintClient.go b/services/nsxt-mp/nsx/node/file_store/ThumbprintClient.go new file mode 100644 index 000000000..975988f45 --- /dev/null +++ b/services/nsxt-mp/nsx/node/file_store/ThumbprintClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Thumbprint +// Used by client-side stubs. + +package file_store + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ThumbprintClient interface { + + // Read file thumbprint + // + // @param fileNameParam Name of the file for which thumbprint should be computed (required) + // @return com.vmware.nsx.model.FileThumbprint + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(fileNameParam string) (model.FileThumbprint, error) +} + +type thumbprintClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewThumbprintClient(connector client.Connector) *thumbprintClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.file_store.thumbprint") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + tIface := thumbprintClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &tIface +} + +func (tIface *thumbprintClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := tIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (tIface *thumbprintClient) Get(fileNameParam string) (model.FileThumbprint, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(thumbprintGetInputType(), typeConverter) + sv.AddStructField("FileName", fileNameParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FileThumbprint + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := thumbprintGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.file_store.thumbprint", "get", inputDataValue, executionContext) + var emptyOutput model.FileThumbprint + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), thumbprintGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FileThumbprint), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/file_store/ThumbprintTypes.go b/services/nsxt-mp/nsx/node/file_store/ThumbprintTypes.go new file mode 100644 index 000000000..03b78e95d --- /dev/null +++ b/services/nsxt-mp/nsx/node/file_store/ThumbprintTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Thumbprint. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package file_store + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func thumbprintGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_name"] = bindings.NewStringType() + fieldNameMap["file_name"] = "FileName" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func thumbprintGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FileThumbprintBindingType) +} + +func thumbprintGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["file_name"] = bindings.NewStringType() + fieldNameMap["file_name"] = "FileName" + paramsTypeMap["file_name"] = bindings.NewStringType() + paramsTypeMap["fileName"] = bindings.NewStringType() + pathParams["file_name"] = "fileName" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/file-store/{fileName}/thumbprint", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/hardening_policy/HardeningPolicyPackageTypes.go b/services/nsxt-mp/nsx/node/hardening_policy/HardeningPolicyPackageTypes.go new file mode 100644 index 000000000..c3fd8f840 --- /dev/null +++ b/services/nsxt-mp/nsx/node/hardening_policy/HardeningPolicyPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.hardening_policy. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package hardening_policy diff --git a/services/nsxt-mp/nsx/node/hardening_policy/MandatoryAccessControlClient.go b/services/nsxt-mp/nsx/node/hardening_policy/MandatoryAccessControlClient.go new file mode 100644 index 000000000..a062d51a6 --- /dev/null +++ b/services/nsxt-mp/nsx/node/hardening_policy/MandatoryAccessControlClient.go @@ -0,0 +1,130 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MandatoryAccessControl +// Used by client-side stubs. + +package hardening_policy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MandatoryAccessControlClient interface { + + // Gets the enable status for Mandatory Access Control + // @return com.vmware.nsx.model.MandatoryAccessControlProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.MandatoryAccessControlProperties, error) + + // Enable or disable Mandatory Access Control + // + // @param mandatoryAccessControlPropertiesParam (required) + // @return com.vmware.nsx.model.MandatoryAccessControlProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(mandatoryAccessControlPropertiesParam model.MandatoryAccessControlProperties) (model.MandatoryAccessControlProperties, error) +} + +type mandatoryAccessControlClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMandatoryAccessControlClient(connector client.Connector) *mandatoryAccessControlClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.hardening_policy.mandatory_access_control") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := mandatoryAccessControlClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *mandatoryAccessControlClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *mandatoryAccessControlClient) Get() (model.MandatoryAccessControlProperties, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(mandatoryAccessControlGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MandatoryAccessControlProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := mandatoryAccessControlGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.hardening_policy.mandatory_access_control", "get", inputDataValue, executionContext) + var emptyOutput model.MandatoryAccessControlProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), mandatoryAccessControlGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MandatoryAccessControlProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *mandatoryAccessControlClient) Update(mandatoryAccessControlPropertiesParam model.MandatoryAccessControlProperties) (model.MandatoryAccessControlProperties, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(mandatoryAccessControlUpdateInputType(), typeConverter) + sv.AddStructField("MandatoryAccessControlProperties", mandatoryAccessControlPropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MandatoryAccessControlProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := mandatoryAccessControlUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.hardening_policy.mandatory_access_control", "update", inputDataValue, executionContext) + var emptyOutput model.MandatoryAccessControlProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), mandatoryAccessControlUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MandatoryAccessControlProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/hardening_policy/MandatoryAccessControlTypes.go b/services/nsxt-mp/nsx/node/hardening_policy/MandatoryAccessControlTypes.go new file mode 100644 index 000000000..1e5f3b89e --- /dev/null +++ b/services/nsxt-mp/nsx/node/hardening_policy/MandatoryAccessControlTypes.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MandatoryAccessControl. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package hardening_policy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func mandatoryAccessControlGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func mandatoryAccessControlGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MandatoryAccessControlPropertiesBindingType) +} + +func mandatoryAccessControlGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/hardening-policy/mandatory-access-control", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func mandatoryAccessControlUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mandatory_access_control_properties"] = bindings.NewReferenceType(model.MandatoryAccessControlPropertiesBindingType) + fieldNameMap["mandatory_access_control_properties"] = "MandatoryAccessControlProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func mandatoryAccessControlUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MandatoryAccessControlPropertiesBindingType) +} + +func mandatoryAccessControlUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["mandatory_access_control_properties"] = bindings.NewReferenceType(model.MandatoryAccessControlPropertiesBindingType) + fieldNameMap["mandatory_access_control_properties"] = "MandatoryAccessControlProperties" + paramsTypeMap["mandatory_access_control_properties"] = bindings.NewReferenceType(model.MandatoryAccessControlPropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "mandatory_access_control_properties", + "PUT", + "/api/v1/node/hardening-policy/mandatory-access-control", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/intelligence/FormFactorsClient.go b/services/nsxt-mp/nsx/node/intelligence/FormFactorsClient.go new file mode 100644 index 000000000..8394dfc45 --- /dev/null +++ b/services/nsxt-mp/nsx/node/intelligence/FormFactorsClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: FormFactors +// Used by client-side stubs. + +package intelligence + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type FormFactorsClient interface { + + // Returns information about all form factors available for Napp cluster + // @return com.vmware.nsx.model.IntelligenceFormFactors + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.IntelligenceFormFactors, error) +} + +type formFactorsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewFormFactorsClient(connector client.Connector) *formFactorsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.intelligence.form_factors") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + fIface := formFactorsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &fIface +} + +func (fIface *formFactorsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := fIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (fIface *formFactorsClient) Get() (model.IntelligenceFormFactors, error) { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(formFactorsGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IntelligenceFormFactors + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := formFactorsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.intelligence.form_factors", "get", inputDataValue, executionContext) + var emptyOutput model.IntelligenceFormFactors + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), formFactorsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IntelligenceFormFactors), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/intelligence/FormFactorsTypes.go b/services/nsxt-mp/nsx/node/intelligence/FormFactorsTypes.go new file mode 100644 index 000000000..bf23b6611 --- /dev/null +++ b/services/nsxt-mp/nsx/node/intelligence/FormFactorsTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: FormFactors. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package intelligence + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func formFactorsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func formFactorsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IntelligenceFormFactorsBindingType) +} + +func formFactorsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/intelligence/form-factors", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/intelligence/IntelligencePackageTypes.go b/services/nsxt-mp/nsx/node/intelligence/IntelligencePackageTypes.go new file mode 100644 index 000000000..8b71b9899 --- /dev/null +++ b/services/nsxt-mp/nsx/node/intelligence/IntelligencePackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.intelligence. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package intelligence diff --git a/services/nsxt-mp/nsx/node/network/InterfacesClient.go b/services/nsxt-mp/nsx/node/network/InterfacesClient.go new file mode 100644 index 000000000..64ef54cf1 --- /dev/null +++ b/services/nsxt-mp/nsx/node/network/InterfacesClient.go @@ -0,0 +1,175 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Interfaces +// Used by client-side stubs. + +package network + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type InterfacesClient interface { + + // Returns detailed information about the specified interface. Interface information includes MTU, broadcast and host IP addresses, link and admin status, MAC address, network mask, and the IP configuration method. + // + // @param interfaceIdParam ID of interface to read (required) + // @return com.vmware.nsx.model.NodeNetworkInterfaceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(interfaceIdParam string) (model.NodeNetworkInterfaceProperties, error) + + // Returns the number of interfaces on the node appliance and detailed information about each interface. Interface information includes MTU, broadcast and host IP addresses, link and admin status, MAC address, network mask, and the IP configuration method (static or DHCP). + // @return com.vmware.nsx.model.NodeNetworkInterfacePropertiesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.NodeNetworkInterfacePropertiesListResult, error) + + // Updates the specified interface properties. You cannot change the properties ``ip_configuration``, ``ip_addresses``, or ``plane``. NSX Manager must have a static IP address. You must use NSX CLI to configure a controller or an edge node. + // + // @param interfaceIdParam ID of interface to update (required) + // @param nodeNetworkInterfacePropertiesParam (required) + // @return com.vmware.nsx.model.NodeNetworkInterfaceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(interfaceIdParam string, nodeNetworkInterfacePropertiesParam model.NodeNetworkInterfaceProperties) (model.NodeNetworkInterfaceProperties, error) +} + +type interfacesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewInterfacesClient(connector client.Connector) *interfacesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.network.interfaces") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := interfacesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *interfacesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *interfacesClient) Get(interfaceIdParam string) (model.NodeNetworkInterfaceProperties, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(interfacesGetInputType(), typeConverter) + sv.AddStructField("InterfaceId", interfaceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeNetworkInterfaceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := interfacesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.network.interfaces", "get", inputDataValue, executionContext) + var emptyOutput model.NodeNetworkInterfaceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), interfacesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeNetworkInterfaceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *interfacesClient) List() (model.NodeNetworkInterfacePropertiesListResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(interfacesListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeNetworkInterfacePropertiesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := interfacesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.network.interfaces", "list", inputDataValue, executionContext) + var emptyOutput model.NodeNetworkInterfacePropertiesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), interfacesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeNetworkInterfacePropertiesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *interfacesClient) Update(interfaceIdParam string, nodeNetworkInterfacePropertiesParam model.NodeNetworkInterfaceProperties) (model.NodeNetworkInterfaceProperties, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(interfacesUpdateInputType(), typeConverter) + sv.AddStructField("InterfaceId", interfaceIdParam) + sv.AddStructField("NodeNetworkInterfaceProperties", nodeNetworkInterfacePropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeNetworkInterfaceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := interfacesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.network.interfaces", "update", inputDataValue, executionContext) + var emptyOutput model.NodeNetworkInterfaceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), interfacesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeNetworkInterfaceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/network/InterfacesTypes.go b/services/nsxt-mp/nsx/node/network/InterfacesTypes.go new file mode 100644 index 000000000..3ca49faf4 --- /dev/null +++ b/services/nsxt-mp/nsx/node/network/InterfacesTypes.go @@ -0,0 +1,167 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Interfaces. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package network + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func interfacesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["interface_id"] = bindings.NewStringType() + fieldNameMap["interface_id"] = "InterfaceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func interfacesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeNetworkInterfacePropertiesBindingType) +} + +func interfacesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["interface_id"] = bindings.NewStringType() + fieldNameMap["interface_id"] = "InterfaceId" + paramsTypeMap["interface_id"] = bindings.NewStringType() + paramsTypeMap["interfaceId"] = bindings.NewStringType() + pathParams["interface_id"] = "interfaceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/network/interfaces/{interfaceId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func interfacesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func interfacesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeNetworkInterfacePropertiesListResultBindingType) +} + +func interfacesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/network/interfaces", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func interfacesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["interface_id"] = bindings.NewStringType() + fields["node_network_interface_properties"] = bindings.NewReferenceType(model.NodeNetworkInterfacePropertiesBindingType) + fieldNameMap["interface_id"] = "InterfaceId" + fieldNameMap["node_network_interface_properties"] = "NodeNetworkInterfaceProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func interfacesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeNetworkInterfacePropertiesBindingType) +} + +func interfacesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["interface_id"] = bindings.NewStringType() + fields["node_network_interface_properties"] = bindings.NewReferenceType(model.NodeNetworkInterfacePropertiesBindingType) + fieldNameMap["interface_id"] = "InterfaceId" + fieldNameMap["node_network_interface_properties"] = "NodeNetworkInterfaceProperties" + paramsTypeMap["interface_id"] = bindings.NewStringType() + paramsTypeMap["node_network_interface_properties"] = bindings.NewReferenceType(model.NodeNetworkInterfacePropertiesBindingType) + paramsTypeMap["interfaceId"] = bindings.NewStringType() + pathParams["interface_id"] = "interfaceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "node_network_interface_properties", + "PUT", + "/api/v1/node/network/interfaces/{interfaceId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/network/NameServersClient.go b/services/nsxt-mp/nsx/node/network/NameServersClient.go new file mode 100644 index 000000000..cfbcc0077 --- /dev/null +++ b/services/nsxt-mp/nsx/node/network/NameServersClient.go @@ -0,0 +1,131 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: NameServers +// Used by client-side stubs. + +package network + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NameServersClient interface { + + // Returns the list of servers that the node uses to look up IP addresses associated with given domain names. + // @return com.vmware.nsx.model.NodeNameServersProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeNameServersProperties, error) + + // Modifies the list of servers that the node uses to look up IP addresses associated with given domain names. If DHCP is configured, this method returns a 409 CONFLICT error, because DHCP manages the list of name servers. + // + // @param nodeNameServersPropertiesParam (required) + // @return com.vmware.nsx.model.NodeNameServersProperties + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(nodeNameServersPropertiesParam model.NodeNameServersProperties) (model.NodeNameServersProperties, error) +} + +type nameServersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNameServersClient(connector client.Connector) *nameServersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.network.name_servers") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nameServersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nameServersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nameServersClient) Get() (model.NodeNameServersProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nameServersGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeNameServersProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nameServersGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.network.name_servers", "get", inputDataValue, executionContext) + var emptyOutput model.NodeNameServersProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nameServersGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeNameServersProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nameServersClient) Update(nodeNameServersPropertiesParam model.NodeNameServersProperties) (model.NodeNameServersProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nameServersUpdateInputType(), typeConverter) + sv.AddStructField("NodeNameServersProperties", nodeNameServersPropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeNameServersProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nameServersUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.network.name_servers", "update", inputDataValue, executionContext) + var emptyOutput model.NodeNameServersProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nameServersUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeNameServersProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/network/NameServersTypes.go b/services/nsxt-mp/nsx/node/network/NameServersTypes.go new file mode 100644 index 000000000..e1a3dde06 --- /dev/null +++ b/services/nsxt-mp/nsx/node/network/NameServersTypes.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: NameServers. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package network + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func nameServersGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nameServersGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeNameServersPropertiesBindingType) +} + +func nameServersGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/network/name-servers", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nameServersUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_name_servers_properties"] = bindings.NewReferenceType(model.NodeNameServersPropertiesBindingType) + fieldNameMap["node_name_servers_properties"] = "NodeNameServersProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nameServersUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeNameServersPropertiesBindingType) +} + +func nameServersUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_name_servers_properties"] = bindings.NewReferenceType(model.NodeNameServersPropertiesBindingType) + fieldNameMap["node_name_servers_properties"] = "NodeNameServersProperties" + paramsTypeMap["node_name_servers_properties"] = bindings.NewReferenceType(model.NodeNameServersPropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "node_name_servers_properties", + "PUT", + "/api/v1/node/network/name-servers", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/network/NetworkPackageTypes.go b/services/nsxt-mp/nsx/node/network/NetworkPackageTypes.go new file mode 100644 index 000000000..c49673bff --- /dev/null +++ b/services/nsxt-mp/nsx/node/network/NetworkPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.network. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package network diff --git a/services/nsxt-mp/nsx/node/network/RoutesClient.go b/services/nsxt-mp/nsx/node/network/RoutesClient.go new file mode 100644 index 000000000..ea720f264 --- /dev/null +++ b/services/nsxt-mp/nsx/node/network/RoutesClient.go @@ -0,0 +1,210 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Routes +// Used by client-side stubs. + +package network + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RoutesClient interface { + + // Add a route to the node routing table. For static routes, the route_type, interface_id, netmask, and destination are required parameters. For default routes, the route_type, gateway address, and interface_id are required. For blackhole routes, the route_type and destination are required. All other parameters are optional. When you add a static route, the scope and route_id are created automatically. When you add a default or blackhole route, the route_id is created automatically. The route_id is read-only, meaning that it cannot be modified. All other properties can be modified by deleting and readding the route. + // + // @param nodeRoutePropertiesParam (required) + // @return com.vmware.nsx.model.NodeRouteProperties + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(nodeRoutePropertiesParam model.NodeRouteProperties) (model.NodeRouteProperties, error) + + // Delete a route from the node routing table. You can modify an existing route by deleting it and then posting the modified version of the route. To verify, remove the route ID from the URI, issue a GET request, and note the absense of the deleted route. + // + // @param routeIdParam ID of route to delete (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(routeIdParam string) error + + // Returns detailed information about a specified route in the node routing table. + // + // @param routeIdParam ID of route to read (required) + // @return com.vmware.nsx.model.NodeRouteProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(routeIdParam string) (model.NodeRouteProperties, error) + + // Returns detailed information about each route in the node routing table. Route information includes the route type (default, static, and so on), a unique route identifier, the route metric, the protocol from which the route was learned, the route source (which is the preferred egress interface), the route destination, and the route scope. The route scope refers to the distance to the destination network: The \"host\" scope leads to a destination address on the node, such as a loopback address; the \"link\" scope leads to a destination on the local network; and the \"global\" scope leads to addresses that are more than one hop away. + // @return com.vmware.nsx.model.NodeRoutePropertiesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.NodeRoutePropertiesListResult, error) +} + +type routesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRoutesClient(connector client.Connector) *routesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.network.routes") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := routesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *routesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *routesClient) Create(nodeRoutePropertiesParam model.NodeRouteProperties) (model.NodeRouteProperties, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(routesCreateInputType(), typeConverter) + sv.AddStructField("NodeRouteProperties", nodeRoutePropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeRouteProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := routesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.network.routes", "create", inputDataValue, executionContext) + var emptyOutput model.NodeRouteProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), routesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeRouteProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *routesClient) Delete(routeIdParam string) error { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(routesDeleteInputType(), typeConverter) + sv.AddStructField("RouteId", routeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := routesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.network.routes", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (rIface *routesClient) Get(routeIdParam string) (model.NodeRouteProperties, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(routesGetInputType(), typeConverter) + sv.AddStructField("RouteId", routeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeRouteProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := routesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.network.routes", "get", inputDataValue, executionContext) + var emptyOutput model.NodeRouteProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), routesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeRouteProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *routesClient) List() (model.NodeRoutePropertiesListResult, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(routesListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeRoutePropertiesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := routesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.network.routes", "list", inputDataValue, executionContext) + var emptyOutput model.NodeRoutePropertiesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), routesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeRoutePropertiesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/network/RoutesTypes.go b/services/nsxt-mp/nsx/node/network/RoutesTypes.go new file mode 100644 index 000000000..c04ced20d --- /dev/null +++ b/services/nsxt-mp/nsx/node/network/RoutesTypes.go @@ -0,0 +1,210 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Routes. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package network + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func routesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_route_properties"] = bindings.NewReferenceType(model.NodeRoutePropertiesBindingType) + fieldNameMap["node_route_properties"] = "NodeRouteProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func routesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeRoutePropertiesBindingType) +} + +func routesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_route_properties"] = bindings.NewReferenceType(model.NodeRoutePropertiesBindingType) + fieldNameMap["node_route_properties"] = "NodeRouteProperties" + paramsTypeMap["node_route_properties"] = bindings.NewReferenceType(model.NodeRoutePropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "node_route_properties", + "POST", + "/api/v1/node/network/routes", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func routesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["route_id"] = bindings.NewStringType() + fieldNameMap["route_id"] = "RouteId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func routesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func routesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["route_id"] = bindings.NewStringType() + fieldNameMap["route_id"] = "RouteId" + paramsTypeMap["route_id"] = bindings.NewStringType() + paramsTypeMap["routeId"] = bindings.NewStringType() + pathParams["route_id"] = "routeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/node/network/routes/{routeId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func routesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["route_id"] = bindings.NewStringType() + fieldNameMap["route_id"] = "RouteId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func routesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeRoutePropertiesBindingType) +} + +func routesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["route_id"] = bindings.NewStringType() + fieldNameMap["route_id"] = "RouteId" + paramsTypeMap["route_id"] = bindings.NewStringType() + paramsTypeMap["routeId"] = bindings.NewStringType() + pathParams["route_id"] = "routeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/network/routes/{routeId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func routesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func routesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeRoutePropertiesListResultBindingType) +} + +func routesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/network/routes", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/network/SearchDomainsClient.go b/services/nsxt-mp/nsx/node/network/SearchDomainsClient.go new file mode 100644 index 000000000..44f0b2829 --- /dev/null +++ b/services/nsxt-mp/nsx/node/network/SearchDomainsClient.go @@ -0,0 +1,131 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: SearchDomains +// Used by client-side stubs. + +package network + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SearchDomainsClient interface { + + // Returns the domain list that the node uses to complete unqualified host names. When a host name does not include a fully qualified domain name (FQDN), the NSX Management node appends the first-listed domain name to the host name before the host name is looked up. The NSX Management node continues this for each entry in the domain list until it finds a match. + // @return com.vmware.nsx.model.NodeSearchDomainsProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeSearchDomainsProperties, error) + + // Modifies the list of domain names that the node uses to complete unqualified host names. If DHCP is configured, this method returns a 409 CONFLICT error, because DHCP manages the list of name servers. + // + // @param nodeSearchDomainsPropertiesParam (required) + // @return com.vmware.nsx.model.NodeSearchDomainsProperties + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(nodeSearchDomainsPropertiesParam model.NodeSearchDomainsProperties) (model.NodeSearchDomainsProperties, error) +} + +type searchDomainsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSearchDomainsClient(connector client.Connector) *searchDomainsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.network.search_domains") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := searchDomainsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *searchDomainsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *searchDomainsClient) Get() (model.NodeSearchDomainsProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(searchDomainsGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeSearchDomainsProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := searchDomainsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.network.search_domains", "get", inputDataValue, executionContext) + var emptyOutput model.NodeSearchDomainsProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), searchDomainsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeSearchDomainsProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *searchDomainsClient) Update(nodeSearchDomainsPropertiesParam model.NodeSearchDomainsProperties) (model.NodeSearchDomainsProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(searchDomainsUpdateInputType(), typeConverter) + sv.AddStructField("NodeSearchDomainsProperties", nodeSearchDomainsPropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeSearchDomainsProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := searchDomainsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.network.search_domains", "update", inputDataValue, executionContext) + var emptyOutput model.NodeSearchDomainsProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), searchDomainsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeSearchDomainsProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/network/SearchDomainsTypes.go b/services/nsxt-mp/nsx/node/network/SearchDomainsTypes.go new file mode 100644 index 000000000..6a6449253 --- /dev/null +++ b/services/nsxt-mp/nsx/node/network/SearchDomainsTypes.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: SearchDomains. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package network + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func searchDomainsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func searchDomainsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeSearchDomainsPropertiesBindingType) +} + +func searchDomainsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/network/search-domains", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func searchDomainsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_search_domains_properties"] = bindings.NewReferenceType(model.NodeSearchDomainsPropertiesBindingType) + fieldNameMap["node_search_domains_properties"] = "NodeSearchDomainsProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func searchDomainsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeSearchDomainsPropertiesBindingType) +} + +func searchDomainsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_search_domains_properties"] = bindings.NewReferenceType(model.NodeSearchDomainsPropertiesBindingType) + fieldNameMap["node_search_domains_properties"] = "NodeSearchDomainsProperties" + paramsTypeMap["node_search_domains_properties"] = bindings.NewReferenceType(model.NodeSearchDomainsPropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "node_search_domains_properties", + "PUT", + "/api/v1/node/network/search-domains", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/network/interfaces/InterfacesPackageTypes.go b/services/nsxt-mp/nsx/node/network/interfaces/InterfacesPackageTypes.go new file mode 100644 index 000000000..978393512 --- /dev/null +++ b/services/nsxt-mp/nsx/node/network/interfaces/InterfacesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.network.interfaces. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package interfaces diff --git a/services/nsxt-mp/nsx/node/network/interfaces/StatsClient.go b/services/nsxt-mp/nsx/node/network/interfaces/StatsClient.go new file mode 100644 index 000000000..afc763391 --- /dev/null +++ b/services/nsxt-mp/nsx/node/network/interfaces/StatsClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Stats +// Used by client-side stubs. + +package interfaces + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatsClient interface { + + // On the specified interface, returns the number of received (rx), transmitted (tx), and dropped packets; the number of bytes and errors received and transmitted on the interface; and the number of detected collisions. + // + // @param interfaceIdParam ID of interface to read (required) + // @return com.vmware.nsx.model.NodeInterfaceStatisticsProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(interfaceIdParam string) (model.NodeInterfaceStatisticsProperties, error) +} + +type statsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatsClient(connector client.Connector) *statsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.network.interfaces.stats") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statsClient) Get(interfaceIdParam string) (model.NodeInterfaceStatisticsProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statsGetInputType(), typeConverter) + sv.AddStructField("InterfaceId", interfaceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeInterfaceStatisticsProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.network.interfaces.stats", "get", inputDataValue, executionContext) + var emptyOutput model.NodeInterfaceStatisticsProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeInterfaceStatisticsProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/network/interfaces/StatsTypes.go b/services/nsxt-mp/nsx/node/network/interfaces/StatsTypes.go new file mode 100644 index 000000000..29379a30c --- /dev/null +++ b/services/nsxt-mp/nsx/node/network/interfaces/StatsTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Stats. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package interfaces + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["interface_id"] = bindings.NewStringType() + fieldNameMap["interface_id"] = "InterfaceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeInterfaceStatisticsPropertiesBindingType) +} + +func statsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["interface_id"] = bindings.NewStringType() + fieldNameMap["interface_id"] = "InterfaceId" + paramsTypeMap["interface_id"] = bindings.NewStringType() + paramsTypeMap["interfaceId"] = bindings.NewStringType() + pathParams["interface_id"] = "interfaceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/network/interfaces/{interfaceId}/stats", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/ApplianceproxyClient.go b/services/nsxt-mp/nsx/node/services/ApplianceproxyClient.go new file mode 100644 index 000000000..726837c84 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/ApplianceproxyClient.go @@ -0,0 +1,207 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Applianceproxy +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ApplianceproxyClient interface { + + // Read the Appliance Proxy service properties + // @return com.vmware.nsx.model.NodeServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceProperties, error) + + // Restart, start or stop the Appliance Proxy Service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the Appliance Proxy Service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the Appliance Proxy Service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) +} + +type applianceproxyClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewApplianceproxyClient(connector client.Connector) *applianceproxyClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.applianceproxy") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := applianceproxyClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *applianceproxyClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *applianceproxyClient) Get() (model.NodeServiceProperties, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(applianceproxyGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := applianceproxyGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.applianceproxy", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), applianceproxyGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (aIface *applianceproxyClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(applianceproxyRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := applianceproxyRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.applianceproxy", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), applianceproxyRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (aIface *applianceproxyClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(applianceproxyStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := applianceproxyStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.applianceproxy", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), applianceproxyStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (aIface *applianceproxyClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(applianceproxyStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := applianceproxyStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.applianceproxy", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), applianceproxyStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/ApplianceproxyTypes.go b/services/nsxt-mp/nsx/node/services/ApplianceproxyTypes.go new file mode 100644 index 000000000..15777355a --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/ApplianceproxyTypes.go @@ -0,0 +1,191 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Applianceproxy. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func applianceproxyGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func applianceproxyGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServicePropertiesBindingType) +} + +func applianceproxyGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/applianceproxy", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func applianceproxyRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func applianceproxyRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func applianceproxyRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/applianceproxy", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func applianceproxyStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func applianceproxyStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func applianceproxyStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/applianceproxy", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func applianceproxyStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func applianceproxyStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func applianceproxyStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/applianceproxy", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/AsyncReplicatorClient.go b/services/nsxt-mp/nsx/node/services/AsyncReplicatorClient.go new file mode 100644 index 000000000..28acd3a00 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/AsyncReplicatorClient.go @@ -0,0 +1,250 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Async_replicator +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type Async_replicatorClient interface { + + // Read the Async Replicator service properties + // @return com.vmware.nsx.model.NodeAsyncReplicatorServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeAsyncReplicatorServiceProperties, error) + + // Restart, start or stop the Async Replicator service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the Async Replicator service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the Async Replicator service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) + + // Update the async_replicator service properties + // + // @param nodeAsyncReplicatorServicePropertiesParam (required) + // @return com.vmware.nsx.model.NodeAsyncReplicatorServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(nodeAsyncReplicatorServicePropertiesParam model.NodeAsyncReplicatorServiceProperties) (model.NodeAsyncReplicatorServiceProperties, error) +} + +type async_replicatorClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAsync_replicatorClient(connector client.Connector) *async_replicatorClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.async_replicator") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := async_replicatorClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *async_replicatorClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *async_replicatorClient) Get() (model.NodeAsyncReplicatorServiceProperties, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(asyncReplicatorGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeAsyncReplicatorServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := asyncReplicatorGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.async_replicator", "get", inputDataValue, executionContext) + var emptyOutput model.NodeAsyncReplicatorServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), asyncReplicatorGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeAsyncReplicatorServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (aIface *async_replicatorClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(asyncReplicatorRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := asyncReplicatorRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.async_replicator", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), asyncReplicatorRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (aIface *async_replicatorClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(asyncReplicatorStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := asyncReplicatorStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.async_replicator", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), asyncReplicatorStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (aIface *async_replicatorClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(asyncReplicatorStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := asyncReplicatorStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.async_replicator", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), asyncReplicatorStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (aIface *async_replicatorClient) Update(nodeAsyncReplicatorServicePropertiesParam model.NodeAsyncReplicatorServiceProperties) (model.NodeAsyncReplicatorServiceProperties, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(asyncReplicatorUpdateInputType(), typeConverter) + sv.AddStructField("NodeAsyncReplicatorServiceProperties", nodeAsyncReplicatorServicePropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeAsyncReplicatorServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := asyncReplicatorUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.async_replicator", "update", inputDataValue, executionContext) + var emptyOutput model.NodeAsyncReplicatorServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), asyncReplicatorUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeAsyncReplicatorServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/AsyncReplicatorTypes.go b/services/nsxt-mp/nsx/node/services/AsyncReplicatorTypes.go new file mode 100644 index 000000000..d2116c97b --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/AsyncReplicatorTypes.go @@ -0,0 +1,239 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Async_replicator. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func asyncReplicatorGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func asyncReplicatorGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeAsyncReplicatorServicePropertiesBindingType) +} + +func asyncReplicatorGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/async_replicator", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func asyncReplicatorRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func asyncReplicatorRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func asyncReplicatorRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/async_replicator", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func asyncReplicatorStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func asyncReplicatorStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func asyncReplicatorStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/async_replicator", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func asyncReplicatorStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func asyncReplicatorStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func asyncReplicatorStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/async_replicator", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func asyncReplicatorUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_async_replicator_service_properties"] = bindings.NewReferenceType(model.NodeAsyncReplicatorServicePropertiesBindingType) + fieldNameMap["node_async_replicator_service_properties"] = "NodeAsyncReplicatorServiceProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func asyncReplicatorUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeAsyncReplicatorServicePropertiesBindingType) +} + +func asyncReplicatorUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_async_replicator_service_properties"] = bindings.NewReferenceType(model.NodeAsyncReplicatorServicePropertiesBindingType) + fieldNameMap["node_async_replicator_service_properties"] = "NodeAsyncReplicatorServiceProperties" + paramsTypeMap["node_async_replicator_service_properties"] = bindings.NewReferenceType(model.NodeAsyncReplicatorServicePropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "node_async_replicator_service_properties", + "PUT", + "/api/v1/node/services/nsxt-mp/async_replicator", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/ClusterManagerClient.go b/services/nsxt-mp/nsx/node/services/ClusterManagerClient.go new file mode 100644 index 000000000..9b93c28bf --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/ClusterManagerClient.go @@ -0,0 +1,207 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Cluster_manager +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type Cluster_managerClient interface { + + // Read cluster boot manager service properties + // @return com.vmware.nsx.model.NodeServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceProperties, error) + + // Restart, start or stop the cluster boot manager service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the cluster boot manager service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the cluster boot manager service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) +} + +type cluster_managerClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewCluster_managerClient(connector client.Connector) *cluster_managerClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.cluster_manager") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := cluster_managerClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *cluster_managerClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *cluster_managerClient) Get() (model.NodeServiceProperties, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clusterManagerGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clusterManagerGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.cluster_manager", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), clusterManagerGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *cluster_managerClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clusterManagerRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clusterManagerRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.cluster_manager", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), clusterManagerRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *cluster_managerClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clusterManagerStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clusterManagerStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.cluster_manager", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), clusterManagerStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *cluster_managerClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(clusterManagerStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := clusterManagerStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.cluster_manager", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), clusterManagerStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/ClusterManagerTypes.go b/services/nsxt-mp/nsx/node/services/ClusterManagerTypes.go new file mode 100644 index 000000000..f252c260b --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/ClusterManagerTypes.go @@ -0,0 +1,191 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Cluster_manager. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func clusterManagerGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clusterManagerGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServicePropertiesBindingType) +} + +func clusterManagerGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/cluster_manager", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func clusterManagerRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clusterManagerRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func clusterManagerRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/cluster_manager", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func clusterManagerStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clusterManagerStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func clusterManagerStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/cluster_manager", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func clusterManagerStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func clusterManagerStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func clusterManagerStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/cluster_manager", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/CmInventoryClient.go b/services/nsxt-mp/nsx/node/services/CmInventoryClient.go new file mode 100644 index 000000000..30d2a20e1 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/CmInventoryClient.go @@ -0,0 +1,207 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: CmInventory +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type CmInventoryClient interface { + + // Read cm inventory service properties + // @return com.vmware.nsx.model.NodeServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceProperties, error) + + // Restart, start or stop the manager service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the manager service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the manager service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) +} + +type cmInventoryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewCmInventoryClient(connector client.Connector) *cmInventoryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.cm_inventory") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := cmInventoryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *cmInventoryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *cmInventoryClient) Get() (model.NodeServiceProperties, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(cmInventoryGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := cmInventoryGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.cm_inventory", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), cmInventoryGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *cmInventoryClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(cmInventoryRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := cmInventoryRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.cm_inventory", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), cmInventoryRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *cmInventoryClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(cmInventoryStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := cmInventoryStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.cm_inventory", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), cmInventoryStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *cmInventoryClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(cmInventoryStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := cmInventoryStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.cm_inventory", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), cmInventoryStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/CmInventoryTypes.go b/services/nsxt-mp/nsx/node/services/CmInventoryTypes.go new file mode 100644 index 000000000..3581c5d3b --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/CmInventoryTypes.go @@ -0,0 +1,191 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: CmInventory. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func cmInventoryGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func cmInventoryGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServicePropertiesBindingType) +} + +func cmInventoryGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/cm-inventory", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func cmInventoryRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func cmInventoryRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func cmInventoryRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/cm-inventory", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func cmInventoryStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func cmInventoryStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func cmInventoryStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/cm-inventory", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func cmInventoryStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func cmInventoryStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func cmInventoryStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/cm-inventory", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/ControllerClient.go b/services/nsxt-mp/nsx/node/services/ControllerClient.go new file mode 100644 index 000000000..b39cc4405 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/ControllerClient.go @@ -0,0 +1,207 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Controller +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ControllerClient interface { + + // Read controller service properties + // @return com.vmware.nsx.model.NodeServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceProperties, error) + + // Restart, start or stop the controller service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the controller service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the controller service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) +} + +type controllerClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewControllerClient(connector client.Connector) *controllerClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.controller") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := controllerClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *controllerClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *controllerClient) Get() (model.NodeServiceProperties, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(controllerGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := controllerGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.controller", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), controllerGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *controllerClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(controllerRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := controllerRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.controller", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), controllerRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *controllerClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(controllerStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := controllerStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.controller", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), controllerStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *controllerClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(controllerStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := controllerStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.controller", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), controllerStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/ControllerTypes.go b/services/nsxt-mp/nsx/node/services/ControllerTypes.go new file mode 100644 index 000000000..2afee1af4 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/ControllerTypes.go @@ -0,0 +1,191 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Controller. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func controllerGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func controllerGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServicePropertiesBindingType) +} + +func controllerGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/controller", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func controllerRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func controllerRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func controllerRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/controller", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func controllerStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func controllerStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func controllerStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/controller", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func controllerStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func controllerStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func controllerStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/controller", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/HttpClient.go b/services/nsxt-mp/nsx/node/services/HttpClient.go new file mode 100644 index 000000000..2ee96db5a --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/HttpClient.go @@ -0,0 +1,272 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Http +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type HttpClient interface { + + // Applies a security certificate to the http service. In the POST request, the CERTIFICATE_ID references a certificate created with the /api/v1/trust-management APIs. If the certificate used is a CA signed certificate,the request fails if the whole chain(leaf, intermediate, root) is not imported. + // + // @param certificateIdParam Certificate ID (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Applycertificate(certificateIdParam string) error + + // This API is deprecated. Read the configuration of the http service by calling the GET /api/v1/cluster/api-service API. + // @return com.vmware.nsx.model.NodeHttpServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeHttpServiceProperties, error) + + // Restart the http service + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() error + + // Start the http service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Stop the http service + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() error + + // This API is deprecated. Make changes to the http service configuration by calling the PUT /api/v1/cluster/api-service API. + // + // @param nodeHttpServicePropertiesParam (required) + // @return com.vmware.nsx.model.NodeHttpServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(nodeHttpServicePropertiesParam model.NodeHttpServiceProperties) (model.NodeHttpServiceProperties, error) +} + +type httpClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewHttpClient(connector client.Connector) *httpClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.http") + methodIdentifiers := map[string]core.MethodIdentifier{ + "applycertificate": core.NewMethodIdentifier(interfaceIdentifier, "applycertificate"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + hIface := httpClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &hIface +} + +func (hIface *httpClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := hIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (hIface *httpClient) Applycertificate(certificateIdParam string) error { + typeConverter := hIface.connector.TypeConverter() + executionContext := hIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(httpApplycertificateInputType(), typeConverter) + sv.AddStructField("CertificateId", certificateIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := httpApplycertificateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + hIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := hIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.http", "applycertificate", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), hIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (hIface *httpClient) Get() (model.NodeHttpServiceProperties, error) { + typeConverter := hIface.connector.TypeConverter() + executionContext := hIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(httpGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeHttpServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := httpGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + hIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := hIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.http", "get", inputDataValue, executionContext) + var emptyOutput model.NodeHttpServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), httpGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeHttpServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), hIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (hIface *httpClient) Restart() error { + typeConverter := hIface.connector.TypeConverter() + executionContext := hIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(httpRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := httpRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + hIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := hIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.http", "restart", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), hIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (hIface *httpClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := hIface.connector.TypeConverter() + executionContext := hIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(httpStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := httpStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + hIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := hIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.http", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), httpStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), hIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (hIface *httpClient) Stop() error { + typeConverter := hIface.connector.TypeConverter() + executionContext := hIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(httpStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := httpStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + hIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := hIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.http", "stop", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), hIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (hIface *httpClient) Update(nodeHttpServicePropertiesParam model.NodeHttpServiceProperties) (model.NodeHttpServiceProperties, error) { + typeConverter := hIface.connector.TypeConverter() + executionContext := hIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(httpUpdateInputType(), typeConverter) + sv.AddStructField("NodeHttpServiceProperties", nodeHttpServicePropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeHttpServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := httpUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + hIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := hIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.http", "update", inputDataValue, executionContext) + var emptyOutput model.NodeHttpServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), httpUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeHttpServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), hIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/HttpTypes.go b/services/nsxt-mp/nsx/node/services/HttpTypes.go new file mode 100644 index 000000000..11df09c05 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/HttpTypes.go @@ -0,0 +1,288 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Http. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func httpApplycertificateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["certificate_id"] = bindings.NewStringType() + fieldNameMap["certificate_id"] = "CertificateId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func httpApplycertificateOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func httpApplycertificateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["certificate_id"] = bindings.NewStringType() + fieldNameMap["certificate_id"] = "CertificateId" + paramsTypeMap["certificate_id"] = bindings.NewStringType() + queryParams["certificate_id"] = "certificate_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=apply_certificate", + "", + "POST", + "/api/v1/node/services/nsxt-mp/http", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func httpGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func httpGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeHttpServicePropertiesBindingType) +} + +func httpGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/http", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func httpRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func httpRestartOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func httpRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/http", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func httpStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func httpStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func httpStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/http", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func httpStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func httpStopOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func httpStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/http", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func httpUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_http_service_properties"] = bindings.NewReferenceType(model.NodeHttpServicePropertiesBindingType) + fieldNameMap["node_http_service_properties"] = "NodeHttpServiceProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func httpUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeHttpServicePropertiesBindingType) +} + +func httpUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_http_service_properties"] = bindings.NewReferenceType(model.NodeHttpServicePropertiesBindingType) + fieldNameMap["node_http_service_properties"] = "NodeHttpServiceProperties" + paramsTypeMap["node_http_service_properties"] = bindings.NewReferenceType(model.NodeHttpServicePropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "node_http_service_properties", + "PUT", + "/api/v1/node/services/nsxt-mp/http", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/IdpsReportingClient.go b/services/nsxt-mp/nsx/node/services/IdpsReportingClient.go new file mode 100644 index 000000000..cb61bd838 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/IdpsReportingClient.go @@ -0,0 +1,207 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: IdpsReporting +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type IdpsReportingClient interface { + + // Read the idps-reporting service properties + // @return com.vmware.nsx.model.NodeServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceProperties, error) + + // Restart, start or stop the idps-reporting service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the idps-reporting service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the idps-reporting service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) +} + +type idpsReportingClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewIdpsReportingClient(connector client.Connector) *idpsReportingClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.idps_reporting") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := idpsReportingClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *idpsReportingClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *idpsReportingClient) Get() (model.NodeServiceProperties, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(idpsReportingGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := idpsReportingGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.idps_reporting", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), idpsReportingGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *idpsReportingClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(idpsReportingRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := idpsReportingRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.idps_reporting", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), idpsReportingRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *idpsReportingClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(idpsReportingStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := idpsReportingStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.idps_reporting", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), idpsReportingStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *idpsReportingClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(idpsReportingStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := idpsReportingStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.idps_reporting", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), idpsReportingStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/IdpsReportingTypes.go b/services/nsxt-mp/nsx/node/services/IdpsReportingTypes.go new file mode 100644 index 000000000..02d7389f3 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/IdpsReportingTypes.go @@ -0,0 +1,191 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: IdpsReporting. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func idpsReportingGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func idpsReportingGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServicePropertiesBindingType) +} + +func idpsReportingGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/idps-reporting", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func idpsReportingRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func idpsReportingRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func idpsReportingRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/idps-reporting", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func idpsReportingStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func idpsReportingStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func idpsReportingStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/idps-reporting", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func idpsReportingStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func idpsReportingStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func idpsReportingStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/idps-reporting", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/InstallUpgradeClient.go b/services/nsxt-mp/nsx/node/services/InstallUpgradeClient.go new file mode 100644 index 000000000..ac8975923 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/InstallUpgradeClient.go @@ -0,0 +1,254 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: InstallUpgrade +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type InstallUpgradeClient interface { + + // Read NSX install-upgrade service properties + // @return com.vmware.nsx.model.NodeInstallUpgradeServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeInstallUpgradeServiceProperties, error) + + // Restart, start or stop the NSX install-upgrade service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the NSX install-upgrade service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the NSX install-upgrade service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) + + // Update NSX install-upgrade service properties + // + // @param nodeInstallUpgradeServicePropertiesParam (required) + // @return com.vmware.nsx.model.NodeInstallUpgradeServiceProperties + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(nodeInstallUpgradeServicePropertiesParam model.NodeInstallUpgradeServiceProperties) (model.NodeInstallUpgradeServiceProperties, error) +} + +type installUpgradeClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewInstallUpgradeClient(connector client.Connector) *installUpgradeClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.install_upgrade") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := installUpgradeClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *installUpgradeClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *installUpgradeClient) Get() (model.NodeInstallUpgradeServiceProperties, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(installUpgradeGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeInstallUpgradeServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := installUpgradeGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.install_upgrade", "get", inputDataValue, executionContext) + var emptyOutput model.NodeInstallUpgradeServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), installUpgradeGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeInstallUpgradeServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *installUpgradeClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(installUpgradeRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := installUpgradeRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.install_upgrade", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), installUpgradeRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *installUpgradeClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(installUpgradeStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := installUpgradeStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.install_upgrade", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), installUpgradeStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *installUpgradeClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(installUpgradeStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := installUpgradeStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.install_upgrade", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), installUpgradeStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *installUpgradeClient) Update(nodeInstallUpgradeServicePropertiesParam model.NodeInstallUpgradeServiceProperties) (model.NodeInstallUpgradeServiceProperties, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(installUpgradeUpdateInputType(), typeConverter) + sv.AddStructField("NodeInstallUpgradeServiceProperties", nodeInstallUpgradeServicePropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeInstallUpgradeServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := installUpgradeUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.install_upgrade", "update", inputDataValue, executionContext) + var emptyOutput model.NodeInstallUpgradeServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), installUpgradeUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeInstallUpgradeServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/InstallUpgradeTypes.go b/services/nsxt-mp/nsx/node/services/InstallUpgradeTypes.go new file mode 100644 index 000000000..8b6e2f473 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/InstallUpgradeTypes.go @@ -0,0 +1,239 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: InstallUpgrade. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func installUpgradeGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func installUpgradeGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeInstallUpgradeServicePropertiesBindingType) +} + +func installUpgradeGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/install-upgrade", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func installUpgradeRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func installUpgradeRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func installUpgradeRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/install-upgrade", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func installUpgradeStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func installUpgradeStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func installUpgradeStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/install-upgrade", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func installUpgradeStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func installUpgradeStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func installUpgradeStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/install-upgrade", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func installUpgradeUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_install_upgrade_service_properties"] = bindings.NewReferenceType(model.NodeInstallUpgradeServicePropertiesBindingType) + fieldNameMap["node_install_upgrade_service_properties"] = "NodeInstallUpgradeServiceProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func installUpgradeUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeInstallUpgradeServicePropertiesBindingType) +} + +func installUpgradeUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_install_upgrade_service_properties"] = bindings.NewReferenceType(model.NodeInstallUpgradeServicePropertiesBindingType) + fieldNameMap["node_install_upgrade_service_properties"] = "NodeInstallUpgradeServiceProperties" + paramsTypeMap["node_install_upgrade_service_properties"] = bindings.NewReferenceType(model.NodeInstallUpgradeServicePropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "node_install_upgrade_service_properties", + "PUT", + "/api/v1/node/services/nsxt-mp/install-upgrade", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/LiagentClient.go b/services/nsxt-mp/nsx/node/services/LiagentClient.go new file mode 100644 index 000000000..bcca287bd --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/LiagentClient.go @@ -0,0 +1,207 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Liagent +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type LiagentClient interface { + + // Read liagent service properties + // @return com.vmware.nsx.model.NodeServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceProperties, error) + + // Restart, start or stop the liagent service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the liagent service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the liagent service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) +} + +type liagentClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewLiagentClient(connector client.Connector) *liagentClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.liagent") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + lIface := liagentClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &lIface +} + +func (lIface *liagentClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := lIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (lIface *liagentClient) Get() (model.NodeServiceProperties, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(liagentGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := liagentGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.liagent", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), liagentGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *liagentClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(liagentRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := liagentRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.liagent", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), liagentRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *liagentClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(liagentStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := liagentStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.liagent", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), liagentStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *liagentClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(liagentStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := liagentStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.liagent", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), liagentStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/LiagentTypes.go b/services/nsxt-mp/nsx/node/services/LiagentTypes.go new file mode 100644 index 000000000..5d08b5e4e --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/LiagentTypes.go @@ -0,0 +1,191 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Liagent. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func liagentGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func liagentGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServicePropertiesBindingType) +} + +func liagentGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/liagent", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func liagentRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func liagentRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func liagentRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/liagent", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func liagentStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func liagentStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func liagentStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/liagent", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func liagentStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func liagentStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func liagentStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/liagent", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/ManagerClient.go b/services/nsxt-mp/nsx/node/services/ManagerClient.go new file mode 100644 index 000000000..1ac326e9e --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/ManagerClient.go @@ -0,0 +1,283 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Manager +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ManagerClient interface { + + // Read service properties + // @return com.vmware.nsx.model.NodeProtonServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeProtonServiceProperties, error) + + // Reset the logging levels to default values + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Resetmanagerlogginglevels() error + + // Restart, start or stop the service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) + + // Update service properties + // + // @param nodeProtonServicePropertiesParam (required) + // @return com.vmware.nsx.model.NodeProtonServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(nodeProtonServicePropertiesParam model.NodeProtonServiceProperties) (model.NodeProtonServiceProperties, error) +} + +type managerClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewManagerClient(connector client.Connector) *managerClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.manager") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "resetmanagerlogginglevels": core.NewMethodIdentifier(interfaceIdentifier, "resetmanagerlogginglevels"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := managerClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *managerClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *managerClient) Get() (model.NodeProtonServiceProperties, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(managerGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeProtonServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := managerGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.manager", "get", inputDataValue, executionContext) + var emptyOutput model.NodeProtonServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), managerGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeProtonServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *managerClient) Resetmanagerlogginglevels() error { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(managerResetmanagerlogginglevelsInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := managerResetmanagerlogginglevelsRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.manager", "resetmanagerlogginglevels", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (mIface *managerClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(managerRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := managerRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.manager", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), managerRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *managerClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(managerStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := managerStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.manager", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), managerStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *managerClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(managerStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := managerStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.manager", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), managerStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *managerClient) Update(nodeProtonServicePropertiesParam model.NodeProtonServiceProperties) (model.NodeProtonServiceProperties, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(managerUpdateInputType(), typeConverter) + sv.AddStructField("NodeProtonServiceProperties", nodeProtonServicePropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeProtonServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := managerUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.manager", "update", inputDataValue, executionContext) + var emptyOutput model.NodeProtonServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), managerUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeProtonServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/ManagerTypes.go b/services/nsxt-mp/nsx/node/services/ManagerTypes.go new file mode 100644 index 000000000..7380810ce --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/ManagerTypes.go @@ -0,0 +1,282 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Manager. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func managerGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func managerGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeProtonServicePropertiesBindingType) +} + +func managerGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/manager", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func managerResetmanagerlogginglevelsInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func managerResetmanagerlogginglevelsOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func managerResetmanagerlogginglevelsRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=reset-manager-logging-levels", + "", + "POST", + "/api/v1/node/services/nsxt-mp/manager", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func managerRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func managerRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func managerRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/manager", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func managerStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func managerStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func managerStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/manager", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func managerStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func managerStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func managerStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/manager", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func managerUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_proton_service_properties"] = bindings.NewReferenceType(model.NodeProtonServicePropertiesBindingType) + fieldNameMap["node_proton_service_properties"] = "NodeProtonServiceProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func managerUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeProtonServicePropertiesBindingType) +} + +func managerUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_proton_service_properties"] = bindings.NewReferenceType(model.NodeProtonServicePropertiesBindingType) + fieldNameMap["node_proton_service_properties"] = "NodeProtonServiceProperties" + paramsTypeMap["node_proton_service_properties"] = bindings.NewReferenceType(model.NodeProtonServicePropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "node_proton_service_properties", + "PUT", + "/api/v1/node/services/nsxt-mp/manager", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/MessagingManagerClient.go b/services/nsxt-mp/nsx/node/services/MessagingManagerClient.go new file mode 100644 index 000000000..5a777d1d6 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/MessagingManagerClient.go @@ -0,0 +1,207 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MessagingManager +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MessagingManagerClient interface { + + // Read NSX Messaging Manager service properties + // @return com.vmware.nsx.model.NodeServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceProperties, error) + + // Restart, start or stop the NSX Messaging Manager service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the NSX Messaging Manager service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the NSX Messaging Manager service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) +} + +type messagingManagerClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMessagingManagerClient(connector client.Connector) *messagingManagerClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.messaging_manager") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := messagingManagerClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *messagingManagerClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *messagingManagerClient) Get() (model.NodeServiceProperties, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(messagingManagerGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := messagingManagerGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.messaging_manager", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), messagingManagerGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *messagingManagerClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(messagingManagerRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := messagingManagerRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.messaging_manager", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), messagingManagerRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *messagingManagerClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(messagingManagerStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := messagingManagerStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.messaging_manager", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), messagingManagerStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *messagingManagerClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(messagingManagerStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := messagingManagerStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.messaging_manager", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), messagingManagerStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/MessagingManagerTypes.go b/services/nsxt-mp/nsx/node/services/MessagingManagerTypes.go new file mode 100644 index 000000000..dbe3d884b --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/MessagingManagerTypes.go @@ -0,0 +1,191 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MessagingManager. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func messagingManagerGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func messagingManagerGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServicePropertiesBindingType) +} + +func messagingManagerGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/messaging-manager", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func messagingManagerRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func messagingManagerRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func messagingManagerRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/messaging-manager", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func messagingManagerStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func messagingManagerStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func messagingManagerStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/messaging-manager", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func messagingManagerStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func messagingManagerStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func messagingManagerStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/messaging-manager", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/MigrationCoordinatorClient.go b/services/nsxt-mp/nsx/node/services/MigrationCoordinatorClient.go new file mode 100644 index 000000000..6a7199e8b --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/MigrationCoordinatorClient.go @@ -0,0 +1,207 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MigrationCoordinator +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MigrationCoordinatorClient interface { + + // Read migration coordinator service properties + // @return com.vmware.nsx.model.NodeServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceProperties, error) + + // Restart, start or stop the migration coordinator service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the migration coordinator service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the migration coordinator service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) +} + +type migrationCoordinatorClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMigrationCoordinatorClient(connector client.Connector) *migrationCoordinatorClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.migration_coordinator") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := migrationCoordinatorClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *migrationCoordinatorClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *migrationCoordinatorClient) Get() (model.NodeServiceProperties, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(migrationCoordinatorGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := migrationCoordinatorGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.migration_coordinator", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), migrationCoordinatorGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *migrationCoordinatorClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(migrationCoordinatorRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := migrationCoordinatorRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.migration_coordinator", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), migrationCoordinatorRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *migrationCoordinatorClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(migrationCoordinatorStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := migrationCoordinatorStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.migration_coordinator", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), migrationCoordinatorStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *migrationCoordinatorClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(migrationCoordinatorStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := migrationCoordinatorStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.migration_coordinator", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), migrationCoordinatorStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/MigrationCoordinatorTypes.go b/services/nsxt-mp/nsx/node/services/MigrationCoordinatorTypes.go new file mode 100644 index 000000000..32feb0a52 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/MigrationCoordinatorTypes.go @@ -0,0 +1,191 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MigrationCoordinator. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func migrationCoordinatorGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func migrationCoordinatorGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServicePropertiesBindingType) +} + +func migrationCoordinatorGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/migration-coordinator", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func migrationCoordinatorRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func migrationCoordinatorRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func migrationCoordinatorRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/migration-coordinator", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func migrationCoordinatorStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func migrationCoordinatorStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func migrationCoordinatorStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/migration-coordinator", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func migrationCoordinatorStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func migrationCoordinatorStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func migrationCoordinatorStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/migration-coordinator", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/NodeMgmtClient.go b/services/nsxt-mp/nsx/node/services/NodeMgmtClient.go new file mode 100644 index 000000000..13e340b01 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/NodeMgmtClient.go @@ -0,0 +1,120 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: NodeMgmt +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NodeMgmtClient interface { + + // Read appliance management service properties + // @return com.vmware.nsx.model.NodeServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceProperties, error) + + // Restart the node management service + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() error +} + +type nodeMgmtClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNodeMgmtClient(connector client.Connector) *nodeMgmtClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.node_mgmt") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nodeMgmtClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nodeMgmtClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nodeMgmtClient) Get() (model.NodeServiceProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodeMgmtGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodeMgmtGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.node_mgmt", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nodeMgmtGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nodeMgmtClient) Restart() error { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodeMgmtRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodeMgmtRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.node_mgmt", "restart", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/NodeMgmtTypes.go b/services/nsxt-mp/nsx/node/services/NodeMgmtTypes.go new file mode 100644 index 000000000..92ee5d5b4 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/NodeMgmtTypes.go @@ -0,0 +1,105 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: NodeMgmt. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func nodeMgmtGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodeMgmtGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServicePropertiesBindingType) +} + +func nodeMgmtGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/node-mgmt", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nodeMgmtRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodeMgmtRestartOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func nodeMgmtRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/node-mgmt", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/NodeStatsClient.go b/services/nsxt-mp/nsx/node/services/NodeStatsClient.go new file mode 100644 index 000000000..2193f06c1 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/NodeStatsClient.go @@ -0,0 +1,207 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: NodeStats +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NodeStatsClient interface { + + // Read NSX node-stats service properties + // @return com.vmware.nsx.model.NodeServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceProperties, error) + + // Restart, start or stop the NSX node-stats service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the NSX node-stats service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the NSX node-stats service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) +} + +type nodeStatsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNodeStatsClient(connector client.Connector) *nodeStatsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.node_stats") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nodeStatsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nodeStatsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nodeStatsClient) Get() (model.NodeServiceProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodeStatsGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodeStatsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.node_stats", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nodeStatsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nodeStatsClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodeStatsRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodeStatsRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.node_stats", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nodeStatsRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nodeStatsClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodeStatsStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodeStatsStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.node_stats", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nodeStatsStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nodeStatsClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodeStatsStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodeStatsStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.node_stats", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nodeStatsStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/NodeStatsTypes.go b/services/nsxt-mp/nsx/node/services/NodeStatsTypes.go new file mode 100644 index 000000000..6cf6a2780 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/NodeStatsTypes.go @@ -0,0 +1,191 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: NodeStats. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func nodeStatsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodeStatsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServicePropertiesBindingType) +} + +func nodeStatsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/node-stats", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nodeStatsRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodeStatsRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func nodeStatsRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/node-stats", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nodeStatsStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodeStatsStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func nodeStatsStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/node-stats", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nodeStatsStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodeStatsStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func nodeStatsStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/node-stats", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/NsxMessageBusClient.go b/services/nsxt-mp/nsx/node/services/NsxMessageBusClient.go new file mode 100644 index 000000000..74d92e92d --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/NsxMessageBusClient.go @@ -0,0 +1,207 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: NsxMessageBus +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NsxMessageBusClient interface { + + // Read NSX Message Bus service properties + // @return com.vmware.nsx.model.NodeServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceProperties, error) + + // Restart, start or stop the NSX Message Bus service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the NSX Message Bus service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the NSX Message Bus service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) +} + +type nsxMessageBusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNsxMessageBusClient(connector client.Connector) *nsxMessageBusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.nsx_message_bus") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nsxMessageBusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nsxMessageBusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nsxMessageBusClient) Get() (model.NodeServiceProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsxMessageBusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsxMessageBusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.nsx_message_bus", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsxMessageBusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nsxMessageBusClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsxMessageBusRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsxMessageBusRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.nsx_message_bus", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsxMessageBusRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nsxMessageBusClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsxMessageBusStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsxMessageBusStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.nsx_message_bus", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsxMessageBusStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nsxMessageBusClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsxMessageBusStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsxMessageBusStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.nsx_message_bus", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsxMessageBusStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/NsxMessageBusTypes.go b/services/nsxt-mp/nsx/node/services/NsxMessageBusTypes.go new file mode 100644 index 000000000..956d857b0 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/NsxMessageBusTypes.go @@ -0,0 +1,191 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: NsxMessageBus. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func nsxMessageBusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsxMessageBusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServicePropertiesBindingType) +} + +func nsxMessageBusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/nsx-message-bus", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsxMessageBusRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsxMessageBusRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func nsxMessageBusRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/nsx-message-bus", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsxMessageBusStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsxMessageBusStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func nsxMessageBusStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/nsx-message-bus", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsxMessageBusStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsxMessageBusStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func nsxMessageBusStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/nsx-message-bus", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/NsxPlatformClientClient.go b/services/nsxt-mp/nsx/node/services/NsxPlatformClientClient.go new file mode 100644 index 000000000..10a3d88c2 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/NsxPlatformClientClient.go @@ -0,0 +1,207 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: NsxPlatformClient +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NsxPlatformClientClient interface { + + // Read NSX Platform Client service properties + // @return com.vmware.nsx.model.NodeServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceProperties, error) + + // Restart, start or stop the NSX Platform Client service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the NSX Platform Client service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the NSX Platform Client service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) +} + +type nsxPlatformClientClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNsxPlatformClientClient(connector client.Connector) *nsxPlatformClientClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.nsx_platform_client") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nsxPlatformClientClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nsxPlatformClientClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nsxPlatformClientClient) Get() (model.NodeServiceProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsxPlatformClientGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsxPlatformClientGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.nsx_platform_client", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsxPlatformClientGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nsxPlatformClientClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsxPlatformClientRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsxPlatformClientRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.nsx_platform_client", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsxPlatformClientRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nsxPlatformClientClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsxPlatformClientStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsxPlatformClientStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.nsx_platform_client", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsxPlatformClientStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nsxPlatformClientClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsxPlatformClientStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsxPlatformClientStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.nsx_platform_client", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsxPlatformClientStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/NsxPlatformClientTypes.go b/services/nsxt-mp/nsx/node/services/NsxPlatformClientTypes.go new file mode 100644 index 000000000..690ad5396 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/NsxPlatformClientTypes.go @@ -0,0 +1,191 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: NsxPlatformClient. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func nsxPlatformClientGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsxPlatformClientGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServicePropertiesBindingType) +} + +func nsxPlatformClientGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/nsx-platform-client", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsxPlatformClientRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsxPlatformClientRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func nsxPlatformClientRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/nsx-platform-client", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsxPlatformClientStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsxPlatformClientStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func nsxPlatformClientStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/nsx-platform-client", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsxPlatformClientStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsxPlatformClientStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func nsxPlatformClientStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/nsx-platform-client", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/NsxUpgradeAgentClient.go b/services/nsxt-mp/nsx/node/services/NsxUpgradeAgentClient.go new file mode 100644 index 000000000..7674b7c47 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/NsxUpgradeAgentClient.go @@ -0,0 +1,207 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: NsxUpgradeAgent +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NsxUpgradeAgentClient interface { + + // Read NSX upgrade Agent service properties + // @return com.vmware.nsx.model.NodeServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceProperties, error) + + // Restart, start or stop the NSX upgrade agent service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the NSX upgrade agent service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the NSX upgrade agent service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) +} + +type nsxUpgradeAgentClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNsxUpgradeAgentClient(connector client.Connector) *nsxUpgradeAgentClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.nsx_upgrade_agent") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nsxUpgradeAgentClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nsxUpgradeAgentClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nsxUpgradeAgentClient) Get() (model.NodeServiceProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsxUpgradeAgentGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsxUpgradeAgentGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.nsx_upgrade_agent", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsxUpgradeAgentGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nsxUpgradeAgentClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsxUpgradeAgentRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsxUpgradeAgentRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.nsx_upgrade_agent", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsxUpgradeAgentRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nsxUpgradeAgentClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsxUpgradeAgentStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsxUpgradeAgentStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.nsx_upgrade_agent", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsxUpgradeAgentStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *nsxUpgradeAgentClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsxUpgradeAgentStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsxUpgradeAgentStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.nsx_upgrade_agent", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsxUpgradeAgentStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/NsxUpgradeAgentTypes.go b/services/nsxt-mp/nsx/node/services/NsxUpgradeAgentTypes.go new file mode 100644 index 000000000..3586da982 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/NsxUpgradeAgentTypes.go @@ -0,0 +1,191 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: NsxUpgradeAgent. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func nsxUpgradeAgentGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsxUpgradeAgentGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServicePropertiesBindingType) +} + +func nsxUpgradeAgentGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/nsx-upgrade-agent", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsxUpgradeAgentRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsxUpgradeAgentRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func nsxUpgradeAgentRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/nsx-upgrade-agent", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsxUpgradeAgentStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsxUpgradeAgentStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func nsxUpgradeAgentStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/nsx-upgrade-agent", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func nsxUpgradeAgentStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsxUpgradeAgentStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func nsxUpgradeAgentStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/nsx-upgrade-agent", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/NtpClient.go b/services/nsxt-mp/nsx/node/services/NtpClient.go new file mode 100644 index 000000000..fa144afbc --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/NtpClient.go @@ -0,0 +1,250 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Ntp +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NtpClient interface { + + // Read NTP service properties + // @return com.vmware.nsx.model.NodeNtpServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeNtpServiceProperties, error) + + // Restart, start or stop the NTP service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the NTP service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the NTP service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) + + // Update NTP service properties + // + // @param nodeNtpServicePropertiesParam (required) + // @return com.vmware.nsx.model.NodeNtpServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(nodeNtpServicePropertiesParam model.NodeNtpServiceProperties) (model.NodeNtpServiceProperties, error) +} + +type ntpClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNtpClient(connector client.Connector) *ntpClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.ntp") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := ntpClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *ntpClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *ntpClient) Get() (model.NodeNtpServiceProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ntpGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeNtpServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ntpGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.ntp", "get", inputDataValue, executionContext) + var emptyOutput model.NodeNtpServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ntpGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeNtpServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *ntpClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ntpRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ntpRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.ntp", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ntpRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *ntpClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ntpStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ntpStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.ntp", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ntpStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *ntpClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ntpStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ntpStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.ntp", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ntpStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *ntpClient) Update(nodeNtpServicePropertiesParam model.NodeNtpServiceProperties) (model.NodeNtpServiceProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ntpUpdateInputType(), typeConverter) + sv.AddStructField("NodeNtpServiceProperties", nodeNtpServicePropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeNtpServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ntpUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.ntp", "update", inputDataValue, executionContext) + var emptyOutput model.NodeNtpServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ntpUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeNtpServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/NtpTypes.go b/services/nsxt-mp/nsx/node/services/NtpTypes.go new file mode 100644 index 000000000..4c24cb173 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/NtpTypes.go @@ -0,0 +1,239 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Ntp. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func ntpGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ntpGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeNtpServicePropertiesBindingType) +} + +func ntpGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/ntp", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ntpRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ntpRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func ntpRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/ntp", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ntpStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ntpStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func ntpStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/ntp", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ntpStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ntpStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func ntpStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/ntp", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ntpUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_ntp_service_properties"] = bindings.NewReferenceType(model.NodeNtpServicePropertiesBindingType) + fieldNameMap["node_ntp_service_properties"] = "NodeNtpServiceProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ntpUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeNtpServicePropertiesBindingType) +} + +func ntpUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_ntp_service_properties"] = bindings.NewReferenceType(model.NodeNtpServicePropertiesBindingType) + fieldNameMap["node_ntp_service_properties"] = "NodeNtpServiceProperties" + paramsTypeMap["node_ntp_service_properties"] = bindings.NewReferenceType(model.NodeNtpServicePropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "node_ntp_service_properties", + "PUT", + "/api/v1/node/services/nsxt-mp/ntp", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/PolicyClient.go b/services/nsxt-mp/nsx/node/services/PolicyClient.go new file mode 100644 index 000000000..e518b433b --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/PolicyClient.go @@ -0,0 +1,283 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Policy +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type PolicyClient interface { + + // Read service properties + // @return com.vmware.nsx.model.NodePolicyServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodePolicyServiceProperties, error) + + // Reset the logging levels to default values + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Resetmanagerlogginglevels() error + + // Restart, start or stop the service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) + + // Update service properties + // + // @param nodePolicyServicePropertiesParam (required) + // @return com.vmware.nsx.model.NodePolicyServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(nodePolicyServicePropertiesParam model.NodePolicyServiceProperties) (model.NodePolicyServiceProperties, error) +} + +type policyClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewPolicyClient(connector client.Connector) *policyClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.policy") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "resetmanagerlogginglevels": core.NewMethodIdentifier(interfaceIdentifier, "resetmanagerlogginglevels"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + pIface := policyClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &pIface +} + +func (pIface *policyClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := pIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (pIface *policyClient) Get() (model.NodePolicyServiceProperties, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(policyGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodePolicyServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := policyGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.policy", "get", inputDataValue, executionContext) + var emptyOutput model.NodePolicyServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), policyGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodePolicyServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *policyClient) Resetmanagerlogginglevels() error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(policyResetmanagerlogginglevelsInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := policyResetmanagerlogginglevelsRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.policy", "resetmanagerlogginglevels", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *policyClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(policyRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := policyRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.policy", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), policyRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *policyClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(policyStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := policyStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.policy", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), policyStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *policyClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(policyStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := policyStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.policy", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), policyStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *policyClient) Update(nodePolicyServicePropertiesParam model.NodePolicyServiceProperties) (model.NodePolicyServiceProperties, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(policyUpdateInputType(), typeConverter) + sv.AddStructField("NodePolicyServiceProperties", nodePolicyServicePropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodePolicyServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := policyUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.policy", "update", inputDataValue, executionContext) + var emptyOutput model.NodePolicyServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), policyUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodePolicyServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/PolicyTypes.go b/services/nsxt-mp/nsx/node/services/PolicyTypes.go new file mode 100644 index 000000000..6f0f687f8 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/PolicyTypes.go @@ -0,0 +1,282 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Policy. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func policyGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func policyGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodePolicyServicePropertiesBindingType) +} + +func policyGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/policy", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func policyResetmanagerlogginglevelsInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func policyResetmanagerlogginglevelsOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func policyResetmanagerlogginglevelsRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=reset-manager-logging-levels", + "", + "POST", + "/api/v1/node/services/nsxt-mp/policy", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func policyRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func policyRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func policyRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/policy", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func policyStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func policyStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func policyStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/policy", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func policyStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func policyStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func policyStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/policy", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func policyUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_policy_service_properties"] = bindings.NewReferenceType(model.NodePolicyServicePropertiesBindingType) + fieldNameMap["node_policy_service_properties"] = "NodePolicyServiceProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func policyUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodePolicyServicePropertiesBindingType) +} + +func policyUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_policy_service_properties"] = bindings.NewReferenceType(model.NodePolicyServicePropertiesBindingType) + fieldNameMap["node_policy_service_properties"] = "NodePolicyServiceProperties" + paramsTypeMap["node_policy_service_properties"] = bindings.NewReferenceType(model.NodePolicyServicePropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "node_policy_service_properties", + "PUT", + "/api/v1/node/services/nsxt-mp/policy", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/SearchClient.go b/services/nsxt-mp/nsx/node/services/SearchClient.go new file mode 100644 index 000000000..2f0aca3e4 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/SearchClient.go @@ -0,0 +1,207 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Search +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SearchClient interface { + + // Read NSX Search service properties + // @return com.vmware.nsx.model.NodeServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceProperties, error) + + // Restart, start or stop the NSX Search service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the NSX Search service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the NSX Search service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) +} + +type searchClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSearchClient(connector client.Connector) *searchClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.search") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := searchClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *searchClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *searchClient) Get() (model.NodeServiceProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(searchGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := searchGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.search", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), searchGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *searchClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(searchRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := searchRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.search", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), searchRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *searchClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(searchStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := searchStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.search", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), searchStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *searchClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(searchStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := searchStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.search", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), searchStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/SearchTypes.go b/services/nsxt-mp/nsx/node/services/SearchTypes.go new file mode 100644 index 000000000..f53118b07 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/SearchTypes.go @@ -0,0 +1,191 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Search. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func searchGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func searchGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServicePropertiesBindingType) +} + +func searchGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/search", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func searchRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func searchRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func searchRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/search", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func searchStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func searchStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func searchStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/search", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func searchStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func searchStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func searchStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/search", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/ServicesPackageTypes.go b/services/nsxt-mp/nsx/node/services/ServicesPackageTypes.go new file mode 100644 index 000000000..43bd7a095 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/ServicesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services diff --git a/services/nsxt-mp/nsx/node/services/SnmpClient.go b/services/nsxt-mp/nsx/node/services/SnmpClient.go new file mode 100644 index 000000000..d82e726fc --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/SnmpClient.go @@ -0,0 +1,254 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Snmp +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SnmpClient interface { + + // Read SNMP service properties. + // + // @param showSensitiveDataParam Show SNMP sensitive data or not (optional, default to false) + // @return com.vmware.nsx.model.NodeSnmpServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(showSensitiveDataParam *bool) (model.NodeSnmpServiceProperties, error) + + // Restart, start or stop the SNMP service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the SNMP service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the SNMP service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) + + // Update SNMP service properties. + // + // @param nodeSnmpServicePropertiesParam (required) + // @return com.vmware.nsx.model.NodeSnmpServiceProperties + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(nodeSnmpServicePropertiesParam model.NodeSnmpServiceProperties) (model.NodeSnmpServiceProperties, error) +} + +type snmpClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSnmpClient(connector client.Connector) *snmpClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.snmp") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := snmpClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *snmpClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *snmpClient) Get(showSensitiveDataParam *bool) (model.NodeSnmpServiceProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(snmpGetInputType(), typeConverter) + sv.AddStructField("ShowSensitiveData", showSensitiveDataParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeSnmpServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := snmpGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.snmp", "get", inputDataValue, executionContext) + var emptyOutput model.NodeSnmpServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), snmpGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeSnmpServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *snmpClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(snmpRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := snmpRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.snmp", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), snmpRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *snmpClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(snmpStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := snmpStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.snmp", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), snmpStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *snmpClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(snmpStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := snmpStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.snmp", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), snmpStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *snmpClient) Update(nodeSnmpServicePropertiesParam model.NodeSnmpServiceProperties) (model.NodeSnmpServiceProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(snmpUpdateInputType(), typeConverter) + sv.AddStructField("NodeSnmpServiceProperties", nodeSnmpServicePropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeSnmpServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := snmpUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.snmp", "update", inputDataValue, executionContext) + var emptyOutput model.NodeSnmpServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), snmpUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeSnmpServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/SnmpTypes.go b/services/nsxt-mp/nsx/node/services/SnmpTypes.go new file mode 100644 index 000000000..f54d48cd5 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/SnmpTypes.go @@ -0,0 +1,245 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Snmp. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func snmpGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["show_sensitive_data"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_sensitive_data"] = "ShowSensitiveData" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func snmpGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeSnmpServicePropertiesBindingType) +} + +func snmpGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["show_sensitive_data"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["show_sensitive_data"] = "ShowSensitiveData" + paramsTypeMap["show_sensitive_data"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["show_sensitive_data"] = "show_sensitive_data" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/snmp", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func snmpRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func snmpRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func snmpRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/snmp", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func snmpStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func snmpStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func snmpStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/snmp", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func snmpStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func snmpStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func snmpStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/snmp", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func snmpUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_snmp_service_properties"] = bindings.NewReferenceType(model.NodeSnmpServicePropertiesBindingType) + fieldNameMap["node_snmp_service_properties"] = "NodeSnmpServiceProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func snmpUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeSnmpServicePropertiesBindingType) +} + +func snmpUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_snmp_service_properties"] = bindings.NewReferenceType(model.NodeSnmpServicePropertiesBindingType) + fieldNameMap["node_snmp_service_properties"] = "NodeSnmpServiceProperties" + paramsTypeMap["node_snmp_service_properties"] = bindings.NewReferenceType(model.NodeSnmpServicePropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "node_snmp_service_properties", + "PUT", + "/api/v1/node/services/nsxt-mp/snmp", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/SshClient.go b/services/nsxt-mp/nsx/node/services/SshClient.go new file mode 100644 index 000000000..35870a7b6 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/SshClient.go @@ -0,0 +1,286 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Ssh +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SshClient interface { + + // Read ssh service properties + // @return com.vmware.nsx.model.NodeSshServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeSshServiceProperties, error) + + // Remove a host's fingerprint from known hosts file + // + // @param knownHostParameterParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Removehostfingerprint(knownHostParameterParam model.KnownHostParameter) error + + // Restart, start or stop the ssh service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the ssh service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the ssh service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) + + // Update ssh service properties. If the start_on_boot property is updated to true, existing ssh sessions if any are stopped and the ssh service is restarted. + // + // @param nodeSshServicePropertiesParam (required) + // @return com.vmware.nsx.model.NodeSshServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(nodeSshServicePropertiesParam model.NodeSshServiceProperties) (model.NodeSshServiceProperties, error) +} + +type sshClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSshClient(connector client.Connector) *sshClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.ssh") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "removehostfingerprint": core.NewMethodIdentifier(interfaceIdentifier, "removehostfingerprint"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := sshClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *sshClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *sshClient) Get() (model.NodeSshServiceProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sshGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeSshServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sshGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.ssh", "get", inputDataValue, executionContext) + var emptyOutput model.NodeSshServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sshGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeSshServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sshClient) Removehostfingerprint(knownHostParameterParam model.KnownHostParameter) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sshRemovehostfingerprintInputType(), typeConverter) + sv.AddStructField("KnownHostParameter", knownHostParameterParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sshRemovehostfingerprintRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.ssh", "removehostfingerprint", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *sshClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sshRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sshRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.ssh", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sshRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sshClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sshStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sshStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.ssh", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sshStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sshClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sshStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sshStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.ssh", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sshStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sshClient) Update(nodeSshServicePropertiesParam model.NodeSshServiceProperties) (model.NodeSshServiceProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sshUpdateInputType(), typeConverter) + sv.AddStructField("NodeSshServiceProperties", nodeSshServicePropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeSshServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sshUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.ssh", "update", inputDataValue, executionContext) + var emptyOutput model.NodeSshServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sshUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeSshServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/SshTypes.go b/services/nsxt-mp/nsx/node/services/SshTypes.go new file mode 100644 index 000000000..85475e00c --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/SshTypes.go @@ -0,0 +1,287 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Ssh. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func sshGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sshGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeSshServicePropertiesBindingType) +} + +func sshGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/ssh", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sshRemovehostfingerprintInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["known_host_parameter"] = bindings.NewReferenceType(model.KnownHostParameterBindingType) + fieldNameMap["known_host_parameter"] = "KnownHostParameter" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sshRemovehostfingerprintOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func sshRemovehostfingerprintRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["known_host_parameter"] = bindings.NewReferenceType(model.KnownHostParameterBindingType) + fieldNameMap["known_host_parameter"] = "KnownHostParameter" + paramsTypeMap["known_host_parameter"] = bindings.NewReferenceType(model.KnownHostParameterBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=remove_host_fingerprint", + "known_host_parameter", + "POST", + "/api/v1/node/services/nsxt-mp/ssh", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sshRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sshRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func sshRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/ssh", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sshStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sshStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func sshStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/ssh", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sshStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sshStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func sshStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/ssh", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sshUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_ssh_service_properties"] = bindings.NewReferenceType(model.NodeSshServicePropertiesBindingType) + fieldNameMap["node_ssh_service_properties"] = "NodeSshServiceProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sshUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeSshServicePropertiesBindingType) +} + +func sshUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_ssh_service_properties"] = bindings.NewReferenceType(model.NodeSshServicePropertiesBindingType) + fieldNameMap["node_ssh_service_properties"] = "NodeSshServiceProperties" + paramsTypeMap["node_ssh_service_properties"] = bindings.NewReferenceType(model.NodeSshServicePropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "node_ssh_service_properties", + "PUT", + "/api/v1/node/services/nsxt-mp/ssh", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/SyslogClient.go b/services/nsxt-mp/nsx/node/services/SyslogClient.go new file mode 100644 index 000000000..26146c9b2 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/SyslogClient.go @@ -0,0 +1,207 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Syslog +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SyslogClient interface { + + // Read syslog service properties + // @return com.vmware.nsx.model.NodeServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceProperties, error) + + // Restart, start or stop the syslog service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the syslog service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the syslog service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) +} + +type syslogClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSyslogClient(connector client.Connector) *syslogClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.syslog") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := syslogClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *syslogClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *syslogClient) Get() (model.NodeServiceProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(syslogGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := syslogGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.syslog", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), syslogGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *syslogClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(syslogRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := syslogRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.syslog", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), syslogRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *syslogClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(syslogStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := syslogStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.syslog", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), syslogStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *syslogClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(syslogStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := syslogStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.syslog", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), syslogStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/SyslogTypes.go b/services/nsxt-mp/nsx/node/services/SyslogTypes.go new file mode 100644 index 000000000..755506aea --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/SyslogTypes.go @@ -0,0 +1,191 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Syslog. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func syslogGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func syslogGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServicePropertiesBindingType) +} + +func syslogGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/syslog", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func syslogRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func syslogRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func syslogRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/syslog", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func syslogStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func syslogStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func syslogStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/syslog", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func syslogStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func syslogStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func syslogStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/syslog", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/TelemetryClient.go b/services/nsxt-mp/nsx/node/services/TelemetryClient.go new file mode 100644 index 000000000..1806781fa --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/TelemetryClient.go @@ -0,0 +1,207 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Telemetry +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type TelemetryClient interface { + + // Read Telemetry service properties + // @return com.vmware.nsx.model.NodeServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceProperties, error) + + // Restart, start or stop Telemetry service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop Telemetry service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop Telemetry service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) +} + +type telemetryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewTelemetryClient(connector client.Connector) *telemetryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.telemetry") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + tIface := telemetryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &tIface +} + +func (tIface *telemetryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := tIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (tIface *telemetryClient) Get() (model.NodeServiceProperties, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(telemetryGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := telemetryGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.telemetry", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), telemetryGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *telemetryClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(telemetryRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := telemetryRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.telemetry", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), telemetryRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *telemetryClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(telemetryStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := telemetryStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.telemetry", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), telemetryStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *telemetryClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(telemetryStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := telemetryStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.telemetry", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), telemetryStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/TelemetryTypes.go b/services/nsxt-mp/nsx/node/services/TelemetryTypes.go new file mode 100644 index 000000000..85135c483 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/TelemetryTypes.go @@ -0,0 +1,191 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Telemetry. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func telemetryGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func telemetryGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServicePropertiesBindingType) +} + +func telemetryGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/telemetry", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func telemetryRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func telemetryRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func telemetryRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/telemetry", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func telemetryStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func telemetryStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func telemetryStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/telemetry", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func telemetryStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func telemetryStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func telemetryStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/telemetry", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/UiServiceClient.go b/services/nsxt-mp/nsx/node/services/UiServiceClient.go new file mode 100644 index 000000000..65c248a22 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/UiServiceClient.go @@ -0,0 +1,207 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: UiService +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UiServiceClient interface { + + // Read ui service properties + // @return com.vmware.nsx.model.NodeServiceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceProperties, error) + + // Restart, Start and Stop the ui service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, Start and Stop the ui service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, Start and Stop the ui service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) +} + +type uiServiceClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUiServiceClient(connector client.Connector) *uiServiceClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.ui_service") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := uiServiceClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *uiServiceClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *uiServiceClient) Get() (model.NodeServiceProperties, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(uiServiceGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := uiServiceGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.ui_service", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), uiServiceGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (uIface *uiServiceClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(uiServiceRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := uiServiceRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.ui_service", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), uiServiceRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (uIface *uiServiceClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(uiServiceStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := uiServiceStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.ui_service", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), uiServiceStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (uIface *uiServiceClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(uiServiceStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := uiServiceStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.ui_service", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), uiServiceStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/UiServiceTypes.go b/services/nsxt-mp/nsx/node/services/UiServiceTypes.go new file mode 100644 index 000000000..7e039c607 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/UiServiceTypes.go @@ -0,0 +1,191 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: UiService. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func uiServiceGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func uiServiceGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServicePropertiesBindingType) +} + +func uiServiceGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/ui-service", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func uiServiceRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func uiServiceRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func uiServiceRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/ui-service", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func uiServiceStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func uiServiceStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func uiServiceStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/ui-service", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func uiServiceStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func uiServiceStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func uiServiceStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/ui-service", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/applianceproxy/ApplianceproxyPackageTypes.go b/services/nsxt-mp/nsx/node/services/applianceproxy/ApplianceproxyPackageTypes.go new file mode 100644 index 000000000..02808c508 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/applianceproxy/ApplianceproxyPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.applianceproxy. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package applianceproxy diff --git a/services/nsxt-mp/nsx/node/services/applianceproxy/StatusClient.go b/services/nsxt-mp/nsx/node/services/applianceproxy/StatusClient.go new file mode 100644 index 000000000..e45bc6b0b --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/applianceproxy/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package applianceproxy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read the Appliance Proxy service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.applianceproxy.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.applianceproxy.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/applianceproxy/StatusTypes.go b/services/nsxt-mp/nsx/node/services/applianceproxy/StatusTypes.go new file mode 100644 index 000000000..a2d9548f7 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/applianceproxy/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package applianceproxy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/applianceproxy/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/async_replicator/AsyncReplicatorPackageTypes.go b/services/nsxt-mp/nsx/node/services/async_replicator/AsyncReplicatorPackageTypes.go new file mode 100644 index 000000000..726f02a84 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/async_replicator/AsyncReplicatorPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.async_replicator. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package async_replicator diff --git a/services/nsxt-mp/nsx/node/services/async_replicator/StatusClient.go b/services/nsxt-mp/nsx/node/services/async_replicator/StatusClient.go new file mode 100644 index 000000000..0c2dc40a2 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/async_replicator/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package async_replicator + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read the Async Replicator service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.async_replicator.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.async_replicator.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/async_replicator/StatusTypes.go b/services/nsxt-mp/nsx/node/services/async_replicator/StatusTypes.go new file mode 100644 index 000000000..e109af243 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/async_replicator/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package async_replicator + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/async_replicator/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/cluster_manager/ClusterManagerPackageTypes.go b/services/nsxt-mp/nsx/node/services/cluster_manager/ClusterManagerPackageTypes.go new file mode 100644 index 000000000..cef5755f5 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/cluster_manager/ClusterManagerPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.cluster_manager. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package cluster_manager diff --git a/services/nsxt-mp/nsx/node/services/cluster_manager/StatusClient.go b/services/nsxt-mp/nsx/node/services/cluster_manager/StatusClient.go new file mode 100644 index 000000000..7bb31519d --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/cluster_manager/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package cluster_manager + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read cluster boot manager service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.cluster_manager.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.cluster_manager.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/cluster_manager/StatusTypes.go b/services/nsxt-mp/nsx/node/services/cluster_manager/StatusTypes.go new file mode 100644 index 000000000..1479cd988 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/cluster_manager/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package cluster_manager + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/cluster_manager/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/cm_inventory/CmInventoryPackageTypes.go b/services/nsxt-mp/nsx/node/services/cm_inventory/CmInventoryPackageTypes.go new file mode 100644 index 000000000..e8353634b --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/cm_inventory/CmInventoryPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.cm_inventory. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package cm_inventory diff --git a/services/nsxt-mp/nsx/node/services/cm_inventory/StatusClient.go b/services/nsxt-mp/nsx/node/services/cm_inventory/StatusClient.go new file mode 100644 index 000000000..9ae4a9af5 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/cm_inventory/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package cm_inventory + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read manager service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.cm_inventory.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.cm_inventory.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/cm_inventory/StatusTypes.go b/services/nsxt-mp/nsx/node/services/cm_inventory/StatusTypes.go new file mode 100644 index 000000000..87a754ade --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/cm_inventory/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package cm_inventory + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/cm-inventory/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/controller/ControllerCertificateClient.go b/services/nsxt-mp/nsx/node/services/controller/ControllerCertificateClient.go new file mode 100644 index 000000000..753cc9d28 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/controller/ControllerCertificateClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ControllerCertificate +// Used by client-side stubs. + +package controller + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ControllerCertificateClient interface { + + // Read controller server certificate properties + // @return com.vmware.nsx.model.CertificateKeyPair + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.CertificateKeyPair, error) +} + +type controllerCertificateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewControllerCertificateClient(connector client.Connector) *controllerCertificateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.controller.controller_certificate") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := controllerCertificateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *controllerCertificateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *controllerCertificateClient) Get() (model.CertificateKeyPair, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(controllerCertificateGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CertificateKeyPair + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := controllerCertificateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.controller.controller_certificate", "get", inputDataValue, executionContext) + var emptyOutput model.CertificateKeyPair + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), controllerCertificateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CertificateKeyPair), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/controller/ControllerCertificateTypes.go b/services/nsxt-mp/nsx/node/services/controller/ControllerCertificateTypes.go new file mode 100644 index 000000000..6b702e7fc --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/controller/ControllerCertificateTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ControllerCertificate. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package controller + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func controllerCertificateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func controllerCertificateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CertificateKeyPairBindingType) +} + +func controllerCertificateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/controller/controller-certificate", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/controller/ControllerPackageTypes.go b/services/nsxt-mp/nsx/node/services/controller/ControllerPackageTypes.go new file mode 100644 index 000000000..38020e751 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/controller/ControllerPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.controller. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package controller diff --git a/services/nsxt-mp/nsx/node/services/controller/ProfilerClient.go b/services/nsxt-mp/nsx/node/services/controller/ProfilerClient.go new file mode 100644 index 000000000..c79d99aa3 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/controller/ProfilerClient.go @@ -0,0 +1,123 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Profiler +// Used by client-side stubs. + +package controller + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ProfilerClient interface { + + // Get the status (Enabled/Disabled) of controller profiler + // @return com.vmware.nsx.model.ControllerProfilerProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.ControllerProfilerProperties, error) + + // Enable or disable controller profiler + // + // @param controllerProfilerPropertiesParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(controllerProfilerPropertiesParam model.ControllerProfilerProperties) error +} + +type profilerClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewProfilerClient(connector client.Connector) *profilerClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.controller.profiler") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + pIface := profilerClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &pIface +} + +func (pIface *profilerClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := pIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (pIface *profilerClient) Get() (model.ControllerProfilerProperties, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(profilerGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ControllerProfilerProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := profilerGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.controller.profiler", "get", inputDataValue, executionContext) + var emptyOutput model.ControllerProfilerProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), profilerGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ControllerProfilerProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *profilerClient) Update(controllerProfilerPropertiesParam model.ControllerProfilerProperties) error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(profilerUpdateInputType(), typeConverter) + sv.AddStructField("ControllerProfilerProperties", controllerProfilerPropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := profilerUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.controller.profiler", "update", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/controller/ProfilerTypes.go b/services/nsxt-mp/nsx/node/services/controller/ProfilerTypes.go new file mode 100644 index 000000000..11685f70c --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/controller/ProfilerTypes.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Profiler. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package controller + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func profilerGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func profilerGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ControllerProfilerPropertiesBindingType) +} + +func profilerGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/controller/profiler", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func profilerUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["controller_profiler_properties"] = bindings.NewReferenceType(model.ControllerProfilerPropertiesBindingType) + fieldNameMap["controller_profiler_properties"] = "ControllerProfilerProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func profilerUpdateOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func profilerUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["controller_profiler_properties"] = bindings.NewReferenceType(model.ControllerProfilerPropertiesBindingType) + fieldNameMap["controller_profiler_properties"] = "ControllerProfilerProperties" + paramsTypeMap["controller_profiler_properties"] = bindings.NewReferenceType(model.ControllerProfilerPropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "controller_profiler_properties", + "PUT", + "/api/v1/node/services/nsxt-mp/controller/profiler", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/controller/StatusClient.go b/services/nsxt-mp/nsx/node/services/controller/StatusClient.go new file mode 100644 index 000000000..43e1924a7 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/controller/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package controller + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read controller service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.controller.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.controller.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/controller/StatusTypes.go b/services/nsxt-mp/nsx/node/services/controller/StatusTypes.go new file mode 100644 index 000000000..99ebb000a --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/controller/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package controller + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/controller/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/http/HttpPackageTypes.go b/services/nsxt-mp/nsx/node/services/http/HttpPackageTypes.go new file mode 100644 index 000000000..6ca2e619e --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/http/HttpPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.http. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package http diff --git a/services/nsxt-mp/nsx/node/services/http/StatusClient.go b/services/nsxt-mp/nsx/node/services/http/StatusClient.go new file mode 100644 index 000000000..4d6a81b09 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/http/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package http + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read http service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.http.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.http.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/http/StatusTypes.go b/services/nsxt-mp/nsx/node/services/http/StatusTypes.go new file mode 100644 index 000000000..4ab701e4a --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/http/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package http + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/http/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/idps_reporting/IdpsReportingPackageTypes.go b/services/nsxt-mp/nsx/node/services/idps_reporting/IdpsReportingPackageTypes.go new file mode 100644 index 000000000..7ac4fec9c --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/idps_reporting/IdpsReportingPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.idps_reporting. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package idps_reporting diff --git a/services/nsxt-mp/nsx/node/services/idps_reporting/StatusClient.go b/services/nsxt-mp/nsx/node/services/idps_reporting/StatusClient.go new file mode 100644 index 000000000..25f00b340 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/idps_reporting/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package idps_reporting + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read the idps-reporting service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.idps_reporting.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.idps_reporting.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/idps_reporting/StatusTypes.go b/services/nsxt-mp/nsx/node/services/idps_reporting/StatusTypes.go new file mode 100644 index 000000000..add8aa002 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/idps_reporting/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package idps_reporting + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/idps-reporting/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/install_upgrade/InstallUpgradePackageTypes.go b/services/nsxt-mp/nsx/node/services/install_upgrade/InstallUpgradePackageTypes.go new file mode 100644 index 000000000..7f188b33c --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/install_upgrade/InstallUpgradePackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.install_upgrade. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package install_upgrade diff --git a/services/nsxt-mp/nsx/node/services/install_upgrade/StatusClient.go b/services/nsxt-mp/nsx/node/services/install_upgrade/StatusClient.go new file mode 100644 index 000000000..a3fa251fa --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/install_upgrade/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package install_upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read NSX install-upgrade service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.install_upgrade.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.install_upgrade.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/install_upgrade/StatusTypes.go b/services/nsxt-mp/nsx/node/services/install_upgrade/StatusTypes.go new file mode 100644 index 000000000..f4908837f --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/install_upgrade/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package install_upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/install-upgrade/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/install_upgrade/UcStateClient.go b/services/nsxt-mp/nsx/node/services/install_upgrade/UcStateClient.go new file mode 100644 index 000000000..8a1d31751 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/install_upgrade/UcStateClient.go @@ -0,0 +1,84 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: UcState +// Used by client-side stubs. + +package install_upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UcStateClient interface { + + // Update UC state properties + // + // @param ucStatePropertiesParam (required) + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(ucStatePropertiesParam model.UcStateProperties) error +} + +type ucStateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUcStateClient(connector client.Connector) *ucStateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.install_upgrade.uc_state") + methodIdentifiers := map[string]core.MethodIdentifier{ + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := ucStateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *ucStateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *ucStateClient) Update(ucStatePropertiesParam model.UcStateProperties) error { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ucStateUpdateInputType(), typeConverter) + sv.AddStructField("UcStateProperties", ucStatePropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ucStateUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.install_upgrade.uc_state", "update", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/install_upgrade/UcStateTypes.go b/services/nsxt-mp/nsx/node/services/install_upgrade/UcStateTypes.go new file mode 100644 index 000000000..05387dd11 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/install_upgrade/UcStateTypes.go @@ -0,0 +1,67 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: UcState. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package install_upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func ucStateUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["uc_state_properties"] = bindings.NewReferenceType(model.UcStatePropertiesBindingType) + fieldNameMap["uc_state_properties"] = "UcStateProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ucStateUpdateOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ucStateUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["uc_state_properties"] = bindings.NewReferenceType(model.UcStatePropertiesBindingType) + fieldNameMap["uc_state_properties"] = "UcStateProperties" + paramsTypeMap["uc_state_properties"] = bindings.NewReferenceType(model.UcStatePropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "uc_state_properties", + "PUT", + "/api/v1/node/services/nsxt-mp/install-upgrade/uc-state", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/liagent/LiagentPackageTypes.go b/services/nsxt-mp/nsx/node/services/liagent/LiagentPackageTypes.go new file mode 100644 index 000000000..3dc96ff10 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/liagent/LiagentPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.liagent. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package liagent diff --git a/services/nsxt-mp/nsx/node/services/liagent/StatusClient.go b/services/nsxt-mp/nsx/node/services/liagent/StatusClient.go new file mode 100644 index 000000000..123a1642f --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/liagent/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package liagent + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read liagent service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.liagent.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.liagent.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/liagent/StatusTypes.go b/services/nsxt-mp/nsx/node/services/liagent/StatusTypes.go new file mode 100644 index 000000000..a8610e3d3 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/liagent/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package liagent + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/liagent/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/manager/ManagerPackageTypes.go b/services/nsxt-mp/nsx/node/services/manager/ManagerPackageTypes.go new file mode 100644 index 000000000..195c9b886 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/manager/ManagerPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.manager. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package manager diff --git a/services/nsxt-mp/nsx/node/services/manager/StatusClient.go b/services/nsxt-mp/nsx/node/services/manager/StatusClient.go new file mode 100644 index 000000000..0426c7de6 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/manager/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package manager + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.manager.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.manager.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/manager/StatusTypes.go b/services/nsxt-mp/nsx/node/services/manager/StatusTypes.go new file mode 100644 index 000000000..ef7e4bbb7 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/manager/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package manager + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/manager/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/messaging_manager/MessagingManagerPackageTypes.go b/services/nsxt-mp/nsx/node/services/messaging_manager/MessagingManagerPackageTypes.go new file mode 100644 index 000000000..0e5512981 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/messaging_manager/MessagingManagerPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.messaging_manager. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package messaging_manager diff --git a/services/nsxt-mp/nsx/node/services/messaging_manager/StatusClient.go b/services/nsxt-mp/nsx/node/services/messaging_manager/StatusClient.go new file mode 100644 index 000000000..af95868f5 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/messaging_manager/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package messaging_manager + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read NSX Messaging Manager service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.messaging_manager.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.messaging_manager.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/messaging_manager/StatusTypes.go b/services/nsxt-mp/nsx/node/services/messaging_manager/StatusTypes.go new file mode 100644 index 000000000..69567b00d --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/messaging_manager/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package messaging_manager + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/messaging-manager/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/migration_coordinator/MigrationCoordinatorPackageTypes.go b/services/nsxt-mp/nsx/node/services/migration_coordinator/MigrationCoordinatorPackageTypes.go new file mode 100644 index 000000000..4c74e80a4 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/migration_coordinator/MigrationCoordinatorPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.migration_coordinator. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration_coordinator diff --git a/services/nsxt-mp/nsx/node/services/migration_coordinator/StatusClient.go b/services/nsxt-mp/nsx/node/services/migration_coordinator/StatusClient.go new file mode 100644 index 000000000..e8a5ecffb --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/migration_coordinator/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package migration_coordinator + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read migration coordinator service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.migration_coordinator.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.migration_coordinator.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/migration_coordinator/StatusTypes.go b/services/nsxt-mp/nsx/node/services/migration_coordinator/StatusTypes.go new file mode 100644 index 000000000..b749d5d3d --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/migration_coordinator/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package migration_coordinator + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/migration-coordinator/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/node_mgmt/NodeMgmtPackageTypes.go b/services/nsxt-mp/nsx/node/services/node_mgmt/NodeMgmtPackageTypes.go new file mode 100644 index 000000000..0b9bd586f --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/node_mgmt/NodeMgmtPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.node_mgmt. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package node_mgmt diff --git a/services/nsxt-mp/nsx/node/services/node_mgmt/StatusClient.go b/services/nsxt-mp/nsx/node/services/node_mgmt/StatusClient.go new file mode 100644 index 000000000..00013a555 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/node_mgmt/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package node_mgmt + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read appliance management service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.node_mgmt.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.node_mgmt.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/node_mgmt/StatusTypes.go b/services/nsxt-mp/nsx/node/services/node_mgmt/StatusTypes.go new file mode 100644 index 000000000..bb848d4b3 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/node_mgmt/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package node_mgmt + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/node-mgmt/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/node_stats/NodeStatsPackageTypes.go b/services/nsxt-mp/nsx/node/services/node_stats/NodeStatsPackageTypes.go new file mode 100644 index 000000000..959352e6c --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/node_stats/NodeStatsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.node_stats. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package node_stats diff --git a/services/nsxt-mp/nsx/node/services/node_stats/StatusClient.go b/services/nsxt-mp/nsx/node/services/node_stats/StatusClient.go new file mode 100644 index 000000000..b849eefd6 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/node_stats/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package node_stats + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read NSX node-stats service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.node_stats.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.node_stats.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/node_stats/StatusTypes.go b/services/nsxt-mp/nsx/node/services/node_stats/StatusTypes.go new file mode 100644 index 000000000..32e7948d7 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/node_stats/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package node_stats + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/node-stats/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/nsx_message_bus/NsxMessageBusPackageTypes.go b/services/nsxt-mp/nsx/node/services/nsx_message_bus/NsxMessageBusPackageTypes.go new file mode 100644 index 000000000..af8c1c0a5 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/nsx_message_bus/NsxMessageBusPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.nsx_message_bus. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx_message_bus diff --git a/services/nsxt-mp/nsx/node/services/nsx_message_bus/StatusClient.go b/services/nsxt-mp/nsx/node/services/nsx_message_bus/StatusClient.go new file mode 100644 index 000000000..9f37ad91b --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/nsx_message_bus/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package nsx_message_bus + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read NSX Message Bus service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.nsx_message_bus.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.nsx_message_bus.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/nsx_message_bus/StatusTypes.go b/services/nsxt-mp/nsx/node/services/nsx_message_bus/StatusTypes.go new file mode 100644 index 000000000..de1ddd5a8 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/nsx_message_bus/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx_message_bus + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/nsx-message-bus/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/nsx_platform_client/NsxPlatformClientPackageTypes.go b/services/nsxt-mp/nsx/node/services/nsx_platform_client/NsxPlatformClientPackageTypes.go new file mode 100644 index 000000000..c1a99e709 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/nsx_platform_client/NsxPlatformClientPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.nsx_platform_client. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx_platform_client diff --git a/services/nsxt-mp/nsx/node/services/nsx_platform_client/StatusClient.go b/services/nsxt-mp/nsx/node/services/nsx_platform_client/StatusClient.go new file mode 100644 index 000000000..b22571d4b --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/nsx_platform_client/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package nsx_platform_client + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read NSX Platform Client service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.nsx_platform_client.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.nsx_platform_client.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/nsx_platform_client/StatusTypes.go b/services/nsxt-mp/nsx/node/services/nsx_platform_client/StatusTypes.go new file mode 100644 index 000000000..75a7aa57f --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/nsx_platform_client/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx_platform_client + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/nsx-platform-client/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/nsx_upgrade_agent/NsxUpgradeAgentPackageTypes.go b/services/nsxt-mp/nsx/node/services/nsx_upgrade_agent/NsxUpgradeAgentPackageTypes.go new file mode 100644 index 000000000..2e557b276 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/nsx_upgrade_agent/NsxUpgradeAgentPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.nsx_upgrade_agent. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx_upgrade_agent diff --git a/services/nsxt-mp/nsx/node/services/nsx_upgrade_agent/StatusClient.go b/services/nsxt-mp/nsx/node/services/nsx_upgrade_agent/StatusClient.go new file mode 100644 index 000000000..362128c00 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/nsx_upgrade_agent/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package nsx_upgrade_agent + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read Nsx upgrade agent service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.nsx_upgrade_agent.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.nsx_upgrade_agent.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/nsx_upgrade_agent/StatusTypes.go b/services/nsxt-mp/nsx/node/services/nsx_upgrade_agent/StatusTypes.go new file mode 100644 index 000000000..4972c4b4b --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/nsx_upgrade_agent/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nsx_upgrade_agent + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/nsx-upgrade-agent/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/ntp/NtpPackageTypes.go b/services/nsxt-mp/nsx/node/services/ntp/NtpPackageTypes.go new file mode 100644 index 000000000..31f1d7537 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/ntp/NtpPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.ntp. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ntp diff --git a/services/nsxt-mp/nsx/node/services/ntp/StatusClient.go b/services/nsxt-mp/nsx/node/services/ntp/StatusClient.go new file mode 100644 index 000000000..8249037ba --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/ntp/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package ntp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read NTP service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.ntp.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.ntp.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/ntp/StatusTypes.go b/services/nsxt-mp/nsx/node/services/ntp/StatusTypes.go new file mode 100644 index 000000000..4657da0e0 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/ntp/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ntp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/ntp/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/policy/PolicyPackageTypes.go b/services/nsxt-mp/nsx/node/services/policy/PolicyPackageTypes.go new file mode 100644 index 000000000..728198a30 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/policy/PolicyPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.policy. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package policy diff --git a/services/nsxt-mp/nsx/node/services/policy/StatusClient.go b/services/nsxt-mp/nsx/node/services/policy/StatusClient.go new file mode 100644 index 000000000..0851899c2 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/policy/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package policy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.policy.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.policy.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/policy/StatusTypes.go b/services/nsxt-mp/nsx/node/services/policy/StatusTypes.go new file mode 100644 index 000000000..9e3e41c7f --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/policy/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package policy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/policy/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/search/SearchPackageTypes.go b/services/nsxt-mp/nsx/node/services/search/SearchPackageTypes.go new file mode 100644 index 000000000..77e10b2f2 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/search/SearchPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.search. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package search diff --git a/services/nsxt-mp/nsx/node/services/search/StatusClient.go b/services/nsxt-mp/nsx/node/services/search/StatusClient.go new file mode 100644 index 000000000..65172febb --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/search/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package search + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read NSX Search service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.search.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.search.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/search/StatusTypes.go b/services/nsxt-mp/nsx/node/services/search/StatusTypes.go new file mode 100644 index 000000000..f98e42eed --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/search/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package search + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/search/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/snmp/SnmpPackageTypes.go b/services/nsxt-mp/nsx/node/services/snmp/SnmpPackageTypes.go new file mode 100644 index 000000000..86c73a2d9 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/snmp/SnmpPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.snmp. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package snmp diff --git a/services/nsxt-mp/nsx/node/services/snmp/StatusClient.go b/services/nsxt-mp/nsx/node/services/snmp/StatusClient.go new file mode 100644 index 000000000..d35b5ab14 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/snmp/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package snmp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read SNMP service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.snmp.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.snmp.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/snmp/StatusTypes.go b/services/nsxt-mp/nsx/node/services/snmp/StatusTypes.go new file mode 100644 index 000000000..8259fc7ed --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/snmp/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package snmp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/snmp/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/snmp/V3EngineIdClient.go b/services/nsxt-mp/nsx/node/services/snmp/V3EngineIdClient.go new file mode 100644 index 000000000..2351ca1b6 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/snmp/V3EngineIdClient.go @@ -0,0 +1,130 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: V3EngineId +// Used by client-side stubs. + +package snmp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type V3EngineIdClient interface { + + // Read SNMP V3 Engine ID + // @return com.vmware.nsx.model.NodeSnmpV3EngineID + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeSnmpV3EngineID, error) + + // Update SNMP V3 Engine ID + // + // @param nodeSnmpV3EngineIDParam (required) + // @return com.vmware.nsx.model.NodeSnmpV3EngineID + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(nodeSnmpV3EngineIDParam model.NodeSnmpV3EngineID) (model.NodeSnmpV3EngineID, error) +} + +type v3EngineIdClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewV3EngineIdClient(connector client.Connector) *v3EngineIdClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.snmp.v3_engine_id") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + vIface := v3EngineIdClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &vIface +} + +func (vIface *v3EngineIdClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := vIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (vIface *v3EngineIdClient) Get() (model.NodeSnmpV3EngineID, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(v3EngineIdGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeSnmpV3EngineID + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := v3EngineIdGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.snmp.v3_engine_id", "get", inputDataValue, executionContext) + var emptyOutput model.NodeSnmpV3EngineID + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), v3EngineIdGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeSnmpV3EngineID), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (vIface *v3EngineIdClient) Update(nodeSnmpV3EngineIDParam model.NodeSnmpV3EngineID) (model.NodeSnmpV3EngineID, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(v3EngineIdUpdateInputType(), typeConverter) + sv.AddStructField("NodeSnmpV3EngineID", nodeSnmpV3EngineIDParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeSnmpV3EngineID + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := v3EngineIdUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.snmp.v3_engine_id", "update", inputDataValue, executionContext) + var emptyOutput model.NodeSnmpV3EngineID + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), v3EngineIdUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeSnmpV3EngineID), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/snmp/V3EngineIdTypes.go b/services/nsxt-mp/nsx/node/services/snmp/V3EngineIdTypes.go new file mode 100644 index 000000000..fe5f267f9 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/snmp/V3EngineIdTypes.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: V3EngineId. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package snmp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func v3EngineIdGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func v3EngineIdGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeSnmpV3EngineIDBindingType) +} + +func v3EngineIdGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/snmp/v3-engine-id", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func v3EngineIdUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_snmp_v3_engine_ID"] = bindings.NewReferenceType(model.NodeSnmpV3EngineIDBindingType) + fieldNameMap["node_snmp_v3_engine_ID"] = "NodeSnmpV3EngineID" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func v3EngineIdUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeSnmpV3EngineIDBindingType) +} + +func v3EngineIdUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_snmp_v3_engine_ID"] = bindings.NewReferenceType(model.NodeSnmpV3EngineIDBindingType) + fieldNameMap["node_snmp_v3_engine_ID"] = "NodeSnmpV3EngineID" + paramsTypeMap["node_snmp_v3_engine_ID"] = bindings.NewReferenceType(model.NodeSnmpV3EngineIDBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "node_snmp_v3_engine_ID", + "PUT", + "/api/v1/node/services/nsxt-mp/snmp/v3-engine-id", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/ssh/NotifyMpaClient.go b/services/nsxt-mp/nsx/node/services/ssh/NotifyMpaClient.go new file mode 100644 index 000000000..794783ca8 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/ssh/NotifyMpaClient.go @@ -0,0 +1,167 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Notify_mpa +// Used by client-side stubs. + +package ssh + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type Notify_mpaClient interface { + + // Restart, start or stop the ssh service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the ssh service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() (model.NodeServiceStatusProperties, error) + + // Restart, start or stop the ssh service + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stop() (model.NodeServiceStatusProperties, error) +} + +type notify_mpaClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNotify_mpaClient(connector client.Connector) *notify_mpaClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.ssh.notify_mpa") + methodIdentifiers := map[string]core.MethodIdentifier{ + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "stop": core.NewMethodIdentifier(interfaceIdentifier, "stop"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := notify_mpaClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *notify_mpaClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *notify_mpaClient) Restart() (model.NodeServiceStatusProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(notifyMpaRestartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := notifyMpaRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.ssh.notify_mpa", "restart", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), notifyMpaRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *notify_mpaClient) Start() (model.NodeServiceStatusProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(notifyMpaStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := notifyMpaStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.ssh.notify_mpa", "start", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), notifyMpaStartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *notify_mpaClient) Stop() (model.NodeServiceStatusProperties, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(notifyMpaStopInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := notifyMpaStopRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.ssh.notify_mpa", "stop", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), notifyMpaStopOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/ssh/NotifyMpaTypes.go b/services/nsxt-mp/nsx/node/services/ssh/NotifyMpaTypes.go new file mode 100644 index 000000000..a80120de6 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/ssh/NotifyMpaTypes.go @@ -0,0 +1,148 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Notify_mpa. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ssh + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func notifyMpaRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func notifyMpaRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func notifyMpaRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/node/services/nsxt-mp/ssh/notify_mpa", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func notifyMpaStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func notifyMpaStartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func notifyMpaStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/node/services/nsxt-mp/ssh/notify_mpa", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func notifyMpaStopInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func notifyMpaStopOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func notifyMpaStopRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stop", + "", + "POST", + "/api/v1/node/services/nsxt-mp/ssh/notify_mpa", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/ssh/SshPackageTypes.go b/services/nsxt-mp/nsx/node/services/ssh/SshPackageTypes.go new file mode 100644 index 000000000..1252be9a7 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/ssh/SshPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.ssh. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ssh diff --git a/services/nsxt-mp/nsx/node/services/ssh/StatusClient.go b/services/nsxt-mp/nsx/node/services/ssh/StatusClient.go new file mode 100644 index 000000000..23aa6d036 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/ssh/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package ssh + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read ssh service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.ssh.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.ssh.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/ssh/StatusTypes.go b/services/nsxt-mp/nsx/node/services/ssh/StatusTypes.go new file mode 100644 index 000000000..a58bcbf65 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/ssh/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ssh + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/ssh/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/syslog/ExportersClient.go b/services/nsxt-mp/nsx/node/services/syslog/ExportersClient.go new file mode 100644 index 000000000..2abfc128d --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/syslog/ExportersClient.go @@ -0,0 +1,276 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Exporters +// Used by client-side stubs. + +package syslog + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ExportersClient interface { + + // Adds a rule for exporting syslog information to a specified server. The required parameters are the rule name (exporter_name); severity level (emerg, alert, crit, and so on); transmission protocol (TCP or UDP); and server IP address or hostname. The optional parameters are the syslog port number, which can be 1 through 65,535 (514, by default); facility level to use when logging messages to syslog (kern, user, mail, and so on); and message IDs (msgids), which identify the types of messages to export. + // + // @param nodeSyslogExporterPropertiesParam (required) + // @return com.vmware.nsx.model.NodeSyslogExporterProperties + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(nodeSyslogExporterPropertiesParam model.NodeSyslogExporterProperties) (model.NodeSyslogExporterProperties, error) + + // Removes all syslog exporter rules. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete() error + + // Removes a specified rule from the collection of syslog exporter rules. + // + // @param exporterNameParam Name of syslog exporter to delete (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete0(exporterNameParam string) error + + // Returns information about a specific syslog collection point. + // + // @param exporterNameParam Name of syslog exporter (required) + // @return com.vmware.nsx.model.NodeSyslogExporterProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(exporterNameParam string) (model.NodeSyslogExporterProperties, error) + + // Returns the collection of registered syslog exporter rules, if any. The rules specify the collector IP address and port, and the protocol to use. + // @return com.vmware.nsx.model.NodeSyslogExporterPropertiesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.NodeSyslogExporterPropertiesListResult, error) + + // Collect iptables rules needed for all existing syslog exporters and verify if the existing iptables rules are the same. If not, remove the stale rules and add the new rules to make sure all exporters work properly. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Verify() error +} + +type exportersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewExportersClient(connector client.Connector) *exportersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.syslog.exporters") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "delete_0": core.NewMethodIdentifier(interfaceIdentifier, "delete_0"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "verify": core.NewMethodIdentifier(interfaceIdentifier, "verify"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + eIface := exportersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &eIface +} + +func (eIface *exportersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := eIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (eIface *exportersClient) Create(nodeSyslogExporterPropertiesParam model.NodeSyslogExporterProperties) (model.NodeSyslogExporterProperties, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(exportersCreateInputType(), typeConverter) + sv.AddStructField("NodeSyslogExporterProperties", nodeSyslogExporterPropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeSyslogExporterProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := exportersCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.syslog.exporters", "create", inputDataValue, executionContext) + var emptyOutput model.NodeSyslogExporterProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), exportersCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeSyslogExporterProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *exportersClient) Delete() error { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(exportersDeleteInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := exportersDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.syslog.exporters", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (eIface *exportersClient) Delete0(exporterNameParam string) error { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(exportersDelete0InputType(), typeConverter) + sv.AddStructField("ExporterName", exporterNameParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := exportersDelete0RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.syslog.exporters", "delete_0", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (eIface *exportersClient) Get(exporterNameParam string) (model.NodeSyslogExporterProperties, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(exportersGetInputType(), typeConverter) + sv.AddStructField("ExporterName", exporterNameParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeSyslogExporterProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := exportersGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.syslog.exporters", "get", inputDataValue, executionContext) + var emptyOutput model.NodeSyslogExporterProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), exportersGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeSyslogExporterProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *exportersClient) List() (model.NodeSyslogExporterPropertiesListResult, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(exportersListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeSyslogExporterPropertiesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := exportersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.syslog.exporters", "list", inputDataValue, executionContext) + var emptyOutput model.NodeSyslogExporterPropertiesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), exportersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeSyslogExporterPropertiesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *exportersClient) Verify() error { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(exportersVerifyInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := exportersVerifyRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.syslog.exporters", "verify", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/syslog/ExportersTypes.go b/services/nsxt-mp/nsx/node/services/syslog/ExportersTypes.go new file mode 100644 index 000000000..a4d41fe3d --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/syslog/ExportersTypes.go @@ -0,0 +1,296 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Exporters. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package syslog + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func exportersCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_syslog_exporter_properties"] = bindings.NewReferenceType(model.NodeSyslogExporterPropertiesBindingType) + fieldNameMap["node_syslog_exporter_properties"] = "NodeSyslogExporterProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func exportersCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeSyslogExporterPropertiesBindingType) +} + +func exportersCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_syslog_exporter_properties"] = bindings.NewReferenceType(model.NodeSyslogExporterPropertiesBindingType) + fieldNameMap["node_syslog_exporter_properties"] = "NodeSyslogExporterProperties" + paramsTypeMap["node_syslog_exporter_properties"] = bindings.NewReferenceType(model.NodeSyslogExporterPropertiesBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "node_syslog_exporter_properties", + "POST", + "/api/v1/node/services/nsxt-mp/syslog/exporters", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func exportersDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func exportersDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func exportersDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/node/services/nsxt-mp/syslog/exporters", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func exportersDelete0InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["exporter_name"] = bindings.NewStringType() + fieldNameMap["exporter_name"] = "ExporterName" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func exportersDelete0OutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func exportersDelete0RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["exporter_name"] = bindings.NewStringType() + fieldNameMap["exporter_name"] = "ExporterName" + paramsTypeMap["exporter_name"] = bindings.NewStringType() + paramsTypeMap["exporterName"] = bindings.NewStringType() + pathParams["exporter_name"] = "exporterName" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/node/services/nsxt-mp/syslog/exporters/{exporterName}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func exportersGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["exporter_name"] = bindings.NewStringType() + fieldNameMap["exporter_name"] = "ExporterName" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func exportersGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeSyslogExporterPropertiesBindingType) +} + +func exportersGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["exporter_name"] = bindings.NewStringType() + fieldNameMap["exporter_name"] = "ExporterName" + paramsTypeMap["exporter_name"] = bindings.NewStringType() + paramsTypeMap["exporterName"] = bindings.NewStringType() + pathParams["exporter_name"] = "exporterName" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/syslog/exporters/{exporterName}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func exportersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func exportersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeSyslogExporterPropertiesListResultBindingType) +} + +func exportersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/syslog/exporters", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func exportersVerifyInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func exportersVerifyOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func exportersVerifyRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=verify", + "", + "POST", + "/api/v1/node/services/nsxt-mp/syslog/exporters", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/syslog/StatusClient.go b/services/nsxt-mp/nsx/node/services/syslog/StatusClient.go new file mode 100644 index 000000000..6e8d3a09b --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/syslog/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package syslog + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read syslog service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.syslog.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.syslog.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/syslog/StatusTypes.go b/services/nsxt-mp/nsx/node/services/syslog/StatusTypes.go new file mode 100644 index 000000000..5e778318c --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/syslog/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package syslog + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/syslog/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/syslog/SyslogPackageTypes.go b/services/nsxt-mp/nsx/node/services/syslog/SyslogPackageTypes.go new file mode 100644 index 000000000..302bd3d4e --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/syslog/SyslogPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.syslog. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package syslog diff --git a/services/nsxt-mp/nsx/node/services/telemetry/StatusClient.go b/services/nsxt-mp/nsx/node/services/telemetry/StatusClient.go new file mode 100644 index 000000000..de87cb0d8 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/telemetry/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package telemetry + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read Telemetry service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.telemetry.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.telemetry.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/telemetry/StatusTypes.go b/services/nsxt-mp/nsx/node/services/telemetry/StatusTypes.go new file mode 100644 index 000000000..df70d829a --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/telemetry/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package telemetry + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/telemetry/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/telemetry/TelemetryPackageTypes.go b/services/nsxt-mp/nsx/node/services/telemetry/TelemetryPackageTypes.go new file mode 100644 index 000000000..370db410e --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/telemetry/TelemetryPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.telemetry. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package telemetry diff --git a/services/nsxt-mp/nsx/node/services/ui_service/StatusClient.go b/services/nsxt-mp/nsx/node/services/ui_service/StatusClient.go new file mode 100644 index 000000000..320de3594 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/ui_service/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package ui_service + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Read ui service status + // @return com.vmware.nsx.model.NodeServiceStatusProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeServiceStatusProperties, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.services.ui_service.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.NodeServiceStatusProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeServiceStatusProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.services.ui_service.status", "get", inputDataValue, executionContext) + var emptyOutput model.NodeServiceStatusProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeServiceStatusProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/services/ui_service/StatusTypes.go b/services/nsxt-mp/nsx/node/services/ui_service/StatusTypes.go new file mode 100644 index 000000000..61bc65008 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/ui_service/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ui_service + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeServiceStatusPropertiesBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/services/nsxt-mp/ui-service/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/services/ui_service/UiServicePackageTypes.go b/services/nsxt-mp/nsx/node/services/ui_service/UiServicePackageTypes.go new file mode 100644 index 000000000..5b8600a54 --- /dev/null +++ b/services/nsxt-mp/nsx/node/services/ui_service/UiServicePackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.services.ui_service. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ui_service diff --git a/services/nsxt-mp/nsx/node/tasks/ResponseClient.go b/services/nsxt-mp/nsx/node/tasks/ResponseClient.go new file mode 100644 index 000000000..374ea48b0 --- /dev/null +++ b/services/nsxt-mp/nsx/node/tasks/ResponseClient.go @@ -0,0 +1,83 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Response +// Used by client-side stubs. + +package tasks + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ResponseClient interface { + + // Read asynchronous task response + // + // @param taskIdParam ID of task to read (required) + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error, Bad Gateway + // @throws NotFound Not Found, Gone + Get(taskIdParam string) error +} + +type responseClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewResponseClient(connector client.Connector) *responseClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.tasks.response") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := responseClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *responseClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *responseClient) Get(taskIdParam string) error { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(responseGetInputType(), typeConverter) + sv.AddStructField("TaskId", taskIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := responseGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.tasks.response", "get", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/tasks/ResponseTypes.go b/services/nsxt-mp/nsx/node/tasks/ResponseTypes.go new file mode 100644 index 000000000..82015a8fe --- /dev/null +++ b/services/nsxt-mp/nsx/node/tasks/ResponseTypes.go @@ -0,0 +1,68 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Response. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package tasks + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "reflect" +) + +func responseGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["task_id"] = bindings.NewStringType() + fieldNameMap["task_id"] = "TaskId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func responseGetOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func responseGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["task_id"] = bindings.NewStringType() + fieldNameMap["task_id"] = "TaskId" + paramsTypeMap["task_id"] = bindings.NewStringType() + paramsTypeMap["taskId"] = bindings.NewStringType() + pathParams["task_id"] = "taskId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/tasks/{taskId}/response", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/tasks/TasksPackageTypes.go b/services/nsxt-mp/nsx/node/tasks/TasksPackageTypes.go new file mode 100644 index 000000000..7bc5a0b0b --- /dev/null +++ b/services/nsxt-mp/nsx/node/tasks/TasksPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.tasks. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package tasks diff --git a/services/nsxt-mp/nsx/node/upgrade/PerformtaskClient.go b/services/nsxt-mp/nsx/node/upgrade/PerformtaskClient.go new file mode 100644 index 000000000..6a00c96d2 --- /dev/null +++ b/services/nsxt-mp/nsx/node/upgrade/PerformtaskClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Performtask +// Used by client-side stubs. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type PerformtaskClient interface { + + // Execute upgrade task. + // + // @param upgradeTaskPropertiesParam (required) + // @param actionParam Upgrade task (optional) + // @return com.vmware.nsx.model.UpgradeTaskProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(upgradeTaskPropertiesParam model.UpgradeTaskProperties, actionParam *string) (model.UpgradeTaskProperties, error) +} + +type performtaskClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewPerformtaskClient(connector client.Connector) *performtaskClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.upgrade.performtask") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + pIface := performtaskClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &pIface +} + +func (pIface *performtaskClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := pIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (pIface *performtaskClient) Create(upgradeTaskPropertiesParam model.UpgradeTaskProperties, actionParam *string) (model.UpgradeTaskProperties, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(performtaskCreateInputType(), typeConverter) + sv.AddStructField("UpgradeTaskProperties", upgradeTaskPropertiesParam) + sv.AddStructField("Action", actionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeTaskProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := performtaskCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.upgrade.performtask", "create", inputDataValue, executionContext) + var emptyOutput model.UpgradeTaskProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), performtaskCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeTaskProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/upgrade/PerformtaskTypes.go b/services/nsxt-mp/nsx/node/upgrade/PerformtaskTypes.go new file mode 100644 index 000000000..a8890be03 --- /dev/null +++ b/services/nsxt-mp/nsx/node/upgrade/PerformtaskTypes.go @@ -0,0 +1,73 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Performtask. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func performtaskCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["upgrade_task_properties"] = bindings.NewReferenceType(model.UpgradeTaskPropertiesBindingType) + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["upgrade_task_properties"] = "UpgradeTaskProperties" + fieldNameMap["action"] = "Action" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func performtaskCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeTaskPropertiesBindingType) +} + +func performtaskCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["upgrade_task_properties"] = bindings.NewReferenceType(model.UpgradeTaskPropertiesBindingType) + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["upgrade_task_properties"] = "UpgradeTaskProperties" + fieldNameMap["action"] = "Action" + paramsTypeMap["action"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["upgrade_task_properties"] = bindings.NewReferenceType(model.UpgradeTaskPropertiesBindingType) + queryParams["action"] = "action" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "upgrade_task_properties", + "POST", + "/api/v1/node/upgrade/performtask", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/upgrade/ProgressStatusClient.go b/services/nsxt-mp/nsx/node/upgrade/ProgressStatusClient.go new file mode 100644 index 000000000..4b26fb286 --- /dev/null +++ b/services/nsxt-mp/nsx/node/upgrade/ProgressStatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ProgressStatus +// Used by client-side stubs. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ProgressStatusClient interface { + + // Get progress status of last upgrade step, if upgrade bundle is present. + // @return com.vmware.nsx.model.UpgradeProgressStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.UpgradeProgressStatus, error) +} + +type progressStatusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewProgressStatusClient(connector client.Connector) *progressStatusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.upgrade.progress_status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + pIface := progressStatusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &pIface +} + +func (pIface *progressStatusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := pIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (pIface *progressStatusClient) Get() (model.UpgradeProgressStatus, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(progressStatusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeProgressStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := progressStatusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.upgrade.progress_status", "get", inputDataValue, executionContext) + var emptyOutput model.UpgradeProgressStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), progressStatusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeProgressStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/upgrade/ProgressStatusTypes.go b/services/nsxt-mp/nsx/node/upgrade/ProgressStatusTypes.go new file mode 100644 index 000000000..891963966 --- /dev/null +++ b/services/nsxt-mp/nsx/node/upgrade/ProgressStatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ProgressStatus. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func progressStatusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func progressStatusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeProgressStatusBindingType) +} + +func progressStatusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/upgrade/progress-status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/upgrade/StatusSummaryClient.go b/services/nsxt-mp/nsx/node/upgrade/StatusSummaryClient.go new file mode 100644 index 000000000..37e0858d8 --- /dev/null +++ b/services/nsxt-mp/nsx/node/upgrade/StatusSummaryClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: StatusSummary +// Used by client-side stubs. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusSummaryClient interface { + + // Get status summary of node upgrade, if upgrade bundle is present. + // @return com.vmware.nsx.model.UpgradeStatusSummary + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.UpgradeStatusSummary, error) +} + +type statusSummaryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusSummaryClient(connector client.Connector) *statusSummaryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.upgrade.status_summary") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusSummaryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusSummaryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusSummaryClient) Get() (model.UpgradeStatusSummary, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusSummaryGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeStatusSummary + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusSummaryGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.upgrade.status_summary", "get", inputDataValue, executionContext) + var emptyOutput model.UpgradeStatusSummary + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusSummaryGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeStatusSummary), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/upgrade/StatusSummaryTypes.go b/services/nsxt-mp/nsx/node/upgrade/StatusSummaryTypes.go new file mode 100644 index 000000000..b0f172eba --- /dev/null +++ b/services/nsxt-mp/nsx/node/upgrade/StatusSummaryTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: StatusSummary. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusSummaryGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusSummaryGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeStatusSummaryBindingType) +} + +func statusSummaryGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/upgrade/status-summary", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/upgrade/UcClient.go b/services/nsxt-mp/nsx/node/upgrade/UcClient.go new file mode 100644 index 000000000..18ddeedc4 --- /dev/null +++ b/services/nsxt-mp/nsx/node/upgrade/UcClient.go @@ -0,0 +1,83 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Uc +// Used by client-side stubs. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UcClient interface { + + // Triggers repository driven uc upgrade on the node. This API expects that repository is synced across nodes before starting upgrade. + // + // @param triggerUcUpgradeParametersParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(triggerUcUpgradeParametersParam model.TriggerUcUpgradeParameters) error +} + +type ucClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUcClient(connector client.Connector) *ucClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.upgrade.uc") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := ucClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *ucClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *ucClient) Create(triggerUcUpgradeParametersParam model.TriggerUcUpgradeParameters) error { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ucCreateInputType(), typeConverter) + sv.AddStructField("TriggerUcUpgradeParameters", triggerUcUpgradeParametersParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ucCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.upgrade.uc", "create", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/upgrade/UcTypes.go b/services/nsxt-mp/nsx/node/upgrade/UcTypes.go new file mode 100644 index 000000000..ad59bb123 --- /dev/null +++ b/services/nsxt-mp/nsx/node/upgrade/UcTypes.go @@ -0,0 +1,67 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Uc. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func ucCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["trigger_uc_upgrade_parameters"] = bindings.NewReferenceType(model.TriggerUcUpgradeParametersBindingType) + fieldNameMap["trigger_uc_upgrade_parameters"] = "TriggerUcUpgradeParameters" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ucCreateOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ucCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["trigger_uc_upgrade_parameters"] = bindings.NewReferenceType(model.TriggerUcUpgradeParametersBindingType) + fieldNameMap["trigger_uc_upgrade_parameters"] = "TriggerUcUpgradeParameters" + paramsTypeMap["trigger_uc_upgrade_parameters"] = bindings.NewReferenceType(model.TriggerUcUpgradeParametersBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "trigger_uc_upgrade_parameters", + "POST", + "/api/v1/node/upgrade/uc", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/upgrade/UpgradePackageTypes.go b/services/nsxt-mp/nsx/node/upgrade/UpgradePackageTypes.go new file mode 100644 index 000000000..83df416f3 --- /dev/null +++ b/services/nsxt-mp/nsx/node/upgrade/UpgradePackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.upgrade. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade diff --git a/services/nsxt-mp/nsx/node/users/SshKeysClient.go b/services/nsxt-mp/nsx/node/users/SshKeysClient.go new file mode 100644 index 000000000..a8650793c --- /dev/null +++ b/services/nsxt-mp/nsx/node/users/SshKeysClient.go @@ -0,0 +1,166 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: SshKeys +// Used by client-side stubs. + +package users + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SshKeysClient interface { + + // Add SSH public key to authorized_keys file for node user + // + // @param useridParam User id of the user (required) + // @param sshKeyPropertiesParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Addsshkey(useridParam string, sshKeyPropertiesParam model.SshKeyProperties) error + + // Returns a list of all SSH keys from authorized_keys file for node user + // + // @param useridParam User id of the user (required) + // @return com.vmware.nsx.model.SshKeyPropertiesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(useridParam string) (model.SshKeyPropertiesListResult, error) + + // Remove SSH public key from authorized_keys file for node user + // + // @param useridParam User id of the user (required) + // @param sshKeyBasePropertiesParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Removesshkey(useridParam string, sshKeyBasePropertiesParam model.SshKeyBaseProperties) error +} + +type sshKeysClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSshKeysClient(connector client.Connector) *sshKeysClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.node.users.ssh_keys") + methodIdentifiers := map[string]core.MethodIdentifier{ + "addsshkey": core.NewMethodIdentifier(interfaceIdentifier, "addsshkey"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "removesshkey": core.NewMethodIdentifier(interfaceIdentifier, "removesshkey"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := sshKeysClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *sshKeysClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *sshKeysClient) Addsshkey(useridParam string, sshKeyPropertiesParam model.SshKeyProperties) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sshKeysAddsshkeyInputType(), typeConverter) + sv.AddStructField("Userid", useridParam) + sv.AddStructField("SshKeyProperties", sshKeyPropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sshKeysAddsshkeyRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.users.ssh_keys", "addsshkey", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *sshKeysClient) List(useridParam string) (model.SshKeyPropertiesListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sshKeysListInputType(), typeConverter) + sv.AddStructField("Userid", useridParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SshKeyPropertiesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sshKeysListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.users.ssh_keys", "list", inputDataValue, executionContext) + var emptyOutput model.SshKeyPropertiesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sshKeysListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SshKeyPropertiesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sshKeysClient) Removesshkey(useridParam string, sshKeyBasePropertiesParam model.SshKeyBaseProperties) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sshKeysRemovesshkeyInputType(), typeConverter) + sv.AddStructField("Userid", useridParam) + sv.AddStructField("SshKeyBaseProperties", sshKeyBasePropertiesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sshKeysRemovesshkeyRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.node.users.ssh_keys", "removesshkey", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/node/users/SshKeysTypes.go b/services/nsxt-mp/nsx/node/users/SshKeysTypes.go new file mode 100644 index 000000000..0eb3c5d94 --- /dev/null +++ b/services/nsxt-mp/nsx/node/users/SshKeysTypes.go @@ -0,0 +1,179 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: SshKeys. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package users + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func sshKeysAddsshkeyInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["userid"] = bindings.NewStringType() + fields["ssh_key_properties"] = bindings.NewReferenceType(model.SshKeyPropertiesBindingType) + fieldNameMap["userid"] = "Userid" + fieldNameMap["ssh_key_properties"] = "SshKeyProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sshKeysAddsshkeyOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func sshKeysAddsshkeyRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["userid"] = bindings.NewStringType() + fields["ssh_key_properties"] = bindings.NewReferenceType(model.SshKeyPropertiesBindingType) + fieldNameMap["userid"] = "Userid" + fieldNameMap["ssh_key_properties"] = "SshKeyProperties" + paramsTypeMap["ssh_key_properties"] = bindings.NewReferenceType(model.SshKeyPropertiesBindingType) + paramsTypeMap["userid"] = bindings.NewStringType() + paramsTypeMap["userid"] = bindings.NewStringType() + pathParams["userid"] = "userid" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=add_ssh_key", + "ssh_key_properties", + "POST", + "/api/v1/node/users/{userid}/ssh-keys", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sshKeysListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["userid"] = bindings.NewStringType() + fieldNameMap["userid"] = "Userid" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sshKeysListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SshKeyPropertiesListResultBindingType) +} + +func sshKeysListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["userid"] = bindings.NewStringType() + fieldNameMap["userid"] = "Userid" + paramsTypeMap["userid"] = bindings.NewStringType() + paramsTypeMap["userid"] = bindings.NewStringType() + pathParams["userid"] = "userid" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/node/users/{userid}/ssh-keys", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sshKeysRemovesshkeyInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["userid"] = bindings.NewStringType() + fields["ssh_key_base_properties"] = bindings.NewReferenceType(model.SshKeyBasePropertiesBindingType) + fieldNameMap["userid"] = "Userid" + fieldNameMap["ssh_key_base_properties"] = "SshKeyBaseProperties" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sshKeysRemovesshkeyOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func sshKeysRemovesshkeyRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["userid"] = bindings.NewStringType() + fields["ssh_key_base_properties"] = bindings.NewReferenceType(model.SshKeyBasePropertiesBindingType) + fieldNameMap["userid"] = "Userid" + fieldNameMap["ssh_key_base_properties"] = "SshKeyBaseProperties" + paramsTypeMap["ssh_key_base_properties"] = bindings.NewReferenceType(model.SshKeyBasePropertiesBindingType) + paramsTypeMap["userid"] = bindings.NewStringType() + paramsTypeMap["userid"] = bindings.NewStringType() + pathParams["userid"] = "userid" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=remove_ssh_key", + "ssh_key_base_properties", + "POST", + "/api/v1/node/users/{userid}/ssh-keys", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/node/users/UsersPackageTypes.go b/services/nsxt-mp/nsx/node/users/UsersPackageTypes.go new file mode 100644 index 000000000..df182af3d --- /dev/null +++ b/services/nsxt-mp/nsx/node/users/UsersPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.node.users. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package users diff --git a/services/nsxt-mp/nsx/notification_watchers/NotificationWatchersPackageTypes.go b/services/nsxt-mp/nsx/notification_watchers/NotificationWatchersPackageTypes.go new file mode 100644 index 000000000..3afb8d487 --- /dev/null +++ b/services/nsxt-mp/nsx/notification_watchers/NotificationWatchersPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.notification_watchers. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package notification_watchers diff --git a/services/nsxt-mp/nsx/notification_watchers/NotificationsClient.go b/services/nsxt-mp/nsx/notification_watchers/NotificationsClient.go new file mode 100644 index 000000000..5896b0b71 --- /dev/null +++ b/services/nsxt-mp/nsx/notification_watchers/NotificationsClient.go @@ -0,0 +1,225 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Notifications +// Used by client-side stubs. + +package notification_watchers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NotificationsClient interface { + + // Add uri filters for the specified watcher ID. + // + // @param watcherIdParam (required) + // @param notificationParam (required) + // @return com.vmware.nsx.model.NotificationsList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Addurifilters(watcherIdParam string, notificationParam model.Notification) (model.NotificationsList, error) + + // Delete uri filters for the specified watcher ID. + // + // @param watcherIdParam (required) + // @param notificationParam (required) + // @return com.vmware.nsx.model.NotificationsList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Deleteurifilters(watcherIdParam string, notificationParam model.Notification) (model.NotificationsList, error) + + // Get notifications for the specified watcher ID. + // + // @param watcherIdParam (required) + // @return com.vmware.nsx.model.NotificationsList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(watcherIdParam string) (model.NotificationsList, error) + + // Update notifications for the specified watcher ID. + // + // @param watcherIdParam (required) + // @param notificationsListParam (required) + // @return com.vmware.nsx.model.NotificationsList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(watcherIdParam string, notificationsListParam model.NotificationsList) (model.NotificationsList, error) +} + +type notificationsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNotificationsClient(connector client.Connector) *notificationsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.notification_watchers.notifications") + methodIdentifiers := map[string]core.MethodIdentifier{ + "addurifilters": core.NewMethodIdentifier(interfaceIdentifier, "addurifilters"), + "deleteurifilters": core.NewMethodIdentifier(interfaceIdentifier, "deleteurifilters"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := notificationsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *notificationsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *notificationsClient) Addurifilters(watcherIdParam string, notificationParam model.Notification) (model.NotificationsList, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(notificationsAddurifiltersInputType(), typeConverter) + sv.AddStructField("WatcherId", watcherIdParam) + sv.AddStructField("Notification", notificationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NotificationsList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := notificationsAddurifiltersRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.notification_watchers.notifications", "addurifilters", inputDataValue, executionContext) + var emptyOutput model.NotificationsList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), notificationsAddurifiltersOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NotificationsList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *notificationsClient) Deleteurifilters(watcherIdParam string, notificationParam model.Notification) (model.NotificationsList, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(notificationsDeleteurifiltersInputType(), typeConverter) + sv.AddStructField("WatcherId", watcherIdParam) + sv.AddStructField("Notification", notificationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NotificationsList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := notificationsDeleteurifiltersRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.notification_watchers.notifications", "deleteurifilters", inputDataValue, executionContext) + var emptyOutput model.NotificationsList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), notificationsDeleteurifiltersOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NotificationsList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *notificationsClient) Get(watcherIdParam string) (model.NotificationsList, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(notificationsGetInputType(), typeConverter) + sv.AddStructField("WatcherId", watcherIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NotificationsList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := notificationsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.notification_watchers.notifications", "get", inputDataValue, executionContext) + var emptyOutput model.NotificationsList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), notificationsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NotificationsList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (nIface *notificationsClient) Update(watcherIdParam string, notificationsListParam model.NotificationsList) (model.NotificationsList, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(notificationsUpdateInputType(), typeConverter) + sv.AddStructField("WatcherId", watcherIdParam) + sv.AddStructField("NotificationsList", notificationsListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NotificationsList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := notificationsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.notification_watchers.notifications", "update", inputDataValue, executionContext) + var emptyOutput model.NotificationsList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), notificationsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NotificationsList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/notification_watchers/NotificationsTypes.go b/services/nsxt-mp/nsx/notification_watchers/NotificationsTypes.go new file mode 100644 index 000000000..69dd5497e --- /dev/null +++ b/services/nsxt-mp/nsx/notification_watchers/NotificationsTypes.go @@ -0,0 +1,234 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Notifications. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package notification_watchers + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func notificationsAddurifiltersInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["watcher_id"] = bindings.NewStringType() + fields["notification"] = bindings.NewReferenceType(model.NotificationBindingType) + fieldNameMap["watcher_id"] = "WatcherId" + fieldNameMap["notification"] = "Notification" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func notificationsAddurifiltersOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NotificationsListBindingType) +} + +func notificationsAddurifiltersRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["watcher_id"] = bindings.NewStringType() + fields["notification"] = bindings.NewReferenceType(model.NotificationBindingType) + fieldNameMap["watcher_id"] = "WatcherId" + fieldNameMap["notification"] = "Notification" + paramsTypeMap["watcher_id"] = bindings.NewStringType() + paramsTypeMap["notification"] = bindings.NewReferenceType(model.NotificationBindingType) + paramsTypeMap["watcherId"] = bindings.NewStringType() + pathParams["watcher_id"] = "watcherId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=add_uri_filters", + "notification", + "POST", + "/api/v1/notification-watchers/{watcherId}/notifications", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func notificationsDeleteurifiltersInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["watcher_id"] = bindings.NewStringType() + fields["notification"] = bindings.NewReferenceType(model.NotificationBindingType) + fieldNameMap["watcher_id"] = "WatcherId" + fieldNameMap["notification"] = "Notification" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func notificationsDeleteurifiltersOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NotificationsListBindingType) +} + +func notificationsDeleteurifiltersRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["watcher_id"] = bindings.NewStringType() + fields["notification"] = bindings.NewReferenceType(model.NotificationBindingType) + fieldNameMap["watcher_id"] = "WatcherId" + fieldNameMap["notification"] = "Notification" + paramsTypeMap["watcher_id"] = bindings.NewStringType() + paramsTypeMap["notification"] = bindings.NewReferenceType(model.NotificationBindingType) + paramsTypeMap["watcherId"] = bindings.NewStringType() + pathParams["watcher_id"] = "watcherId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=delete_uri_filters", + "notification", + "POST", + "/api/v1/notification-watchers/{watcherId}/notifications", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func notificationsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["watcher_id"] = bindings.NewStringType() + fieldNameMap["watcher_id"] = "WatcherId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func notificationsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NotificationsListBindingType) +} + +func notificationsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["watcher_id"] = bindings.NewStringType() + fieldNameMap["watcher_id"] = "WatcherId" + paramsTypeMap["watcher_id"] = bindings.NewStringType() + paramsTypeMap["watcherId"] = bindings.NewStringType() + pathParams["watcher_id"] = "watcherId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/notification-watchers/{watcherId}/notifications", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func notificationsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["watcher_id"] = bindings.NewStringType() + fields["notifications_list"] = bindings.NewReferenceType(model.NotificationsListBindingType) + fieldNameMap["watcher_id"] = "WatcherId" + fieldNameMap["notifications_list"] = "NotificationsList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func notificationsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NotificationsListBindingType) +} + +func notificationsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["watcher_id"] = bindings.NewStringType() + fields["notifications_list"] = bindings.NewReferenceType(model.NotificationsListBindingType) + fieldNameMap["watcher_id"] = "WatcherId" + fieldNameMap["notifications_list"] = "NotificationsList" + paramsTypeMap["watcher_id"] = bindings.NewStringType() + paramsTypeMap["notifications_list"] = bindings.NewReferenceType(model.NotificationsListBindingType) + paramsTypeMap["watcherId"] = bindings.NewStringType() + pathParams["watcher_id"] = "watcherId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "notifications_list", + "PUT", + "/api/v1/notification-watchers/{watcherId}/notifications", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ns_groups/ConsolidatedEffectiveIpAddressMembersClient.go b/services/nsxt-mp/nsx/ns_groups/ConsolidatedEffectiveIpAddressMembersClient.go new file mode 100644 index 000000000..5f8f13c76 --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/ConsolidatedEffectiveIpAddressMembersClient.go @@ -0,0 +1,104 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ConsolidatedEffectiveIpAddressMembers +// Used by client-side stubs. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ConsolidatedEffectiveIpAddressMembersClient interface { + + // Returns consolidated effective ip address members of the specified NSGroup. Applicable in case of federated environment. The response contains site-wise list of consolidated effective IP address members. In the response, for the local-site, the list will contain static and dynamicaly translated IPs. For the remote sites, the list will contain only the dynamically translated IPs. The static IPs will not be seen in the response of this API. Hence, user can refer to the local-site Ip response in the API results or the group definition to see the static IP membership of the Group. This API is applicable only for NSGroups containing either VirtualMachine, VIF, LogicalSwitch, LogicalPort or IPSet member type. For NSGroups containing other member types,it returns an empty list. Use the cursor value in the response to fetch the next page. If there is no cursor value for a response, it implies the last page in the results for the query. + // + // @param nsGroupIdParam NSGroup Id (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param ipFilterParam IP address, range, or subnet (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param siteIdParam UUID of the site from which the effective IP addresses are to be fetched (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.ConsolidatedEffectiveIPAddressMemberListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, ipFilterParam *string, pageSizeParam *int64, siteIdParam *string, sortAscendingParam *bool, sortByParam *string) (model.ConsolidatedEffectiveIPAddressMemberListResult, error) +} + +type consolidatedEffectiveIpAddressMembersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewConsolidatedEffectiveIpAddressMembersClient(connector client.Connector) *consolidatedEffectiveIpAddressMembersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ns_groups.consolidated_effective_ip_address_members") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := consolidatedEffectiveIpAddressMembersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *consolidatedEffectiveIpAddressMembersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *consolidatedEffectiveIpAddressMembersClient) List(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, ipFilterParam *string, pageSizeParam *int64, siteIdParam *string, sortAscendingParam *bool, sortByParam *string) (model.ConsolidatedEffectiveIPAddressMemberListResult, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(consolidatedEffectiveIpAddressMembersListInputType(), typeConverter) + sv.AddStructField("NsGroupId", nsGroupIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("IpFilter", ipFilterParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SiteId", siteIdParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ConsolidatedEffectiveIPAddressMemberListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := consolidatedEffectiveIpAddressMembersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_groups.consolidated_effective_ip_address_members", "list", inputDataValue, executionContext) + var emptyOutput model.ConsolidatedEffectiveIPAddressMemberListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), consolidatedEffectiveIpAddressMembersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ConsolidatedEffectiveIPAddressMemberListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ns_groups/ConsolidatedEffectiveIpAddressMembersTypes.go b/services/nsxt-mp/nsx/ns_groups/ConsolidatedEffectiveIpAddressMembersTypes.go new file mode 100644 index 000000000..a1ba2476a --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/ConsolidatedEffectiveIpAddressMembersTypes.go @@ -0,0 +1,111 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ConsolidatedEffectiveIpAddressMembers. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func consolidatedEffectiveIpAddressMembersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["ip_filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["ip_filter"] = "IpFilter" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["site_id"] = "SiteId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func consolidatedEffectiveIpAddressMembersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ConsolidatedEffectiveIPAddressMemberListResultBindingType) +} + +func consolidatedEffectiveIpAddressMembersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["ip_filter"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["ip_filter"] = "IpFilter" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["site_id"] = "SiteId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["ns_group_id"] = bindings.NewStringType() + paramsTypeMap["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["ip_filter"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["nsGroupId"] = bindings.NewStringType() + pathParams["ns_group_id"] = "nsGroupId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["site_id"] = "site_id" + queryParams["sort_by"] = "sort_by" + queryParams["ip_filter"] = "ip_filter" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-groups/{nsGroupId}/consolidated-effective-ip-address-members", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ns_groups/EffectiveCloudNativeServiceInstanceMembersClient.go b/services/nsxt-mp/nsx/ns_groups/EffectiveCloudNativeServiceInstanceMembersClient.go new file mode 100644 index 000000000..b6c1ab12a --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/EffectiveCloudNativeServiceInstanceMembersClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: EffectiveCloudNativeServiceInstanceMembers +// Used by client-side stubs. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type EffectiveCloudNativeServiceInstanceMembersClient interface { + + // Returns effective cloud native service instances of the specified NSGroup. This API is applicable only for NSGroups containing CloudNativeServiceInstance member type. For NSGroups containing other member types,it returns an empty list. target_id in response is external_id of CloudNativeServiceInstance + // + // @param nsGroupIdParam NSGroup Id (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.EffectiveMemberResourceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.EffectiveMemberResourceListResult, error) +} + +type effectiveCloudNativeServiceInstanceMembersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewEffectiveCloudNativeServiceInstanceMembersClient(connector client.Connector) *effectiveCloudNativeServiceInstanceMembersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ns_groups.effective_cloud_native_service_instance_members") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + eIface := effectiveCloudNativeServiceInstanceMembersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &eIface +} + +func (eIface *effectiveCloudNativeServiceInstanceMembersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := eIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (eIface *effectiveCloudNativeServiceInstanceMembersClient) List(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.EffectiveMemberResourceListResult, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(effectiveCloudNativeServiceInstanceMembersListInputType(), typeConverter) + sv.AddStructField("NsGroupId", nsGroupIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EffectiveMemberResourceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := effectiveCloudNativeServiceInstanceMembersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_groups.effective_cloud_native_service_instance_members", "list", inputDataValue, executionContext) + var emptyOutput model.EffectiveMemberResourceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), effectiveCloudNativeServiceInstanceMembersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EffectiveMemberResourceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ns_groups/EffectiveCloudNativeServiceInstanceMembersTypes.go b/services/nsxt-mp/nsx/ns_groups/EffectiveCloudNativeServiceInstanceMembersTypes.go new file mode 100644 index 000000000..8dc5a8651 --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/EffectiveCloudNativeServiceInstanceMembersTypes.go @@ -0,0 +1,99 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: EffectiveCloudNativeServiceInstanceMembers. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func effectiveCloudNativeServiceInstanceMembersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func effectiveCloudNativeServiceInstanceMembersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EffectiveMemberResourceListResultBindingType) +} + +func effectiveCloudNativeServiceInstanceMembersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["ns_group_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["nsGroupId"] = bindings.NewStringType() + pathParams["ns_group_id"] = "nsGroupId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-groups/{nsGroupId}/effective-cloud-native-service-instance-members", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ns_groups/EffectiveDirectoryGroupMembersClient.go b/services/nsxt-mp/nsx/ns_groups/EffectiveDirectoryGroupMembersClient.go new file mode 100644 index 000000000..d5afa7794 --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/EffectiveDirectoryGroupMembersClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: EffectiveDirectoryGroupMembers +// Used by client-side stubs. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type EffectiveDirectoryGroupMembersClient interface { + + // Returns effective directory groups which are members of the specified NSGroup. This API is applicable only for NSGroups containing DirectoryGroup member type. For NSGroups containing other member types,it returns an empty list. + // + // @param nsGroupIdParam NSGroup Id (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.EffectiveMemberResourceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.EffectiveMemberResourceListResult, error) +} + +type effectiveDirectoryGroupMembersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewEffectiveDirectoryGroupMembersClient(connector client.Connector) *effectiveDirectoryGroupMembersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ns_groups.effective_directory_group_members") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + eIface := effectiveDirectoryGroupMembersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &eIface +} + +func (eIface *effectiveDirectoryGroupMembersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := eIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (eIface *effectiveDirectoryGroupMembersClient) List(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.EffectiveMemberResourceListResult, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(effectiveDirectoryGroupMembersListInputType(), typeConverter) + sv.AddStructField("NsGroupId", nsGroupIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EffectiveMemberResourceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := effectiveDirectoryGroupMembersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_groups.effective_directory_group_members", "list", inputDataValue, executionContext) + var emptyOutput model.EffectiveMemberResourceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), effectiveDirectoryGroupMembersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EffectiveMemberResourceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ns_groups/EffectiveDirectoryGroupMembersTypes.go b/services/nsxt-mp/nsx/ns_groups/EffectiveDirectoryGroupMembersTypes.go new file mode 100644 index 000000000..7f499f292 --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/EffectiveDirectoryGroupMembersTypes.go @@ -0,0 +1,99 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: EffectiveDirectoryGroupMembers. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func effectiveDirectoryGroupMembersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func effectiveDirectoryGroupMembersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EffectiveMemberResourceListResultBindingType) +} + +func effectiveDirectoryGroupMembersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["ns_group_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["nsGroupId"] = bindings.NewStringType() + pathParams["ns_group_id"] = "nsGroupId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-groups/{nsGroupId}/effective-directory-group-members", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ns_groups/EffectiveIpAddressMembersClient.go b/services/nsxt-mp/nsx/ns_groups/EffectiveIpAddressMembersClient.go new file mode 100644 index 000000000..d4510041e --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/EffectiveIpAddressMembersClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: EffectiveIpAddressMembers +// Used by client-side stubs. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type EffectiveIpAddressMembersClient interface { + + // Returns effective ip address members of the specified NSGroup. This API is applicable only for NSGroups containing either VirtualMachine, VIF, LogicalSwitch, LogicalPort or IPSet member type. For NSGroups containing other member types,it returns an empty list. + // + // @param nsGroupIdParam NSGroup Id (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.EffectiveIPAddressMemberListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.EffectiveIPAddressMemberListResult, error) +} + +type effectiveIpAddressMembersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewEffectiveIpAddressMembersClient(connector client.Connector) *effectiveIpAddressMembersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ns_groups.effective_ip_address_members") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + eIface := effectiveIpAddressMembersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &eIface +} + +func (eIface *effectiveIpAddressMembersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := eIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (eIface *effectiveIpAddressMembersClient) List(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.EffectiveIPAddressMemberListResult, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(effectiveIpAddressMembersListInputType(), typeConverter) + sv.AddStructField("NsGroupId", nsGroupIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EffectiveIPAddressMemberListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := effectiveIpAddressMembersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_groups.effective_ip_address_members", "list", inputDataValue, executionContext) + var emptyOutput model.EffectiveIPAddressMemberListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), effectiveIpAddressMembersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EffectiveIPAddressMemberListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ns_groups/EffectiveIpAddressMembersTypes.go b/services/nsxt-mp/nsx/ns_groups/EffectiveIpAddressMembersTypes.go new file mode 100644 index 000000000..e4099441e --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/EffectiveIpAddressMembersTypes.go @@ -0,0 +1,99 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: EffectiveIpAddressMembers. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func effectiveIpAddressMembersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func effectiveIpAddressMembersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EffectiveIPAddressMemberListResultBindingType) +} + +func effectiveIpAddressMembersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["ns_group_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["nsGroupId"] = bindings.NewStringType() + pathParams["ns_group_id"] = "nsGroupId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-groups/{nsGroupId}/effective-ip-address-members", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ns_groups/EffectiveIpsetMembersClient.go b/services/nsxt-mp/nsx/ns_groups/EffectiveIpsetMembersClient.go new file mode 100644 index 000000000..79004522e --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/EffectiveIpsetMembersClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: EffectiveIpsetMembers +// Used by client-side stubs. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type EffectiveIpsetMembersClient interface { + + // Returns effective IPSets which are members of the specified NSGroup. This API is applicable only for NSGroups containing IPSet member type. For NSGroups containing other member types,it returns an empty list. + // + // @param nsGroupIdParam NSGroup Id (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.EffectiveMemberResourceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.EffectiveMemberResourceListResult, error) +} + +type effectiveIpsetMembersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewEffectiveIpsetMembersClient(connector client.Connector) *effectiveIpsetMembersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ns_groups.effective_ipset_members") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + eIface := effectiveIpsetMembersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &eIface +} + +func (eIface *effectiveIpsetMembersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := eIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (eIface *effectiveIpsetMembersClient) List(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.EffectiveMemberResourceListResult, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(effectiveIpsetMembersListInputType(), typeConverter) + sv.AddStructField("NsGroupId", nsGroupIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EffectiveMemberResourceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := effectiveIpsetMembersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_groups.effective_ipset_members", "list", inputDataValue, executionContext) + var emptyOutput model.EffectiveMemberResourceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), effectiveIpsetMembersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EffectiveMemberResourceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ns_groups/EffectiveIpsetMembersTypes.go b/services/nsxt-mp/nsx/ns_groups/EffectiveIpsetMembersTypes.go new file mode 100644 index 000000000..e2761b051 --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/EffectiveIpsetMembersTypes.go @@ -0,0 +1,99 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: EffectiveIpsetMembers. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func effectiveIpsetMembersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func effectiveIpsetMembersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EffectiveMemberResourceListResultBindingType) +} + +func effectiveIpsetMembersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["ns_group_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["nsGroupId"] = bindings.NewStringType() + pathParams["ns_group_id"] = "nsGroupId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-groups/{nsGroupId}/effective-ipset-members", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ns_groups/EffectiveLogicalPortMembersClient.go b/services/nsxt-mp/nsx/ns_groups/EffectiveLogicalPortMembersClient.go new file mode 100644 index 000000000..af310dd72 --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/EffectiveLogicalPortMembersClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: EffectiveLogicalPortMembers +// Used by client-side stubs. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type EffectiveLogicalPortMembersClient interface { + + // Returns effective logical port members of the specified NSGroup. This API is applicable only for NSGroups containing either VirtualMachines, LogicalSwitch or LogicalPort member types.For NSGroups containing other member types,it returns an empty list. + // + // @param nsGroupIdParam NSGroup Id (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.EffectiveMemberResourceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.EffectiveMemberResourceListResult, error) +} + +type effectiveLogicalPortMembersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewEffectiveLogicalPortMembersClient(connector client.Connector) *effectiveLogicalPortMembersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ns_groups.effective_logical_port_members") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + eIface := effectiveLogicalPortMembersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &eIface +} + +func (eIface *effectiveLogicalPortMembersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := eIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (eIface *effectiveLogicalPortMembersClient) List(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.EffectiveMemberResourceListResult, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(effectiveLogicalPortMembersListInputType(), typeConverter) + sv.AddStructField("NsGroupId", nsGroupIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EffectiveMemberResourceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := effectiveLogicalPortMembersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_groups.effective_logical_port_members", "list", inputDataValue, executionContext) + var emptyOutput model.EffectiveMemberResourceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), effectiveLogicalPortMembersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EffectiveMemberResourceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ns_groups/EffectiveLogicalPortMembersTypes.go b/services/nsxt-mp/nsx/ns_groups/EffectiveLogicalPortMembersTypes.go new file mode 100644 index 000000000..e5aaff260 --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/EffectiveLogicalPortMembersTypes.go @@ -0,0 +1,99 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: EffectiveLogicalPortMembers. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func effectiveLogicalPortMembersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func effectiveLogicalPortMembersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EffectiveMemberResourceListResultBindingType) +} + +func effectiveLogicalPortMembersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["ns_group_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["nsGroupId"] = bindings.NewStringType() + pathParams["ns_group_id"] = "nsGroupId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-groups/{nsGroupId}/effective-logical-port-members", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ns_groups/EffectiveLogicalSwitchMembersClient.go b/services/nsxt-mp/nsx/ns_groups/EffectiveLogicalSwitchMembersClient.go new file mode 100644 index 000000000..0dfba6bad --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/EffectiveLogicalSwitchMembersClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: EffectiveLogicalSwitchMembers +// Used by client-side stubs. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type EffectiveLogicalSwitchMembersClient interface { + + // Returns effective logical switch members of the specified NSGroup. This API is applicable for NSGroups containing LogicalSwitch members. For NSGroups containing other member types,it returns an empty list. + // + // @param nsGroupIdParam NSGroup Id (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.EffectiveMemberResourceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.EffectiveMemberResourceListResult, error) +} + +type effectiveLogicalSwitchMembersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewEffectiveLogicalSwitchMembersClient(connector client.Connector) *effectiveLogicalSwitchMembersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ns_groups.effective_logical_switch_members") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + eIface := effectiveLogicalSwitchMembersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &eIface +} + +func (eIface *effectiveLogicalSwitchMembersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := eIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (eIface *effectiveLogicalSwitchMembersClient) List(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.EffectiveMemberResourceListResult, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(effectiveLogicalSwitchMembersListInputType(), typeConverter) + sv.AddStructField("NsGroupId", nsGroupIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EffectiveMemberResourceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := effectiveLogicalSwitchMembersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_groups.effective_logical_switch_members", "list", inputDataValue, executionContext) + var emptyOutput model.EffectiveMemberResourceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), effectiveLogicalSwitchMembersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EffectiveMemberResourceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ns_groups/EffectiveLogicalSwitchMembersTypes.go b/services/nsxt-mp/nsx/ns_groups/EffectiveLogicalSwitchMembersTypes.go new file mode 100644 index 000000000..c8b6295b4 --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/EffectiveLogicalSwitchMembersTypes.go @@ -0,0 +1,99 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: EffectiveLogicalSwitchMembers. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func effectiveLogicalSwitchMembersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func effectiveLogicalSwitchMembersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EffectiveMemberResourceListResultBindingType) +} + +func effectiveLogicalSwitchMembersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["ns_group_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["nsGroupId"] = bindings.NewStringType() + pathParams["ns_group_id"] = "nsGroupId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-groups/{nsGroupId}/effective-logical-switch-members", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ns_groups/EffectivePhysicalServerMembersClient.go b/services/nsxt-mp/nsx/ns_groups/EffectivePhysicalServerMembersClient.go new file mode 100644 index 000000000..3791417d6 --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/EffectivePhysicalServerMembersClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: EffectivePhysicalServerMembers +// Used by client-side stubs. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type EffectivePhysicalServerMembersClient interface { + + // Returns effective physical server members of the specified NSGroup. This API is applicable only for NSGroups containing Physical Server member type. For NSGroups containing other member types,it returns an empty list. + // + // @param nsGroupIdParam NSGroup Id (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.EffectiveMemberResourceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.EffectiveMemberResourceListResult, error) +} + +type effectivePhysicalServerMembersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewEffectivePhysicalServerMembersClient(connector client.Connector) *effectivePhysicalServerMembersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ns_groups.effective_physical_server_members") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + eIface := effectivePhysicalServerMembersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &eIface +} + +func (eIface *effectivePhysicalServerMembersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := eIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (eIface *effectivePhysicalServerMembersClient) List(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.EffectiveMemberResourceListResult, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(effectivePhysicalServerMembersListInputType(), typeConverter) + sv.AddStructField("NsGroupId", nsGroupIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EffectiveMemberResourceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := effectivePhysicalServerMembersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_groups.effective_physical_server_members", "list", inputDataValue, executionContext) + var emptyOutput model.EffectiveMemberResourceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), effectivePhysicalServerMembersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EffectiveMemberResourceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ns_groups/EffectivePhysicalServerMembersTypes.go b/services/nsxt-mp/nsx/ns_groups/EffectivePhysicalServerMembersTypes.go new file mode 100644 index 000000000..be477827a --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/EffectivePhysicalServerMembersTypes.go @@ -0,0 +1,99 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: EffectivePhysicalServerMembers. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func effectivePhysicalServerMembersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func effectivePhysicalServerMembersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EffectiveMemberResourceListResultBindingType) +} + +func effectivePhysicalServerMembersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["ns_group_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["nsGroupId"] = bindings.NewStringType() + pathParams["ns_group_id"] = "nsGroupId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-groups/{nsGroupId}/effective-physical-server-members", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ns_groups/EffectiveTransportNodeMembersClient.go b/services/nsxt-mp/nsx/ns_groups/EffectiveTransportNodeMembersClient.go new file mode 100644 index 000000000..861eafde0 --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/EffectiveTransportNodeMembersClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: EffectiveTransportNodeMembers +// Used by client-side stubs. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type EffectiveTransportNodeMembersClient interface { + + // Returns effective transport node members of the specified NSGroup. This API is applicable only for NSGroups containing TransportNode member type. For NSGroups containing other member types,it returns an empty list. + // + // @param nsGroupIdParam NSGroup Id (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.EffectiveMemberResourceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.EffectiveMemberResourceListResult, error) +} + +type effectiveTransportNodeMembersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewEffectiveTransportNodeMembersClient(connector client.Connector) *effectiveTransportNodeMembersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ns_groups.effective_transport_node_members") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + eIface := effectiveTransportNodeMembersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &eIface +} + +func (eIface *effectiveTransportNodeMembersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := eIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (eIface *effectiveTransportNodeMembersClient) List(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.EffectiveMemberResourceListResult, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(effectiveTransportNodeMembersListInputType(), typeConverter) + sv.AddStructField("NsGroupId", nsGroupIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EffectiveMemberResourceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := effectiveTransportNodeMembersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_groups.effective_transport_node_members", "list", inputDataValue, executionContext) + var emptyOutput model.EffectiveMemberResourceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), effectiveTransportNodeMembersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EffectiveMemberResourceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ns_groups/EffectiveTransportNodeMembersTypes.go b/services/nsxt-mp/nsx/ns_groups/EffectiveTransportNodeMembersTypes.go new file mode 100644 index 000000000..004fd57d2 --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/EffectiveTransportNodeMembersTypes.go @@ -0,0 +1,99 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: EffectiveTransportNodeMembers. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func effectiveTransportNodeMembersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func effectiveTransportNodeMembersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EffectiveMemberResourceListResultBindingType) +} + +func effectiveTransportNodeMembersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["ns_group_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["nsGroupId"] = bindings.NewStringType() + pathParams["ns_group_id"] = "nsGroupId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-groups/{nsGroupId}/effective-transport-node-members", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ns_groups/EffectiveVifMembersClient.go b/services/nsxt-mp/nsx/ns_groups/EffectiveVifMembersClient.go new file mode 100644 index 000000000..f50bd99dc --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/EffectiveVifMembersClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: EffectiveVifMembers +// Used by client-side stubs. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type EffectiveVifMembersClient interface { + + // Returns effective VIF members of the specified NSGroup. This API is applicable only for NSGroups containing either VirtualMachines or VIF member type. For NSGroups containing other member types,it returns an empty list. + // + // @param nsGroupIdParam NSGroup Id (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.VirtualNetworkInterfaceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.VirtualNetworkInterfaceListResult, error) +} + +type effectiveVifMembersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewEffectiveVifMembersClient(connector client.Connector) *effectiveVifMembersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ns_groups.effective_vif_members") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + eIface := effectiveVifMembersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &eIface +} + +func (eIface *effectiveVifMembersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := eIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (eIface *effectiveVifMembersClient) List(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.VirtualNetworkInterfaceListResult, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(effectiveVifMembersListInputType(), typeConverter) + sv.AddStructField("NsGroupId", nsGroupIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.VirtualNetworkInterfaceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := effectiveVifMembersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_groups.effective_vif_members", "list", inputDataValue, executionContext) + var emptyOutput model.VirtualNetworkInterfaceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), effectiveVifMembersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.VirtualNetworkInterfaceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ns_groups/EffectiveVifMembersTypes.go b/services/nsxt-mp/nsx/ns_groups/EffectiveVifMembersTypes.go new file mode 100644 index 000000000..5a048c793 --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/EffectiveVifMembersTypes.go @@ -0,0 +1,99 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: EffectiveVifMembers. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func effectiveVifMembersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func effectiveVifMembersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.VirtualNetworkInterfaceListResultBindingType) +} + +func effectiveVifMembersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["ns_group_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["nsGroupId"] = bindings.NewStringType() + pathParams["ns_group_id"] = "nsGroupId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-groups/{nsGroupId}/effective-vif-members", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ns_groups/EffectiveVirtualMachineMembersClient.go b/services/nsxt-mp/nsx/ns_groups/EffectiveVirtualMachineMembersClient.go new file mode 100644 index 000000000..d3306150d --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/EffectiveVirtualMachineMembersClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: EffectiveVirtualMachineMembers +// Used by client-side stubs. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type EffectiveVirtualMachineMembersClient interface { + + // Returns effective virtual machine members of the specified NSGroup. This API is applicable only for NSGroups containing VirtualMachine member type. For NSGroups containing other member types,it returns an empty list. + // + // @param nsGroupIdParam NSGroup Id (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.VirtualMachineListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.VirtualMachineListResult, error) +} + +type effectiveVirtualMachineMembersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewEffectiveVirtualMachineMembersClient(connector client.Connector) *effectiveVirtualMachineMembersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ns_groups.effective_virtual_machine_members") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + eIface := effectiveVirtualMachineMembersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &eIface +} + +func (eIface *effectiveVirtualMachineMembersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := eIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (eIface *effectiveVirtualMachineMembersClient) List(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.VirtualMachineListResult, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(effectiveVirtualMachineMembersListInputType(), typeConverter) + sv.AddStructField("NsGroupId", nsGroupIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.VirtualMachineListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := effectiveVirtualMachineMembersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_groups.effective_virtual_machine_members", "list", inputDataValue, executionContext) + var emptyOutput model.VirtualMachineListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), effectiveVirtualMachineMembersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.VirtualMachineListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ns_groups/EffectiveVirtualMachineMembersTypes.go b/services/nsxt-mp/nsx/ns_groups/EffectiveVirtualMachineMembersTypes.go new file mode 100644 index 000000000..c8d28b3da --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/EffectiveVirtualMachineMembersTypes.go @@ -0,0 +1,99 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: EffectiveVirtualMachineMembers. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func effectiveVirtualMachineMembersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func effectiveVirtualMachineMembersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.VirtualMachineListResultBindingType) +} + +func effectiveVirtualMachineMembersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["ns_group_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["nsGroupId"] = bindings.NewStringType() + pathParams["ns_group_id"] = "nsGroupId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-groups/{nsGroupId}/effective-virtual-machine-members", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ns_groups/MemberTypesClient.go b/services/nsxt-mp/nsx/ns_groups/MemberTypesClient.go new file mode 100644 index 000000000..9273e39e7 --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/MemberTypesClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MemberTypes +// Used by client-side stubs. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MemberTypesClient interface { + + // Returns member types for a specified NSGroup including child NSGroups. This considers static members and members added via membership criteria only + // + // @param nsGroupIdParam NSGroup Id (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.EffectiveMemberTypeListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.EffectiveMemberTypeListResult, error) +} + +type memberTypesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMemberTypesClient(connector client.Connector) *memberTypesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ns_groups.member_types") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := memberTypesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *memberTypesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *memberTypesClient) Get(nsGroupIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.EffectiveMemberTypeListResult, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(memberTypesGetInputType(), typeConverter) + sv.AddStructField("NsGroupId", nsGroupIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EffectiveMemberTypeListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := memberTypesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_groups.member_types", "get", inputDataValue, executionContext) + var emptyOutput model.EffectiveMemberTypeListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), memberTypesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EffectiveMemberTypeListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ns_groups/MemberTypesTypes.go b/services/nsxt-mp/nsx/ns_groups/MemberTypesTypes.go new file mode 100644 index 000000000..5523f6ae9 --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/MemberTypesTypes.go @@ -0,0 +1,99 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MemberTypes. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func memberTypesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func memberTypesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EffectiveMemberTypeListResultBindingType) +} + +func memberTypesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ns_group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ns_group_id"] = "NsGroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["ns_group_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["nsGroupId"] = bindings.NewStringType() + pathParams["ns_group_id"] = "nsGroupId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-groups/{nsGroupId}/member-types", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ns_groups/NsGroupsPackageTypes.go b/services/nsxt-mp/nsx/ns_groups/NsGroupsPackageTypes.go new file mode 100644 index 000000000..5dc55134d --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/NsGroupsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.ns_groups. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ns_groups diff --git a/services/nsxt-mp/nsx/ns_groups/ServiceAssociationsClient.go b/services/nsxt-mp/nsx/ns_groups/ServiceAssociationsClient.go new file mode 100644 index 000000000..49fe6b92f --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/ServiceAssociationsClient.go @@ -0,0 +1,105 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ServiceAssociations +// Used by client-side stubs. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ServiceAssociationsClient interface { + + // Returns information about services that are associated with the given NSGroup. The service name is passed by service_type parameter + // + // @param nsgroupIdParam (required) + // @param serviceTypeParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param fetchParentgroupAssociationsParam Fetch complete list of associated resources considering nesting (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.ServiceAssociationListResult + // The return value will contain all the properties defined in model.ServiceAssociationListResult. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(nsgroupIdParam string, serviceTypeParam string, cursorParam *string, fetchParentgroupAssociationsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (*data.StructValue, error) +} + +type serviceAssociationsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewServiceAssociationsClient(connector client.Connector) *serviceAssociationsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ns_groups.service_associations") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := serviceAssociationsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *serviceAssociationsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *serviceAssociationsClient) List(nsgroupIdParam string, serviceTypeParam string, cursorParam *string, fetchParentgroupAssociationsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (*data.StructValue, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceAssociationsListInputType(), typeConverter) + sv.AddStructField("NsgroupId", nsgroupIdParam) + sv.AddStructField("ServiceType", serviceTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("FetchParentgroupAssociations", fetchParentgroupAssociationsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceAssociationsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_groups.service_associations", "list", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceAssociationsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ns_groups/ServiceAssociationsTypes.go b/services/nsxt-mp/nsx/ns_groups/ServiceAssociationsTypes.go new file mode 100644 index 000000000..e96366a1c --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/ServiceAssociationsTypes.go @@ -0,0 +1,117 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ServiceAssociations. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``serviceType`` of method ServiceAssociations#list. +const ServiceAssociations_LIST_SERVICE_TYPE_FIREWALL = "firewall" + +// Possible value for ``serviceType`` of method ServiceAssociations#list. +const ServiceAssociations_LIST_SERVICE_TYPE_IPFIX = "ipfix" + +func serviceAssociationsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["nsgroup_id"] = bindings.NewStringType() + fields["service_type"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["fetch_parentgroup_associations"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nsgroup_id"] = "NsgroupId" + fieldNameMap["service_type"] = "ServiceType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["fetch_parentgroup_associations"] = "FetchParentgroupAssociations" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceAssociationsListOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.ServiceAssociationListResultBindingType)}, bindings.REST) +} + +func serviceAssociationsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["nsgroup_id"] = bindings.NewStringType() + fields["service_type"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["fetch_parentgroup_associations"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["nsgroup_id"] = "NsgroupId" + fieldNameMap["service_type"] = "ServiceType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["fetch_parentgroup_associations"] = "FetchParentgroupAssociations" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["fetch_parentgroup_associations"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["nsgroup_id"] = bindings.NewStringType() + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_type"] = bindings.NewStringType() + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["nsgroupId"] = bindings.NewStringType() + pathParams["nsgroup_id"] = "nsgroupId" + queryParams["cursor"] = "cursor" + queryParams["service_type"] = "service_type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["fetch_parentgroup_associations"] = "fetch_parentgroup_associations" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-groups/{nsgroupId}/service-associations", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ns_groups/UnassociatedVirtualMachinesClient.go b/services/nsxt-mp/nsx/ns_groups/UnassociatedVirtualMachinesClient.go new file mode 100644 index 000000000..5b5af3323 --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/UnassociatedVirtualMachinesClient.go @@ -0,0 +1,106 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: UnassociatedVirtualMachines +// Used by client-side stubs. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UnassociatedVirtualMachinesClient interface { + + // Get the list of all the virtual machines that are not a part of any existing NSGroup. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param displayNameParam Display Name of the virtual machine (optional) + // @param excludeVmTypeParam VM types to be excluded (optional) + // @param externalIdParam External id of the virtual machine (optional) + // @param hostIdParam Id of the host where this vif is located (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.UnassociatedVMListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, displayNameParam *string, excludeVmTypeParam *string, externalIdParam *string, hostIdParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.UnassociatedVMListResult, error) +} + +type unassociatedVirtualMachinesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUnassociatedVirtualMachinesClient(connector client.Connector) *unassociatedVirtualMachinesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ns_groups.unassociated_virtual_machines") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := unassociatedVirtualMachinesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *unassociatedVirtualMachinesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *unassociatedVirtualMachinesClient) List(cursorParam *string, displayNameParam *string, excludeVmTypeParam *string, externalIdParam *string, hostIdParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.UnassociatedVMListResult, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(unassociatedVirtualMachinesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("DisplayName", displayNameParam) + sv.AddStructField("ExcludeVmType", excludeVmTypeParam) + sv.AddStructField("ExternalId", externalIdParam) + sv.AddStructField("HostId", hostIdParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UnassociatedVMListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := unassociatedVirtualMachinesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_groups.unassociated_virtual_machines", "list", inputDataValue, executionContext) + var emptyOutput model.UnassociatedVMListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), unassociatedVirtualMachinesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UnassociatedVMListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ns_groups/UnassociatedVirtualMachinesTypes.go b/services/nsxt-mp/nsx/ns_groups/UnassociatedVirtualMachinesTypes.go new file mode 100644 index 000000000..f5e49c2ce --- /dev/null +++ b/services/nsxt-mp/nsx/ns_groups/UnassociatedVirtualMachinesTypes.go @@ -0,0 +1,116 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: UnassociatedVirtualMachines. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ns_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func unassociatedVirtualMachinesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["exclude_vm_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["host_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["display_name"] = "DisplayName" + fieldNameMap["exclude_vm_type"] = "ExcludeVmType" + fieldNameMap["external_id"] = "ExternalId" + fieldNameMap["host_id"] = "HostId" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func unassociatedVirtualMachinesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UnassociatedVMListResultBindingType) +} + +func unassociatedVirtualMachinesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["exclude_vm_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["host_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["display_name"] = "DisplayName" + fieldNameMap["exclude_vm_type"] = "ExcludeVmType" + fieldNameMap["external_id"] = "ExternalId" + fieldNameMap["host_id"] = "HostId" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["external_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["exclude_vm_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["host_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["exclude_vm_type"] = "exclude_vm_type" + queryParams["external_id"] = "external_id" + queryParams["sort_by"] = "sort_by" + queryParams["display_name"] = "display_name" + queryParams["host_id"] = "host_id" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-groups/unassociated-virtual-machines", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ns_profiles/AttributeTypesClient.go b/services/nsxt-mp/nsx/ns_profiles/AttributeTypesClient.go new file mode 100644 index 000000000..70bc42959 --- /dev/null +++ b/services/nsxt-mp/nsx/ns_profiles/AttributeTypesClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: AttributeTypes +// Used by client-side stubs. + +package ns_profiles + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AttributeTypesClient interface { + + // Returns supported attribute type strings for NSProfile. + // @return com.vmware.nsx.model.NSSupportedAttributeTypesResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NSSupportedAttributeTypesResult, error) +} + +type attributeTypesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAttributeTypesClient(connector client.Connector) *attributeTypesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ns_profiles.attribute_types") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := attributeTypesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *attributeTypesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *attributeTypesClient) Get() (model.NSSupportedAttributeTypesResult, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(attributeTypesGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NSSupportedAttributeTypesResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := attributeTypesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_profiles.attribute_types", "get", inputDataValue, executionContext) + var emptyOutput model.NSSupportedAttributeTypesResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), attributeTypesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NSSupportedAttributeTypesResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ns_profiles/AttributeTypesTypes.go b/services/nsxt-mp/nsx/ns_profiles/AttributeTypesTypes.go new file mode 100644 index 000000000..0a76fe7ae --- /dev/null +++ b/services/nsxt-mp/nsx/ns_profiles/AttributeTypesTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: AttributeTypes. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ns_profiles + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func attributeTypesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func attributeTypesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NSSupportedAttributeTypesResultBindingType) +} + +func attributeTypesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-profiles/attribute-types", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ns_profiles/AttributesClient.go b/services/nsxt-mp/nsx/ns_profiles/AttributesClient.go new file mode 100644 index 000000000..699a69b65 --- /dev/null +++ b/services/nsxt-mp/nsx/ns_profiles/AttributesClient.go @@ -0,0 +1,102 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Attributes +// Used by client-side stubs. + +package ns_profiles + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AttributesClient interface { + + // Returns supported attribute and sub-attributes for specified attribute type with their supported values, if provided in query/request parameter, else will fetch all supported attribute and sub-attributes for all supported attribute types. + // + // @param attributeSourceParam Fetch attributes source (optional) + // @param attributeTypeParam Fetch attributes and sub-attributes for the given attribute type (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.NSSupportedAttributesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(attributeSourceParam *string, attributeTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.NSSupportedAttributesListResult, error) +} + +type attributesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAttributesClient(connector client.Connector) *attributesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ns_profiles.attributes") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := attributesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *attributesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *attributesClient) List(attributeSourceParam *string, attributeTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.NSSupportedAttributesListResult, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(attributesListInputType(), typeConverter) + sv.AddStructField("AttributeSource", attributeSourceParam) + sv.AddStructField("AttributeType", attributeTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NSSupportedAttributesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := attributesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ns_profiles.attributes", "list", inputDataValue, executionContext) + var emptyOutput model.NSSupportedAttributesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), attributesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NSSupportedAttributesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ns_profiles/AttributesTypes.go b/services/nsxt-mp/nsx/ns_profiles/AttributesTypes.go new file mode 100644 index 000000000..15f342684 --- /dev/null +++ b/services/nsxt-mp/nsx/ns_profiles/AttributesTypes.go @@ -0,0 +1,113 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Attributes. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ns_profiles + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``attributeSource`` of method Attributes#list. +const Attributes_LIST_ATTRIBUTE_SOURCE_SYSTEM = "SYSTEM" + +// Possible value for ``attributeSource`` of method Attributes#list. +const Attributes_LIST_ATTRIBUTE_SOURCE_CUSTOM = "CUSTOM" + +// Possible value for ``attributeSource`` of method Attributes#list. +const Attributes_LIST_ATTRIBUTE_SOURCE_ALL = "ALL" + +func attributesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["attribute_source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["attribute_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["attribute_source"] = "AttributeSource" + fieldNameMap["attribute_type"] = "AttributeType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func attributesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NSSupportedAttributesListResultBindingType) +} + +func attributesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["attribute_source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["attribute_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["attribute_source"] = "AttributeSource" + fieldNameMap["attribute_type"] = "AttributeType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["attribute_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["attribute_source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["attribute_source"] = "attribute_source" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["attribute_type"] = "attribute_type" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ns-profiles/attributes", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ns_profiles/NsProfilesPackageTypes.go b/services/nsxt-mp/nsx/ns_profiles/NsProfilesPackageTypes.go new file mode 100644 index 000000000..0c7d3fe5d --- /dev/null +++ b/services/nsxt-mp/nsx/ns_profiles/NsProfilesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.ns_profiles. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ns_profiles diff --git a/services/nsxt-mp/nsx/nvds_urt/NvdsUrtPackageTypes.go b/services/nsxt-mp/nsx/nvds_urt/NvdsUrtPackageTypes.go new file mode 100644 index 000000000..aaaad6d08 --- /dev/null +++ b/services/nsxt-mp/nsx/nvds_urt/NvdsUrtPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.nvds_urt. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nvds_urt diff --git a/services/nsxt-mp/nsx/nvds_urt/PrecheckByClustersClient.go b/services/nsxt-mp/nsx/nvds_urt/PrecheckByClustersClient.go new file mode 100644 index 000000000..95001a7a8 --- /dev/null +++ b/services/nsxt-mp/nsx/nvds_urt/PrecheckByClustersClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: PrecheckByClusters +// Used by client-side stubs. + +package nvds_urt + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type PrecheckByClustersClient interface { + + // Start precheck for N-VDS to VDS migration by clusters + // + // @param precheckParametersParam (required) + // @param tolerateDifferentConfigurationsParam tolerate differnet configurations (optional, default to true) + // @return com.vmware.nsx.model.NvdsUpgradePrecheckId + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(precheckParametersParam model.PrecheckParameters, tolerateDifferentConfigurationsParam *bool) (model.NvdsUpgradePrecheckId, error) +} + +type precheckByClustersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewPrecheckByClustersClient(connector client.Connector) *precheckByClustersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.nvds_urt.precheck_by_clusters") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + pIface := precheckByClustersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &pIface +} + +func (pIface *precheckByClustersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := pIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (pIface *precheckByClustersClient) Create(precheckParametersParam model.PrecheckParameters, tolerateDifferentConfigurationsParam *bool) (model.NvdsUpgradePrecheckId, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(precheckByClustersCreateInputType(), typeConverter) + sv.AddStructField("PrecheckParameters", precheckParametersParam) + sv.AddStructField("TolerateDifferentConfigurations", tolerateDifferentConfigurationsParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NvdsUpgradePrecheckId + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := precheckByClustersCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.nvds_urt.precheck_by_clusters", "create", inputDataValue, executionContext) + var emptyOutput model.NvdsUpgradePrecheckId + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), precheckByClustersCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NvdsUpgradePrecheckId), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/nvds_urt/PrecheckByClustersTypes.go b/services/nsxt-mp/nsx/nvds_urt/PrecheckByClustersTypes.go new file mode 100644 index 000000000..4a9793a51 --- /dev/null +++ b/services/nsxt-mp/nsx/nvds_urt/PrecheckByClustersTypes.go @@ -0,0 +1,73 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: PrecheckByClusters. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nvds_urt + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func precheckByClustersCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["precheck_parameters"] = bindings.NewReferenceType(model.PrecheckParametersBindingType) + fields["tolerate_different_configurations"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["precheck_parameters"] = "PrecheckParameters" + fieldNameMap["tolerate_different_configurations"] = "TolerateDifferentConfigurations" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func precheckByClustersCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NvdsUpgradePrecheckIdBindingType) +} + +func precheckByClustersCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["precheck_parameters"] = bindings.NewReferenceType(model.PrecheckParametersBindingType) + fields["tolerate_different_configurations"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["precheck_parameters"] = "PrecheckParameters" + fieldNameMap["tolerate_different_configurations"] = "TolerateDifferentConfigurations" + paramsTypeMap["tolerate_different_configurations"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["precheck_parameters"] = bindings.NewReferenceType(model.PrecheckParametersBindingType) + queryParams["tolerate_different_configurations"] = "tolerate_different_configurations" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "precheck_parameters", + "POST", + "/api/v1/nvds-urt/precheck-by-clusters", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/nvds_urt/PrecheckClient.go b/services/nsxt-mp/nsx/nvds_urt/PrecheckClient.go new file mode 100644 index 000000000..0d2af7a87 --- /dev/null +++ b/services/nsxt-mp/nsx/nvds_urt/PrecheckClient.go @@ -0,0 +1,130 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Precheck +// Used by client-side stubs. + +package nvds_urt + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type PrecheckClient interface { + + // Start precheck for N-VDS to VDS migration + // + // @param tolerateDifferentConfigurationsParam tolerate differnet configurations (optional, default to true) + // @return com.vmware.nsx.model.NvdsUpgradePrecheckId + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(tolerateDifferentConfigurationsParam *bool) (model.NvdsUpgradePrecheckId, error) + + // Retrieve latest precheck ID of the N-VDS to VDS migration + // @return com.vmware.nsx.model.NvdsUpgradePrecheckId + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NvdsUpgradePrecheckId, error) +} + +type precheckClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewPrecheckClient(connector client.Connector) *precheckClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.nvds_urt.precheck") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + pIface := precheckClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &pIface +} + +func (pIface *precheckClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := pIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (pIface *precheckClient) Create(tolerateDifferentConfigurationsParam *bool) (model.NvdsUpgradePrecheckId, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(precheckCreateInputType(), typeConverter) + sv.AddStructField("TolerateDifferentConfigurations", tolerateDifferentConfigurationsParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NvdsUpgradePrecheckId + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := precheckCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.nvds_urt.precheck", "create", inputDataValue, executionContext) + var emptyOutput model.NvdsUpgradePrecheckId + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), precheckCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NvdsUpgradePrecheckId), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *precheckClient) Get() (model.NvdsUpgradePrecheckId, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(precheckGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NvdsUpgradePrecheckId + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := precheckGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.nvds_urt.precheck", "get", inputDataValue, executionContext) + var emptyOutput model.NvdsUpgradePrecheckId + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), precheckGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NvdsUpgradePrecheckId), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/nvds_urt/PrecheckTypes.go b/services/nsxt-mp/nsx/nvds_urt/PrecheckTypes.go new file mode 100644 index 000000000..33f4e8d69 --- /dev/null +++ b/services/nsxt-mp/nsx/nvds_urt/PrecheckTypes.go @@ -0,0 +1,111 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Precheck. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nvds_urt + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func precheckCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["tolerate_different_configurations"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["tolerate_different_configurations"] = "TolerateDifferentConfigurations" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func precheckCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NvdsUpgradePrecheckIdBindingType) +} + +func precheckCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["tolerate_different_configurations"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["tolerate_different_configurations"] = "TolerateDifferentConfigurations" + paramsTypeMap["tolerate_different_configurations"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["tolerate_different_configurations"] = "tolerate_different_configurations" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "POST", + "/api/v1/nvds-urt/precheck", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func precheckGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func precheckGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NvdsUpgradePrecheckIdBindingType) +} + +func precheckGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/nvds-urt/precheck", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/nvds_urt/StatusSummaryClient.go b/services/nsxt-mp/nsx/nvds_urt/StatusSummaryClient.go new file mode 100644 index 000000000..1cdfa5d56 --- /dev/null +++ b/services/nsxt-mp/nsx/nvds_urt/StatusSummaryClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: StatusSummary +// Used by client-side stubs. + +package nvds_urt + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusSummaryClient interface { + + // Get summary of N-VDS to VDS migration + // + // @param precheckIdParam (required) + // @param clusterIdParam cluster identifier (optional) + // @return com.vmware.nsx.model.NvdsUpgradeStatusSummary + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(precheckIdParam string, clusterIdParam *string) (model.NvdsUpgradeStatusSummary, error) +} + +type statusSummaryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusSummaryClient(connector client.Connector) *statusSummaryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.nvds_urt.status_summary") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusSummaryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusSummaryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusSummaryClient) Get(precheckIdParam string, clusterIdParam *string) (model.NvdsUpgradeStatusSummary, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusSummaryGetInputType(), typeConverter) + sv.AddStructField("PrecheckId", precheckIdParam) + sv.AddStructField("ClusterId", clusterIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NvdsUpgradeStatusSummary + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusSummaryGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.nvds_urt.status_summary", "get", inputDataValue, executionContext) + var emptyOutput model.NvdsUpgradeStatusSummary + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusSummaryGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NvdsUpgradeStatusSummary), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/nvds_urt/StatusSummaryTypes.go b/services/nsxt-mp/nsx/nvds_urt/StatusSummaryTypes.go new file mode 100644 index 000000000..fbcad55e5 --- /dev/null +++ b/services/nsxt-mp/nsx/nvds_urt/StatusSummaryTypes.go @@ -0,0 +1,75 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: StatusSummary. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nvds_urt + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusSummaryGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["precheck_id"] = bindings.NewStringType() + fields["cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["precheck_id"] = "PrecheckId" + fieldNameMap["cluster_id"] = "ClusterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusSummaryGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NvdsUpgradeStatusSummaryBindingType) +} + +func statusSummaryGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["precheck_id"] = bindings.NewStringType() + fields["cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["precheck_id"] = "PrecheckId" + fieldNameMap["cluster_id"] = "ClusterId" + paramsTypeMap["cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["precheck_id"] = bindings.NewStringType() + paramsTypeMap["precheckId"] = bindings.NewStringType() + pathParams["precheck_id"] = "precheckId" + queryParams["cluster_id"] = "cluster_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/nvds-urt/status-summary/{precheckId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/nvds_urt/TopologyClient.go b/services/nsxt-mp/nsx/nvds_urt/TopologyClient.go new file mode 100644 index 000000000..53023ee85 --- /dev/null +++ b/services/nsxt-mp/nsx/nvds_urt/TopologyClient.go @@ -0,0 +1,143 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Topology +// Used by client-side stubs. + +package nvds_urt + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type TopologyClient interface { + + // Set VDS configuration and create it in vCenter + // + // @param upgradeTopologyParam (required) + // @param clusterIdParam cluster identifier (optional) + // @param useRecommendedTopologyConfigParam Flag to indicate if use recommended topology got from the latest precheck (optional) + // @return com.vmware.nsx.model.UpgradeTopology + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Apply(upgradeTopologyParam model.UpgradeTopology, clusterIdParam *string, useRecommendedTopologyConfigParam *bool) (model.UpgradeTopology, error) + + // Recommmended topology + // + // @param precheckIdParam (required) + // @param clusterIdParam cluster identifier (optional) + // @param computeManagerIdParam vCenter identifier (optional) + // @param showVdsConfigParam Flag to indicate if VdsTopology should contain VDS configuration (optional) + // @return com.vmware.nsx.model.UpgradeTopology + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(precheckIdParam string, clusterIdParam *string, computeManagerIdParam *string, showVdsConfigParam *bool) (model.UpgradeTopology, error) +} + +type topologyClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewTopologyClient(connector client.Connector) *topologyClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.nvds_urt.topology") + methodIdentifiers := map[string]core.MethodIdentifier{ + "apply": core.NewMethodIdentifier(interfaceIdentifier, "apply"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + tIface := topologyClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &tIface +} + +func (tIface *topologyClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := tIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (tIface *topologyClient) Apply(upgradeTopologyParam model.UpgradeTopology, clusterIdParam *string, useRecommendedTopologyConfigParam *bool) (model.UpgradeTopology, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(topologyApplyInputType(), typeConverter) + sv.AddStructField("UpgradeTopology", upgradeTopologyParam) + sv.AddStructField("ClusterId", clusterIdParam) + sv.AddStructField("UseRecommendedTopologyConfig", useRecommendedTopologyConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeTopology + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := topologyApplyRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.nvds_urt.topology", "apply", inputDataValue, executionContext) + var emptyOutput model.UpgradeTopology + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), topologyApplyOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeTopology), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *topologyClient) Get(precheckIdParam string, clusterIdParam *string, computeManagerIdParam *string, showVdsConfigParam *bool) (model.UpgradeTopology, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(topologyGetInputType(), typeConverter) + sv.AddStructField("PrecheckId", precheckIdParam) + sv.AddStructField("ClusterId", clusterIdParam) + sv.AddStructField("ComputeManagerId", computeManagerIdParam) + sv.AddStructField("ShowVdsConfig", showVdsConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeTopology + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := topologyGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.nvds_urt.topology", "get", inputDataValue, executionContext) + var emptyOutput model.UpgradeTopology + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), topologyGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeTopology), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/nvds_urt/TopologyTypes.go b/services/nsxt-mp/nsx/nvds_urt/TopologyTypes.go new file mode 100644 index 000000000..9a63f3613 --- /dev/null +++ b/services/nsxt-mp/nsx/nvds_urt/TopologyTypes.go @@ -0,0 +1,147 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Topology. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package nvds_urt + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func topologyApplyInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["upgrade_topology"] = bindings.NewReferenceType(model.UpgradeTopologyBindingType) + fields["cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["use_recommended_topology_config"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["upgrade_topology"] = "UpgradeTopology" + fieldNameMap["cluster_id"] = "ClusterId" + fieldNameMap["use_recommended_topology_config"] = "UseRecommendedTopologyConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func topologyApplyOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeTopologyBindingType) +} + +func topologyApplyRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["upgrade_topology"] = bindings.NewReferenceType(model.UpgradeTopologyBindingType) + fields["cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["use_recommended_topology_config"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["upgrade_topology"] = "UpgradeTopology" + fieldNameMap["cluster_id"] = "ClusterId" + fieldNameMap["use_recommended_topology_config"] = "UseRecommendedTopologyConfig" + paramsTypeMap["cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["use_recommended_topology_config"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["upgrade_topology"] = bindings.NewReferenceType(model.UpgradeTopologyBindingType) + queryParams["cluster_id"] = "cluster_id" + queryParams["use_recommended_topology_config"] = "use_recommended_topology_config" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=apply", + "upgrade_topology", + "POST", + "/api/v1/nvds-urt/topology", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func topologyGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["precheck_id"] = bindings.NewStringType() + fields["cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["compute_manager_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["show_vds_config"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["precheck_id"] = "PrecheckId" + fieldNameMap["cluster_id"] = "ClusterId" + fieldNameMap["compute_manager_id"] = "ComputeManagerId" + fieldNameMap["show_vds_config"] = "ShowVdsConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func topologyGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeTopologyBindingType) +} + +func topologyGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["precheck_id"] = bindings.NewStringType() + fields["cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["compute_manager_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["show_vds_config"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["precheck_id"] = "PrecheckId" + fieldNameMap["cluster_id"] = "ClusterId" + fieldNameMap["compute_manager_id"] = "ComputeManagerId" + fieldNameMap["show_vds_config"] = "ShowVdsConfig" + paramsTypeMap["cluster_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["precheck_id"] = bindings.NewStringType() + paramsTypeMap["show_vds_config"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["compute_manager_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["precheckId"] = bindings.NewStringType() + pathParams["precheck_id"] = "precheckId" + queryParams["compute_manager_id"] = "compute_manager_id" + queryParams["cluster_id"] = "cluster_id" + queryParams["show_vds_config"] = "show_vds_config" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/nvds-urt/topology/{precheckId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/pktcap/PktcapPackageTypes.go b/services/nsxt-mp/nsx/pktcap/PktcapPackageTypes.go new file mode 100644 index 000000000..92ecb4f76 --- /dev/null +++ b/services/nsxt-mp/nsx/pktcap/PktcapPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.pktcap. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package pktcap diff --git a/services/nsxt-mp/nsx/pktcap/SessionClient.go b/services/nsxt-mp/nsx/pktcap/SessionClient.go new file mode 100644 index 000000000..d6a5f7692 --- /dev/null +++ b/services/nsxt-mp/nsx/pktcap/SessionClient.go @@ -0,0 +1,262 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Session +// Used by client-side stubs. + +package pktcap + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SessionClient interface { + + // Create an new packet capture session on given node with specified options + // + // @param packetCaptureRequestParam (required) + // @return com.vmware.nsx.model.PacketCaptureSession + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(packetCaptureRequestParam model.PacketCaptureRequest) (model.PacketCaptureSession, error) + + // Before calling this method, terminate any running capture session. + // + // @param sessionIdParam Packet capture session id (required) + // @return com.vmware.nsx.model.PacketCaptureSession + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(sessionIdParam string) (model.PacketCaptureSession, error) + + // Get the packet capture status information by session id. + // + // @param sessionIdParam Packet capture session id (required) + // @return com.vmware.nsx.model.PacketCaptureSession + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(sessionIdParam string) (model.PacketCaptureSession, error) + + // Restart the packet capture session + // + // @param sessionIdParam Packet capture session id (required) + // @return com.vmware.nsx.model.PacketCaptureSession + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Restart(sessionIdParam string) (model.PacketCaptureSession, error) + + // Terminate the packet capture session by session id. + // + // @param sessionIdParam Packet capture session id (required) + // @return com.vmware.nsx.model.PacketCaptureSession + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Terminate(sessionIdParam string) (model.PacketCaptureSession, error) +} + +type sessionClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSessionClient(connector client.Connector) *sessionClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.pktcap.session") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "restart": core.NewMethodIdentifier(interfaceIdentifier, "restart"), + "terminate": core.NewMethodIdentifier(interfaceIdentifier, "terminate"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := sessionClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *sessionClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *sessionClient) Create(packetCaptureRequestParam model.PacketCaptureRequest) (model.PacketCaptureSession, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sessionCreateInputType(), typeConverter) + sv.AddStructField("PacketCaptureRequest", packetCaptureRequestParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PacketCaptureSession + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pktcap.session", "create", inputDataValue, executionContext) + var emptyOutput model.PacketCaptureSession + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sessionCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PacketCaptureSession), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sessionClient) Delete(sessionIdParam string) (model.PacketCaptureSession, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sessionDeleteInputType(), typeConverter) + sv.AddStructField("SessionId", sessionIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PacketCaptureSession + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pktcap.session", "delete", inputDataValue, executionContext) + var emptyOutput model.PacketCaptureSession + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sessionDeleteOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PacketCaptureSession), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sessionClient) Get(sessionIdParam string) (model.PacketCaptureSession, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sessionGetInputType(), typeConverter) + sv.AddStructField("SessionId", sessionIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PacketCaptureSession + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pktcap.session", "get", inputDataValue, executionContext) + var emptyOutput model.PacketCaptureSession + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sessionGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PacketCaptureSession), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sessionClient) Restart(sessionIdParam string) (model.PacketCaptureSession, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sessionRestartInputType(), typeConverter) + sv.AddStructField("SessionId", sessionIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PacketCaptureSession + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionRestartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pktcap.session", "restart", inputDataValue, executionContext) + var emptyOutput model.PacketCaptureSession + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sessionRestartOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PacketCaptureSession), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sessionClient) Terminate(sessionIdParam string) (model.PacketCaptureSession, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sessionTerminateInputType(), typeConverter) + sv.AddStructField("SessionId", sessionIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PacketCaptureSession + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionTerminateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pktcap.session", "terminate", inputDataValue, executionContext) + var emptyOutput model.PacketCaptureSession + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sessionTerminateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PacketCaptureSession), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/pktcap/SessionTypes.go b/services/nsxt-mp/nsx/pktcap/SessionTypes.go new file mode 100644 index 000000000..084d0b02d --- /dev/null +++ b/services/nsxt-mp/nsx/pktcap/SessionTypes.go @@ -0,0 +1,267 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Session. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package pktcap + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func sessionCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["packet_capture_request"] = bindings.NewReferenceType(model.PacketCaptureRequestBindingType) + fieldNameMap["packet_capture_request"] = "PacketCaptureRequest" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PacketCaptureSessionBindingType) +} + +func sessionCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["packet_capture_request"] = bindings.NewReferenceType(model.PacketCaptureRequestBindingType) + fieldNameMap["packet_capture_request"] = "PacketCaptureRequest" + paramsTypeMap["packet_capture_request"] = bindings.NewReferenceType(model.PacketCaptureRequestBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "packet_capture_request", + "POST", + "/api/v1/pktcap/session", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sessionDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["session_id"] = bindings.NewStringType() + fieldNameMap["session_id"] = "SessionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionDeleteOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PacketCaptureSessionBindingType) +} + +func sessionDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["session_id"] = bindings.NewStringType() + fieldNameMap["session_id"] = "SessionId" + paramsTypeMap["session_id"] = bindings.NewStringType() + paramsTypeMap["sessionId"] = bindings.NewStringType() + pathParams["session_id"] = "sessionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=delete", + "", + "POST", + "/api/v1/pktcap/session/{sessionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sessionGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["session_id"] = bindings.NewStringType() + fieldNameMap["session_id"] = "SessionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PacketCaptureSessionBindingType) +} + +func sessionGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["session_id"] = bindings.NewStringType() + fieldNameMap["session_id"] = "SessionId" + paramsTypeMap["session_id"] = bindings.NewStringType() + paramsTypeMap["sessionId"] = bindings.NewStringType() + pathParams["session_id"] = "sessionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/pktcap/session/{sessionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sessionRestartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["session_id"] = bindings.NewStringType() + fieldNameMap["session_id"] = "SessionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionRestartOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PacketCaptureSessionBindingType) +} + +func sessionRestartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["session_id"] = bindings.NewStringType() + fieldNameMap["session_id"] = "SessionId" + paramsTypeMap["session_id"] = bindings.NewStringType() + paramsTypeMap["sessionId"] = bindings.NewStringType() + pathParams["session_id"] = "sessionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=restart", + "", + "POST", + "/api/v1/pktcap/session/{sessionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sessionTerminateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["session_id"] = bindings.NewStringType() + fieldNameMap["session_id"] = "SessionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionTerminateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PacketCaptureSessionBindingType) +} + +func sessionTerminateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["session_id"] = bindings.NewStringType() + fieldNameMap["session_id"] = "SessionId" + paramsTypeMap["session_id"] = bindings.NewStringType() + paramsTypeMap["sessionId"] = bindings.NewStringType() + pathParams["session_id"] = "sessionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=terminate", + "", + "POST", + "/api/v1/pktcap/session/{sessionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/pktcap/SessionsClient.go b/services/nsxt-mp/nsx/pktcap/SessionsClient.go new file mode 100644 index 000000000..9036980bb --- /dev/null +++ b/services/nsxt-mp/nsx/pktcap/SessionsClient.go @@ -0,0 +1,127 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Sessions +// Used by client-side stubs. + +package pktcap + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SessionsClient interface { + + // Delete all the packet capture sessions. + // @return com.vmware.nsx.model.PacketCaptureSessionList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete() (model.PacketCaptureSessionList, error) + + // Get the information of all packet capture sessions. + // @return com.vmware.nsx.model.PacketCaptureSessionList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.PacketCaptureSessionList, error) +} + +type sessionsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSessionsClient(connector client.Connector) *sessionsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.pktcap.sessions") + methodIdentifiers := map[string]core.MethodIdentifier{ + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := sessionsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *sessionsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *sessionsClient) Delete() (model.PacketCaptureSessionList, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sessionsDeleteInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PacketCaptureSessionList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pktcap.sessions", "delete", inputDataValue, executionContext) + var emptyOutput model.PacketCaptureSessionList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sessionsDeleteOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PacketCaptureSessionList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sessionsClient) List() (model.PacketCaptureSessionList, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sessionsListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PacketCaptureSessionList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pktcap.sessions", "list", inputDataValue, executionContext) + var emptyOutput model.PacketCaptureSessionList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sessionsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PacketCaptureSessionList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/pktcap/SessionsTypes.go b/services/nsxt-mp/nsx/pktcap/SessionsTypes.go new file mode 100644 index 000000000..10b2f90a6 --- /dev/null +++ b/services/nsxt-mp/nsx/pktcap/SessionsTypes.go @@ -0,0 +1,105 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Sessions. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package pktcap + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func sessionsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionsDeleteOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PacketCaptureSessionListBindingType) +} + +func sessionsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=delete", + "", + "POST", + "/api/v1/pktcap/sessions", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sessionsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PacketCaptureSessionListBindingType) +} + +func sessionsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/pktcap/sessions", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/pools/IpBlocksClient.go b/services/nsxt-mp/nsx/pools/IpBlocksClient.go new file mode 100644 index 000000000..5e45c2fd6 --- /dev/null +++ b/services/nsxt-mp/nsx/pools/IpBlocksClient.go @@ -0,0 +1,266 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: IpBlocks +// Used by client-side stubs. + +package pools + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type IpBlocksClient interface { + + // Creates a new IPv4 address block using the specified cidr. cidr is a required parameter. display_name & description are optional parameters + // + // @param ipBlockParam (required) + // @return com.vmware.nsx.model.IpBlock + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(ipBlockParam model.IpBlock) (model.IpBlock, error) + + // Deletes the IP address block with specified id if it exists. IP block cannot be deleted if there are allocated subnets from the block. + // + // @param blockIdParam IP address block id (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(blockIdParam string) error + + // Returns information about the IP address block with specified id. Information includes id, display_name, description & cidr. + // + // @param blockIdParam IP address block id (required) + // @return com.vmware.nsx.model.IpBlock + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(blockIdParam string) (model.IpBlock, error) + + // Returns information about configured IP address blocks. Information includes the id, display name, description & CIDR of IP address blocks + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.IpBlockListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IpBlockListResult, error) + + // Modifies the IP address block with specifed id. display_name, description and cidr are parameters that can be modified. If a new cidr is specified, it should contain all existing subnets in the IP block. Returns a conflict error if the IP address block cidr can not be modified due to the presence of subnets that it contains. Eg: If the IP block contains a subnet 192.168.0.1/24 and we try to change the IP block cidr to 10.1.0.1/16, it results in a conflict. + // + // @param blockIdParam IP address block id (required) + // @param ipBlockParam (required) + // @return com.vmware.nsx.model.IpBlock + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(blockIdParam string, ipBlockParam model.IpBlock) (model.IpBlock, error) +} + +type ipBlocksClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewIpBlocksClient(connector client.Connector) *ipBlocksClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.pools.ip_blocks") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := ipBlocksClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *ipBlocksClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *ipBlocksClient) Create(ipBlockParam model.IpBlock) (model.IpBlock, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipBlocksCreateInputType(), typeConverter) + sv.AddStructField("IpBlock", ipBlockParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IpBlock + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipBlocksCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.ip_blocks", "create", inputDataValue, executionContext) + var emptyOutput model.IpBlock + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipBlocksCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IpBlock), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipBlocksClient) Delete(blockIdParam string) error { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipBlocksDeleteInputType(), typeConverter) + sv.AddStructField("BlockId", blockIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipBlocksDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.ip_blocks", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *ipBlocksClient) Get(blockIdParam string) (model.IpBlock, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipBlocksGetInputType(), typeConverter) + sv.AddStructField("BlockId", blockIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IpBlock + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipBlocksGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.ip_blocks", "get", inputDataValue, executionContext) + var emptyOutput model.IpBlock + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipBlocksGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IpBlock), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipBlocksClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IpBlockListResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipBlocksListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IpBlockListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipBlocksListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.ip_blocks", "list", inputDataValue, executionContext) + var emptyOutput model.IpBlockListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipBlocksListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IpBlockListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipBlocksClient) Update(blockIdParam string, ipBlockParam model.IpBlock) (model.IpBlock, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipBlocksUpdateInputType(), typeConverter) + sv.AddStructField("BlockId", blockIdParam) + sv.AddStructField("IpBlock", ipBlockParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IpBlock + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipBlocksUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.ip_blocks", "update", inputDataValue, executionContext) + var emptyOutput model.IpBlock + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipBlocksUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IpBlock), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/pools/IpBlocksTypes.go b/services/nsxt-mp/nsx/pools/IpBlocksTypes.go new file mode 100644 index 000000000..bdb92c165 --- /dev/null +++ b/services/nsxt-mp/nsx/pools/IpBlocksTypes.go @@ -0,0 +1,295 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: IpBlocks. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package pools + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func ipBlocksCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_block"] = bindings.NewReferenceType(model.IpBlockBindingType) + fieldNameMap["ip_block"] = "IpBlock" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipBlocksCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IpBlockBindingType) +} + +func ipBlocksCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ip_block"] = bindings.NewReferenceType(model.IpBlockBindingType) + fieldNameMap["ip_block"] = "IpBlock" + paramsTypeMap["ip_block"] = bindings.NewReferenceType(model.IpBlockBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_block", + "POST", + "/api/v1/pools/ip-blocks", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipBlocksDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["block_id"] = bindings.NewStringType() + fieldNameMap["block_id"] = "BlockId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipBlocksDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipBlocksDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["block_id"] = bindings.NewStringType() + fieldNameMap["block_id"] = "BlockId" + paramsTypeMap["block_id"] = bindings.NewStringType() + paramsTypeMap["blockId"] = bindings.NewStringType() + pathParams["block_id"] = "blockId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/pools/ip-blocks/{blockId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipBlocksGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["block_id"] = bindings.NewStringType() + fieldNameMap["block_id"] = "BlockId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipBlocksGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IpBlockBindingType) +} + +func ipBlocksGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["block_id"] = bindings.NewStringType() + fieldNameMap["block_id"] = "BlockId" + paramsTypeMap["block_id"] = bindings.NewStringType() + paramsTypeMap["blockId"] = bindings.NewStringType() + pathParams["block_id"] = "blockId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/pools/ip-blocks/{blockId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipBlocksListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipBlocksListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IpBlockListResultBindingType) +} + +func ipBlocksListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/pools/ip-blocks", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipBlocksUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["block_id"] = bindings.NewStringType() + fields["ip_block"] = bindings.NewReferenceType(model.IpBlockBindingType) + fieldNameMap["block_id"] = "BlockId" + fieldNameMap["ip_block"] = "IpBlock" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipBlocksUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IpBlockBindingType) +} + +func ipBlocksUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["block_id"] = bindings.NewStringType() + fields["ip_block"] = bindings.NewReferenceType(model.IpBlockBindingType) + fieldNameMap["block_id"] = "BlockId" + fieldNameMap["ip_block"] = "IpBlock" + paramsTypeMap["ip_block"] = bindings.NewReferenceType(model.IpBlockBindingType) + paramsTypeMap["block_id"] = bindings.NewStringType() + paramsTypeMap["blockId"] = bindings.NewStringType() + pathParams["block_id"] = "blockId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_block", + "PUT", + "/api/v1/pools/ip-blocks/{blockId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/pools/IpPoolsClient.go b/services/nsxt-mp/nsx/pools/IpPoolsClient.go new file mode 100644 index 000000000..59a4a7f46 --- /dev/null +++ b/services/nsxt-mp/nsx/pools/IpPoolsClient.go @@ -0,0 +1,315 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: IpPools +// Used by client-side stubs. + +package pools + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type IpPoolsClient interface { + + // Allocates or releases an IP address from the specified IP pool. To allocate an address, include ?action=ALLOCATE in the request and \"allocation_id\":null in the request body. When the request is successful, the response is \"allocation_id\": \"\", where is an IP address from the specified pool. To release an IP address (return it back to the pool), include ?action=RELEASE in the request and \"allocation_id\": in the request body, where is the address to be released. When the request is successful, the response is NULL. Tags, display_name and description attributes are not supported for AllocationIpAddress in this release. + // + // @param poolIdParam IP pool ID (required) + // @param allocationIpAddressParam (required) + // @param actionParam Specifies allocate or release action (required) + // @return com.vmware.nsx.model.AllocationIpAddress + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Allocateorrelease(poolIdParam string, allocationIpAddressParam model.AllocationIpAddress, actionParam string) (model.AllocationIpAddress, error) + + // Creates a new IPv4 or IPv6 address pool. Required parameters are allocation_ranges and cidr. Optional parameters are display_name, description, dns_nameservers, dns_suffix, and gateway_ip. + // + // @param ipPoolParam (required) + // @return com.vmware.nsx.model.IpPool + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(ipPoolParam model.IpPool) (model.IpPool, error) + + // Deletes the specified IP address pool. By default, if the IpPool is used in other configurations (such as transport node template), it won't be deleted. In such situations, pass \"force=true\" as query param to force delete the IpPool + // + // @param poolIdParam IP pool ID (required) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(poolIdParam string, forceParam *bool) error + + // Returns information about the specified IP address pool. + // + // @param poolIdParam IP pool ID (required) + // @return com.vmware.nsx.model.IpPool + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(poolIdParam string) (model.IpPool, error) + + // Returns information about the configured IP address pools. Information includes the display name and description of the pool and the details of each of the subnets in the pool, including the DNS servers, allocation ranges, gateway, and CIDR subnet address. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.IpPoolListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IpPoolListResult, error) + + // Modifies the specified IP address pool. Modifiable parameters include the description, display_name, and all subnet information. + // + // @param poolIdParam IP pool ID (required) + // @param ipPoolParam (required) + // @return com.vmware.nsx.model.IpPool + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(poolIdParam string, ipPoolParam model.IpPool) (model.IpPool, error) +} + +type ipPoolsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewIpPoolsClient(connector client.Connector) *ipPoolsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.pools.ip_pools") + methodIdentifiers := map[string]core.MethodIdentifier{ + "allocateorrelease": core.NewMethodIdentifier(interfaceIdentifier, "allocateorrelease"), + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := ipPoolsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *ipPoolsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *ipPoolsClient) Allocateorrelease(poolIdParam string, allocationIpAddressParam model.AllocationIpAddress, actionParam string) (model.AllocationIpAddress, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipPoolsAllocateorreleaseInputType(), typeConverter) + sv.AddStructField("PoolId", poolIdParam) + sv.AddStructField("AllocationIpAddress", allocationIpAddressParam) + sv.AddStructField("Action", actionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.AllocationIpAddress + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipPoolsAllocateorreleaseRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.ip_pools", "allocateorrelease", inputDataValue, executionContext) + var emptyOutput model.AllocationIpAddress + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipPoolsAllocateorreleaseOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.AllocationIpAddress), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipPoolsClient) Create(ipPoolParam model.IpPool) (model.IpPool, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipPoolsCreateInputType(), typeConverter) + sv.AddStructField("IpPool", ipPoolParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IpPool + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipPoolsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.ip_pools", "create", inputDataValue, executionContext) + var emptyOutput model.IpPool + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipPoolsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IpPool), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipPoolsClient) Delete(poolIdParam string, forceParam *bool) error { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipPoolsDeleteInputType(), typeConverter) + sv.AddStructField("PoolId", poolIdParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipPoolsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.ip_pools", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *ipPoolsClient) Get(poolIdParam string) (model.IpPool, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipPoolsGetInputType(), typeConverter) + sv.AddStructField("PoolId", poolIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IpPool + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipPoolsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.ip_pools", "get", inputDataValue, executionContext) + var emptyOutput model.IpPool + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipPoolsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IpPool), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipPoolsClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IpPoolListResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipPoolsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IpPoolListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipPoolsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.ip_pools", "list", inputDataValue, executionContext) + var emptyOutput model.IpPoolListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipPoolsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IpPoolListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipPoolsClient) Update(poolIdParam string, ipPoolParam model.IpPool) (model.IpPool, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipPoolsUpdateInputType(), typeConverter) + sv.AddStructField("PoolId", poolIdParam) + sv.AddStructField("IpPool", ipPoolParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IpPool + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipPoolsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.ip_pools", "update", inputDataValue, executionContext) + var emptyOutput model.IpPool + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipPoolsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IpPool), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/pools/IpPoolsTypes.go b/services/nsxt-mp/nsx/pools/IpPoolsTypes.go new file mode 100644 index 000000000..e56e64a51 --- /dev/null +++ b/services/nsxt-mp/nsx/pools/IpPoolsTypes.go @@ -0,0 +1,368 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: IpPools. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package pools + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``action`` of method IpPools#allocateorrelease. +const IpPools_ALLOCATEORRELEASE_ACTION_ALLOCATE = "ALLOCATE" + +// Possible value for ``action`` of method IpPools#allocateorrelease. +const IpPools_ALLOCATEORRELEASE_ACTION_RELEASE = "RELEASE" + +func ipPoolsAllocateorreleaseInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["pool_id"] = bindings.NewStringType() + fields["allocation_ip_address"] = bindings.NewReferenceType(model.AllocationIpAddressBindingType) + fields["action"] = bindings.NewStringType() + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["allocation_ip_address"] = "AllocationIpAddress" + fieldNameMap["action"] = "Action" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipPoolsAllocateorreleaseOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.AllocationIpAddressBindingType) +} + +func ipPoolsAllocateorreleaseRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["pool_id"] = bindings.NewStringType() + fields["allocation_ip_address"] = bindings.NewReferenceType(model.AllocationIpAddressBindingType) + fields["action"] = bindings.NewStringType() + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["allocation_ip_address"] = "AllocationIpAddress" + fieldNameMap["action"] = "Action" + paramsTypeMap["allocation_ip_address"] = bindings.NewReferenceType(model.AllocationIpAddressBindingType) + paramsTypeMap["action"] = bindings.NewStringType() + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + queryParams["action"] = "action" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "allocation_ip_address", + "POST", + "/api/v1/pools/ip-pools/{poolId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipPoolsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_pool"] = bindings.NewReferenceType(model.IpPoolBindingType) + fieldNameMap["ip_pool"] = "IpPool" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipPoolsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IpPoolBindingType) +} + +func ipPoolsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ip_pool"] = bindings.NewReferenceType(model.IpPoolBindingType) + fieldNameMap["ip_pool"] = "IpPool" + paramsTypeMap["ip_pool"] = bindings.NewReferenceType(model.IpPoolBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_pool", + "POST", + "/api/v1/pools/ip-pools", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipPoolsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["pool_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipPoolsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipPoolsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["pool_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["force"] = "Force" + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/pools/ip-pools/{poolId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipPoolsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["pool_id"] = bindings.NewStringType() + fieldNameMap["pool_id"] = "PoolId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipPoolsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IpPoolBindingType) +} + +func ipPoolsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["pool_id"] = bindings.NewStringType() + fieldNameMap["pool_id"] = "PoolId" + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/pools/ip-pools/{poolId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipPoolsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipPoolsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IpPoolListResultBindingType) +} + +func ipPoolsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/pools/ip-pools", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipPoolsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["pool_id"] = bindings.NewStringType() + fields["ip_pool"] = bindings.NewReferenceType(model.IpPoolBindingType) + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["ip_pool"] = "IpPool" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipPoolsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IpPoolBindingType) +} + +func ipPoolsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["pool_id"] = bindings.NewStringType() + fields["ip_pool"] = bindings.NewReferenceType(model.IpPoolBindingType) + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["ip_pool"] = "IpPool" + paramsTypeMap["ip_pool"] = bindings.NewReferenceType(model.IpPoolBindingType) + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_pool", + "PUT", + "/api/v1/pools/ip-pools/{poolId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/pools/IpSubnetsClient.go b/services/nsxt-mp/nsx/pools/IpSubnetsClient.go new file mode 100644 index 000000000..9d1cc42c2 --- /dev/null +++ b/services/nsxt-mp/nsx/pools/IpSubnetsClient.go @@ -0,0 +1,271 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: IpSubnets +// Used by client-side stubs. + +package pools + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type IpSubnetsClient interface { + + // Allocates or releases an IP address from the specified IP subnet. To allocate an address, include ?action=ALLOCATE in the request and a \"{}\" in the request body. When the request is successful, the response is \"allocation_id\": \"\", where is an IP address from the specified pool. To release an IP address (return it back to the pool), include ?action=RELEASE in the request and \"allocation_id\": in the request body, where is the address to be released. When the request is successful, the response is NULL. + // + // @param subnetIdParam IP subnet id (required) + // @param allocationIpAddressParam (required) + // @param actionParam Specifies allocate or release action (required) + // @return com.vmware.nsx.model.AllocationIpAddress + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Allocateorreleasefromipblocksubnet(subnetIdParam string, allocationIpAddressParam model.AllocationIpAddress, actionParam string) (model.AllocationIpAddress, error) + + // Carves out a subnet of requested size from the specified IP block. The \"size\" parameter and the \"block_id \" are the requireds field while invoking this API. If the IP block has sufficient resources/space to allocate a subnet of specified size, the response will contain all the details of the newly created subnet including the display_name, description, cidr & allocation_ranges. Returns a conflict error if the IP block does not have enough resources/space to allocate a subnet of the requested size. + // + // @param ipBlockSubnetParam (required) + // @return com.vmware.nsx.model.IpBlockSubnet + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(ipBlockSubnetParam model.IpBlockSubnet) (model.IpBlockSubnet, error) + + // Deletes a subnet with specified id within a given IP address block. Deletion is allowed only when there are no allocated IP addresses from that subnet. + // + // @param subnetIdParam Subnet id (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(subnetIdParam string) error + + // Returns information about the subnet with specified id within a given IP address block. Information includes display_name, description, cidr and allocation_ranges. + // + // @param subnetIdParam Subnet id (required) + // @return com.vmware.nsx.model.IpBlockSubnet + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(subnetIdParam string) (model.IpBlockSubnet, error) + + // Returns information about all subnets present within an IP address block. Information includes subnet's id, display_name, description, cidr and allocation ranges. + // + // @param blockIdParam (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.IpBlockSubnetListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(blockIdParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IpBlockSubnetListResult, error) +} + +type ipSubnetsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewIpSubnetsClient(connector client.Connector) *ipSubnetsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.pools.ip_subnets") + methodIdentifiers := map[string]core.MethodIdentifier{ + "allocateorreleasefromipblocksubnet": core.NewMethodIdentifier(interfaceIdentifier, "allocateorreleasefromipblocksubnet"), + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := ipSubnetsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *ipSubnetsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *ipSubnetsClient) Allocateorreleasefromipblocksubnet(subnetIdParam string, allocationIpAddressParam model.AllocationIpAddress, actionParam string) (model.AllocationIpAddress, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipSubnetsAllocateorreleasefromipblocksubnetInputType(), typeConverter) + sv.AddStructField("SubnetId", subnetIdParam) + sv.AddStructField("AllocationIpAddress", allocationIpAddressParam) + sv.AddStructField("Action", actionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.AllocationIpAddress + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipSubnetsAllocateorreleasefromipblocksubnetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.ip_subnets", "allocateorreleasefromipblocksubnet", inputDataValue, executionContext) + var emptyOutput model.AllocationIpAddress + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipSubnetsAllocateorreleasefromipblocksubnetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.AllocationIpAddress), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipSubnetsClient) Create(ipBlockSubnetParam model.IpBlockSubnet) (model.IpBlockSubnet, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipSubnetsCreateInputType(), typeConverter) + sv.AddStructField("IpBlockSubnet", ipBlockSubnetParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IpBlockSubnet + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipSubnetsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.ip_subnets", "create", inputDataValue, executionContext) + var emptyOutput model.IpBlockSubnet + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipSubnetsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IpBlockSubnet), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipSubnetsClient) Delete(subnetIdParam string) error { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipSubnetsDeleteInputType(), typeConverter) + sv.AddStructField("SubnetId", subnetIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipSubnetsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.ip_subnets", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *ipSubnetsClient) Get(subnetIdParam string) (model.IpBlockSubnet, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipSubnetsGetInputType(), typeConverter) + sv.AddStructField("SubnetId", subnetIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IpBlockSubnet + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipSubnetsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.ip_subnets", "get", inputDataValue, executionContext) + var emptyOutput model.IpBlockSubnet + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipSubnetsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IpBlockSubnet), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ipSubnetsClient) List(blockIdParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IpBlockSubnetListResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ipSubnetsListInputType(), typeConverter) + sv.AddStructField("BlockId", blockIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IpBlockSubnetListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ipSubnetsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.ip_subnets", "list", inputDataValue, executionContext) + var emptyOutput model.IpBlockSubnetListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ipSubnetsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IpBlockSubnetListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/pools/IpSubnetsTypes.go b/services/nsxt-mp/nsx/pools/IpSubnetsTypes.go new file mode 100644 index 000000000..98ad10e32 --- /dev/null +++ b/services/nsxt-mp/nsx/pools/IpSubnetsTypes.go @@ -0,0 +1,313 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: IpSubnets. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package pools + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``action`` of method IpSubnets#allocateorreleasefromipblocksubnet. +const IpSubnets_ALLOCATEORRELEASEFROMIPBLOCKSUBNET_ACTION_ALLOCATE = "ALLOCATE" + +// Possible value for ``action`` of method IpSubnets#allocateorreleasefromipblocksubnet. +const IpSubnets_ALLOCATEORRELEASEFROMIPBLOCKSUBNET_ACTION_RELEASE = "RELEASE" + +func ipSubnetsAllocateorreleasefromipblocksubnetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["subnet_id"] = bindings.NewStringType() + fields["allocation_ip_address"] = bindings.NewReferenceType(model.AllocationIpAddressBindingType) + fields["action"] = bindings.NewStringType() + fieldNameMap["subnet_id"] = "SubnetId" + fieldNameMap["allocation_ip_address"] = "AllocationIpAddress" + fieldNameMap["action"] = "Action" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipSubnetsAllocateorreleasefromipblocksubnetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.AllocationIpAddressBindingType) +} + +func ipSubnetsAllocateorreleasefromipblocksubnetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["subnet_id"] = bindings.NewStringType() + fields["allocation_ip_address"] = bindings.NewReferenceType(model.AllocationIpAddressBindingType) + fields["action"] = bindings.NewStringType() + fieldNameMap["subnet_id"] = "SubnetId" + fieldNameMap["allocation_ip_address"] = "AllocationIpAddress" + fieldNameMap["action"] = "Action" + paramsTypeMap["allocation_ip_address"] = bindings.NewReferenceType(model.AllocationIpAddressBindingType) + paramsTypeMap["action"] = bindings.NewStringType() + paramsTypeMap["subnet_id"] = bindings.NewStringType() + paramsTypeMap["subnetId"] = bindings.NewStringType() + pathParams["subnet_id"] = "subnetId" + queryParams["action"] = "action" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "allocation_ip_address", + "POST", + "/api/v1/pools/ip-subnets/{subnetId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipSubnetsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_block_subnet"] = bindings.NewReferenceType(model.IpBlockSubnetBindingType) + fieldNameMap["ip_block_subnet"] = "IpBlockSubnet" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipSubnetsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IpBlockSubnetBindingType) +} + +func ipSubnetsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ip_block_subnet"] = bindings.NewReferenceType(model.IpBlockSubnetBindingType) + fieldNameMap["ip_block_subnet"] = "IpBlockSubnet" + paramsTypeMap["ip_block_subnet"] = bindings.NewReferenceType(model.IpBlockSubnetBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_block_subnet", + "POST", + "/api/v1/pools/ip-subnets", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipSubnetsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["subnet_id"] = bindings.NewStringType() + fieldNameMap["subnet_id"] = "SubnetId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipSubnetsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ipSubnetsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["subnet_id"] = bindings.NewStringType() + fieldNameMap["subnet_id"] = "SubnetId" + paramsTypeMap["subnet_id"] = bindings.NewStringType() + paramsTypeMap["subnetId"] = bindings.NewStringType() + pathParams["subnet_id"] = "subnetId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/pools/ip-subnets/{subnetId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipSubnetsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["subnet_id"] = bindings.NewStringType() + fieldNameMap["subnet_id"] = "SubnetId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipSubnetsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IpBlockSubnetBindingType) +} + +func ipSubnetsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["subnet_id"] = bindings.NewStringType() + fieldNameMap["subnet_id"] = "SubnetId" + paramsTypeMap["subnet_id"] = bindings.NewStringType() + paramsTypeMap["subnetId"] = bindings.NewStringType() + pathParams["subnet_id"] = "subnetId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/pools/ip-subnets/{subnetId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ipSubnetsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["block_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["block_id"] = "BlockId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ipSubnetsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IpBlockSubnetListResultBindingType) +} + +func ipSubnetsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["block_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["block_id"] = "BlockId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["block_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["block_id"] = "block_id" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/pools/ip-subnets", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/pools/MacPoolsClient.go b/services/nsxt-mp/nsx/pools/MacPoolsClient.go new file mode 100644 index 000000000..8a5aa077c --- /dev/null +++ b/services/nsxt-mp/nsx/pools/MacPoolsClient.go @@ -0,0 +1,141 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: MacPools +// Used by client-side stubs. + +package pools + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type MacPoolsClient interface { + + // Returns information about the specified MAC pool. + // + // @param poolIdParam MAC pool ID (required) + // @return com.vmware.nsx.model.MacPool + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(poolIdParam string) (model.MacPool, error) + + // Returns a list of all the MAC pools + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.MacPoolListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.MacPoolListResult, error) +} + +type macPoolsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewMacPoolsClient(connector client.Connector) *macPoolsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.pools.mac_pools") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := macPoolsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *macPoolsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *macPoolsClient) Get(poolIdParam string) (model.MacPool, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(macPoolsGetInputType(), typeConverter) + sv.AddStructField("PoolId", poolIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MacPool + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := macPoolsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.mac_pools", "get", inputDataValue, executionContext) + var emptyOutput model.MacPool + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), macPoolsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MacPool), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (mIface *macPoolsClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.MacPoolListResult, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(macPoolsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.MacPoolListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := macPoolsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.mac_pools", "list", inputDataValue, executionContext) + var emptyOutput model.MacPoolListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), macPoolsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.MacPoolListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/pools/MacPoolsTypes.go b/services/nsxt-mp/nsx/pools/MacPoolsTypes.go new file mode 100644 index 000000000..c8701fae4 --- /dev/null +++ b/services/nsxt-mp/nsx/pools/MacPoolsTypes.go @@ -0,0 +1,142 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: MacPools. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package pools + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func macPoolsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["pool_id"] = bindings.NewStringType() + fieldNameMap["pool_id"] = "PoolId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func macPoolsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MacPoolBindingType) +} + +func macPoolsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["pool_id"] = bindings.NewStringType() + fieldNameMap["pool_id"] = "PoolId" + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/pools/mac-pools/{poolId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func macPoolsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func macPoolsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.MacPoolListResultBindingType) +} + +func macPoolsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/pools/mac-pools", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/pools/PoolsPackageTypes.go b/services/nsxt-mp/nsx/pools/PoolsPackageTypes.go new file mode 100644 index 000000000..4aa0dd232 --- /dev/null +++ b/services/nsxt-mp/nsx/pools/PoolsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.pools. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package pools diff --git a/services/nsxt-mp/nsx/pools/VniPoolsClient.go b/services/nsxt-mp/nsx/pools/VniPoolsClient.go new file mode 100644 index 000000000..030c59f24 --- /dev/null +++ b/services/nsxt-mp/nsx/pools/VniPoolsClient.go @@ -0,0 +1,267 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: VniPools +// Used by client-side stubs. + +package pools + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type VniPoolsClient interface { + + // Creates a new VNI pool using the specified VNI pool range. The range should be non-overlapping with an existing range. If the range in payload is present or overlaps with an existing range, return code 400 with bad request and an error message is returned mentioning that the given range overlaps with an existing range. + // + // @param vniPoolParam (required) + // @return com.vmware.nsx.model.VniPool + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(vniPoolParam model.VniPool) (model.VniPool, error) + + // Deletes the given VNI pool. + // + // @param poolIdParam VNI pool id (required) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(poolIdParam string, forceParam *bool) error + + // Returns information about the specified virtual network identifier (VNI) pool. + // + // @param poolIdParam VNI pool ID (required) + // @return com.vmware.nsx.model.VniPool + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(poolIdParam string) (model.VniPool, error) + + // Returns information about the default and configured virtual network identifier (VNI) pools for use when building logical network segments. Each virtual network has a unique ID called a VNI. Instead of creating a new VNI each time you need a new logical switch, you can instead allocate a VNI from a VNI pool. VNI pools are sometimes called segment ID pools. Each VNI pool has a range of usable VNIs. By default, there is one pool with two ranges [5000, 65535] and [65536, 75000]. To create multiple smaller pools, specify a smaller range for each pool such as 75001-75100 and 75101-75200. The VNI range determines the maximum number of logical switches that can be created in each network segment. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.VniPoolListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.VniPoolListResult, error) + + // Updates the specified VNI pool. Modifiable parameters include description, display_name and ranges. Ranges can be added, modified or deleted. Overlapping ranges are not allowed. Only range end can be modified for any existing range. Range shrinking or deletion is not allowed if there are any allocated VNIs. + // + // @param poolIdParam VNI pool ID (required) + // @param vniPoolParam (required) + // @return com.vmware.nsx.model.VniPool + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(poolIdParam string, vniPoolParam model.VniPool) (model.VniPool, error) +} + +type vniPoolsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewVniPoolsClient(connector client.Connector) *vniPoolsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.pools.vni_pools") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + vIface := vniPoolsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &vIface +} + +func (vIface *vniPoolsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := vIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (vIface *vniPoolsClient) Create(vniPoolParam model.VniPool) (model.VniPool, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(vniPoolsCreateInputType(), typeConverter) + sv.AddStructField("VniPool", vniPoolParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.VniPool + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := vniPoolsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.vni_pools", "create", inputDataValue, executionContext) + var emptyOutput model.VniPool + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), vniPoolsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.VniPool), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (vIface *vniPoolsClient) Delete(poolIdParam string, forceParam *bool) error { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(vniPoolsDeleteInputType(), typeConverter) + sv.AddStructField("PoolId", poolIdParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := vniPoolsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.vni_pools", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (vIface *vniPoolsClient) Get(poolIdParam string) (model.VniPool, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(vniPoolsGetInputType(), typeConverter) + sv.AddStructField("PoolId", poolIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.VniPool + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := vniPoolsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.vni_pools", "get", inputDataValue, executionContext) + var emptyOutput model.VniPool + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), vniPoolsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.VniPool), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (vIface *vniPoolsClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.VniPoolListResult, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(vniPoolsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.VniPoolListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := vniPoolsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.vni_pools", "list", inputDataValue, executionContext) + var emptyOutput model.VniPoolListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), vniPoolsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.VniPoolListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (vIface *vniPoolsClient) Update(poolIdParam string, vniPoolParam model.VniPool) (model.VniPool, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(vniPoolsUpdateInputType(), typeConverter) + sv.AddStructField("PoolId", poolIdParam) + sv.AddStructField("VniPool", vniPoolParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.VniPool + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := vniPoolsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.vni_pools", "update", inputDataValue, executionContext) + var emptyOutput model.VniPool + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), vniPoolsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.VniPool), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/pools/VniPoolsTypes.go b/services/nsxt-mp/nsx/pools/VniPoolsTypes.go new file mode 100644 index 000000000..241b9581b --- /dev/null +++ b/services/nsxt-mp/nsx/pools/VniPoolsTypes.go @@ -0,0 +1,301 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: VniPools. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package pools + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func vniPoolsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["vni_pool"] = bindings.NewReferenceType(model.VniPoolBindingType) + fieldNameMap["vni_pool"] = "VniPool" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func vniPoolsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.VniPoolBindingType) +} + +func vniPoolsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["vni_pool"] = bindings.NewReferenceType(model.VniPoolBindingType) + fieldNameMap["vni_pool"] = "VniPool" + paramsTypeMap["vni_pool"] = bindings.NewReferenceType(model.VniPoolBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "vni_pool", + "POST", + "/api/v1/pools/vni-pools", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func vniPoolsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["pool_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func vniPoolsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func vniPoolsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["pool_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["force"] = "Force" + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/pools/vni-pools/{poolId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func vniPoolsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["pool_id"] = bindings.NewStringType() + fieldNameMap["pool_id"] = "PoolId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func vniPoolsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.VniPoolBindingType) +} + +func vniPoolsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["pool_id"] = bindings.NewStringType() + fieldNameMap["pool_id"] = "PoolId" + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/pools/vni-pools/{poolId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func vniPoolsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func vniPoolsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.VniPoolListResultBindingType) +} + +func vniPoolsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/pools/vni-pools", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func vniPoolsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["pool_id"] = bindings.NewStringType() + fields["vni_pool"] = bindings.NewReferenceType(model.VniPoolBindingType) + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["vni_pool"] = "VniPool" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func vniPoolsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.VniPoolBindingType) +} + +func vniPoolsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["pool_id"] = bindings.NewStringType() + fields["vni_pool"] = bindings.NewReferenceType(model.VniPoolBindingType) + fieldNameMap["pool_id"] = "PoolId" + fieldNameMap["vni_pool"] = "VniPool" + paramsTypeMap["vni_pool"] = bindings.NewReferenceType(model.VniPoolBindingType) + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "vni_pool", + "PUT", + "/api/v1/pools/vni-pools/{poolId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/pools/VtepLabelPoolsClient.go b/services/nsxt-mp/nsx/pools/VtepLabelPoolsClient.go new file mode 100644 index 000000000..1ef85b152 --- /dev/null +++ b/services/nsxt-mp/nsx/pools/VtepLabelPoolsClient.go @@ -0,0 +1,141 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: VtepLabelPools +// Used by client-side stubs. + +package pools + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type VtepLabelPoolsClient interface { + + // Returns information about the specified virtual tunnel endpoint label pool. + // + // @param poolIdParam Virtual tunnel endpoint label pool ID (required) + // @return com.vmware.nsx.model.VtepLabelPool + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(poolIdParam string) (model.VtepLabelPool, error) + + // Returns a list of all virtual tunnel endpoint label pools + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.VtepLabelPoolListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.VtepLabelPoolListResult, error) +} + +type vtepLabelPoolsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewVtepLabelPoolsClient(connector client.Connector) *vtepLabelPoolsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.pools.vtep_label_pools") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + vIface := vtepLabelPoolsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &vIface +} + +func (vIface *vtepLabelPoolsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := vIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (vIface *vtepLabelPoolsClient) Get(poolIdParam string) (model.VtepLabelPool, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(vtepLabelPoolsGetInputType(), typeConverter) + sv.AddStructField("PoolId", poolIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.VtepLabelPool + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := vtepLabelPoolsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.vtep_label_pools", "get", inputDataValue, executionContext) + var emptyOutput model.VtepLabelPool + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), vtepLabelPoolsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.VtepLabelPool), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (vIface *vtepLabelPoolsClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.VtepLabelPoolListResult, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(vtepLabelPoolsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.VtepLabelPoolListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := vtepLabelPoolsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.vtep_label_pools", "list", inputDataValue, executionContext) + var emptyOutput model.VtepLabelPoolListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), vtepLabelPoolsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.VtepLabelPoolListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/pools/VtepLabelPoolsTypes.go b/services/nsxt-mp/nsx/pools/VtepLabelPoolsTypes.go new file mode 100644 index 000000000..2a0751274 --- /dev/null +++ b/services/nsxt-mp/nsx/pools/VtepLabelPoolsTypes.go @@ -0,0 +1,142 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: VtepLabelPools. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package pools + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func vtepLabelPoolsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["pool_id"] = bindings.NewStringType() + fieldNameMap["pool_id"] = "PoolId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func vtepLabelPoolsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.VtepLabelPoolBindingType) +} + +func vtepLabelPoolsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["pool_id"] = bindings.NewStringType() + fieldNameMap["pool_id"] = "PoolId" + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/pools/vtep-label-pools/{poolId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func vtepLabelPoolsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func vtepLabelPoolsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.VtepLabelPoolListResultBindingType) +} + +func vtepLabelPoolsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/pools/vtep-label-pools", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/pools/ip_pools/AllocationsClient.go b/services/nsxt-mp/nsx/pools/ip_pools/AllocationsClient.go new file mode 100644 index 000000000..bee1bf0a3 --- /dev/null +++ b/services/nsxt-mp/nsx/pools/ip_pools/AllocationsClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Allocations +// Used by client-side stubs. + +package ip_pools + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AllocationsClient interface { + + // Returns information about which addresses have been allocated from a specified IP address pool. + // + // @param poolIdParam IP pool ID (required) + // @return com.vmware.nsx.model.AllocationIpAddressListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(poolIdParam string) (model.AllocationIpAddressListResult, error) +} + +type allocationsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAllocationsClient(connector client.Connector) *allocationsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.pools.ip_pools.allocations") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := allocationsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *allocationsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *allocationsClient) List(poolIdParam string) (model.AllocationIpAddressListResult, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(allocationsListInputType(), typeConverter) + sv.AddStructField("PoolId", poolIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.AllocationIpAddressListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := allocationsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.pools.ip_pools.allocations", "list", inputDataValue, executionContext) + var emptyOutput model.AllocationIpAddressListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), allocationsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.AllocationIpAddressListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/pools/ip_pools/AllocationsTypes.go b/services/nsxt-mp/nsx/pools/ip_pools/AllocationsTypes.go new file mode 100644 index 000000000..f0b5d3486 --- /dev/null +++ b/services/nsxt-mp/nsx/pools/ip_pools/AllocationsTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Allocations. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ip_pools + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func allocationsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["pool_id"] = bindings.NewStringType() + fieldNameMap["pool_id"] = "PoolId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func allocationsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.AllocationIpAddressListResultBindingType) +} + +func allocationsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["pool_id"] = bindings.NewStringType() + fieldNameMap["pool_id"] = "PoolId" + paramsTypeMap["pool_id"] = bindings.NewStringType() + paramsTypeMap["poolId"] = bindings.NewStringType() + pathParams["pool_id"] = "poolId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/pools/ip-pools/{poolId}/allocations", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/pools/ip_pools/IpPoolsPackageTypes.go b/services/nsxt-mp/nsx/pools/ip_pools/IpPoolsPackageTypes.go new file mode 100644 index 000000000..3bf4bc773 --- /dev/null +++ b/services/nsxt-mp/nsx/pools/ip_pools/IpPoolsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.pools.ip_pools. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ip_pools diff --git a/services/nsxt-mp/nsx/proxy/ConfigClient.go b/services/nsxt-mp/nsx/proxy/ConfigClient.go new file mode 100644 index 000000000..b2f01a6fe --- /dev/null +++ b/services/nsxt-mp/nsx/proxy/ConfigClient.go @@ -0,0 +1,130 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Config +// Used by client-side stubs. + +package proxy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ConfigClient interface { + + // Returns the proxy configuration. + // @return com.vmware.nsx.model.Proxy + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.Proxy, error) + + // Updates or creates the proxy configuration, and returns the new configuration. + // + // @param proxyParam (required) + // @return com.vmware.nsx.model.Proxy + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(proxyParam model.Proxy) (model.Proxy, error) +} + +type configClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewConfigClient(connector client.Connector) *configClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.proxy.config") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := configClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *configClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *configClient) Get() (model.Proxy, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(configGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Proxy + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := configGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.proxy.config", "get", inputDataValue, executionContext) + var emptyOutput model.Proxy + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), configGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Proxy), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *configClient) Update(proxyParam model.Proxy) (model.Proxy, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(configUpdateInputType(), typeConverter) + sv.AddStructField("Proxy", proxyParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Proxy + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := configUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.proxy.config", "update", inputDataValue, executionContext) + var emptyOutput model.Proxy + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), configUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Proxy), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/proxy/ConfigTypes.go b/services/nsxt-mp/nsx/proxy/ConfigTypes.go new file mode 100644 index 000000000..5c4406e64 --- /dev/null +++ b/services/nsxt-mp/nsx/proxy/ConfigTypes.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Config. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package proxy + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func configGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func configGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ProxyBindingType) +} + +func configGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/proxy/config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func configUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["proxy"] = bindings.NewReferenceType(model.ProxyBindingType) + fieldNameMap["proxy"] = "Proxy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func configUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ProxyBindingType) +} + +func configUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["proxy"] = bindings.NewReferenceType(model.ProxyBindingType) + fieldNameMap["proxy"] = "Proxy" + paramsTypeMap["proxy"] = bindings.NewReferenceType(model.ProxyBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "proxy", + "PUT", + "/api/v1/proxy/config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/proxy/ProxyPackageTypes.go b/services/nsxt-mp/nsx/proxy/ProxyPackageTypes.go new file mode 100644 index 000000000..7c99aab64 --- /dev/null +++ b/services/nsxt-mp/nsx/proxy/ProxyPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.proxy. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package proxy diff --git a/services/nsxt-mp/nsx/realization_state_barrier/ConfigClient.go b/services/nsxt-mp/nsx/realization_state_barrier/ConfigClient.go new file mode 100644 index 000000000..d36893eef --- /dev/null +++ b/services/nsxt-mp/nsx/realization_state_barrier/ConfigClient.go @@ -0,0 +1,130 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Config +// Used by client-side stubs. + +package realization_state_barrier + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ConfigClient interface { + + // Returns the current barrier configuration + // @return com.vmware.nsx.model.RealizationStateBarrierConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.RealizationStateBarrierConfig, error) + + // Updates the barrier configuration having interval set in milliseconds The new interval that automatically increments the global realization number + // + // @param realizationStateBarrierConfigParam (required) + // @return com.vmware.nsx.model.RealizationStateBarrierConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(realizationStateBarrierConfigParam model.RealizationStateBarrierConfig) (model.RealizationStateBarrierConfig, error) +} + +type configClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewConfigClient(connector client.Connector) *configClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.realization_state_barrier.config") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := configClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *configClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *configClient) Get() (model.RealizationStateBarrierConfig, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(configGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RealizationStateBarrierConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := configGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.realization_state_barrier.config", "get", inputDataValue, executionContext) + var emptyOutput model.RealizationStateBarrierConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), configGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RealizationStateBarrierConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *configClient) Update(realizationStateBarrierConfigParam model.RealizationStateBarrierConfig) (model.RealizationStateBarrierConfig, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(configUpdateInputType(), typeConverter) + sv.AddStructField("RealizationStateBarrierConfig", realizationStateBarrierConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RealizationStateBarrierConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := configUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.realization_state_barrier.config", "update", inputDataValue, executionContext) + var emptyOutput model.RealizationStateBarrierConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), configUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RealizationStateBarrierConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/realization_state_barrier/ConfigTypes.go b/services/nsxt-mp/nsx/realization_state_barrier/ConfigTypes.go new file mode 100644 index 000000000..d374442d6 --- /dev/null +++ b/services/nsxt-mp/nsx/realization_state_barrier/ConfigTypes.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Config. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package realization_state_barrier + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func configGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func configGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RealizationStateBarrierConfigBindingType) +} + +func configGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/realization-state-barrier/config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func configUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["realization_state_barrier_config"] = bindings.NewReferenceType(model.RealizationStateBarrierConfigBindingType) + fieldNameMap["realization_state_barrier_config"] = "RealizationStateBarrierConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func configUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RealizationStateBarrierConfigBindingType) +} + +func configUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["realization_state_barrier_config"] = bindings.NewReferenceType(model.RealizationStateBarrierConfigBindingType) + fieldNameMap["realization_state_barrier_config"] = "RealizationStateBarrierConfig" + paramsTypeMap["realization_state_barrier_config"] = bindings.NewReferenceType(model.RealizationStateBarrierConfigBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "realization_state_barrier_config", + "PUT", + "/api/v1/realization-state-barrier/config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/realization_state_barrier/CurrentClient.go b/services/nsxt-mp/nsx/realization_state_barrier/CurrentClient.go new file mode 100644 index 000000000..c38f4e8fa --- /dev/null +++ b/services/nsxt-mp/nsx/realization_state_barrier/CurrentClient.go @@ -0,0 +1,127 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Current +// Used by client-side stubs. + +package realization_state_barrier + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type CurrentClient interface { + + // Returns the current global realization barrier number for NSX. This method has been deprecated. To track realization state, use X-NSX-REQUESTID request header instead. + // @return com.vmware.nsx.model.CurrentRealizationStateBarrier + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.CurrentRealizationStateBarrier, error) + + // Increment the current barrier number by 1 for NSX. This method has been deprecated. To track realization state, use X-NSX-REQUESTID request header instead. + // @return com.vmware.nsx.model.CurrentRealizationStateBarrier + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Increment() (model.CurrentRealizationStateBarrier, error) +} + +type currentClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewCurrentClient(connector client.Connector) *currentClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.realization_state_barrier.current") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "increment": core.NewMethodIdentifier(interfaceIdentifier, "increment"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := currentClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *currentClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *currentClient) Get() (model.CurrentRealizationStateBarrier, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(currentGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CurrentRealizationStateBarrier + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := currentGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.realization_state_barrier.current", "get", inputDataValue, executionContext) + var emptyOutput model.CurrentRealizationStateBarrier + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), currentGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CurrentRealizationStateBarrier), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *currentClient) Increment() (model.CurrentRealizationStateBarrier, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(currentIncrementInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CurrentRealizationStateBarrier + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := currentIncrementRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.realization_state_barrier.current", "increment", inputDataValue, executionContext) + var emptyOutput model.CurrentRealizationStateBarrier + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), currentIncrementOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CurrentRealizationStateBarrier), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/realization_state_barrier/CurrentTypes.go b/services/nsxt-mp/nsx/realization_state_barrier/CurrentTypes.go new file mode 100644 index 000000000..2cded7d8d --- /dev/null +++ b/services/nsxt-mp/nsx/realization_state_barrier/CurrentTypes.go @@ -0,0 +1,105 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Current. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package realization_state_barrier + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func currentGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func currentGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CurrentRealizationStateBarrierBindingType) +} + +func currentGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/realization-state-barrier/current", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func currentIncrementInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func currentIncrementOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CurrentRealizationStateBarrierBindingType) +} + +func currentIncrementRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=increment", + "", + "POST", + "/api/v1/realization-state-barrier/current", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/realization_state_barrier/RealizationStateBarrierPackageTypes.go b/services/nsxt-mp/nsx/realization_state_barrier/RealizationStateBarrierPackageTypes.go new file mode 100644 index 000000000..4ea1ef5f3 --- /dev/null +++ b/services/nsxt-mp/nsx/realization_state_barrier/RealizationStateBarrierPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.realization_state_barrier. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package realization_state_barrier diff --git a/services/nsxt-mp/nsx/repository/BundlesClient.go b/services/nsxt-mp/nsx/repository/BundlesClient.go new file mode 100644 index 000000000..b256841c2 --- /dev/null +++ b/services/nsxt-mp/nsx/repository/BundlesClient.go @@ -0,0 +1,178 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Bundles +// Used by client-side stubs. + +package repository + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type BundlesClient interface { + + // Cancel upload of bundle. This API works only when bundle upload is in-progress and will not work during post-processing of bundle. If bundle upload is in-progress, then the API call returns http OK response after cancelling the upload and deleting partially uploaded bundle. + // + // @param bundleIdParam (required) + // @param productParam Name of the appliance (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Cancelupload(bundleIdParam string, productParam string) error + + // Upload the bundle from remote bundle URL. The call returns after fetch is initiated. Check status by periodically retrieving bundle upload status using GET /repository/bundles//upload-status. The upload is complete when the status is SUCCESS. + // + // @param remoteBundleUrlParam (required) + // @param fileTypeParam Type of file (required) + // @param productParam Name of the appliance (required) + // @return com.vmware.nsx.model.BundleId + // @throws Unauthenticated Unauthorized + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(remoteBundleUrlParam model.RemoteBundleUrl, fileTypeParam string, productParam string) (model.BundleId, error) + + // Get list of bundle-ids which are available in repository or in-progress + // + // @param fileTypeParam Type of file (required) + // @param productParam Name of the appliance (required) + // @return com.vmware.nsx.model.BundleIds + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(fileTypeParam string, productParam string) (model.BundleIds, error) +} + +type bundlesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewBundlesClient(connector client.Connector) *bundlesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.repository.bundles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "cancelupload": core.NewMethodIdentifier(interfaceIdentifier, "cancelupload"), + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + bIface := bundlesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &bIface +} + +func (bIface *bundlesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := bIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (bIface *bundlesClient) Cancelupload(bundleIdParam string, productParam string) error { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bundlesCanceluploadInputType(), typeConverter) + sv.AddStructField("BundleId", bundleIdParam) + sv.AddStructField("Product", productParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bundlesCanceluploadRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.repository.bundles", "cancelupload", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (bIface *bundlesClient) Create(remoteBundleUrlParam model.RemoteBundleUrl, fileTypeParam string, productParam string) (model.BundleId, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bundlesCreateInputType(), typeConverter) + sv.AddStructField("RemoteBundleUrl", remoteBundleUrlParam) + sv.AddStructField("FileType", fileTypeParam) + sv.AddStructField("Product", productParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BundleId + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bundlesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.repository.bundles", "create", inputDataValue, executionContext) + var emptyOutput model.BundleId + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bundlesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BundleId), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (bIface *bundlesClient) Get(fileTypeParam string, productParam string) (model.BundleIds, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bundlesGetInputType(), typeConverter) + sv.AddStructField("FileType", fileTypeParam) + sv.AddStructField("Product", productParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BundleIds + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bundlesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.repository.bundles", "get", inputDataValue, executionContext) + var emptyOutput model.BundleIds + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bundlesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BundleIds), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/repository/BundlesTypes.go b/services/nsxt-mp/nsx/repository/BundlesTypes.go new file mode 100644 index 000000000..d50c24c7e --- /dev/null +++ b/services/nsxt-mp/nsx/repository/BundlesTypes.go @@ -0,0 +1,225 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Bundles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package repository + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``product`` of method Bundles#cancelupload. +const Bundles_CANCELUPLOAD_PRODUCT_SAMPLE = "SAMPLE" + +// Possible value for ``product`` of method Bundles#cancelupload. +const Bundles_CANCELUPLOAD_PRODUCT_ALB_CONTROLLER = "ALB_CONTROLLER" + +// Possible value for ``product`` of method Bundles#cancelupload. +const Bundles_CANCELUPLOAD_PRODUCT_INTELLIGENCE = "INTELLIGENCE" + +// Possible value for ``fileType`` of method Bundles#create. +const Bundles_CREATE_FILE_TYPE_OVA = "OVA" + +// Possible value for ``product`` of method Bundles#create. +const Bundles_CREATE_PRODUCT_SAMPLE = "SAMPLE" + +// Possible value for ``product`` of method Bundles#create. +const Bundles_CREATE_PRODUCT_ALB_CONTROLLER = "ALB_CONTROLLER" + +// Possible value for ``product`` of method Bundles#create. +const Bundles_CREATE_PRODUCT_INTELLIGENCE = "INTELLIGENCE" + +// Possible value for ``fileType`` of method Bundles#get. +const Bundles_GET_FILE_TYPE_OVA = "OVA" + +// Possible value for ``product`` of method Bundles#get. +const Bundles_GET_PRODUCT_SAMPLE = "SAMPLE" + +// Possible value for ``product`` of method Bundles#get. +const Bundles_GET_PRODUCT_ALB_CONTROLLER = "ALB_CONTROLLER" + +// Possible value for ``product`` of method Bundles#get. +const Bundles_GET_PRODUCT_INTELLIGENCE = "INTELLIGENCE" + +func bundlesCanceluploadInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bundle_id"] = bindings.NewStringType() + fields["product"] = bindings.NewStringType() + fieldNameMap["bundle_id"] = "BundleId" + fieldNameMap["product"] = "Product" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bundlesCanceluploadOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func bundlesCanceluploadRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["bundle_id"] = bindings.NewStringType() + fields["product"] = bindings.NewStringType() + fieldNameMap["bundle_id"] = "BundleId" + fieldNameMap["product"] = "Product" + paramsTypeMap["bundle_id"] = bindings.NewStringType() + paramsTypeMap["product"] = bindings.NewStringType() + paramsTypeMap["bundleId"] = bindings.NewStringType() + pathParams["bundle_id"] = "bundleId" + queryParams["product"] = "product" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=cancel_upload", + "", + "POST", + "/api/v1/repository/bundles/{bundleId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func bundlesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["remote_bundle_url"] = bindings.NewReferenceType(model.RemoteBundleUrlBindingType) + fields["file_type"] = bindings.NewStringType() + fields["product"] = bindings.NewStringType() + fieldNameMap["remote_bundle_url"] = "RemoteBundleUrl" + fieldNameMap["file_type"] = "FileType" + fieldNameMap["product"] = "Product" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bundlesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BundleIdBindingType) +} + +func bundlesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["remote_bundle_url"] = bindings.NewReferenceType(model.RemoteBundleUrlBindingType) + fields["file_type"] = bindings.NewStringType() + fields["product"] = bindings.NewStringType() + fieldNameMap["remote_bundle_url"] = "RemoteBundleUrl" + fieldNameMap["file_type"] = "FileType" + fieldNameMap["product"] = "Product" + paramsTypeMap["remote_bundle_url"] = bindings.NewReferenceType(model.RemoteBundleUrlBindingType) + paramsTypeMap["file_type"] = bindings.NewStringType() + paramsTypeMap["product"] = bindings.NewStringType() + queryParams["product"] = "product" + queryParams["file_type"] = "file_type" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"] = make(map[string]string) + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"]["challenge"] = "WWW-Authenticate" + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "remote_bundle_url", + "POST", + "/api/v1/repository/bundles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.unauthenticated": 401, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func bundlesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["file_type"] = bindings.NewStringType() + fields["product"] = bindings.NewStringType() + fieldNameMap["file_type"] = "FileType" + fieldNameMap["product"] = "Product" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bundlesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BundleIdsBindingType) +} + +func bundlesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["file_type"] = bindings.NewStringType() + fields["product"] = bindings.NewStringType() + fieldNameMap["file_type"] = "FileType" + fieldNameMap["product"] = "Product" + paramsTypeMap["file_type"] = bindings.NewStringType() + paramsTypeMap["product"] = bindings.NewStringType() + queryParams["product"] = "product" + queryParams["file_type"] = "file_type" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/repository/bundles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/repository/RepositoryPackageTypes.go b/services/nsxt-mp/nsx/repository/RepositoryPackageTypes.go new file mode 100644 index 000000000..8c4c31c45 --- /dev/null +++ b/services/nsxt-mp/nsx/repository/RepositoryPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.repository. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package repository diff --git a/services/nsxt-mp/nsx/repository/bundles/BundlesPackageTypes.go b/services/nsxt-mp/nsx/repository/bundles/BundlesPackageTypes.go new file mode 100644 index 000000000..59745584f --- /dev/null +++ b/services/nsxt-mp/nsx/repository/bundles/BundlesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.repository.bundles. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package bundles diff --git a/services/nsxt-mp/nsx/repository/bundles/OvfDeployInfoClient.go b/services/nsxt-mp/nsx/repository/bundles/OvfDeployInfoClient.go new file mode 100644 index 000000000..a117126f6 --- /dev/null +++ b/services/nsxt-mp/nsx/repository/bundles/OvfDeployInfoClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: OvfDeployInfo +// Used by client-side stubs. + +package bundles + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type OvfDeployInfoClient interface { + + // Get information of the OVF for specified appliance which is present in repository and will be used to deploy new VM. + // + // @param productParam Name of the appliance (required) + // @return com.vmware.nsx.model.OvfInfo + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(productParam string) (model.OvfInfo, error) +} + +type ovfDeployInfoClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewOvfDeployInfoClient(connector client.Connector) *ovfDeployInfoClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.repository.bundles.ovf_deploy_info") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + oIface := ovfDeployInfoClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &oIface +} + +func (oIface *ovfDeployInfoClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := oIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (oIface *ovfDeployInfoClient) Get(productParam string) (model.OvfInfo, error) { + typeConverter := oIface.connector.TypeConverter() + executionContext := oIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ovfDeployInfoGetInputType(), typeConverter) + sv.AddStructField("Product", productParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.OvfInfo + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ovfDeployInfoGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + oIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := oIface.connector.GetApiProvider().Invoke("com.vmware.nsx.repository.bundles.ovf_deploy_info", "get", inputDataValue, executionContext) + var emptyOutput model.OvfInfo + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ovfDeployInfoGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.OvfInfo), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), oIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/repository/bundles/OvfDeployInfoTypes.go b/services/nsxt-mp/nsx/repository/bundles/OvfDeployInfoTypes.go new file mode 100644 index 000000000..766a40c7b --- /dev/null +++ b/services/nsxt-mp/nsx/repository/bundles/OvfDeployInfoTypes.go @@ -0,0 +1,77 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: OvfDeployInfo. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package bundles + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``product`` of method OvfDeployInfo#get. +const OvfDeployInfo_GET_PRODUCT_SAMPLE = "SAMPLE" + +// Possible value for ``product`` of method OvfDeployInfo#get. +const OvfDeployInfo_GET_PRODUCT_ALB_CONTROLLER = "ALB_CONTROLLER" + +// Possible value for ``product`` of method OvfDeployInfo#get. +const OvfDeployInfo_GET_PRODUCT_INTELLIGENCE = "INTELLIGENCE" + +func ovfDeployInfoGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["product"] = bindings.NewStringType() + fieldNameMap["product"] = "Product" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ovfDeployInfoGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.OvfInfoBindingType) +} + +func ovfDeployInfoGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["product"] = bindings.NewStringType() + fieldNameMap["product"] = "Product" + paramsTypeMap["product"] = bindings.NewStringType() + queryParams["product"] = "product" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/repository/bundles/ovf-deploy-info", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/repository/bundles/UploadAllowedClient.go b/services/nsxt-mp/nsx/repository/bundles/UploadAllowedClient.go new file mode 100644 index 000000000..0ee64517b --- /dev/null +++ b/services/nsxt-mp/nsx/repository/bundles/UploadAllowedClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: UploadAllowed +// Used by client-side stubs. + +package bundles + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UploadAllowedClient interface { + + // Checks whether bundle upload is allowed on given node for given appliance. There are different kinds of checks for different appliances. Some of the checks for Intelligence appliance are as follows: 1. Is bundle upload-allowed on given node 2. Is bundle upload already in-progress + // + // @param productParam Name of the appliance (required) + // @return com.vmware.nsx.model.BundleUploadPermission + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(productParam string) (model.BundleUploadPermission, error) +} + +type uploadAllowedClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUploadAllowedClient(connector client.Connector) *uploadAllowedClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.repository.bundles.upload_allowed") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := uploadAllowedClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *uploadAllowedClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *uploadAllowedClient) Get(productParam string) (model.BundleUploadPermission, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(uploadAllowedGetInputType(), typeConverter) + sv.AddStructField("Product", productParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BundleUploadPermission + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := uploadAllowedGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.repository.bundles.upload_allowed", "get", inputDataValue, executionContext) + var emptyOutput model.BundleUploadPermission + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), uploadAllowedGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BundleUploadPermission), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/repository/bundles/UploadAllowedTypes.go b/services/nsxt-mp/nsx/repository/bundles/UploadAllowedTypes.go new file mode 100644 index 000000000..92c5f0fe4 --- /dev/null +++ b/services/nsxt-mp/nsx/repository/bundles/UploadAllowedTypes.go @@ -0,0 +1,77 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: UploadAllowed. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package bundles + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``product`` of method UploadAllowed#get. +const UploadAllowed_GET_PRODUCT_SAMPLE = "SAMPLE" + +// Possible value for ``product`` of method UploadAllowed#get. +const UploadAllowed_GET_PRODUCT_ALB_CONTROLLER = "ALB_CONTROLLER" + +// Possible value for ``product`` of method UploadAllowed#get. +const UploadAllowed_GET_PRODUCT_INTELLIGENCE = "INTELLIGENCE" + +func uploadAllowedGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["product"] = bindings.NewStringType() + fieldNameMap["product"] = "Product" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func uploadAllowedGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BundleUploadPermissionBindingType) +} + +func uploadAllowedGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["product"] = bindings.NewStringType() + fieldNameMap["product"] = "Product" + paramsTypeMap["product"] = bindings.NewStringType() + queryParams["product"] = "product" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/repository/bundles/upload-allowed", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/repository/bundles/UploadStatusClient.go b/services/nsxt-mp/nsx/repository/bundles/UploadStatusClient.go new file mode 100644 index 000000000..9212f0b53 --- /dev/null +++ b/services/nsxt-mp/nsx/repository/bundles/UploadStatusClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: UploadStatus +// Used by client-side stubs. + +package bundles + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UploadStatusClient interface { + + // Get uploaded bundle upload status + // + // @param bundleIdParam (required) + // @param productParam Name of the appliance (required) + // @return com.vmware.nsx.model.BundleUploadStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(bundleIdParam string, productParam string) (model.BundleUploadStatus, error) +} + +type uploadStatusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUploadStatusClient(connector client.Connector) *uploadStatusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.repository.bundles.upload_status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := uploadStatusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *uploadStatusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *uploadStatusClient) Get(bundleIdParam string, productParam string) (model.BundleUploadStatus, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(uploadStatusGetInputType(), typeConverter) + sv.AddStructField("BundleId", bundleIdParam) + sv.AddStructField("Product", productParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BundleUploadStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := uploadStatusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.repository.bundles.upload_status", "get", inputDataValue, executionContext) + var emptyOutput model.BundleUploadStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), uploadStatusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BundleUploadStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/repository/bundles/UploadStatusTypes.go b/services/nsxt-mp/nsx/repository/bundles/UploadStatusTypes.go new file mode 100644 index 000000000..8ada7daf9 --- /dev/null +++ b/services/nsxt-mp/nsx/repository/bundles/UploadStatusTypes.go @@ -0,0 +1,84 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: UploadStatus. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package bundles + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``product`` of method UploadStatus#get. +const UploadStatus_GET_PRODUCT_SAMPLE = "SAMPLE" + +// Possible value for ``product`` of method UploadStatus#get. +const UploadStatus_GET_PRODUCT_ALB_CONTROLLER = "ALB_CONTROLLER" + +// Possible value for ``product`` of method UploadStatus#get. +const UploadStatus_GET_PRODUCT_INTELLIGENCE = "INTELLIGENCE" + +func uploadStatusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bundle_id"] = bindings.NewStringType() + fields["product"] = bindings.NewStringType() + fieldNameMap["bundle_id"] = "BundleId" + fieldNameMap["product"] = "Product" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func uploadStatusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BundleUploadStatusBindingType) +} + +func uploadStatusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["bundle_id"] = bindings.NewStringType() + fields["product"] = bindings.NewStringType() + fieldNameMap["bundle_id"] = "BundleId" + fieldNameMap["product"] = "Product" + paramsTypeMap["bundle_id"] = bindings.NewStringType() + paramsTypeMap["product"] = bindings.NewStringType() + paramsTypeMap["bundleId"] = bindings.NewStringType() + pathParams["bundle_id"] = "bundleId" + queryParams["product"] = "product" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/repository/bundles/{bundleId}/upload-status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/search/DslClient.go b/services/nsxt-mp/nsx/search/DslClient.go new file mode 100644 index 000000000..75839ca5d --- /dev/null +++ b/services/nsxt-mp/nsx/search/DslClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Dsl +// Used by client-side stubs. + +package search + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type DslClient interface { + + // DSL (Domain Specific Language) search API + // + // @param queryParam Search query (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.SearchResponse + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(queryParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SearchResponse, error) +} + +type dslClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewDslClient(connector client.Connector) *dslClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.search.dsl") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + dIface := dslClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &dIface +} + +func (dIface *dslClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := dIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (dIface *dslClient) List(queryParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SearchResponse, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(dslListInputType(), typeConverter) + sv.AddStructField("Query", queryParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SearchResponse + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dslListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.search.dsl", "list", inputDataValue, executionContext) + var emptyOutput model.SearchResponse + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dslListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SearchResponse), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/search/DslTypes.go b/services/nsxt-mp/nsx/search/DslTypes.go new file mode 100644 index 000000000..b13292adc --- /dev/null +++ b/services/nsxt-mp/nsx/search/DslTypes.go @@ -0,0 +1,98 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Dsl. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package search + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func dslListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["query"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["query"] = "Query" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dslListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SearchResponseBindingType) +} + +func dslListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["query"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["query"] = "Query" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["query"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["query"] = "query" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/search/dsl", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/search/QueryClient.go b/services/nsxt-mp/nsx/search/QueryClient.go new file mode 100644 index 000000000..ad356c1f9 --- /dev/null +++ b/services/nsxt-mp/nsx/search/QueryClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Query +// Used by client-side stubs. + +package search + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type QueryClient interface { + + // Full text search API + // + // @param queryParam Search query (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.SearchResponse + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(queryParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SearchResponse, error) +} + +type queryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewQueryClient(connector client.Connector) *queryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.search.query") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + qIface := queryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &qIface +} + +func (qIface *queryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := qIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (qIface *queryClient) List(queryParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SearchResponse, error) { + typeConverter := qIface.connector.TypeConverter() + executionContext := qIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(queryListInputType(), typeConverter) + sv.AddStructField("Query", queryParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SearchResponse + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := queryListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + qIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := qIface.connector.GetApiProvider().Invoke("com.vmware.nsx.search.query", "list", inputDataValue, executionContext) + var emptyOutput model.SearchResponse + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), queryListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SearchResponse), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), qIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/search/QueryTypes.go b/services/nsxt-mp/nsx/search/QueryTypes.go new file mode 100644 index 000000000..b007cbb91 --- /dev/null +++ b/services/nsxt-mp/nsx/search/QueryTypes.go @@ -0,0 +1,98 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Query. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package search + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func queryListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["query"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["query"] = "Query" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func queryListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SearchResponseBindingType) +} + +func queryListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["query"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["query"] = "Query" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["query"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["query"] = "query" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/search/query", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/search/SearchPackageTypes.go b/services/nsxt-mp/nsx/search/SearchPackageTypes.go new file mode 100644 index 000000000..e28bac822 --- /dev/null +++ b/services/nsxt-mp/nsx/search/SearchPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.search. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package search diff --git a/services/nsxt-mp/nsx/service_configs/BatchClient.go b/services/nsxt-mp/nsx/service_configs/BatchClient.go new file mode 100644 index 000000000..ce6b475dc --- /dev/null +++ b/services/nsxt-mp/nsx/service_configs/BatchClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Batch +// Used by client-side stubs. + +package service_configs + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type BatchClient interface { + + // Creates/Updates new service configs sent in batch request. This API returns ALL the service configs that are created/updated. + // + // @param serviceConfigListParam (required) + // @return com.vmware.nsx.model.ServiceConfigListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(serviceConfigListParam model.ServiceConfigList) (model.ServiceConfigListResult, error) +} + +type batchClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewBatchClient(connector client.Connector) *batchClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.service_configs.batch") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + bIface := batchClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &bIface +} + +func (bIface *batchClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := bIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (bIface *batchClient) Create(serviceConfigListParam model.ServiceConfigList) (model.ServiceConfigListResult, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(batchCreateInputType(), typeConverter) + sv.AddStructField("ServiceConfigList", serviceConfigListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceConfigListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := batchCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.service_configs.batch", "create", inputDataValue, executionContext) + var emptyOutput model.ServiceConfigListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), batchCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceConfigListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/service_configs/BatchTypes.go b/services/nsxt-mp/nsx/service_configs/BatchTypes.go new file mode 100644 index 000000000..cae63dcda --- /dev/null +++ b/services/nsxt-mp/nsx/service_configs/BatchTypes.go @@ -0,0 +1,67 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Batch. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package service_configs + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func batchCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_config_list"] = bindings.NewReferenceType(model.ServiceConfigListBindingType) + fieldNameMap["service_config_list"] = "ServiceConfigList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func batchCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceConfigListResultBindingType) +} + +func batchCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_config_list"] = bindings.NewReferenceType(model.ServiceConfigListBindingType) + fieldNameMap["service_config_list"] = "ServiceConfigList" + paramsTypeMap["service_config_list"] = bindings.NewReferenceType(model.ServiceConfigListBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "service_config_list", + "POST", + "/api/v1/service-configs/batch", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/service_configs/EffectiveProfilesClient.go b/services/nsxt-mp/nsx/service_configs/EffectiveProfilesClient.go new file mode 100644 index 000000000..f9b99e597 --- /dev/null +++ b/services/nsxt-mp/nsx/service_configs/EffectiveProfilesClient.go @@ -0,0 +1,104 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: EffectiveProfiles +// Used by client-side stubs. + +package service_configs + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type EffectiveProfilesClient interface { + + // Returns the effective profiles applied to the specified Resource. + // + // @param resourceIdParam The resource for which the effective profiles are to be fetched (required) + // @param resourceTypeParam Valid Resource type in effective profiles API (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param profileTypeParam Fetch effectivw profiles of the given profile_type (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.EffectiveProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(resourceIdParam string, resourceTypeParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, profileTypeParam *string, sortAscendingParam *bool, sortByParam *string) (model.EffectiveProfileListResult, error) +} + +type effectiveProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewEffectiveProfilesClient(connector client.Connector) *effectiveProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.service_configs.effective_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + eIface := effectiveProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &eIface +} + +func (eIface *effectiveProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := eIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (eIface *effectiveProfilesClient) List(resourceIdParam string, resourceTypeParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, profileTypeParam *string, sortAscendingParam *bool, sortByParam *string) (model.EffectiveProfileListResult, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(effectiveProfilesListInputType(), typeConverter) + sv.AddStructField("ResourceId", resourceIdParam) + sv.AddStructField("ResourceType", resourceTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("ProfileType", profileTypeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EffectiveProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := effectiveProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.service_configs.effective_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.EffectiveProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), effectiveProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EffectiveProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/service_configs/EffectiveProfilesTypes.go b/services/nsxt-mp/nsx/service_configs/EffectiveProfilesTypes.go new file mode 100644 index 000000000..c8360b06a --- /dev/null +++ b/services/nsxt-mp/nsx/service_configs/EffectiveProfilesTypes.go @@ -0,0 +1,128 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: EffectiveProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package service_configs + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``resourceType`` of method EffectiveProfiles#list. +const EffectiveProfiles_LIST_RESOURCE_TYPE_NSGROUP = "NSGroup" + +// Possible value for ``resourceType`` of method EffectiveProfiles#list. +const EffectiveProfiles_LIST_RESOURCE_TYPE_LOGICALPORT = "LogicalPort" + +// Possible value for ``resourceType`` of method EffectiveProfiles#list. +const EffectiveProfiles_LIST_RESOURCE_TYPE_VIRTUALMACHINE = "VirtualMachine" + +// Possible value for ``resourceType`` of method EffectiveProfiles#list. +const EffectiveProfiles_LIST_RESOURCE_TYPE_TRANSPORTNODE = "TransportNode" + +// Possible value for ``resourceType`` of method EffectiveProfiles#list. +const EffectiveProfiles_LIST_RESOURCE_TYPE_LOGICALROUTER = "LogicalRouter" + +// Possible value for ``resourceType`` of method EffectiveProfiles#list. +const EffectiveProfiles_LIST_RESOURCE_TYPE_LOGICALSWITCH = "LogicalSwitch" + +func effectiveProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_id"] = bindings.NewStringType() + fields["resource_type"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["profile_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_id"] = "ResourceId" + fieldNameMap["resource_type"] = "ResourceType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["profile_type"] = "ProfileType" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func effectiveProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EffectiveProfileListResultBindingType) +} + +func effectiveProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["resource_id"] = bindings.NewStringType() + fields["resource_type"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["profile_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["resource_id"] = "ResourceId" + fieldNameMap["resource_type"] = "ResourceType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["profile_type"] = "ProfileType" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["resource_type"] = bindings.NewStringType() + paramsTypeMap["resource_id"] = bindings.NewStringType() + paramsTypeMap["profile_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["profile_type"] = "profile_type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["resource_type"] = "resource_type" + queryParams["resource_id"] = "resource_id" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/service-configs/effective-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/service_configs/ServiceConfigsPackageTypes.go b/services/nsxt-mp/nsx/service_configs/ServiceConfigsPackageTypes.go new file mode 100644 index 000000000..bd42af8e0 --- /dev/null +++ b/services/nsxt-mp/nsx/service_configs/ServiceConfigsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.service_configs. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package service_configs diff --git a/services/nsxt-mp/nsx/serviceinsertion/ExcludelistClient.go b/services/nsxt-mp/nsx/serviceinsertion/ExcludelistClient.go new file mode 100644 index 000000000..77569f7ea --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/ExcludelistClient.go @@ -0,0 +1,216 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Excludelist +// Used by client-side stubs. + +package serviceinsertion + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ExcludelistClient interface { + + // Note- POST serviceinsertion excludelist API is deprecated. Please use the policy serviceinsertion excludelist API instead. + // + // @param resourceReferenceParam (required) + // @return com.vmware.nsx.model.ResourceReference + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Addmember(resourceReferenceParam model.ResourceReference) (model.ResourceReference, error) + + // Note- GET serviceinsertion excludelist API is deprecated. Please use the policy serviceinsertion excludelist API instead. + // @return com.vmware.nsx.model.SIExcludeList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.SIExcludeList, error) + + // Note- POST serviceinsertion excludelist API is deprecated. Please use the policy serviceinsertion excludelist API instead. + // + // @param objectIdParam Identifier of the object (required) + // @return com.vmware.nsx.model.ResourceReference + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Removemember(objectIdParam string) (model.ResourceReference, error) + + // Modify exclude list. This includes adding/removing members in the list. Note- PUT serviceinsertion excludelist API is deprecated. Please use the policy serviceinsertion excludelist API instead. + // + // @param siExcludeListParam (required) + // @return com.vmware.nsx.model.SIExcludeList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(siExcludeListParam model.SIExcludeList) (model.SIExcludeList, error) +} + +type excludelistClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewExcludelistClient(connector client.Connector) *excludelistClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.excludelist") + methodIdentifiers := map[string]core.MethodIdentifier{ + "addmember": core.NewMethodIdentifier(interfaceIdentifier, "addmember"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "removemember": core.NewMethodIdentifier(interfaceIdentifier, "removemember"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + eIface := excludelistClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &eIface +} + +func (eIface *excludelistClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := eIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (eIface *excludelistClient) Addmember(resourceReferenceParam model.ResourceReference) (model.ResourceReference, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(excludelistAddmemberInputType(), typeConverter) + sv.AddStructField("ResourceReference", resourceReferenceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ResourceReference + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := excludelistAddmemberRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.excludelist", "addmember", inputDataValue, executionContext) + var emptyOutput model.ResourceReference + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), excludelistAddmemberOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ResourceReference), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *excludelistClient) Get() (model.SIExcludeList, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(excludelistGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SIExcludeList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := excludelistGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.excludelist", "get", inputDataValue, executionContext) + var emptyOutput model.SIExcludeList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), excludelistGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SIExcludeList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *excludelistClient) Removemember(objectIdParam string) (model.ResourceReference, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(excludelistRemovememberInputType(), typeConverter) + sv.AddStructField("ObjectId", objectIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ResourceReference + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := excludelistRemovememberRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.excludelist", "removemember", inputDataValue, executionContext) + var emptyOutput model.ResourceReference + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), excludelistRemovememberOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ResourceReference), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *excludelistClient) Update(siExcludeListParam model.SIExcludeList) (model.SIExcludeList, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(excludelistUpdateInputType(), typeConverter) + sv.AddStructField("SiExcludeList", siExcludeListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SIExcludeList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := excludelistUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.excludelist", "update", inputDataValue, executionContext) + var emptyOutput model.SIExcludeList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), excludelistUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SIExcludeList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/ExcludelistTypes.go b/services/nsxt-mp/nsx/serviceinsertion/ExcludelistTypes.go new file mode 100644 index 000000000..3c9a08eea --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/ExcludelistTypes.go @@ -0,0 +1,207 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Excludelist. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package serviceinsertion + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func excludelistAddmemberInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["resource_reference"] = bindings.NewReferenceType(model.ResourceReferenceBindingType) + fieldNameMap["resource_reference"] = "ResourceReference" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func excludelistAddmemberOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ResourceReferenceBindingType) +} + +func excludelistAddmemberRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["resource_reference"] = bindings.NewReferenceType(model.ResourceReferenceBindingType) + fieldNameMap["resource_reference"] = "ResourceReference" + paramsTypeMap["resource_reference"] = bindings.NewReferenceType(model.ResourceReferenceBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=add_member", + "resource_reference", + "POST", + "/api/v1/serviceinsertion/excludelist", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func excludelistGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func excludelistGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SIExcludeListBindingType) +} + +func excludelistGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/excludelist", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func excludelistRemovememberInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["object_id"] = bindings.NewStringType() + fieldNameMap["object_id"] = "ObjectId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func excludelistRemovememberOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ResourceReferenceBindingType) +} + +func excludelistRemovememberRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["object_id"] = bindings.NewStringType() + fieldNameMap["object_id"] = "ObjectId" + paramsTypeMap["object_id"] = bindings.NewStringType() + queryParams["object_id"] = "object_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=remove_member", + "", + "POST", + "/api/v1/serviceinsertion/excludelist", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func excludelistUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["si_exclude_list"] = bindings.NewReferenceType(model.SIExcludeListBindingType) + fieldNameMap["si_exclude_list"] = "SiExcludeList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func excludelistUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SIExcludeListBindingType) +} + +func excludelistUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["si_exclude_list"] = bindings.NewReferenceType(model.SIExcludeListBindingType) + fieldNameMap["si_exclude_list"] = "SiExcludeList" + paramsTypeMap["si_exclude_list"] = bindings.NewReferenceType(model.SIExcludeListBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "si_exclude_list", + "PUT", + "/api/v1/serviceinsertion/excludelist", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/SectionsClient.go b/services/nsxt-mp/nsx/serviceinsertion/SectionsClient.go new file mode 100644 index 000000000..dec24eff6 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/SectionsClient.go @@ -0,0 +1,520 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Sections +// Used by client-side stubs. + +package serviceinsertion + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SectionsClient interface { + + // Creates new empty Service Insertion section in the system. Note- POST service insertion section API is deprecated. Please use the policy redirection-policy API. + // + // @param serviceInsertionSectionParam (required) + // @param idParam Identifier of the anchor rule or section. This is a required field in case operation like 'insert_before' and 'insert_after'. (optional) + // @param operationParam Operation (optional, default to insert_top) + // @return com.vmware.nsx.model.ServiceInsertionSection + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(serviceInsertionSectionParam model.ServiceInsertionSection, idParam *string, operationParam *string) (model.ServiceInsertionSection, error) + + // Creates a new serviceinsertion section with rules. The limit on the number of rules is defined by maxItems in collection types for ServiceInsertionRule (ServiceInsertionRuleXXXList types). When invoked on a section with a large number of rules, this API is supported only at low rates of invocation (not more than 4-5 times per minute). The typical latency of this API with about 1024 rules is about 4-5 seconds. This API should not be invoked with large payloads at automation speeds. More than 50 rules are not supported. Instead, to create sections, use: POST /api/v1/serviceinsertion/sections To create rules, use: POST /api/v1/serviceinsertion/sections//rules Note- POST service insertion section creation with rules API is deprecated. Please use policy redirection-policy API. + // + // @param serviceInsertionSectionRuleListParam (required) + // @param idParam Identifier of the anchor rule or section. This is a required field in case operation like 'insert_before' and 'insert_after'. (optional) + // @param operationParam Operation (optional, default to insert_top) + // @return com.vmware.nsx.model.ServiceInsertionSectionRuleList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Createwithrules(serviceInsertionSectionRuleListParam model.ServiceInsertionSectionRuleList, idParam *string, operationParam *string) (model.ServiceInsertionSectionRuleList, error) + + // Removes serviceinsertion section from the system. ServiceInsertion section with rules can only be deleted by passing \"cascade=true\" parameter. Note- DELETE service insertion section API is deprecated. Please use policy redirection-policy API. + // + // @param sectionIdParam (required) + // @param cascadeParam Flag to cascade delete of this object to all it's child objects. (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(sectionIdParam string, cascadeParam *bool) error + + // Returns information about serviceinsertion section for the identifier. Note- GET service insertion section API is deprecated. Please use policy redirection-policy API. + // + // @param sectionIdParam (required) + // @return com.vmware.nsx.model.ServiceInsertionSection + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(sectionIdParam string) (model.ServiceInsertionSection, error) + + // List all Service Insertion section in paginated form. A default page size is limited to 1000 sections. By default, the list of section is filtered by L3REDIRECT type. Note- GET service insertion sections API is deprecated. Please use the policy redirection-policy API. + // + // @param appliedTosParam AppliedTo's referenced by this section or section's Distributed Service Rules . (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param destinationsParam Destinations referenced by this section's Distributed Service Rules . (optional) + // @param excludeAppliedToTypeParam Resource type valid for use as AppliedTo filter in section API (optional) + // @param filterTypeParam Filter type (optional, default to FILTER) + // @param includeAppliedToTypeParam Resource type valid for use as AppliedTo filter in section API (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param servicesParam NSService referenced by this section's Distributed Service Rules . (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param sourcesParam Sources referenced by this section's Distributed Service Rules . (optional) + // @param type_Param Section Type (optional, default to L3REDIRECT) + // @return com.vmware.nsx.model.ServiceInsertionSectionListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(appliedTosParam *string, cursorParam *string, destinationsParam *string, excludeAppliedToTypeParam *string, filterTypeParam *string, includeAppliedToTypeParam *string, includedFieldsParam *string, pageSizeParam *int64, servicesParam *string, sortAscendingParam *bool, sortByParam *string, sourcesParam *string, type_Param *string) (model.ServiceInsertionSectionListResult, error) + + // Returns serviceinsertion section information with rules for a section identifier. When invoked on a section with a large number of rules, this API is supported only at low rates of invocation (not more than 4-5 times per minute). The typical latency of this API with about 1024 rules is about 4-5 seconds. This API should not be invoked with large payloads at automation speeds. More than 50 rules are not supported. Instead, to read serviceinsertion rules, use: GET /api/v1/serviceinsertion/sections//rules with the appropriate page_size. Note- GET service insertion section with rules API is deprecated. Please use policy redirection-policy API. + // + // @param sectionIdParam (required) + // @return com.vmware.nsx.model.ServiceInsertionSectionRuleList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Listwithrules(sectionIdParam string) (model.ServiceInsertionSectionRuleList, error) + + // Modifies an existing serviceinsertion section along with its relative position among other serviceinsertion sections in the system. Note- POST service insertion section API is deprecated. Please use policy redirection-policy API. + // + // @param sectionIdParam (required) + // @param serviceInsertionSectionParam (required) + // @param idParam Identifier of the anchor rule or section. This is a required field in case operation like 'insert_before' and 'insert_after'. (optional) + // @param operationParam Operation (optional, default to insert_top) + // @return com.vmware.nsx.model.ServiceInsertionSection + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Revise(sectionIdParam string, serviceInsertionSectionParam model.ServiceInsertionSection, idParam *string, operationParam *string) (model.ServiceInsertionSection, error) + + // Modifies an existing serviceinsertion section along with its relative position among other serviceinsertion sections with rules. When invoked on a large number of rules, this API is supported only at low rates of invocation (not more than 2 times per minute). The typical latency of this API with about 1024 rules is about 15 seconds in a cluster setup. This API should not be invoked with large payloads at automation speeds. Instead, to move a section above or below another section, use: POST /api/v1/serviceinsertion/sections/?action=revise To modify rules, use: PUT /api/v1/serviceinsertion/sections//rules/ Note- POST service insertion section API is deprecated. Please use policy redirection-policy API. + // + // @param sectionIdParam (required) + // @param serviceInsertionSectionRuleListParam (required) + // @param idParam Identifier of the anchor rule or section. This is a required field in case operation like 'insert_before' and 'insert_after'. (optional) + // @param operationParam Operation (optional, default to insert_top) + // @return com.vmware.nsx.model.ServiceInsertionSectionRuleList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Revisewithrules(sectionIdParam string, serviceInsertionSectionRuleListParam model.ServiceInsertionSectionRuleList, idParam *string, operationParam *string) (model.ServiceInsertionSectionRuleList, error) + + // Modifies the specified section, but does not modify the section's associated rules. Note- PUT service insertion section API is deprecated. Please use policy redirection-policy API. + // + // @param sectionIdParam (required) + // @param serviceInsertionSectionParam (required) + // @return com.vmware.nsx.model.ServiceInsertionSection + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(sectionIdParam string, serviceInsertionSectionParam model.ServiceInsertionSection) (model.ServiceInsertionSection, error) + + // Modifies existing serviceinsertion section along with its association with rules. When invoked on a large number of rules, this API is supported only at low rates of invocation (not more than 2 times per minute). The typical latency of this API with about 1024 rules is about 15 seconds in a cluster setup. This API should not be invoked with large payloads at automation speeds. Instead, to update rule content, use: PUT /api/v1/serviceinsertion/sections//rules/ Note- POST service insertion section with rules API is deprecated. Please use policy redirection-policy API. + // + // @param sectionIdParam (required) + // @param serviceInsertionSectionRuleListParam (required) + // @return com.vmware.nsx.model.ServiceInsertionSectionRuleList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Updatewithrules(sectionIdParam string, serviceInsertionSectionRuleListParam model.ServiceInsertionSectionRuleList) (model.ServiceInsertionSectionRuleList, error) +} + +type sectionsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSectionsClient(connector client.Connector) *sectionsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.sections") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "createwithrules": core.NewMethodIdentifier(interfaceIdentifier, "createwithrules"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "listwithrules": core.NewMethodIdentifier(interfaceIdentifier, "listwithrules"), + "revise": core.NewMethodIdentifier(interfaceIdentifier, "revise"), + "revisewithrules": core.NewMethodIdentifier(interfaceIdentifier, "revisewithrules"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + "updatewithrules": core.NewMethodIdentifier(interfaceIdentifier, "updatewithrules"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := sectionsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *sectionsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *sectionsClient) Create(serviceInsertionSectionParam model.ServiceInsertionSection, idParam *string, operationParam *string) (model.ServiceInsertionSection, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sectionsCreateInputType(), typeConverter) + sv.AddStructField("ServiceInsertionSection", serviceInsertionSectionParam) + sv.AddStructField("Id", idParam) + sv.AddStructField("Operation", operationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInsertionSection + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sectionsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.sections", "create", inputDataValue, executionContext) + var emptyOutput model.ServiceInsertionSection + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sectionsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInsertionSection), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sectionsClient) Createwithrules(serviceInsertionSectionRuleListParam model.ServiceInsertionSectionRuleList, idParam *string, operationParam *string) (model.ServiceInsertionSectionRuleList, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sectionsCreatewithrulesInputType(), typeConverter) + sv.AddStructField("ServiceInsertionSectionRuleList", serviceInsertionSectionRuleListParam) + sv.AddStructField("Id", idParam) + sv.AddStructField("Operation", operationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInsertionSectionRuleList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sectionsCreatewithrulesRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.sections", "createwithrules", inputDataValue, executionContext) + var emptyOutput model.ServiceInsertionSectionRuleList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sectionsCreatewithrulesOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInsertionSectionRuleList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sectionsClient) Delete(sectionIdParam string, cascadeParam *bool) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sectionsDeleteInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("Cascade", cascadeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sectionsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.sections", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *sectionsClient) Get(sectionIdParam string) (model.ServiceInsertionSection, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sectionsGetInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInsertionSection + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sectionsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.sections", "get", inputDataValue, executionContext) + var emptyOutput model.ServiceInsertionSection + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sectionsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInsertionSection), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sectionsClient) List(appliedTosParam *string, cursorParam *string, destinationsParam *string, excludeAppliedToTypeParam *string, filterTypeParam *string, includeAppliedToTypeParam *string, includedFieldsParam *string, pageSizeParam *int64, servicesParam *string, sortAscendingParam *bool, sortByParam *string, sourcesParam *string, type_Param *string) (model.ServiceInsertionSectionListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sectionsListInputType(), typeConverter) + sv.AddStructField("AppliedTos", appliedTosParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("Destinations", destinationsParam) + sv.AddStructField("ExcludeAppliedToType", excludeAppliedToTypeParam) + sv.AddStructField("FilterType", filterTypeParam) + sv.AddStructField("IncludeAppliedToType", includeAppliedToTypeParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("Services", servicesParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Sources", sourcesParam) + sv.AddStructField("Type_", type_Param) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInsertionSectionListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sectionsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.sections", "list", inputDataValue, executionContext) + var emptyOutput model.ServiceInsertionSectionListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sectionsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInsertionSectionListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sectionsClient) Listwithrules(sectionIdParam string) (model.ServiceInsertionSectionRuleList, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sectionsListwithrulesInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInsertionSectionRuleList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sectionsListwithrulesRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.sections", "listwithrules", inputDataValue, executionContext) + var emptyOutput model.ServiceInsertionSectionRuleList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sectionsListwithrulesOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInsertionSectionRuleList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sectionsClient) Revise(sectionIdParam string, serviceInsertionSectionParam model.ServiceInsertionSection, idParam *string, operationParam *string) (model.ServiceInsertionSection, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sectionsReviseInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("ServiceInsertionSection", serviceInsertionSectionParam) + sv.AddStructField("Id", idParam) + sv.AddStructField("Operation", operationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInsertionSection + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sectionsReviseRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.sections", "revise", inputDataValue, executionContext) + var emptyOutput model.ServiceInsertionSection + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sectionsReviseOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInsertionSection), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sectionsClient) Revisewithrules(sectionIdParam string, serviceInsertionSectionRuleListParam model.ServiceInsertionSectionRuleList, idParam *string, operationParam *string) (model.ServiceInsertionSectionRuleList, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sectionsRevisewithrulesInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("ServiceInsertionSectionRuleList", serviceInsertionSectionRuleListParam) + sv.AddStructField("Id", idParam) + sv.AddStructField("Operation", operationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInsertionSectionRuleList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sectionsRevisewithrulesRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.sections", "revisewithrules", inputDataValue, executionContext) + var emptyOutput model.ServiceInsertionSectionRuleList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sectionsRevisewithrulesOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInsertionSectionRuleList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sectionsClient) Update(sectionIdParam string, serviceInsertionSectionParam model.ServiceInsertionSection) (model.ServiceInsertionSection, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sectionsUpdateInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("ServiceInsertionSection", serviceInsertionSectionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInsertionSection + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sectionsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.sections", "update", inputDataValue, executionContext) + var emptyOutput model.ServiceInsertionSection + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sectionsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInsertionSection), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sectionsClient) Updatewithrules(sectionIdParam string, serviceInsertionSectionRuleListParam model.ServiceInsertionSectionRuleList) (model.ServiceInsertionSectionRuleList, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sectionsUpdatewithrulesInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("ServiceInsertionSectionRuleList", serviceInsertionSectionRuleListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInsertionSectionRuleList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sectionsUpdatewithrulesRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.sections", "updatewithrules", inputDataValue, executionContext) + var emptyOutput model.ServiceInsertionSectionRuleList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sectionsUpdatewithrulesOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInsertionSectionRuleList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/SectionsTypes.go b/services/nsxt-mp/nsx/serviceinsertion/SectionsTypes.go new file mode 100644 index 000000000..ef1bd70f5 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/SectionsTypes.go @@ -0,0 +1,741 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Sections. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package serviceinsertion + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``operation`` of method Sections#create. +const Sections_CREATE_OPERATION_TOP = "insert_top" + +// Possible value for ``operation`` of method Sections#create. +const Sections_CREATE_OPERATION_BOTTOM = "insert_bottom" + +// Possible value for ``operation`` of method Sections#create. +const Sections_CREATE_OPERATION_AFTER = "insert_after" + +// Possible value for ``operation`` of method Sections#create. +const Sections_CREATE_OPERATION_BEFORE = "insert_before" + +// Possible value for ``operation`` of method Sections#createwithrules. +const Sections_CREATEWITHRULES_OPERATION_TOP = "insert_top" + +// Possible value for ``operation`` of method Sections#createwithrules. +const Sections_CREATEWITHRULES_OPERATION_BOTTOM = "insert_bottom" + +// Possible value for ``operation`` of method Sections#createwithrules. +const Sections_CREATEWITHRULES_OPERATION_AFTER = "insert_after" + +// Possible value for ``operation`` of method Sections#createwithrules. +const Sections_CREATEWITHRULES_OPERATION_BEFORE = "insert_before" + +// Possible value for ``excludeAppliedToType`` of method Sections#list. +const Sections_LIST_EXCLUDE_APPLIED_TO_TYPE_NSGROUP = "NSGroup" + +// Possible value for ``excludeAppliedToType`` of method Sections#list. +const Sections_LIST_EXCLUDE_APPLIED_TO_TYPE_LOGICALSWITCH = "LogicalSwitch" + +// Possible value for ``excludeAppliedToType`` of method Sections#list. +const Sections_LIST_EXCLUDE_APPLIED_TO_TYPE_LOGICALROUTER = "LogicalRouter" + +// Possible value for ``excludeAppliedToType`` of method Sections#list. +const Sections_LIST_EXCLUDE_APPLIED_TO_TYPE_LOGICALPORT = "LogicalPort" + +// Possible value for ``filterType`` of method Sections#list. +const Sections_LIST_FILTER_TYPE_FILTER = "FILTER" + +// Possible value for ``filterType`` of method Sections#list. +const Sections_LIST_FILTER_TYPE_SEARCH = "SEARCH" + +// Possible value for ``includeAppliedToType`` of method Sections#list. +const Sections_LIST_INCLUDE_APPLIED_TO_TYPE_NSGROUP = "NSGroup" + +// Possible value for ``includeAppliedToType`` of method Sections#list. +const Sections_LIST_INCLUDE_APPLIED_TO_TYPE_LOGICALSWITCH = "LogicalSwitch" + +// Possible value for ``includeAppliedToType`` of method Sections#list. +const Sections_LIST_INCLUDE_APPLIED_TO_TYPE_LOGICALROUTER = "LogicalRouter" + +// Possible value for ``includeAppliedToType`` of method Sections#list. +const Sections_LIST_INCLUDE_APPLIED_TO_TYPE_LOGICALPORT = "LogicalPort" + +// Possible value for ``type`` of method Sections#list. +const Sections_LIST_TYPE_L3REDIRECT = "L3REDIRECT" + +// Possible value for ``operation`` of method Sections#revise. +const Sections_REVISE_OPERATION_TOP = "insert_top" + +// Possible value for ``operation`` of method Sections#revise. +const Sections_REVISE_OPERATION_BOTTOM = "insert_bottom" + +// Possible value for ``operation`` of method Sections#revise. +const Sections_REVISE_OPERATION_AFTER = "insert_after" + +// Possible value for ``operation`` of method Sections#revise. +const Sections_REVISE_OPERATION_BEFORE = "insert_before" + +// Possible value for ``operation`` of method Sections#revisewithrules. +const Sections_REVISEWITHRULES_OPERATION_TOP = "insert_top" + +// Possible value for ``operation`` of method Sections#revisewithrules. +const Sections_REVISEWITHRULES_OPERATION_BOTTOM = "insert_bottom" + +// Possible value for ``operation`` of method Sections#revisewithrules. +const Sections_REVISEWITHRULES_OPERATION_AFTER = "insert_after" + +// Possible value for ``operation`` of method Sections#revisewithrules. +const Sections_REVISEWITHRULES_OPERATION_BEFORE = "insert_before" + +func sectionsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_insertion_section"] = bindings.NewReferenceType(model.ServiceInsertionSectionBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_insertion_section"] = "ServiceInsertionSection" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sectionsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInsertionSectionBindingType) +} + +func sectionsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_insertion_section"] = bindings.NewReferenceType(model.ServiceInsertionSectionBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_insertion_section"] = "ServiceInsertionSection" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + paramsTypeMap["id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_insertion_section"] = bindings.NewReferenceType(model.ServiceInsertionSectionBindingType) + queryParams["id"] = "id" + queryParams["operation"] = "operation" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "service_insertion_section", + "POST", + "/api/v1/serviceinsertion/sections", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sectionsCreatewithrulesInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_insertion_section_rule_list"] = bindings.NewReferenceType(model.ServiceInsertionSectionRuleListBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_insertion_section_rule_list"] = "ServiceInsertionSectionRuleList" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sectionsCreatewithrulesOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInsertionSectionRuleListBindingType) +} + +func sectionsCreatewithrulesRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_insertion_section_rule_list"] = bindings.NewReferenceType(model.ServiceInsertionSectionRuleListBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_insertion_section_rule_list"] = "ServiceInsertionSectionRuleList" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + paramsTypeMap["id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_insertion_section_rule_list"] = bindings.NewReferenceType(model.ServiceInsertionSectionRuleListBindingType) + queryParams["id"] = "id" + queryParams["operation"] = "operation" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=create_with_rules", + "service_insertion_section_rule_list", + "POST", + "/api/v1/serviceinsertion/sections", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sectionsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["cascade"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["cascade"] = "Cascade" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sectionsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func sectionsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["cascade"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["cascade"] = "Cascade" + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["cascade"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + queryParams["cascade"] = "cascade" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/serviceinsertion/sections/{sectionId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sectionsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fieldNameMap["section_id"] = "SectionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sectionsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInsertionSectionBindingType) +} + +func sectionsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fieldNameMap["section_id"] = "SectionId" + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/sections/{sectionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sectionsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["applied_tos"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["destinations"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["exclude_applied_to_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["filter_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_applied_to_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["services"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sources"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["applied_tos"] = "AppliedTos" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["destinations"] = "Destinations" + fieldNameMap["exclude_applied_to_type"] = "ExcludeAppliedToType" + fieldNameMap["filter_type"] = "FilterType" + fieldNameMap["include_applied_to_type"] = "IncludeAppliedToType" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["services"] = "Services" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["sources"] = "Sources" + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sectionsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInsertionSectionListResultBindingType) +} + +func sectionsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["applied_tos"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["destinations"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["exclude_applied_to_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["filter_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["include_applied_to_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["services"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sources"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["applied_tos"] = "AppliedTos" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["destinations"] = "Destinations" + fieldNameMap["exclude_applied_to_type"] = "ExcludeAppliedToType" + fieldNameMap["filter_type"] = "FilterType" + fieldNameMap["include_applied_to_type"] = "IncludeAppliedToType" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["services"] = "Services" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["sources"] = "Sources" + fieldNameMap["type"] = "Type_" + paramsTypeMap["sources"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["exclude_applied_to_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["include_applied_to_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["destinations"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["filter_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["applied_tos"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["services"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sources"] = "sources" + queryParams["destinations"] = "destinations" + queryParams["exclude_applied_to_type"] = "exclude_applied_to_type" + queryParams["include_applied_to_type"] = "include_applied_to_type" + queryParams["services"] = "services" + queryParams["sort_by"] = "sort_by" + queryParams["type"] = "type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["filter_type"] = "filter_type" + queryParams["included_fields"] = "included_fields" + queryParams["applied_tos"] = "applied_tos" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/sections", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sectionsListwithrulesInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fieldNameMap["section_id"] = "SectionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sectionsListwithrulesOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInsertionSectionRuleListBindingType) +} + +func sectionsListwithrulesRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fieldNameMap["section_id"] = "SectionId" + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=list_with_rules", + "", + "POST", + "/api/v1/serviceinsertion/sections/{sectionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sectionsReviseInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["service_insertion_section"] = bindings.NewReferenceType(model.ServiceInsertionSectionBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["service_insertion_section"] = "ServiceInsertionSection" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sectionsReviseOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInsertionSectionBindingType) +} + +func sectionsReviseRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["service_insertion_section"] = bindings.NewReferenceType(model.ServiceInsertionSectionBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["service_insertion_section"] = "ServiceInsertionSection" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + paramsTypeMap["id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_insertion_section"] = bindings.NewReferenceType(model.ServiceInsertionSectionBindingType) + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + queryParams["id"] = "id" + queryParams["operation"] = "operation" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=revise", + "service_insertion_section", + "POST", + "/api/v1/serviceinsertion/sections/{sectionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sectionsRevisewithrulesInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["service_insertion_section_rule_list"] = bindings.NewReferenceType(model.ServiceInsertionSectionRuleListBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["service_insertion_section_rule_list"] = "ServiceInsertionSectionRuleList" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sectionsRevisewithrulesOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInsertionSectionRuleListBindingType) +} + +func sectionsRevisewithrulesRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["service_insertion_section_rule_list"] = bindings.NewReferenceType(model.ServiceInsertionSectionRuleListBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["service_insertion_section_rule_list"] = "ServiceInsertionSectionRuleList" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + paramsTypeMap["id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_insertion_section_rule_list"] = bindings.NewReferenceType(model.ServiceInsertionSectionRuleListBindingType) + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + queryParams["id"] = "id" + queryParams["operation"] = "operation" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=revise_with_rules", + "service_insertion_section_rule_list", + "POST", + "/api/v1/serviceinsertion/sections/{sectionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sectionsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["service_insertion_section"] = bindings.NewReferenceType(model.ServiceInsertionSectionBindingType) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["service_insertion_section"] = "ServiceInsertionSection" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sectionsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInsertionSectionBindingType) +} + +func sectionsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["service_insertion_section"] = bindings.NewReferenceType(model.ServiceInsertionSectionBindingType) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["service_insertion_section"] = "ServiceInsertionSection" + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["service_insertion_section"] = bindings.NewReferenceType(model.ServiceInsertionSectionBindingType) + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "service_insertion_section", + "PUT", + "/api/v1/serviceinsertion/sections/{sectionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sectionsUpdatewithrulesInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["service_insertion_section_rule_list"] = bindings.NewReferenceType(model.ServiceInsertionSectionRuleListBindingType) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["service_insertion_section_rule_list"] = "ServiceInsertionSectionRuleList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sectionsUpdatewithrulesOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInsertionSectionRuleListBindingType) +} + +func sectionsUpdatewithrulesRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["service_insertion_section_rule_list"] = bindings.NewReferenceType(model.ServiceInsertionSectionRuleListBindingType) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["service_insertion_section_rule_list"] = "ServiceInsertionSectionRuleList" + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["service_insertion_section_rule_list"] = bindings.NewReferenceType(model.ServiceInsertionSectionRuleListBindingType) + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=update_with_rules", + "service_insertion_section_rule_list", + "POST", + "/api/v1/serviceinsertion/sections/{sectionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/ServiceAttachmentsClient.go b/services/nsxt-mp/nsx/serviceinsertion/ServiceAttachmentsClient.go new file mode 100644 index 000000000..092390ea2 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/ServiceAttachmentsClient.go @@ -0,0 +1,254 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ServiceAttachments +// Used by client-side stubs. + +package serviceinsertion + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ServiceAttachmentsClient interface { + + // Adds a new Service attachment. A service attachment represents a point on NSX entity (Example: Logical Router) to which service instance can be connected through an InstanceEndpoint. + // + // @param serviceAttachmentParam (required) + // @return com.vmware.nsx.model.ServiceAttachment + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(serviceAttachmentParam model.ServiceAttachment) (model.ServiceAttachment, error) + + // Delete existing service attachment from system. Before deletion, please make sure that, no instance endpoints are connected to this attachment. In turn no appliance should be connected to this attachment. + // + // @param serviceAttachmentIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(serviceAttachmentIdParam string) error + + // Returns detailed Attachment information for a given service attachment. + // + // @param serviceAttachmentIdParam (required) + // @return com.vmware.nsx.model.ServiceAttachment + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceAttachmentIdParam string) (model.ServiceAttachment, error) + + // Returns all Service-Attachement(s) present in the system. + // @return com.vmware.nsx.model.ServiceAttachmentListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.ServiceAttachmentListResult, error) + + // Modifies an existing service attachment. Updates to name, description and Logical Router list only supported. + // + // @param serviceAttachmentIdParam (required) + // @param serviceAttachmentParam (required) + // @return com.vmware.nsx.model.ServiceAttachment + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(serviceAttachmentIdParam string, serviceAttachmentParam model.ServiceAttachment) (model.ServiceAttachment, error) +} + +type serviceAttachmentsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewServiceAttachmentsClient(connector client.Connector) *serviceAttachmentsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.service_attachments") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := serviceAttachmentsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *serviceAttachmentsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *serviceAttachmentsClient) Create(serviceAttachmentParam model.ServiceAttachment) (model.ServiceAttachment, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceAttachmentsCreateInputType(), typeConverter) + sv.AddStructField("ServiceAttachment", serviceAttachmentParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceAttachment + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceAttachmentsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.service_attachments", "create", inputDataValue, executionContext) + var emptyOutput model.ServiceAttachment + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceAttachmentsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceAttachment), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serviceAttachmentsClient) Delete(serviceAttachmentIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceAttachmentsDeleteInputType(), typeConverter) + sv.AddStructField("ServiceAttachmentId", serviceAttachmentIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceAttachmentsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.service_attachments", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *serviceAttachmentsClient) Get(serviceAttachmentIdParam string) (model.ServiceAttachment, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceAttachmentsGetInputType(), typeConverter) + sv.AddStructField("ServiceAttachmentId", serviceAttachmentIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceAttachment + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceAttachmentsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.service_attachments", "get", inputDataValue, executionContext) + var emptyOutput model.ServiceAttachment + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceAttachmentsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceAttachment), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serviceAttachmentsClient) List() (model.ServiceAttachmentListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceAttachmentsListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceAttachmentListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceAttachmentsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.service_attachments", "list", inputDataValue, executionContext) + var emptyOutput model.ServiceAttachmentListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceAttachmentsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceAttachmentListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serviceAttachmentsClient) Update(serviceAttachmentIdParam string, serviceAttachmentParam model.ServiceAttachment) (model.ServiceAttachment, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceAttachmentsUpdateInputType(), typeConverter) + sv.AddStructField("ServiceAttachmentId", serviceAttachmentIdParam) + sv.AddStructField("ServiceAttachment", serviceAttachmentParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceAttachment + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceAttachmentsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.service_attachments", "update", inputDataValue, executionContext) + var emptyOutput model.ServiceAttachment + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceAttachmentsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceAttachment), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/ServiceAttachmentsTypes.go b/services/nsxt-mp/nsx/serviceinsertion/ServiceAttachmentsTypes.go new file mode 100644 index 000000000..78a15af6e --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/ServiceAttachmentsTypes.go @@ -0,0 +1,265 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ServiceAttachments. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package serviceinsertion + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func serviceAttachmentsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_attachment"] = bindings.NewReferenceType(model.ServiceAttachmentBindingType) + fieldNameMap["service_attachment"] = "ServiceAttachment" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceAttachmentsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceAttachmentBindingType) +} + +func serviceAttachmentsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_attachment"] = bindings.NewReferenceType(model.ServiceAttachmentBindingType) + fieldNameMap["service_attachment"] = "ServiceAttachment" + paramsTypeMap["service_attachment"] = bindings.NewReferenceType(model.ServiceAttachmentBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "service_attachment", + "POST", + "/api/v1/serviceinsertion/service-attachments", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceAttachmentsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_attachment_id"] = bindings.NewStringType() + fieldNameMap["service_attachment_id"] = "ServiceAttachmentId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceAttachmentsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func serviceAttachmentsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_attachment_id"] = bindings.NewStringType() + fieldNameMap["service_attachment_id"] = "ServiceAttachmentId" + paramsTypeMap["service_attachment_id"] = bindings.NewStringType() + paramsTypeMap["serviceAttachmentId"] = bindings.NewStringType() + pathParams["service_attachment_id"] = "serviceAttachmentId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/serviceinsertion/service-attachments/{serviceAttachmentId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceAttachmentsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_attachment_id"] = bindings.NewStringType() + fieldNameMap["service_attachment_id"] = "ServiceAttachmentId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceAttachmentsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceAttachmentBindingType) +} + +func serviceAttachmentsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_attachment_id"] = bindings.NewStringType() + fieldNameMap["service_attachment_id"] = "ServiceAttachmentId" + paramsTypeMap["service_attachment_id"] = bindings.NewStringType() + paramsTypeMap["serviceAttachmentId"] = bindings.NewStringType() + pathParams["service_attachment_id"] = "serviceAttachmentId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/service-attachments/{serviceAttachmentId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceAttachmentsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceAttachmentsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceAttachmentListResultBindingType) +} + +func serviceAttachmentsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/service-attachments", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceAttachmentsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_attachment_id"] = bindings.NewStringType() + fields["service_attachment"] = bindings.NewReferenceType(model.ServiceAttachmentBindingType) + fieldNameMap["service_attachment_id"] = "ServiceAttachmentId" + fieldNameMap["service_attachment"] = "ServiceAttachment" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceAttachmentsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceAttachmentBindingType) +} + +func serviceAttachmentsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_attachment_id"] = bindings.NewStringType() + fields["service_attachment"] = bindings.NewReferenceType(model.ServiceAttachmentBindingType) + fieldNameMap["service_attachment_id"] = "ServiceAttachmentId" + fieldNameMap["service_attachment"] = "ServiceAttachment" + paramsTypeMap["service_attachment"] = bindings.NewReferenceType(model.ServiceAttachmentBindingType) + paramsTypeMap["service_attachment_id"] = bindings.NewStringType() + paramsTypeMap["serviceAttachmentId"] = bindings.NewStringType() + pathParams["service_attachment_id"] = "serviceAttachmentId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "service_attachment", + "PUT", + "/api/v1/serviceinsertion/service-attachments/{serviceAttachmentId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/ServiceChainsClient.go b/services/nsxt-mp/nsx/serviceinsertion/ServiceChainsClient.go new file mode 100644 index 000000000..71394d4fa --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/ServiceChainsClient.go @@ -0,0 +1,209 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ServiceChains +// Used by client-side stubs. + +package serviceinsertion + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ServiceChainsClient interface { + + // Adds a new service chain. Service Chains is can contain profile belonging to same or different Service(s). It represents a redirection target for a Rule. + // + // @param serviceChainParam (required) + // @return com.vmware.nsx.model.ServiceChain + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(serviceChainParam model.ServiceChain) (model.ServiceChain, error) + + // Delete a particular service chain. + // + // @param serviceChainIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(serviceChainIdParam string) error + + // Returns detailed service chain information. + // + // @param serviceChainIdParam (required) + // @return com.vmware.nsx.model.ServiceChain + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceChainIdParam string) (model.ServiceChain, error) + + // List all service chains in the system. + // @return com.vmware.nsx.model.ServiceChainListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.ServiceChainListResult, error) +} + +type serviceChainsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewServiceChainsClient(connector client.Connector) *serviceChainsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.service_chains") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := serviceChainsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *serviceChainsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *serviceChainsClient) Create(serviceChainParam model.ServiceChain) (model.ServiceChain, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceChainsCreateInputType(), typeConverter) + sv.AddStructField("ServiceChain", serviceChainParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceChain + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceChainsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.service_chains", "create", inputDataValue, executionContext) + var emptyOutput model.ServiceChain + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceChainsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceChain), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serviceChainsClient) Delete(serviceChainIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceChainsDeleteInputType(), typeConverter) + sv.AddStructField("ServiceChainId", serviceChainIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceChainsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.service_chains", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *serviceChainsClient) Get(serviceChainIdParam string) (model.ServiceChain, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceChainsGetInputType(), typeConverter) + sv.AddStructField("ServiceChainId", serviceChainIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceChain + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceChainsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.service_chains", "get", inputDataValue, executionContext) + var emptyOutput model.ServiceChain + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceChainsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceChain), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serviceChainsClient) List() (model.ServiceChainListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceChainsListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceChainListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceChainsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.service_chains", "list", inputDataValue, executionContext) + var emptyOutput model.ServiceChainListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceChainsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceChainListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/ServiceChainsTypes.go b/services/nsxt-mp/nsx/serviceinsertion/ServiceChainsTypes.go new file mode 100644 index 000000000..c126965bd --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/ServiceChainsTypes.go @@ -0,0 +1,210 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ServiceChains. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package serviceinsertion + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func serviceChainsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_chain"] = bindings.NewReferenceType(model.ServiceChainBindingType) + fieldNameMap["service_chain"] = "ServiceChain" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceChainsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceChainBindingType) +} + +func serviceChainsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_chain"] = bindings.NewReferenceType(model.ServiceChainBindingType) + fieldNameMap["service_chain"] = "ServiceChain" + paramsTypeMap["service_chain"] = bindings.NewReferenceType(model.ServiceChainBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "service_chain", + "POST", + "/api/v1/serviceinsertion/service-chains", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceChainsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_chain_id"] = bindings.NewStringType() + fieldNameMap["service_chain_id"] = "ServiceChainId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceChainsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func serviceChainsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_chain_id"] = bindings.NewStringType() + fieldNameMap["service_chain_id"] = "ServiceChainId" + paramsTypeMap["service_chain_id"] = bindings.NewStringType() + paramsTypeMap["serviceChainId"] = bindings.NewStringType() + pathParams["service_chain_id"] = "serviceChainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/serviceinsertion/service-chains/{serviceChainId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceChainsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_chain_id"] = bindings.NewStringType() + fieldNameMap["service_chain_id"] = "ServiceChainId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceChainsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceChainBindingType) +} + +func serviceChainsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_chain_id"] = bindings.NewStringType() + fieldNameMap["service_chain_id"] = "ServiceChainId" + paramsTypeMap["service_chain_id"] = bindings.NewStringType() + paramsTypeMap["serviceChainId"] = bindings.NewStringType() + pathParams["service_chain_id"] = "serviceChainId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/service-chains/{serviceChainId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceChainsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceChainsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceChainListResultBindingType) +} + +func serviceChainsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/service-chains", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/ServiceInstancesClient.go b/services/nsxt-mp/nsx/serviceinsertion/ServiceInstancesClient.go new file mode 100644 index 000000000..a19dcbe7c --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/ServiceInstancesClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ServiceInstances +// Used by client-side stubs. + +package serviceinsertion + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ServiceInstancesClient interface { + + // Returns all Service-Instance(s) of all Services present in system. When request parameter (deployed_to or service_deployment_id) is provided as a part of request, it will filter out Service-Instances accordingly. + // + // @param deployedToParam Deployed_to referenced by service instances present in system (optional) + // @param serviceDeploymentIdParam Service Deployment Id using which the instances were deployed (optional) + // @return com.vmware.nsx.model.ServiceInstanceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(deployedToParam *string, serviceDeploymentIdParam *string) (model.ServiceInstanceListResult, error) +} + +type serviceInstancesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewServiceInstancesClient(connector client.Connector) *serviceInstancesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.service_instances") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := serviceInstancesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *serviceInstancesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *serviceInstancesClient) List(deployedToParam *string, serviceDeploymentIdParam *string) (model.ServiceInstanceListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceInstancesListInputType(), typeConverter) + sv.AddStructField("DeployedTo", deployedToParam) + sv.AddStructField("ServiceDeploymentId", serviceDeploymentIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInstanceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceInstancesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.service_instances", "list", inputDataValue, executionContext) + var emptyOutput model.ServiceInstanceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceInstancesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInstanceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/ServiceInstancesTypes.go b/services/nsxt-mp/nsx/serviceinsertion/ServiceInstancesTypes.go new file mode 100644 index 000000000..c3b99022f --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/ServiceInstancesTypes.go @@ -0,0 +1,74 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ServiceInstances. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package serviceinsertion + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func serviceInstancesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["deployed_to"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["service_deployment_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["deployed_to"] = "DeployedTo" + fieldNameMap["service_deployment_id"] = "ServiceDeploymentId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceInstancesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInstanceListResultBindingType) +} + +func serviceInstancesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["deployed_to"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["service_deployment_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["deployed_to"] = "DeployedTo" + fieldNameMap["service_deployment_id"] = "ServiceDeploymentId" + paramsTypeMap["deployed_to"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_deployment_id"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["service_deployment_id"] = "service_deployment_id" + queryParams["deployed_to"] = "deployed_to" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/service-instances", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/ServiceManagersClient.go b/services/nsxt-mp/nsx/serviceinsertion/ServiceManagersClient.go new file mode 100644 index 000000000..53d69a361 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/ServiceManagersClient.go @@ -0,0 +1,254 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ServiceManagers +// Used by client-side stubs. + +package serviceinsertion + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ServiceManagersClient interface { + + // Register service-manager with NSX with basic details like name, username, password. + // + // @param serviceManagerParam (required) + // @return com.vmware.nsx.model.ServiceManager + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(serviceManagerParam model.ServiceManager) (model.ServiceManager, error) + + // Delete service-manager which is registered with NSX with basic details like name, username, password. + // + // @param serviceManagerIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(serviceManagerIdParam string) error + + // Retrieve service-manager details like name, username, password, vendor ID, thumbprint for a given ID. + // + // @param serviceManagerIdParam (required) + // @return com.vmware.nsx.model.ServiceManager + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceManagerIdParam string) (model.ServiceManager, error) + + // List all service managers. + // @return com.vmware.nsx.model.ServiceManagerListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.ServiceManagerListResult, error) + + // Update service-manager which is registered with NSX with basic details like name, username, password. + // + // @param serviceManagerIdParam (required) + // @param serviceManagerParam (required) + // @return com.vmware.nsx.model.ServiceManager + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(serviceManagerIdParam string, serviceManagerParam model.ServiceManager) (model.ServiceManager, error) +} + +type serviceManagersClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewServiceManagersClient(connector client.Connector) *serviceManagersClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.service_managers") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := serviceManagersClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *serviceManagersClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *serviceManagersClient) Create(serviceManagerParam model.ServiceManager) (model.ServiceManager, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceManagersCreateInputType(), typeConverter) + sv.AddStructField("ServiceManager", serviceManagerParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceManager + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceManagersCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.service_managers", "create", inputDataValue, executionContext) + var emptyOutput model.ServiceManager + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceManagersCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceManager), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serviceManagersClient) Delete(serviceManagerIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceManagersDeleteInputType(), typeConverter) + sv.AddStructField("ServiceManagerId", serviceManagerIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceManagersDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.service_managers", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *serviceManagersClient) Get(serviceManagerIdParam string) (model.ServiceManager, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceManagersGetInputType(), typeConverter) + sv.AddStructField("ServiceManagerId", serviceManagerIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceManager + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceManagersGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.service_managers", "get", inputDataValue, executionContext) + var emptyOutput model.ServiceManager + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceManagersGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceManager), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serviceManagersClient) List() (model.ServiceManagerListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceManagersListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceManagerListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceManagersListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.service_managers", "list", inputDataValue, executionContext) + var emptyOutput model.ServiceManagerListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceManagersListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceManagerListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serviceManagersClient) Update(serviceManagerIdParam string, serviceManagerParam model.ServiceManager) (model.ServiceManager, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceManagersUpdateInputType(), typeConverter) + sv.AddStructField("ServiceManagerId", serviceManagerIdParam) + sv.AddStructField("ServiceManager", serviceManagerParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceManager + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceManagersUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.service_managers", "update", inputDataValue, executionContext) + var emptyOutput model.ServiceManager + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceManagersUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceManager), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/ServiceManagersTypes.go b/services/nsxt-mp/nsx/serviceinsertion/ServiceManagersTypes.go new file mode 100644 index 000000000..454174f45 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/ServiceManagersTypes.go @@ -0,0 +1,265 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ServiceManagers. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package serviceinsertion + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func serviceManagersCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_manager"] = bindings.NewReferenceType(model.ServiceManagerBindingType) + fieldNameMap["service_manager"] = "ServiceManager" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceManagersCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceManagerBindingType) +} + +func serviceManagersCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_manager"] = bindings.NewReferenceType(model.ServiceManagerBindingType) + fieldNameMap["service_manager"] = "ServiceManager" + paramsTypeMap["service_manager"] = bindings.NewReferenceType(model.ServiceManagerBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "service_manager", + "POST", + "/api/v1/serviceinsertion/service-managers", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceManagersDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_manager_id"] = bindings.NewStringType() + fieldNameMap["service_manager_id"] = "ServiceManagerId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceManagersDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func serviceManagersDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_manager_id"] = bindings.NewStringType() + fieldNameMap["service_manager_id"] = "ServiceManagerId" + paramsTypeMap["service_manager_id"] = bindings.NewStringType() + paramsTypeMap["serviceManagerId"] = bindings.NewStringType() + pathParams["service_manager_id"] = "serviceManagerId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/serviceinsertion/service-managers/{serviceManagerId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceManagersGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_manager_id"] = bindings.NewStringType() + fieldNameMap["service_manager_id"] = "ServiceManagerId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceManagersGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceManagerBindingType) +} + +func serviceManagersGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_manager_id"] = bindings.NewStringType() + fieldNameMap["service_manager_id"] = "ServiceManagerId" + paramsTypeMap["service_manager_id"] = bindings.NewStringType() + paramsTypeMap["serviceManagerId"] = bindings.NewStringType() + pathParams["service_manager_id"] = "serviceManagerId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/service-managers/{serviceManagerId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceManagersListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceManagersListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceManagerListResultBindingType) +} + +func serviceManagersListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/service-managers", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceManagersUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_manager_id"] = bindings.NewStringType() + fields["service_manager"] = bindings.NewReferenceType(model.ServiceManagerBindingType) + fieldNameMap["service_manager_id"] = "ServiceManagerId" + fieldNameMap["service_manager"] = "ServiceManager" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceManagersUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceManagerBindingType) +} + +func serviceManagersUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_manager_id"] = bindings.NewStringType() + fields["service_manager"] = bindings.NewReferenceType(model.ServiceManagerBindingType) + fieldNameMap["service_manager_id"] = "ServiceManagerId" + fieldNameMap["service_manager"] = "ServiceManager" + paramsTypeMap["service_manager"] = bindings.NewReferenceType(model.ServiceManagerBindingType) + paramsTypeMap["service_manager_id"] = bindings.NewStringType() + paramsTypeMap["serviceManagerId"] = bindings.NewStringType() + pathParams["service_manager_id"] = "serviceManagerId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "service_manager", + "PUT", + "/api/v1/serviceinsertion/service-managers/{serviceManagerId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/ServiceinsertionPackageTypes.go b/services/nsxt-mp/nsx/serviceinsertion/ServiceinsertionPackageTypes.go new file mode 100644 index 000000000..204a6dcda --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/ServiceinsertionPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.serviceinsertion. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package serviceinsertion diff --git a/services/nsxt-mp/nsx/serviceinsertion/ServicesClient.go b/services/nsxt-mp/nsx/serviceinsertion/ServicesClient.go new file mode 100644 index 000000000..aed676087 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/ServicesClient.go @@ -0,0 +1,256 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Services +// Used by client-side stubs. + +package serviceinsertion + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ServicesClient interface { + + // Creates new Service-Insertion Service in the system. + // + // @param serviceDefinitionParam (required) + // @return com.vmware.nsx.model.ServiceDefinition + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(serviceDefinitionParam model.ServiceDefinition) (model.ServiceDefinition, error) + + // Removes Service-Insertion Service from the system. A Service with Service-Instances can only be deleted by passing \"cascade=true\" parameter. + // + // @param serviceIdParam (required) + // @param cascadeParam Flag to cascade delete all the child objects, associated with it. (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(serviceIdParam string, cascadeParam *bool) error + + // Returns information about Service-Insertion Service with the given identifier. + // + // @param serviceIdParam (required) + // @return com.vmware.nsx.model.ServiceDefinition + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string) (model.ServiceDefinition, error) + + // List all Service-Insertion Service Definitions. + // @return com.vmware.nsx.model.ServiceInsertionServiceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.ServiceInsertionServiceListResult, error) + + // Modifies the specified Service. + // + // @param serviceIdParam (required) + // @param serviceDefinitionParam (required) + // @return com.vmware.nsx.model.ServiceDefinition + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(serviceIdParam string, serviceDefinitionParam model.ServiceDefinition) (model.ServiceDefinition, error) +} + +type servicesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewServicesClient(connector client.Connector) *servicesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.services") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := servicesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *servicesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *servicesClient) Create(serviceDefinitionParam model.ServiceDefinition) (model.ServiceDefinition, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(servicesCreateInputType(), typeConverter) + sv.AddStructField("ServiceDefinition", serviceDefinitionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceDefinition + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services", "create", inputDataValue, executionContext) + var emptyOutput model.ServiceDefinition + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), servicesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceDefinition), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *servicesClient) Delete(serviceIdParam string, cascadeParam *bool) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(servicesDeleteInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("Cascade", cascadeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *servicesClient) Get(serviceIdParam string) (model.ServiceDefinition, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(servicesGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceDefinition + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services", "get", inputDataValue, executionContext) + var emptyOutput model.ServiceDefinition + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), servicesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceDefinition), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *servicesClient) List() (model.ServiceInsertionServiceListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(servicesListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInsertionServiceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services", "list", inputDataValue, executionContext) + var emptyOutput model.ServiceInsertionServiceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), servicesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInsertionServiceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *servicesClient) Update(serviceIdParam string, serviceDefinitionParam model.ServiceDefinition) (model.ServiceDefinition, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(servicesUpdateInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceDefinition", serviceDefinitionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceDefinition + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services", "update", inputDataValue, executionContext) + var emptyOutput model.ServiceDefinition + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), servicesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceDefinition), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/ServicesTypes.go b/services/nsxt-mp/nsx/serviceinsertion/ServicesTypes.go new file mode 100644 index 000000000..e45ce0907 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/ServicesTypes.go @@ -0,0 +1,271 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Services. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package serviceinsertion + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func servicesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_definition"] = bindings.NewReferenceType(model.ServiceDefinitionBindingType) + fieldNameMap["service_definition"] = "ServiceDefinition" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceDefinitionBindingType) +} + +func servicesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_definition"] = bindings.NewReferenceType(model.ServiceDefinitionBindingType) + fieldNameMap["service_definition"] = "ServiceDefinition" + paramsTypeMap["service_definition"] = bindings.NewReferenceType(model.ServiceDefinitionBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "service_definition", + "POST", + "/api/v1/serviceinsertion/services/nsxt-mp", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func servicesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["cascade"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["cascade"] = "Cascade" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func servicesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["cascade"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["cascade"] = "Cascade" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["cascade"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + queryParams["cascade"] = "cascade" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func servicesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceDefinitionBindingType) +} + +func servicesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func servicesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInsertionServiceListResultBindingType) +} + +func servicesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func servicesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_definition"] = bindings.NewReferenceType(model.ServiceDefinitionBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_definition"] = "ServiceDefinition" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceDefinitionBindingType) +} + +func servicesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_definition"] = bindings.NewReferenceType(model.ServiceDefinitionBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_definition"] = "ServiceDefinition" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service_definition"] = bindings.NewReferenceType(model.ServiceDefinitionBindingType) + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "service_definition", + "PUT", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/SourceEntitiesClient.go b/services/nsxt-mp/nsx/serviceinsertion/SourceEntitiesClient.go new file mode 100644 index 000000000..ea5cce4aa --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/SourceEntitiesClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: SourceEntities +// Used by client-side stubs. + +package serviceinsertion + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SourceEntitiesClient interface { + + // Service insertion data path inserts unique 'source node id' value into each packet. This API can be used to identify the source of the packet using this value. It can be resolved to multiple source entities. + // + // @param sourceNodeValueParam value (required) + // @return com.vmware.nsx.model.SourceEntityResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(sourceNodeValueParam string) (model.SourceEntityResult, error) +} + +type sourceEntitiesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSourceEntitiesClient(connector client.Connector) *sourceEntitiesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.source_entities") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := sourceEntitiesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *sourceEntitiesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *sourceEntitiesClient) List(sourceNodeValueParam string) (model.SourceEntityResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sourceEntitiesListInputType(), typeConverter) + sv.AddStructField("SourceNodeValue", sourceNodeValueParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SourceEntityResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sourceEntitiesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.source_entities", "list", inputDataValue, executionContext) + var emptyOutput model.SourceEntityResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sourceEntitiesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SourceEntityResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/SourceEntitiesTypes.go b/services/nsxt-mp/nsx/serviceinsertion/SourceEntitiesTypes.go new file mode 100644 index 000000000..1a37f1693 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/SourceEntitiesTypes.go @@ -0,0 +1,68 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: SourceEntities. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package serviceinsertion + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func sourceEntitiesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["source_node_value"] = bindings.NewStringType() + fieldNameMap["source_node_value"] = "SourceNodeValue" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sourceEntitiesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SourceEntityResultBindingType) +} + +func sourceEntitiesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["source_node_value"] = bindings.NewStringType() + fieldNameMap["source_node_value"] = "SourceNodeValue" + paramsTypeMap["source_node_value"] = bindings.NewStringType() + queryParams["source_node_value"] = "source_node_value" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/source-entities", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/StatusClient.go b/services/nsxt-mp/nsx/serviceinsertion/StatusClient.go new file mode 100644 index 000000000..65df7c9d2 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/StatusClient.go @@ -0,0 +1,175 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package serviceinsertion + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Get ServiceInsertion global status for a context + // + // @param contextTypeParam (required) + // @return com.vmware.nsx.model.ServiceInsertionStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(contextTypeParam string) (model.ServiceInsertionStatus, error) + + // List all service insertion status for supported contexts + // @return com.vmware.nsx.model.ServiceInsertionStatusListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.ServiceInsertionStatusListResult, error) + + // Update global ServiceInsertion status for a context + // + // @param contextTypeParam (required) + // @param serviceInsertionStatusParam (required) + // @return com.vmware.nsx.model.ServiceInsertionStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(contextTypeParam string, serviceInsertionStatusParam model.ServiceInsertionStatus) (model.ServiceInsertionStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(contextTypeParam string) (model.ServiceInsertionStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("ContextType", contextTypeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInsertionStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.status", "get", inputDataValue, executionContext) + var emptyOutput model.ServiceInsertionStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInsertionStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statusClient) List() (model.ServiceInsertionStatusListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInsertionStatusListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.status", "list", inputDataValue, executionContext) + var emptyOutput model.ServiceInsertionStatusListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInsertionStatusListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statusClient) Update(contextTypeParam string, serviceInsertionStatusParam model.ServiceInsertionStatus) (model.ServiceInsertionStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusUpdateInputType(), typeConverter) + sv.AddStructField("ContextType", contextTypeParam) + sv.AddStructField("ServiceInsertionStatus", serviceInsertionStatusParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInsertionStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.status", "update", inputDataValue, executionContext) + var emptyOutput model.ServiceInsertionStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInsertionStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/StatusTypes.go b/services/nsxt-mp/nsx/serviceinsertion/StatusTypes.go new file mode 100644 index 000000000..a9a8c92e2 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/StatusTypes.go @@ -0,0 +1,167 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package serviceinsertion + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["context_type"] = bindings.NewStringType() + fieldNameMap["context_type"] = "ContextType" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInsertionStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["context_type"] = bindings.NewStringType() + fieldNameMap["context_type"] = "ContextType" + paramsTypeMap["context_type"] = bindings.NewStringType() + paramsTypeMap["contextType"] = bindings.NewStringType() + pathParams["context_type"] = "contextType" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/status/{contextType}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statusListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInsertionStatusListResultBindingType) +} + +func statusListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statusUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["context_type"] = bindings.NewStringType() + fields["service_insertion_status"] = bindings.NewReferenceType(model.ServiceInsertionStatusBindingType) + fieldNameMap["context_type"] = "ContextType" + fieldNameMap["service_insertion_status"] = "ServiceInsertionStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInsertionStatusBindingType) +} + +func statusUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["context_type"] = bindings.NewStringType() + fields["service_insertion_status"] = bindings.NewReferenceType(model.ServiceInsertionStatusBindingType) + fieldNameMap["context_type"] = "ContextType" + fieldNameMap["service_insertion_status"] = "ServiceInsertionStatus" + paramsTypeMap["service_insertion_status"] = bindings.NewReferenceType(model.ServiceInsertionStatusBindingType) + paramsTypeMap["context_type"] = bindings.NewStringType() + paramsTypeMap["contextType"] = bindings.NewStringType() + pathParams["context_type"] = "contextType" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "service_insertion_status", + "PUT", + "/api/v1/serviceinsertion/status/{contextType}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/sections/RulesClient.go b/services/nsxt-mp/nsx/serviceinsertion/sections/RulesClient.go new file mode 100644 index 000000000..9204bcfd2 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/sections/RulesClient.go @@ -0,0 +1,389 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Rules +// Used by client-side stubs. + +package sections + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RulesClient interface { + + // Adds a new serviceinsertion rule in existing serviceinsertion section. Note- POST service insertion section API is deprecated. Please use policy redirection-policy API. + // + // @param sectionIdParam (required) + // @param serviceInsertionRuleParam (required) + // @param idParam Identifier of the anchor rule or section. This is a required field in case operation like 'insert_before' and 'insert_after'. (optional) + // @param operationParam Operation (optional, default to insert_top) + // @return com.vmware.nsx.model.ServiceInsertionRule + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(sectionIdParam string, serviceInsertionRuleParam model.ServiceInsertionRule, idParam *string, operationParam *string) (model.ServiceInsertionRule, error) + + // Create multiple serviceinsertion rules in existing serviceinsertion section bounded by limit of 1000 serviceinsertion rules per section. Note- POST service insertion rules API is deprecated. Please use policy redirection-policy API. + // + // @param sectionIdParam (required) + // @param serviceInsertionRuleListParam (required) + // @param idParam Identifier of the anchor rule or section. This is a required field in case operation like 'insert_before' and 'insert_after'. (optional) + // @param operationParam Operation (optional, default to insert_top) + // @return com.vmware.nsx.model.ServiceInsertionRuleList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Createmultiple(sectionIdParam string, serviceInsertionRuleListParam model.ServiceInsertionRuleList, idParam *string, operationParam *string) (model.ServiceInsertionRuleList, error) + + // Delete existing serviceinsertion rule in a serviceinsertion section. Note- DELETE service insertion rule API is deprecated. Please use policy redirection-policy API. + // + // @param sectionIdParam (required) + // @param ruleIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(sectionIdParam string, ruleIdParam string) error + + // Return existing serviceinsertion rule information in a serviceinsertion section. Note- GET service insertion rule API is deprecated. Please use policy redirection-policy API. + // + // @param sectionIdParam (required) + // @param ruleIdParam (required) + // @return com.vmware.nsx.model.ServiceInsertionRule + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(sectionIdParam string, ruleIdParam string) (model.ServiceInsertionRule, error) + + // Return all serviceinsertion rule(s) information for a given serviceinsertion section. Note- GET service insertion rules API is deprecated. Please use policy redirection-policy API. + // + // @param sectionIdParam (required) + // @param appliedTosParam AppliedTo's referenced by this section or section's Distributed Service Rules . (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param destinationsParam Destinations referenced by this section's Distributed Service Rules . (optional) + // @param filterTypeParam Filter type (optional, default to FILTER) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param servicesParam NSService referenced by this section's Distributed Service Rules . (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param sourcesParam Sources referenced by this section's Distributed Service Rules . (optional) + // @return com.vmware.nsx.model.ServiceInsertionRuleListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(sectionIdParam string, appliedTosParam *string, cursorParam *string, destinationsParam *string, filterTypeParam *string, includedFieldsParam *string, pageSizeParam *int64, servicesParam *string, sortAscendingParam *bool, sortByParam *string, sourcesParam *string) (model.ServiceInsertionRuleListResult, error) + + // Modifies existing serviceinsertion rule along with relative position among other serviceinsertion rules inside a serviceinsertion section. Note- POST service insertion rule API is deprecated. Please use policy redirection-policy API. + // + // @param sectionIdParam (required) + // @param ruleIdParam (required) + // @param serviceInsertionRuleParam (required) + // @param idParam Identifier of the anchor rule or section. This is a required field in case operation like 'insert_before' and 'insert_after'. (optional) + // @param operationParam Operation (optional, default to insert_top) + // @return com.vmware.nsx.model.ServiceInsertionRule + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Revise(sectionIdParam string, ruleIdParam string, serviceInsertionRuleParam model.ServiceInsertionRule, idParam *string, operationParam *string) (model.ServiceInsertionRule, error) + + // Modifies existing serviceinsertion rule in a serviceinsertion section. Note- PUT service insertion rule API is deprecated. Please use policy redirection-policy API. + // + // @param sectionIdParam (required) + // @param ruleIdParam (required) + // @param serviceInsertionRuleParam (required) + // @return com.vmware.nsx.model.ServiceInsertionRule + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(sectionIdParam string, ruleIdParam string, serviceInsertionRuleParam model.ServiceInsertionRule) (model.ServiceInsertionRule, error) +} + +type rulesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRulesClient(connector client.Connector) *rulesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.sections.rules") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "createmultiple": core.NewMethodIdentifier(interfaceIdentifier, "createmultiple"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "revise": core.NewMethodIdentifier(interfaceIdentifier, "revise"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := rulesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *rulesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *rulesClient) Create(sectionIdParam string, serviceInsertionRuleParam model.ServiceInsertionRule, idParam *string, operationParam *string) (model.ServiceInsertionRule, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesCreateInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("ServiceInsertionRule", serviceInsertionRuleParam) + sv.AddStructField("Id", idParam) + sv.AddStructField("Operation", operationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInsertionRule + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.sections.rules", "create", inputDataValue, executionContext) + var emptyOutput model.ServiceInsertionRule + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInsertionRule), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rulesClient) Createmultiple(sectionIdParam string, serviceInsertionRuleListParam model.ServiceInsertionRuleList, idParam *string, operationParam *string) (model.ServiceInsertionRuleList, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesCreatemultipleInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("ServiceInsertionRuleList", serviceInsertionRuleListParam) + sv.AddStructField("Id", idParam) + sv.AddStructField("Operation", operationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInsertionRuleList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesCreatemultipleRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.sections.rules", "createmultiple", inputDataValue, executionContext) + var emptyOutput model.ServiceInsertionRuleList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesCreatemultipleOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInsertionRuleList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rulesClient) Delete(sectionIdParam string, ruleIdParam string) error { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesDeleteInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("RuleId", ruleIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.sections.rules", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (rIface *rulesClient) Get(sectionIdParam string, ruleIdParam string) (model.ServiceInsertionRule, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesGetInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("RuleId", ruleIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInsertionRule + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.sections.rules", "get", inputDataValue, executionContext) + var emptyOutput model.ServiceInsertionRule + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInsertionRule), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rulesClient) List(sectionIdParam string, appliedTosParam *string, cursorParam *string, destinationsParam *string, filterTypeParam *string, includedFieldsParam *string, pageSizeParam *int64, servicesParam *string, sortAscendingParam *bool, sortByParam *string, sourcesParam *string) (model.ServiceInsertionRuleListResult, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesListInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("AppliedTos", appliedTosParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("Destinations", destinationsParam) + sv.AddStructField("FilterType", filterTypeParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("Services", servicesParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Sources", sourcesParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInsertionRuleListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.sections.rules", "list", inputDataValue, executionContext) + var emptyOutput model.ServiceInsertionRuleListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInsertionRuleListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rulesClient) Revise(sectionIdParam string, ruleIdParam string, serviceInsertionRuleParam model.ServiceInsertionRule, idParam *string, operationParam *string) (model.ServiceInsertionRule, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesReviseInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("RuleId", ruleIdParam) + sv.AddStructField("ServiceInsertionRule", serviceInsertionRuleParam) + sv.AddStructField("Id", idParam) + sv.AddStructField("Operation", operationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInsertionRule + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesReviseRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.sections.rules", "revise", inputDataValue, executionContext) + var emptyOutput model.ServiceInsertionRule + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesReviseOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInsertionRule), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (rIface *rulesClient) Update(sectionIdParam string, ruleIdParam string, serviceInsertionRuleParam model.ServiceInsertionRule) (model.ServiceInsertionRule, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(rulesUpdateInputType(), typeConverter) + sv.AddStructField("SectionId", sectionIdParam) + sv.AddStructField("RuleId", ruleIdParam) + sv.AddStructField("ServiceInsertionRule", serviceInsertionRuleParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInsertionRule + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := rulesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.sections.rules", "update", inputDataValue, executionContext) + var emptyOutput model.ServiceInsertionRule + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), rulesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInsertionRule), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/sections/RulesTypes.go b/services/nsxt-mp/nsx/serviceinsertion/sections/RulesTypes.go new file mode 100644 index 000000000..06b4161de --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/sections/RulesTypes.go @@ -0,0 +1,555 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Rules. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package sections + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``operation`` of method Rules#create. +const Rules_CREATE_OPERATION_TOP = "insert_top" + +// Possible value for ``operation`` of method Rules#create. +const Rules_CREATE_OPERATION_BOTTOM = "insert_bottom" + +// Possible value for ``operation`` of method Rules#create. +const Rules_CREATE_OPERATION_AFTER = "insert_after" + +// Possible value for ``operation`` of method Rules#create. +const Rules_CREATE_OPERATION_BEFORE = "insert_before" + +// Possible value for ``operation`` of method Rules#createmultiple. +const Rules_CREATEMULTIPLE_OPERATION_TOP = "insert_top" + +// Possible value for ``operation`` of method Rules#createmultiple. +const Rules_CREATEMULTIPLE_OPERATION_BOTTOM = "insert_bottom" + +// Possible value for ``operation`` of method Rules#createmultiple. +const Rules_CREATEMULTIPLE_OPERATION_AFTER = "insert_after" + +// Possible value for ``operation`` of method Rules#createmultiple. +const Rules_CREATEMULTIPLE_OPERATION_BEFORE = "insert_before" + +// Possible value for ``filterType`` of method Rules#list. +const Rules_LIST_FILTER_TYPE_FILTER = "FILTER" + +// Possible value for ``filterType`` of method Rules#list. +const Rules_LIST_FILTER_TYPE_SEARCH = "SEARCH" + +// Possible value for ``operation`` of method Rules#revise. +const Rules_REVISE_OPERATION_TOP = "insert_top" + +// Possible value for ``operation`` of method Rules#revise. +const Rules_REVISE_OPERATION_BOTTOM = "insert_bottom" + +// Possible value for ``operation`` of method Rules#revise. +const Rules_REVISE_OPERATION_AFTER = "insert_after" + +// Possible value for ``operation`` of method Rules#revise. +const Rules_REVISE_OPERATION_BEFORE = "insert_before" + +func rulesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["service_insertion_rule"] = bindings.NewReferenceType(model.ServiceInsertionRuleBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["service_insertion_rule"] = "ServiceInsertionRule" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInsertionRuleBindingType) +} + +func rulesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["service_insertion_rule"] = bindings.NewReferenceType(model.ServiceInsertionRuleBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["service_insertion_rule"] = "ServiceInsertionRule" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + paramsTypeMap["id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["service_insertion_rule"] = bindings.NewReferenceType(model.ServiceInsertionRuleBindingType) + paramsTypeMap["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + queryParams["id"] = "id" + queryParams["operation"] = "operation" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "service_insertion_rule", + "POST", + "/api/v1/serviceinsertion/sections/{sectionId}/rules", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesCreatemultipleInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["service_insertion_rule_list"] = bindings.NewReferenceType(model.ServiceInsertionRuleListBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["service_insertion_rule_list"] = "ServiceInsertionRuleList" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesCreatemultipleOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInsertionRuleListBindingType) +} + +func rulesCreatemultipleRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["service_insertion_rule_list"] = bindings.NewReferenceType(model.ServiceInsertionRuleListBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["service_insertion_rule_list"] = "ServiceInsertionRuleList" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + paramsTypeMap["id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_insertion_rule_list"] = bindings.NewReferenceType(model.ServiceInsertionRuleListBindingType) + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + queryParams["id"] = "id" + queryParams["operation"] = "operation" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=create_multiple", + "service_insertion_rule_list", + "POST", + "/api/v1/serviceinsertion/sections/{sectionId}/rules", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["rule_id"] = "RuleId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func rulesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["rule_id"] = "RuleId" + paramsTypeMap["rule_id"] = bindings.NewStringType() + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["sectionId"] = bindings.NewStringType() + paramsTypeMap["ruleId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + pathParams["rule_id"] = "ruleId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/serviceinsertion/sections/{sectionId}/rules/{ruleId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["rule_id"] = "RuleId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInsertionRuleBindingType) +} + +func rulesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["rule_id"] = "RuleId" + paramsTypeMap["rule_id"] = bindings.NewStringType() + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["sectionId"] = bindings.NewStringType() + paramsTypeMap["ruleId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + pathParams["rule_id"] = "ruleId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/sections/{sectionId}/rules/{ruleId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["applied_tos"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["destinations"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["filter_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["services"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sources"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["applied_tos"] = "AppliedTos" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["destinations"] = "Destinations" + fieldNameMap["filter_type"] = "FilterType" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["services"] = "Services" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["sources"] = "Sources" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInsertionRuleListResultBindingType) +} + +func rulesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["applied_tos"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["destinations"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["filter_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["services"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sources"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["applied_tos"] = "AppliedTos" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["destinations"] = "Destinations" + fieldNameMap["filter_type"] = "FilterType" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["services"] = "Services" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["sources"] = "Sources" + paramsTypeMap["sources"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["filter_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["applied_tos"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["services"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["destinations"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["sectionId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["sources"] = "sources" + queryParams["filter_type"] = "filter_type" + queryParams["included_fields"] = "included_fields" + queryParams["destinations"] = "destinations" + queryParams["applied_tos"] = "applied_tos" + queryParams["services"] = "services" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/sections/{sectionId}/rules", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesReviseInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fields["service_insertion_rule"] = bindings.NewReferenceType(model.ServiceInsertionRuleBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["rule_id"] = "RuleId" + fieldNameMap["service_insertion_rule"] = "ServiceInsertionRule" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesReviseOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInsertionRuleBindingType) +} + +func rulesReviseRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fields["service_insertion_rule"] = bindings.NewReferenceType(model.ServiceInsertionRuleBindingType) + fields["id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["rule_id"] = "RuleId" + fieldNameMap["service_insertion_rule"] = "ServiceInsertionRule" + fieldNameMap["id"] = "Id" + fieldNameMap["operation"] = "Operation" + paramsTypeMap["rule_id"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["service_insertion_rule"] = bindings.NewReferenceType(model.ServiceInsertionRuleBindingType) + paramsTypeMap["operation"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sectionId"] = bindings.NewStringType() + paramsTypeMap["ruleId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + pathParams["rule_id"] = "ruleId" + queryParams["id"] = "id" + queryParams["operation"] = "operation" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=revise", + "service_insertion_rule", + "POST", + "/api/v1/serviceinsertion/sections/{sectionId}/rules/{ruleId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func rulesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["section_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fields["service_insertion_rule"] = bindings.NewReferenceType(model.ServiceInsertionRuleBindingType) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["rule_id"] = "RuleId" + fieldNameMap["service_insertion_rule"] = "ServiceInsertionRule" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func rulesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInsertionRuleBindingType) +} + +func rulesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["section_id"] = bindings.NewStringType() + fields["rule_id"] = bindings.NewStringType() + fields["service_insertion_rule"] = bindings.NewReferenceType(model.ServiceInsertionRuleBindingType) + fieldNameMap["section_id"] = "SectionId" + fieldNameMap["rule_id"] = "RuleId" + fieldNameMap["service_insertion_rule"] = "ServiceInsertionRule" + paramsTypeMap["rule_id"] = bindings.NewStringType() + paramsTypeMap["section_id"] = bindings.NewStringType() + paramsTypeMap["service_insertion_rule"] = bindings.NewReferenceType(model.ServiceInsertionRuleBindingType) + paramsTypeMap["sectionId"] = bindings.NewStringType() + paramsTypeMap["ruleId"] = bindings.NewStringType() + pathParams["section_id"] = "sectionId" + pathParams["rule_id"] = "ruleId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "service_insertion_rule", + "PUT", + "/api/v1/serviceinsertion/sections/{sectionId}/rules/{ruleId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/sections/SectionsPackageTypes.go b/services/nsxt-mp/nsx/serviceinsertion/sections/SectionsPackageTypes.go new file mode 100644 index 000000000..b9d0b0d54 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/sections/SectionsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.serviceinsertion.sections. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package sections diff --git a/services/nsxt-mp/nsx/serviceinsertion/service_chains/ServiceChainsPackageTypes.go b/services/nsxt-mp/nsx/serviceinsertion/service_chains/ServiceChainsPackageTypes.go new file mode 100644 index 000000000..69a1d56d5 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/service_chains/ServiceChainsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.serviceinsertion.service_chains. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package service_chains diff --git a/services/nsxt-mp/nsx/serviceinsertion/service_chains/ServicePathsClient.go b/services/nsxt-mp/nsx/serviceinsertion/service_chains/ServicePathsClient.go new file mode 100644 index 000000000..ce0d7b841 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/service_chains/ServicePathsClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ServicePaths +// Used by client-side stubs. + +package service_chains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ServicePathsClient interface { + + // List all service paths for the given service chain for the given service chain id NOTE: GET service paths api is deprecated, please use the policy API. + // + // @param serviceChainIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.ServicePathListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(serviceChainIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ServicePathListResult, error) +} + +type servicePathsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewServicePathsClient(connector client.Connector) *servicePathsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.service_chains.service_paths") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := servicePathsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *servicePathsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *servicePathsClient) List(serviceChainIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ServicePathListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(servicePathsListInputType(), typeConverter) + sv.AddStructField("ServiceChainId", serviceChainIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServicePathListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicePathsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.service_chains.service_paths", "list", inputDataValue, executionContext) + var emptyOutput model.ServicePathListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), servicePathsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServicePathListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/service_chains/ServicePathsTypes.go b/services/nsxt-mp/nsx/serviceinsertion/service_chains/ServicePathsTypes.go new file mode 100644 index 000000000..dd563733e --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/service_chains/ServicePathsTypes.go @@ -0,0 +1,99 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ServicePaths. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package service_chains + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func servicePathsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_chain_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_chain_id"] = "ServiceChainId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicePathsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServicePathListResultBindingType) +} + +func servicePathsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_chain_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_chain_id"] = "ServiceChainId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["service_chain_id"] = bindings.NewStringType() + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["serviceChainId"] = bindings.NewStringType() + pathParams["service_chain_id"] = "serviceChainId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/service-chains/{serviceChainId}/service-paths", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/ServiceDeploymentsClient.go b/services/nsxt-mp/nsx/serviceinsertion/services/ServiceDeploymentsClient.go new file mode 100644 index 000000000..c8b864370 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/ServiceDeploymentsClient.go @@ -0,0 +1,307 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ServiceDeployments +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ServiceDeploymentsClient interface { + + // This will deploy a particular service on a given cluster / host. Internally multiple service instance can be created during the deployment. If there are no issues in the parameters, the call returns immediately, and the service VMs will be deployed asynchronously. To get the overall status of the deployment or to get the status of individual service vm, please use the deployment status APIs. + // + // @param serviceIdParam (required) + // @param serviceDeploymentParam (required) + // @return com.vmware.nsx.model.ServiceDeployment + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(serviceIdParam string, serviceDeploymentParam model.ServiceDeployment) (model.ServiceDeployment, error) + + // Remove the service deployment. Will remove all the Service VMs that were created as part of this deployment. User can send optional force delete option which will force remove the deployment, but should be used only when the regular delete is not working. Regular delete will ensure proper cleanup of Service VMs and related objects. Directly calling this API without trying regular undeploy will result in unexpected results, and orphan objects. + // + // @param serviceIdParam (required) + // @param serviceDeploymentIdParam (required) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(serviceIdParam string, serviceDeploymentIdParam string, forceParam *bool) error + + // Returns detail of service deployment. + // + // @param serviceIdParam (required) + // @param serviceDeploymentIdParam (required) + // @return com.vmware.nsx.model.ServiceDeployment + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string, serviceDeploymentIdParam string) (model.ServiceDeployment, error) + + // Returns the list of deployments for the given service + // + // @param serviceIdParam (required) + // @return com.vmware.nsx.model.ServiceDeploymentListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(serviceIdParam string) (model.ServiceDeploymentListResult, error) + + // This API is deprecated since only property we can change on service deployment is display name, which is used for the SVM name. Changing the name will cause the name of the deployment to go out of sync with the deployed VM. + // + // @param serviceIdParam (required) + // @param serviceDeploymentIdParam (required) + // @param serviceDeploymentParam (required) + // @return com.vmware.nsx.model.ServiceDeployment + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(serviceIdParam string, serviceDeploymentIdParam string, serviceDeploymentParam model.ServiceDeployment) (model.ServiceDeployment, error) + + // If new deployment spec is provided, the deployment will be moved to the provided spec provided that current deployment state is either UPGRADE_FAILED or DEPLOYMENT_SUCCESSFUL If same deployment spec is provided, upgrade will be done only if current deployment state is UPGRADE_FAILED + // + // @param serviceIdParam (required) + // @param serviceDeploymentIdParam (required) + // @param deploymentSpecNameParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Upgrade(serviceIdParam string, serviceDeploymentIdParam string, deploymentSpecNameParam model.DeploymentSpecName) error +} + +type serviceDeploymentsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewServiceDeploymentsClient(connector client.Connector) *serviceDeploymentsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.services.service_deployments") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + "upgrade": core.NewMethodIdentifier(interfaceIdentifier, "upgrade"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := serviceDeploymentsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *serviceDeploymentsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *serviceDeploymentsClient) Create(serviceIdParam string, serviceDeploymentParam model.ServiceDeployment) (model.ServiceDeployment, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceDeploymentsCreateInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceDeployment", serviceDeploymentParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceDeployment + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceDeploymentsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_deployments", "create", inputDataValue, executionContext) + var emptyOutput model.ServiceDeployment + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceDeploymentsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceDeployment), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serviceDeploymentsClient) Delete(serviceIdParam string, serviceDeploymentIdParam string, forceParam *bool) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceDeploymentsDeleteInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceDeploymentId", serviceDeploymentIdParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceDeploymentsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_deployments", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *serviceDeploymentsClient) Get(serviceIdParam string, serviceDeploymentIdParam string) (model.ServiceDeployment, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceDeploymentsGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceDeploymentId", serviceDeploymentIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceDeployment + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceDeploymentsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_deployments", "get", inputDataValue, executionContext) + var emptyOutput model.ServiceDeployment + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceDeploymentsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceDeployment), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serviceDeploymentsClient) List(serviceIdParam string) (model.ServiceDeploymentListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceDeploymentsListInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceDeploymentListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceDeploymentsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_deployments", "list", inputDataValue, executionContext) + var emptyOutput model.ServiceDeploymentListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceDeploymentsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceDeploymentListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serviceDeploymentsClient) Update(serviceIdParam string, serviceDeploymentIdParam string, serviceDeploymentParam model.ServiceDeployment) (model.ServiceDeployment, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceDeploymentsUpdateInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceDeploymentId", serviceDeploymentIdParam) + sv.AddStructField("ServiceDeployment", serviceDeploymentParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceDeployment + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceDeploymentsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_deployments", "update", inputDataValue, executionContext) + var emptyOutput model.ServiceDeployment + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceDeploymentsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceDeployment), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serviceDeploymentsClient) Upgrade(serviceIdParam string, serviceDeploymentIdParam string, deploymentSpecNameParam model.DeploymentSpecName) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceDeploymentsUpgradeInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceDeploymentId", serviceDeploymentIdParam) + sv.AddStructField("DeploymentSpecName", deploymentSpecNameParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceDeploymentsUpgradeRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_deployments", "upgrade", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/ServiceDeploymentsTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/ServiceDeploymentsTypes.go new file mode 100644 index 000000000..c11235713 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/ServiceDeploymentsTypes.go @@ -0,0 +1,368 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ServiceDeployments. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func serviceDeploymentsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_deployment"] = bindings.NewReferenceType(model.ServiceDeploymentBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_deployment"] = "ServiceDeployment" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceDeploymentsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceDeploymentBindingType) +} + +func serviceDeploymentsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_deployment"] = bindings.NewReferenceType(model.ServiceDeploymentBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_deployment"] = "ServiceDeployment" + paramsTypeMap["service_deployment"] = bindings.NewReferenceType(model.ServiceDeploymentBindingType) + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "service_deployment", + "POST", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-deployments", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceDeploymentsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_deployment_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_deployment_id"] = "ServiceDeploymentId" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceDeploymentsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func serviceDeploymentsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_deployment_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_deployment_id"] = "ServiceDeploymentId" + fieldNameMap["force"] = "Force" + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["service_deployment_id"] = bindings.NewStringType() + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceDeploymentId"] = bindings.NewStringType() + pathParams["service_deployment_id"] = "serviceDeploymentId" + pathParams["service_id"] = "serviceId" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-deployments/{serviceDeploymentId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceDeploymentsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_deployment_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_deployment_id"] = "ServiceDeploymentId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceDeploymentsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceDeploymentBindingType) +} + +func serviceDeploymentsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_deployment_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_deployment_id"] = "ServiceDeploymentId" + paramsTypeMap["service_deployment_id"] = bindings.NewStringType() + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceDeploymentId"] = bindings.NewStringType() + pathParams["service_deployment_id"] = "serviceDeploymentId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-deployments/{serviceDeploymentId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceDeploymentsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceDeploymentsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceDeploymentListResultBindingType) +} + +func serviceDeploymentsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-deployments", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceDeploymentsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_deployment_id"] = bindings.NewStringType() + fields["service_deployment"] = bindings.NewReferenceType(model.ServiceDeploymentBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_deployment_id"] = "ServiceDeploymentId" + fieldNameMap["service_deployment"] = "ServiceDeployment" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceDeploymentsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceDeploymentBindingType) +} + +func serviceDeploymentsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_deployment_id"] = bindings.NewStringType() + fields["service_deployment"] = bindings.NewReferenceType(model.ServiceDeploymentBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_deployment_id"] = "ServiceDeploymentId" + fieldNameMap["service_deployment"] = "ServiceDeployment" + paramsTypeMap["service_deployment"] = bindings.NewReferenceType(model.ServiceDeploymentBindingType) + paramsTypeMap["service_deployment_id"] = bindings.NewStringType() + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceDeploymentId"] = bindings.NewStringType() + pathParams["service_deployment_id"] = "serviceDeploymentId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "service_deployment", + "PUT", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-deployments/{serviceDeploymentId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceDeploymentsUpgradeInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_deployment_id"] = bindings.NewStringType() + fields["deployment_spec_name"] = bindings.NewReferenceType(model.DeploymentSpecNameBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_deployment_id"] = "ServiceDeploymentId" + fieldNameMap["deployment_spec_name"] = "DeploymentSpecName" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceDeploymentsUpgradeOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func serviceDeploymentsUpgradeRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_deployment_id"] = bindings.NewStringType() + fields["deployment_spec_name"] = bindings.NewReferenceType(model.DeploymentSpecNameBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_deployment_id"] = "ServiceDeploymentId" + fieldNameMap["deployment_spec_name"] = "DeploymentSpecName" + paramsTypeMap["service_deployment_id"] = bindings.NewStringType() + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["deployment_spec_name"] = bindings.NewReferenceType(model.DeploymentSpecNameBindingType) + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceDeploymentId"] = bindings.NewStringType() + pathParams["service_deployment_id"] = "serviceDeploymentId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=upgrade", + "deployment_spec_name", + "POST", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-deployments/{serviceDeploymentId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/ServiceInstancesClient.go b/services/nsxt-mp/nsx/serviceinsertion/services/ServiceInstancesClient.go new file mode 100644 index 000000000..b70d05b7f --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/ServiceInstancesClient.go @@ -0,0 +1,271 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ServiceInstances +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ServiceInstancesClient interface { + + // Adds a new Service-Instance under the specified Service. + // + // @param serviceIdParam (required) + // @param baseServiceInstanceParam (required) + // The parameter must contain all the properties defined in model.BaseServiceInstance. + // @return com.vmware.nsx.model.BaseServiceInstance + // The return value will contain all the properties defined in model.BaseServiceInstance. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(serviceIdParam string, baseServiceInstanceParam *data.StructValue) (*data.StructValue, error) + + // Delete existing Service-Instance for a given Service-Insertion Service. + // + // @param serviceIdParam (required) + // @param serviceInstanceIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(serviceIdParam string, serviceInstanceIdParam string) error + + // Returns Service-Instance information for a given Service-Insertion Service. + // + // @param serviceIdParam (required) + // @param serviceInstanceIdParam (required) + // @return com.vmware.nsx.model.BaseServiceInstance + // The return value will contain all the properties defined in model.BaseServiceInstance. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string, serviceInstanceIdParam string) (*data.StructValue, error) + + // Returns all Service-Instance(s) for a given Service-Insertion Service. + // + // @param serviceIdParam (required) + // @return com.vmware.nsx.model.ServiceInstanceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(serviceIdParam string) (model.ServiceInstanceListResult, error) + + // Modifies an existing Service-Instance for a given Service-Insertion Service. + // + // @param serviceIdParam (required) + // @param serviceInstanceIdParam (required) + // @param baseServiceInstanceParam (required) + // The parameter must contain all the properties defined in model.BaseServiceInstance. + // @return com.vmware.nsx.model.BaseServiceInstance + // The return value will contain all the properties defined in model.BaseServiceInstance. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(serviceIdParam string, serviceInstanceIdParam string, baseServiceInstanceParam *data.StructValue) (*data.StructValue, error) +} + +type serviceInstancesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewServiceInstancesClient(connector client.Connector) *serviceInstancesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.services.service_instances") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := serviceInstancesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *serviceInstancesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *serviceInstancesClient) Create(serviceIdParam string, baseServiceInstanceParam *data.StructValue) (*data.StructValue, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceInstancesCreateInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("BaseServiceInstance", baseServiceInstanceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceInstancesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_instances", "create", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceInstancesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serviceInstancesClient) Delete(serviceIdParam string, serviceInstanceIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceInstancesDeleteInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceInstanceId", serviceInstanceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceInstancesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_instances", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *serviceInstancesClient) Get(serviceIdParam string, serviceInstanceIdParam string) (*data.StructValue, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceInstancesGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceInstanceId", serviceInstanceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceInstancesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_instances", "get", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceInstancesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serviceInstancesClient) List(serviceIdParam string) (model.ServiceInstanceListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceInstancesListInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInstanceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceInstancesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_instances", "list", inputDataValue, executionContext) + var emptyOutput model.ServiceInstanceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceInstancesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInstanceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serviceInstancesClient) Update(serviceIdParam string, serviceInstanceIdParam string, baseServiceInstanceParam *data.StructValue) (*data.StructValue, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceInstancesUpdateInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceInstanceId", serviceInstanceIdParam) + sv.AddStructField("BaseServiceInstance", baseServiceInstanceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceInstancesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_instances", "update", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceInstancesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/ServiceInstancesTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/ServiceInstancesTypes.go new file mode 100644 index 000000000..6a4a90126 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/ServiceInstancesTypes.go @@ -0,0 +1,300 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ServiceInstances. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func serviceInstancesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["base_service_instance"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseServiceInstanceBindingType)}, bindings.REST) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["base_service_instance"] = "BaseServiceInstance" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceInstancesCreateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseServiceInstanceBindingType)}, bindings.REST) +} + +func serviceInstancesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["base_service_instance"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseServiceInstanceBindingType)}, bindings.REST) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["base_service_instance"] = "BaseServiceInstance" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["base_service_instance"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseServiceInstanceBindingType)}, bindings.REST) + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "base_service_instance", + "POST", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-instances", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceInstancesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceInstancesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func serviceInstancesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service_instance_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceInstanceId"] = bindings.NewStringType() + pathParams["service_instance_id"] = "serviceInstanceId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-instances/{serviceInstanceId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceInstancesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceInstancesGetOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseServiceInstanceBindingType)}, bindings.REST) +} + +func serviceInstancesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service_instance_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceInstanceId"] = bindings.NewStringType() + pathParams["service_instance_id"] = "serviceInstanceId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-instances/{serviceInstanceId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceInstancesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceInstancesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInstanceListResultBindingType) +} + +func serviceInstancesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-instances", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceInstancesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fields["base_service_instance"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseServiceInstanceBindingType)}, bindings.REST) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + fieldNameMap["base_service_instance"] = "BaseServiceInstance" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceInstancesUpdateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseServiceInstanceBindingType)}, bindings.REST) +} + +func serviceInstancesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fields["base_service_instance"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseServiceInstanceBindingType)}, bindings.REST) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + fieldNameMap["base_service_instance"] = "BaseServiceInstance" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["base_service_instance"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseServiceInstanceBindingType)}, bindings.REST) + paramsTypeMap["service_instance_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceInstanceId"] = bindings.NewStringType() + pathParams["service_instance_id"] = "serviceInstanceId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "base_service_instance", + "PUT", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-instances/{serviceInstanceId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/ServiceProfilesClient.go b/services/nsxt-mp/nsx/serviceinsertion/services/ServiceProfilesClient.go new file mode 100644 index 000000000..36f7eec63 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/ServiceProfilesClient.go @@ -0,0 +1,222 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ServiceProfiles +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ServiceProfilesClient interface { + + // Adds a new service profile. + // + // @param serviceIdParam (required) + // @param baseServiceProfileParam (required) + // The parameter must contain all the properties defined in model.BaseServiceProfile. + // @return com.vmware.nsx.model.BaseServiceProfile + // The return value will contain all the properties defined in model.BaseServiceProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(serviceIdParam string, baseServiceProfileParam *data.StructValue) (*data.StructValue, error) + + // Delete service profile for a given service. + // + // @param serviceIdParam (required) + // @param serviceProfileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(serviceIdParam string, serviceProfileIdParam string) error + + // Returns detailed service profile information for a given Service. + // + // @param serviceIdParam (required) + // @param serviceProfileIdParam (required) + // @return com.vmware.nsx.model.BaseServiceProfile + // The return value will contain all the properties defined in model.BaseServiceProfile. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string, serviceProfileIdParam string) (*data.StructValue, error) + + // List all service profiles of a service. + // + // @param serviceIdParam (required) + // @return com.vmware.nsx.model.SIServiceProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(serviceIdParam string) (model.SIServiceProfileListResult, error) +} + +type serviceProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewServiceProfilesClient(connector client.Connector) *serviceProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.services.service_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := serviceProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *serviceProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *serviceProfilesClient) Create(serviceIdParam string, baseServiceProfileParam *data.StructValue) (*data.StructValue, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceProfilesCreateInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("BaseServiceProfile", baseServiceProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceProfilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_profiles", "create", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceProfilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serviceProfilesClient) Delete(serviceIdParam string, serviceProfileIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceProfilesDeleteInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceProfileId", serviceProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *serviceProfilesClient) Get(serviceIdParam string, serviceProfileIdParam string) (*data.StructValue, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceProfilesGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceProfileId", serviceProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_profiles", "get", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *serviceProfilesClient) List(serviceIdParam string) (model.SIServiceProfileListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceProfilesListInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SIServiceProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.SIServiceProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SIServiceProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/ServiceProfilesTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/ServiceProfilesTypes.go new file mode 100644 index 000000000..24c7ec48c --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/ServiceProfilesTypes.go @@ -0,0 +1,238 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ServiceProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func serviceProfilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["base_service_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseServiceProfileBindingType)}, bindings.REST) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["base_service_profile"] = "BaseServiceProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceProfilesCreateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseServiceProfileBindingType)}, bindings.REST) +} + +func serviceProfilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["base_service_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseServiceProfileBindingType)}, bindings.REST) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["base_service_profile"] = "BaseServiceProfile" + paramsTypeMap["base_service_profile"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseServiceProfileBindingType)}, bindings.REST) + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "base_service_profile", + "POST", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_profile_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_profile_id"] = "ServiceProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func serviceProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_profile_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_profile_id"] = "ServiceProfileId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service_profile_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceProfileId"] = bindings.NewStringType() + pathParams["service_profile_id"] = "serviceProfileId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-profiles/{serviceProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_profile_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_profile_id"] = "ServiceProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceProfilesGetOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.BaseServiceProfileBindingType)}, bindings.REST) +} + +func serviceProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_profile_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_profile_id"] = "ServiceProfileId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service_profile_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceProfileId"] = bindings.NewStringType() + pathParams["service_profile_id"] = "serviceProfileId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-profiles/{serviceProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func serviceProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SIServiceProfileListResultBindingType) +} + +func serviceProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/ServicesPackageTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/ServicesPackageTypes.go new file mode 100644 index 000000000..2f1024726 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/ServicesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.serviceinsertion.services. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/SolutionConfigsClient.go b/services/nsxt-mp/nsx/serviceinsertion/services/SolutionConfigsClient.go new file mode 100644 index 000000000..79d1764d0 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/SolutionConfigsClient.go @@ -0,0 +1,265 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: SolutionConfigs +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SolutionConfigsClient interface { + + // Adds a solution config. Solution Config are service level objects, required for configuring the NXGI partner Service after deployment. + // + // @param serviceIdParam (required) + // @param solutionConfigParam (required) + // @return com.vmware.nsx.model.SolutionConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(serviceIdParam string, solutionConfigParam model.SolutionConfig) (model.SolutionConfig, error) + + // Deletes solution config information for a given service. + // + // @param serviceIdParam (required) + // @param solutionConfigIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(serviceIdParam string, solutionConfigIdParam string) error + + // Returns Solution Config information for a given solution config id. + // + // @param serviceIdParam (required) + // @param solutionConfigIdParam (required) + // @return com.vmware.nsx.model.SolutionConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string, solutionConfigIdParam string) (model.SolutionConfig, error) + + // Returns Solution Config information for a given service. + // + // @param serviceIdParam (required) + // @return com.vmware.nsx.model.SolutionConfigListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(serviceIdParam string) (model.SolutionConfigListResult, error) + + // Updates a solution config. Solution Config are service level objects, required for configuring the NXGI partner Service after deployment. + // + // @param serviceIdParam (required) + // @param solutionConfigIdParam (required) + // @param solutionConfigParam (required) + // @return com.vmware.nsx.model.SolutionConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(serviceIdParam string, solutionConfigIdParam string, solutionConfigParam model.SolutionConfig) (model.SolutionConfig, error) +} + +type solutionConfigsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSolutionConfigsClient(connector client.Connector) *solutionConfigsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.services.solution_configs") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := solutionConfigsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *solutionConfigsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *solutionConfigsClient) Create(serviceIdParam string, solutionConfigParam model.SolutionConfig) (model.SolutionConfig, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(solutionConfigsCreateInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("SolutionConfig", solutionConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SolutionConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := solutionConfigsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.solution_configs", "create", inputDataValue, executionContext) + var emptyOutput model.SolutionConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), solutionConfigsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SolutionConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *solutionConfigsClient) Delete(serviceIdParam string, solutionConfigIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(solutionConfigsDeleteInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("SolutionConfigId", solutionConfigIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := solutionConfigsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.solution_configs", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *solutionConfigsClient) Get(serviceIdParam string, solutionConfigIdParam string) (model.SolutionConfig, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(solutionConfigsGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("SolutionConfigId", solutionConfigIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SolutionConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := solutionConfigsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.solution_configs", "get", inputDataValue, executionContext) + var emptyOutput model.SolutionConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), solutionConfigsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SolutionConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *solutionConfigsClient) List(serviceIdParam string) (model.SolutionConfigListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(solutionConfigsListInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SolutionConfigListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := solutionConfigsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.solution_configs", "list", inputDataValue, executionContext) + var emptyOutput model.SolutionConfigListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), solutionConfigsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SolutionConfigListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *solutionConfigsClient) Update(serviceIdParam string, solutionConfigIdParam string, solutionConfigParam model.SolutionConfig) (model.SolutionConfig, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(solutionConfigsUpdateInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("SolutionConfigId", solutionConfigIdParam) + sv.AddStructField("SolutionConfig", solutionConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SolutionConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := solutionConfigsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.solution_configs", "update", inputDataValue, executionContext) + var emptyOutput model.SolutionConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), solutionConfigsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SolutionConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/SolutionConfigsTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/SolutionConfigsTypes.go new file mode 100644 index 000000000..b3618511a --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/SolutionConfigsTypes.go @@ -0,0 +1,300 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: SolutionConfigs. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func solutionConfigsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["solution_config"] = bindings.NewReferenceType(model.SolutionConfigBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["solution_config"] = "SolutionConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func solutionConfigsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SolutionConfigBindingType) +} + +func solutionConfigsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["solution_config"] = bindings.NewReferenceType(model.SolutionConfigBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["solution_config"] = "SolutionConfig" + paramsTypeMap["solution_config"] = bindings.NewReferenceType(model.SolutionConfigBindingType) + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "solution_config", + "POST", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/solution-configs", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func solutionConfigsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["solution_config_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["solution_config_id"] = "SolutionConfigId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func solutionConfigsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func solutionConfigsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["solution_config_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["solution_config_id"] = "SolutionConfigId" + paramsTypeMap["solution_config_id"] = bindings.NewStringType() + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["solutionConfigId"] = bindings.NewStringType() + pathParams["solution_config_id"] = "solutionConfigId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/solution-configs/{solutionConfigId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func solutionConfigsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["solution_config_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["solution_config_id"] = "SolutionConfigId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func solutionConfigsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SolutionConfigBindingType) +} + +func solutionConfigsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["solution_config_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["solution_config_id"] = "SolutionConfigId" + paramsTypeMap["solution_config_id"] = bindings.NewStringType() + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["solutionConfigId"] = bindings.NewStringType() + pathParams["solution_config_id"] = "solutionConfigId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/solution-configs/{solutionConfigId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func solutionConfigsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func solutionConfigsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SolutionConfigListResultBindingType) +} + +func solutionConfigsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/solution-configs", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func solutionConfigsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["solution_config_id"] = bindings.NewStringType() + fields["solution_config"] = bindings.NewReferenceType(model.SolutionConfigBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["solution_config_id"] = "SolutionConfigId" + fieldNameMap["solution_config"] = "SolutionConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func solutionConfigsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SolutionConfigBindingType) +} + +func solutionConfigsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["solution_config_id"] = bindings.NewStringType() + fields["solution_config"] = bindings.NewReferenceType(model.SolutionConfigBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["solution_config_id"] = "SolutionConfigId" + fieldNameMap["solution_config"] = "SolutionConfig" + paramsTypeMap["solution_config"] = bindings.NewReferenceType(model.SolutionConfigBindingType) + paramsTypeMap["solution_config_id"] = bindings.NewStringType() + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["solutionConfigId"] = bindings.NewStringType() + pathParams["solution_config_id"] = "solutionConfigId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "solution_config", + "PUT", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/solution-configs/{solutionConfigId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/VendorTemplatesClient.go b/services/nsxt-mp/nsx/serviceinsertion/services/VendorTemplatesClient.go new file mode 100644 index 000000000..4a54c5b29 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/VendorTemplatesClient.go @@ -0,0 +1,220 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: VendorTemplates +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type VendorTemplatesClient interface { + + // Adds a new vendor template. Vendor templates are service level objects, registered to be used in Service Profiles. + // + // @param serviceIdParam (required) + // @param vendorTemplateParam (required) + // @return com.vmware.nsx.model.VendorTemplate + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(serviceIdParam string, vendorTemplateParam model.VendorTemplate) (model.VendorTemplate, error) + + // Delete vendor template information for a given service. Please make sure to delete all the Service Profile(s), which refer to this vendor tempalte before deleting the template itself. + // + // @param serviceIdParam (required) + // @param vendorTemplateIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(serviceIdParam string, vendorTemplateIdParam string) error + + // Returns detailed vendor template information for a given service. + // + // @param serviceIdParam (required) + // @param vendorTemplateIdParam (required) + // @return com.vmware.nsx.model.VendorTemplate + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string, vendorTemplateIdParam string) (model.VendorTemplate, error) + + // List all vendor templates of a service. + // + // @param serviceIdParam (required) + // @param vendorTemplateNameParam Name of vendor template (optional) + // @return com.vmware.nsx.model.VendorTemplateListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(serviceIdParam string, vendorTemplateNameParam *string) (model.VendorTemplateListResult, error) +} + +type vendorTemplatesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewVendorTemplatesClient(connector client.Connector) *vendorTemplatesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.services.vendor_templates") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + vIface := vendorTemplatesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &vIface +} + +func (vIface *vendorTemplatesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := vIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (vIface *vendorTemplatesClient) Create(serviceIdParam string, vendorTemplateParam model.VendorTemplate) (model.VendorTemplate, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(vendorTemplatesCreateInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("VendorTemplate", vendorTemplateParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.VendorTemplate + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := vendorTemplatesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.vendor_templates", "create", inputDataValue, executionContext) + var emptyOutput model.VendorTemplate + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), vendorTemplatesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.VendorTemplate), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (vIface *vendorTemplatesClient) Delete(serviceIdParam string, vendorTemplateIdParam string) error { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(vendorTemplatesDeleteInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("VendorTemplateId", vendorTemplateIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := vendorTemplatesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.vendor_templates", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (vIface *vendorTemplatesClient) Get(serviceIdParam string, vendorTemplateIdParam string) (model.VendorTemplate, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(vendorTemplatesGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("VendorTemplateId", vendorTemplateIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.VendorTemplate + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := vendorTemplatesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.vendor_templates", "get", inputDataValue, executionContext) + var emptyOutput model.VendorTemplate + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), vendorTemplatesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.VendorTemplate), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (vIface *vendorTemplatesClient) List(serviceIdParam string, vendorTemplateNameParam *string) (model.VendorTemplateListResult, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(vendorTemplatesListInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("VendorTemplateName", vendorTemplateNameParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.VendorTemplateListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := vendorTemplatesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.vendor_templates", "list", inputDataValue, executionContext) + var emptyOutput model.VendorTemplateListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), vendorTemplatesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.VendorTemplateListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/VendorTemplatesTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/VendorTemplatesTypes.go new file mode 100644 index 000000000..ff727ba18 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/VendorTemplatesTypes.go @@ -0,0 +1,244 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: VendorTemplates. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func vendorTemplatesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["vendor_template"] = bindings.NewReferenceType(model.VendorTemplateBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["vendor_template"] = "VendorTemplate" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func vendorTemplatesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.VendorTemplateBindingType) +} + +func vendorTemplatesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["vendor_template"] = bindings.NewReferenceType(model.VendorTemplateBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["vendor_template"] = "VendorTemplate" + paramsTypeMap["vendor_template"] = bindings.NewReferenceType(model.VendorTemplateBindingType) + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "vendor_template", + "POST", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/vendor-templates", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func vendorTemplatesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["vendor_template_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["vendor_template_id"] = "VendorTemplateId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func vendorTemplatesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func vendorTemplatesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["vendor_template_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["vendor_template_id"] = "VendorTemplateId" + paramsTypeMap["vendor_template_id"] = bindings.NewStringType() + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["vendorTemplateId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + pathParams["vendor_template_id"] = "vendorTemplateId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/vendor-templates/{vendorTemplateId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func vendorTemplatesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["vendor_template_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["vendor_template_id"] = "VendorTemplateId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func vendorTemplatesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.VendorTemplateBindingType) +} + +func vendorTemplatesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["vendor_template_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["vendor_template_id"] = "VendorTemplateId" + paramsTypeMap["vendor_template_id"] = bindings.NewStringType() + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["vendorTemplateId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + pathParams["vendor_template_id"] = "vendorTemplateId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/vendor-templates/{vendorTemplateId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func vendorTemplatesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["vendor_template_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["vendor_template_name"] = "VendorTemplateName" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func vendorTemplatesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.VendorTemplateListResultBindingType) +} + +func vendorTemplatesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["vendor_template_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["vendor_template_name"] = "VendorTemplateName" + paramsTypeMap["vendor_template_name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + queryParams["vendor_template_name"] = "vendor_template_name" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/vendor-templates", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_deployments/ServiceDeploymentsPackageTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_deployments/ServiceDeploymentsPackageTypes.go new file mode 100644 index 000000000..bb11fd512 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_deployments/ServiceDeploymentsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.serviceinsertion.services.service_deployments. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package service_deployments diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_deployments/StateClient.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_deployments/StateClient.go new file mode 100644 index 000000000..2a487222e --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_deployments/StateClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: State +// Used by client-side stubs. + +package service_deployments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StateClient interface { + + // Returns configuration state of deployed partner service using service insertion framework. + // + // @param serviceIdParam (required) + // @param serviceDeploymentIdParam (required) + // @return com.vmware.nsx.model.ConfigurationState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string, serviceDeploymentIdParam string) (model.ConfigurationState, error) +} + +type stateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStateClient(connector client.Connector) *stateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.services.service_deployments.state") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := stateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *stateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *stateClient) Get(serviceIdParam string, serviceDeploymentIdParam string) (model.ConfigurationState, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(stateGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceDeploymentId", serviceDeploymentIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ConfigurationState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_deployments.state", "get", inputDataValue, executionContext) + var emptyOutput model.ConfigurationState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ConfigurationState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_deployments/StateTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_deployments/StateTypes.go new file mode 100644 index 000000000..3d2fd6473 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_deployments/StateTypes.go @@ -0,0 +1,76 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: State. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package service_deployments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func stateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_deployment_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_deployment_id"] = "ServiceDeploymentId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ConfigurationStateBindingType) +} + +func stateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_deployment_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_deployment_id"] = "ServiceDeploymentId" + paramsTypeMap["service_deployment_id"] = bindings.NewStringType() + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceDeploymentId"] = bindings.NewStringType() + pathParams["service_deployment_id"] = "serviceDeploymentId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-deployments/{serviceDeploymentId}/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_deployments/StatusClient.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_deployments/StatusClient.go new file mode 100644 index 000000000..bfc0cc8f4 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_deployments/StatusClient.go @@ -0,0 +1,94 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package service_deployments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Returns current status of the deployment of partner service. Available only for EPP Services. By default this API would return cached status. Caching happens every 3 minutes. For realtime status, query parameter \"source=realtime\" needs to be passed. + // + // @param serviceIdParam (required) + // @param serviceDeploymentIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.ServiceDeploymentStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string, serviceDeploymentIdParam string, sourceParam *string) (model.ServiceDeploymentStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.services.service_deployments.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(serviceIdParam string, serviceDeploymentIdParam string, sourceParam *string) (model.ServiceDeploymentStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceDeploymentId", serviceDeploymentIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceDeploymentStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_deployments.status", "get", inputDataValue, executionContext) + var emptyOutput model.ServiceDeploymentStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceDeploymentStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_deployments/StatusTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_deployments/StatusTypes.go new file mode 100644 index 000000000..23d755bc1 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_deployments/StatusTypes.go @@ -0,0 +1,88 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package service_deployments + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_CACHED = "cached" + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_deployment_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_deployment_id"] = "ServiceDeploymentId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceDeploymentStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_deployment_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_deployment_id"] = "ServiceDeploymentId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_deployment_id"] = bindings.NewStringType() + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceDeploymentId"] = bindings.NewStringType() + pathParams["service_deployment_id"] = "serviceDeploymentId" + pathParams["service_id"] = "serviceId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-deployments/{serviceDeploymentId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/GroupAssociationsClient.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/GroupAssociationsClient.go new file mode 100644 index 000000000..93b387046 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/GroupAssociationsClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: GroupAssociations +// Used by client-side stubs. + +package service_instances + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type GroupAssociationsClient interface { + + // Returns list of NSGroups used in Service Insertion North-South rules for a given Service Instance. + // + // @param serviceIdParam (required) + // @param serviceInstanceIdParam (required) + // @return com.vmware.nsx.model.ServiceInstanceNSGroups + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string, serviceInstanceIdParam string) (model.ServiceInstanceNSGroups, error) +} + +type groupAssociationsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewGroupAssociationsClient(connector client.Connector) *groupAssociationsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.services.service_instances.group_associations") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + gIface := groupAssociationsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &gIface +} + +func (gIface *groupAssociationsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := gIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (gIface *groupAssociationsClient) Get(serviceIdParam string, serviceInstanceIdParam string) (model.ServiceInstanceNSGroups, error) { + typeConverter := gIface.connector.TypeConverter() + executionContext := gIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(groupAssociationsGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceInstanceId", serviceInstanceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInstanceNSGroups + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := groupAssociationsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + gIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := gIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_instances.group_associations", "get", inputDataValue, executionContext) + var emptyOutput model.ServiceInstanceNSGroups + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), groupAssociationsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInstanceNSGroups), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), gIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/GroupAssociationsTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/GroupAssociationsTypes.go new file mode 100644 index 000000000..c32908684 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/GroupAssociationsTypes.go @@ -0,0 +1,76 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: GroupAssociations. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package service_instances + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func groupAssociationsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func groupAssociationsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInstanceNSGroupsBindingType) +} + +func groupAssociationsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service_instance_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceInstanceId"] = bindings.NewStringType() + pathParams["service_instance_id"] = "serviceInstanceId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-instances/{serviceInstanceId}/group-associations", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/InstanceEndpointsClient.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/InstanceEndpointsClient.go new file mode 100644 index 000000000..2591bc0fe --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/InstanceEndpointsClient.go @@ -0,0 +1,226 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: InstanceEndpoints +// Used by client-side stubs. + +package service_instances + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type InstanceEndpointsClient interface { + + // Adds a new instance endpoint. It belongs to one service instance and is attached to one service attachment. It represents a redirection target for a Rule. + // + // @param serviceIdParam (required) + // @param serviceInstanceIdParam (required) + // @param instanceEndpointParam (required) + // @return com.vmware.nsx.model.InstanceEndpoint + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(serviceIdParam string, serviceInstanceIdParam string, instanceEndpointParam model.InstanceEndpoint) (model.InstanceEndpoint, error) + + // Delete instance endpoint information for a given instace endpoint. Please make sure to delete all the Service Insertion Rules, which refer to this Endpoint as 'redirect_tos' target. + // + // @param serviceIdParam (required) + // @param serviceInstanceIdParam (required) + // @param instanceEndpointIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(serviceIdParam string, serviceInstanceIdParam string, instanceEndpointIdParam string) error + + // Returns detailed Endpoint information for a given InstanceEndpoint. + // + // @param serviceIdParam (required) + // @param serviceInstanceIdParam (required) + // @param instanceEndpointIdParam (required) + // @return com.vmware.nsx.model.InstanceEndpoint + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string, serviceInstanceIdParam string, instanceEndpointIdParam string) (model.InstanceEndpoint, error) + + // List all InstanceEndpoints of a service instance. + // + // @param serviceIdParam (required) + // @param serviceInstanceIdParam (required) + // @return com.vmware.nsx.model.InstanceEndpointListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(serviceIdParam string, serviceInstanceIdParam string) (model.InstanceEndpointListResult, error) +} + +type instanceEndpointsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewInstanceEndpointsClient(connector client.Connector) *instanceEndpointsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.services.service_instances.instance_endpoints") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := instanceEndpointsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *instanceEndpointsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *instanceEndpointsClient) Create(serviceIdParam string, serviceInstanceIdParam string, instanceEndpointParam model.InstanceEndpoint) (model.InstanceEndpoint, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(instanceEndpointsCreateInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceInstanceId", serviceInstanceIdParam) + sv.AddStructField("InstanceEndpoint", instanceEndpointParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.InstanceEndpoint + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := instanceEndpointsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_instances.instance_endpoints", "create", inputDataValue, executionContext) + var emptyOutput model.InstanceEndpoint + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), instanceEndpointsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.InstanceEndpoint), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *instanceEndpointsClient) Delete(serviceIdParam string, serviceInstanceIdParam string, instanceEndpointIdParam string) error { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(instanceEndpointsDeleteInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceInstanceId", serviceInstanceIdParam) + sv.AddStructField("InstanceEndpointId", instanceEndpointIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := instanceEndpointsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_instances.instance_endpoints", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *instanceEndpointsClient) Get(serviceIdParam string, serviceInstanceIdParam string, instanceEndpointIdParam string) (model.InstanceEndpoint, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(instanceEndpointsGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceInstanceId", serviceInstanceIdParam) + sv.AddStructField("InstanceEndpointId", instanceEndpointIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.InstanceEndpoint + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := instanceEndpointsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_instances.instance_endpoints", "get", inputDataValue, executionContext) + var emptyOutput model.InstanceEndpoint + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), instanceEndpointsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.InstanceEndpoint), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *instanceEndpointsClient) List(serviceIdParam string, serviceInstanceIdParam string) (model.InstanceEndpointListResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(instanceEndpointsListInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceInstanceId", serviceInstanceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.InstanceEndpointListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := instanceEndpointsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_instances.instance_endpoints", "list", inputDataValue, executionContext) + var emptyOutput model.InstanceEndpointListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), instanceEndpointsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.InstanceEndpointListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/InstanceEndpointsTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/InstanceEndpointsTypes.go new file mode 100644 index 000000000..8918f58f3 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/InstanceEndpointsTypes.go @@ -0,0 +1,266 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: InstanceEndpoints. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package service_instances + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func instanceEndpointsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fields["instance_endpoint"] = bindings.NewReferenceType(model.InstanceEndpointBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + fieldNameMap["instance_endpoint"] = "InstanceEndpoint" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func instanceEndpointsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.InstanceEndpointBindingType) +} + +func instanceEndpointsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fields["instance_endpoint"] = bindings.NewReferenceType(model.InstanceEndpointBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + fieldNameMap["instance_endpoint"] = "InstanceEndpoint" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service_instance_id"] = bindings.NewStringType() + paramsTypeMap["instance_endpoint"] = bindings.NewReferenceType(model.InstanceEndpointBindingType) + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceInstanceId"] = bindings.NewStringType() + pathParams["service_instance_id"] = "serviceInstanceId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "instance_endpoint", + "POST", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-instances/{serviceInstanceId}/instance-endpoints", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func instanceEndpointsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fields["instance_endpoint_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + fieldNameMap["instance_endpoint_id"] = "InstanceEndpointId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func instanceEndpointsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func instanceEndpointsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fields["instance_endpoint_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + fieldNameMap["instance_endpoint_id"] = "InstanceEndpointId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service_instance_id"] = bindings.NewStringType() + paramsTypeMap["instance_endpoint_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceInstanceId"] = bindings.NewStringType() + paramsTypeMap["instanceEndpointId"] = bindings.NewStringType() + pathParams["instance_endpoint_id"] = "instanceEndpointId" + pathParams["service_instance_id"] = "serviceInstanceId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-instances/{serviceInstanceId}/instance-endpoints/{instanceEndpointId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func instanceEndpointsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fields["instance_endpoint_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + fieldNameMap["instance_endpoint_id"] = "InstanceEndpointId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func instanceEndpointsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.InstanceEndpointBindingType) +} + +func instanceEndpointsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fields["instance_endpoint_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + fieldNameMap["instance_endpoint_id"] = "InstanceEndpointId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service_instance_id"] = bindings.NewStringType() + paramsTypeMap["instance_endpoint_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceInstanceId"] = bindings.NewStringType() + paramsTypeMap["instanceEndpointId"] = bindings.NewStringType() + pathParams["instance_endpoint_id"] = "instanceEndpointId" + pathParams["service_instance_id"] = "serviceInstanceId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-instances/{serviceInstanceId}/instance-endpoints/{instanceEndpointId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func instanceEndpointsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func instanceEndpointsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.InstanceEndpointListResultBindingType) +} + +func instanceEndpointsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service_instance_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceInstanceId"] = bindings.NewStringType() + pathParams["service_instance_id"] = "serviceInstanceId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-instances/{serviceInstanceId}/instance-endpoints", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/InstanceRuntimesClient.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/InstanceRuntimesClient.go new file mode 100644 index 000000000..292637ea9 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/InstanceRuntimesClient.go @@ -0,0 +1,250 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: InstanceRuntimes +// Used by client-side stubs. + +package service_instances + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type InstanceRuntimesClient interface { + + // Set service VM either in or out of maintenance mode for maintenance mode, or in service or out of service for runtime state. Only one value can be set at one time. + // + // @param serviceIdParam (required) + // @param serviceInstanceIdParam (required) + // @param instanceRuntimeIdParam (required) + // @param actionParam (optional) + // @param unhealthyReasonParam Reason for the unhealthy state (optional) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(serviceIdParam string, serviceInstanceIdParam string, instanceRuntimeIdParam string, actionParam *string, unhealthyReasonParam *string) error + + // Undeploy one service VM as standalone or two service VMs as HA. Associated deployment information and instance runtime will also be deleted once service VMs have been un-deployed successfully. + // + // @param serviceIdParam (required) + // @param serviceInstanceIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(serviceIdParam string, serviceInstanceIdParam string) error + + // Deploys one service VM as standalone, or two service VMs as HA where one VM is active and another one is standby. During the deployment of service VMs, service will be set up based on deployment events using callbacks. + // + // @param serviceIdParam (required) + // @param serviceInstanceIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Deploy(serviceIdParam string, serviceInstanceIdParam string) error + + // Returns list of instance runtimes of service VMs being deployed for a given service instance id + // + // @param serviceIdParam (required) + // @param serviceInstanceIdParam (required) + // @return com.vmware.nsx.model.InstanceRuntimeListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(serviceIdParam string, serviceInstanceIdParam string) (model.InstanceRuntimeListResult, error) + + // Upgrade service VMs using newer version of OVF. Upgrade is a 2 step process. Update the 'deployment_spec_name' in the ServiceInstance to the new DeploymentSpec to which the service VMs will be upgraded, folowed by this 'upgrade' api. In case of HA, the stand-by service VM will be upgrade first. Once it has been upgraded, it switches to be the Active one and then the other VM will be upgrade. + // + // @param serviceIdParam (required) + // @param serviceInstanceIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Upgrade(serviceIdParam string, serviceInstanceIdParam string) error +} + +type instanceRuntimesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewInstanceRuntimesClient(connector client.Connector) *instanceRuntimesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.services.service_instances.instance_runtimes") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "deploy": core.NewMethodIdentifier(interfaceIdentifier, "deploy"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "upgrade": core.NewMethodIdentifier(interfaceIdentifier, "upgrade"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := instanceRuntimesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *instanceRuntimesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *instanceRuntimesClient) Create(serviceIdParam string, serviceInstanceIdParam string, instanceRuntimeIdParam string, actionParam *string, unhealthyReasonParam *string) error { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(instanceRuntimesCreateInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceInstanceId", serviceInstanceIdParam) + sv.AddStructField("InstanceRuntimeId", instanceRuntimeIdParam) + sv.AddStructField("Action", actionParam) + sv.AddStructField("UnhealthyReason", unhealthyReasonParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := instanceRuntimesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_instances.instance_runtimes", "create", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *instanceRuntimesClient) Delete(serviceIdParam string, serviceInstanceIdParam string) error { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(instanceRuntimesDeleteInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceInstanceId", serviceInstanceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := instanceRuntimesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_instances.instance_runtimes", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *instanceRuntimesClient) Deploy(serviceIdParam string, serviceInstanceIdParam string) error { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(instanceRuntimesDeployInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceInstanceId", serviceInstanceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := instanceRuntimesDeployRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_instances.instance_runtimes", "deploy", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *instanceRuntimesClient) List(serviceIdParam string, serviceInstanceIdParam string) (model.InstanceRuntimeListResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(instanceRuntimesListInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceInstanceId", serviceInstanceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.InstanceRuntimeListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := instanceRuntimesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_instances.instance_runtimes", "list", inputDataValue, executionContext) + var emptyOutput model.InstanceRuntimeListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), instanceRuntimesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.InstanceRuntimeListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *instanceRuntimesClient) Upgrade(serviceIdParam string, serviceInstanceIdParam string) error { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(instanceRuntimesUpgradeInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceInstanceId", serviceInstanceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := instanceRuntimesUpgradeRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_instances.instance_runtimes", "upgrade", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/InstanceRuntimesTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/InstanceRuntimesTypes.go new file mode 100644 index 000000000..03501afe8 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/InstanceRuntimesTypes.go @@ -0,0 +1,338 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: InstanceRuntimes. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package service_instances + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``action`` of method InstanceRuntimes#create. +const InstanceRuntimes_CREATE_ACTION_ENABLE_MAINTENANCE_MODE = "enable_maintenance_mode" + +// Possible value for ``action`` of method InstanceRuntimes#create. +const InstanceRuntimes_CREATE_ACTION_DISABLE_MAINTENANCE_MODE = "disable_maintenance_mode" + +// Possible value for ``action`` of method InstanceRuntimes#create. +const InstanceRuntimes_CREATE_ACTION_IS_HEALTHY = "is_healthy" + +// Possible value for ``action`` of method InstanceRuntimes#create. +const InstanceRuntimes_CREATE_ACTION_IS_STOPPED = "is_stopped" + +// Possible value for ``action`` of method InstanceRuntimes#create. +const InstanceRuntimes_CREATE_ACTION_IS_NOT_RESPONDING = "is_not_responding" + +func instanceRuntimesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fields["instance_runtime_id"] = bindings.NewStringType() + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["unhealthy_reason"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + fieldNameMap["instance_runtime_id"] = "InstanceRuntimeId" + fieldNameMap["action"] = "Action" + fieldNameMap["unhealthy_reason"] = "UnhealthyReason" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func instanceRuntimesCreateOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func instanceRuntimesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fields["instance_runtime_id"] = bindings.NewStringType() + fields["action"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["unhealthy_reason"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + fieldNameMap["instance_runtime_id"] = "InstanceRuntimeId" + fieldNameMap["action"] = "Action" + fieldNameMap["unhealthy_reason"] = "UnhealthyReason" + paramsTypeMap["action"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["unhealthy_reason"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service_instance_id"] = bindings.NewStringType() + paramsTypeMap["instance_runtime_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceInstanceId"] = bindings.NewStringType() + paramsTypeMap["instanceRuntimeId"] = bindings.NewStringType() + pathParams["instance_runtime_id"] = "instanceRuntimeId" + pathParams["service_instance_id"] = "serviceInstanceId" + pathParams["service_id"] = "serviceId" + queryParams["action"] = "action" + queryParams["unhealthy_reason"] = "unhealthy_reason" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "POST", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-instances/{serviceInstanceId}/instance-runtimes/{instanceRuntimeId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func instanceRuntimesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func instanceRuntimesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func instanceRuntimesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service_instance_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceInstanceId"] = bindings.NewStringType() + pathParams["service_instance_id"] = "serviceInstanceId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=delete", + "", + "POST", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-instances/{serviceInstanceId}/instance-runtimes", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func instanceRuntimesDeployInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func instanceRuntimesDeployOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func instanceRuntimesDeployRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service_instance_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceInstanceId"] = bindings.NewStringType() + pathParams["service_instance_id"] = "serviceInstanceId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=deploy", + "", + "POST", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-instances/{serviceInstanceId}/instance-runtimes", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func instanceRuntimesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func instanceRuntimesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.InstanceRuntimeListResultBindingType) +} + +func instanceRuntimesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service_instance_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceInstanceId"] = bindings.NewStringType() + pathParams["service_instance_id"] = "serviceInstanceId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-instances/{serviceInstanceId}/instance-runtimes", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func instanceRuntimesUpgradeInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func instanceRuntimesUpgradeOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func instanceRuntimesUpgradeRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service_instance_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceInstanceId"] = bindings.NewStringType() + pathParams["service_instance_id"] = "serviceInstanceId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=upgrade", + "", + "POST", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-instances/{serviceInstanceId}/instance-runtimes", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/ServiceInstancesPackageTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/ServiceInstancesPackageTypes.go new file mode 100644 index 000000000..eb589db0e --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/ServiceInstancesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.serviceinsertion.services.service_instances. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package service_instances diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/StateClient.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/StateClient.go new file mode 100644 index 000000000..4c09dc8d0 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/StateClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: State +// Used by client-side stubs. + +package service_instances + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StateClient interface { + + // Returns configuration state of one instance of a deployed partner service using service insertion framework. + // + // @param serviceIdParam (required) + // @param serviceInstanceIdParam (required) + // @return com.vmware.nsx.model.ConfigurationState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string, serviceInstanceIdParam string) (model.ConfigurationState, error) +} + +type stateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStateClient(connector client.Connector) *stateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.services.service_instances.state") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := stateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *stateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *stateClient) Get(serviceIdParam string, serviceInstanceIdParam string) (model.ConfigurationState, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(stateGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceInstanceId", serviceInstanceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ConfigurationState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_instances.state", "get", inputDataValue, executionContext) + var emptyOutput model.ConfigurationState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ConfigurationState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/StateTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/StateTypes.go new file mode 100644 index 000000000..309dac038 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/StateTypes.go @@ -0,0 +1,76 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: State. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package service_instances + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func stateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ConfigurationStateBindingType) +} + +func stateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service_instance_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceInstanceId"] = bindings.NewStringType() + pathParams["service_instance_id"] = "serviceInstanceId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-instances/{serviceInstanceId}/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/StatusClient.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/StatusClient.go new file mode 100644 index 000000000..446b92f1b --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/StatusClient.go @@ -0,0 +1,94 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package service_instances + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Returns status of one instance of a deployed partner service using service insertion framework. By default this API would return cached status. Caching happens every 3 minutes. For realtime status, query parameter \"source=realtime\" needs to be passed. + // + // @param serviceIdParam (required) + // @param serviceInstanceIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.ServiceInstanceStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string, serviceInstanceIdParam string, sourceParam *string) (model.ServiceInstanceStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.services.service_instances.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(serviceIdParam string, serviceInstanceIdParam string, sourceParam *string) (model.ServiceInstanceStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceInstanceId", serviceInstanceIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceInstanceStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_instances.status", "get", inputDataValue, executionContext) + var emptyOutput model.ServiceInstanceStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceInstanceStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/StatusTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/StatusTypes.go new file mode 100644 index 000000000..307ed8713 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/StatusTypes.go @@ -0,0 +1,88 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package service_instances + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_CACHED = "cached" + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceInstanceStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service_instance_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceInstanceId"] = bindings.NewStringType() + pathParams["service_instance_id"] = "serviceInstanceId" + pathParams["service_id"] = "serviceId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-instances/{serviceInstanceId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/instance_runtimes/interfaces/InterfacesPackageTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/instance_runtimes/interfaces/InterfacesPackageTypes.go new file mode 100644 index 000000000..792bc856a --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/instance_runtimes/interfaces/InterfacesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.serviceinsertion.services.service_instances.instance_runtimes.interfaces. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package interfaces diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/instance_runtimes/interfaces/StatisticsClient.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/instance_runtimes/interfaces/StatisticsClient.go new file mode 100644 index 000000000..6c3453e69 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/instance_runtimes/interfaces/StatisticsClient.go @@ -0,0 +1,98 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Statistics +// Used by client-side stubs. + +package interfaces + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatisticsClient interface { + + // Returns statistics of a specified interface via associated logical port. If the logical port is attached to a logical router port, query parameter \"source=realtime\" is not supported. + // + // @param serviceIdParam (required) + // @param serviceInstanceIdParam (required) + // @param instanceRuntimeIdParam (required) + // @param interfaceIndexParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.RuntimeInterfaceStatistics + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string, serviceInstanceIdParam string, instanceRuntimeIdParam string, interfaceIndexParam string, sourceParam *string) (model.RuntimeInterfaceStatistics, error) +} + +type statisticsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatisticsClient(connector client.Connector) *statisticsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.services.service_instances.instance_runtimes.interfaces.statistics") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statisticsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statisticsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statisticsClient) Get(serviceIdParam string, serviceInstanceIdParam string, instanceRuntimeIdParam string, interfaceIndexParam string, sourceParam *string) (model.RuntimeInterfaceStatistics, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statisticsGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceInstanceId", serviceInstanceIdParam) + sv.AddStructField("InstanceRuntimeId", instanceRuntimeIdParam) + sv.AddStructField("InterfaceIndex", interfaceIndexParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RuntimeInterfaceStatistics + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statisticsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_instances.instance_runtimes.interfaces.statistics", "get", inputDataValue, executionContext) + var emptyOutput model.RuntimeInterfaceStatistics + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statisticsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RuntimeInterfaceStatistics), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/instance_runtimes/interfaces/StatisticsTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/instance_runtimes/interfaces/StatisticsTypes.go new file mode 100644 index 000000000..9f9048757 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/instance_runtimes/interfaces/StatisticsTypes.go @@ -0,0 +1,102 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Statistics. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package interfaces + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Statistics#get. +const Statistics_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Statistics#get. +const Statistics_GET_SOURCE_CACHED = "cached" + +func statisticsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fields["instance_runtime_id"] = bindings.NewStringType() + fields["interface_index"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + fieldNameMap["instance_runtime_id"] = "InstanceRuntimeId" + fieldNameMap["interface_index"] = "InterfaceIndex" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statisticsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RuntimeInterfaceStatisticsBindingType) +} + +func statisticsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fields["instance_runtime_id"] = bindings.NewStringType() + fields["interface_index"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + fieldNameMap["instance_runtime_id"] = "InstanceRuntimeId" + fieldNameMap["interface_index"] = "InterfaceIndex" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["interface_index"] = bindings.NewStringType() + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service_instance_id"] = bindings.NewStringType() + paramsTypeMap["instance_runtime_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceInstanceId"] = bindings.NewStringType() + paramsTypeMap["instanceRuntimeId"] = bindings.NewStringType() + paramsTypeMap["interfaceIndex"] = bindings.NewStringType() + pathParams["instance_runtime_id"] = "instanceRuntimeId" + pathParams["service_instance_id"] = "serviceInstanceId" + pathParams["interface_index"] = "interfaceIndex" + pathParams["service_id"] = "serviceId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-instances/{serviceInstanceId}/instance-runtimes/{instanceRuntimeId}/interfaces/{interfaceIndex}/statistics", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/instance_runtimes/interfaces/StatusClient.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/instance_runtimes/interfaces/StatusClient.go new file mode 100644 index 000000000..e991d3aa6 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/instance_runtimes/interfaces/StatusClient.go @@ -0,0 +1,98 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package interfaces + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Returns operational status of a specified interface + // + // @param serviceIdParam (required) + // @param serviceInstanceIdParam (required) + // @param instanceRuntimeIdParam (required) + // @param interfaceIndexParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.RuntimeInterfaceOperationalStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string, serviceInstanceIdParam string, instanceRuntimeIdParam string, interfaceIndexParam string, sourceParam *string) (model.RuntimeInterfaceOperationalStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.services.service_instances.instance_runtimes.interfaces.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(serviceIdParam string, serviceInstanceIdParam string, instanceRuntimeIdParam string, interfaceIndexParam string, sourceParam *string) (model.RuntimeInterfaceOperationalStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceInstanceId", serviceInstanceIdParam) + sv.AddStructField("InstanceRuntimeId", instanceRuntimeIdParam) + sv.AddStructField("InterfaceIndex", interfaceIndexParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RuntimeInterfaceOperationalStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_instances.instance_runtimes.interfaces.status", "get", inputDataValue, executionContext) + var emptyOutput model.RuntimeInterfaceOperationalStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RuntimeInterfaceOperationalStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/instance_runtimes/interfaces/StatusTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/instance_runtimes/interfaces/StatusTypes.go new file mode 100644 index 000000000..048d2e251 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_instances/instance_runtimes/interfaces/StatusTypes.go @@ -0,0 +1,102 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package interfaces + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_CACHED = "cached" + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fields["instance_runtime_id"] = bindings.NewStringType() + fields["interface_index"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + fieldNameMap["instance_runtime_id"] = "InstanceRuntimeId" + fieldNameMap["interface_index"] = "InterfaceIndex" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RuntimeInterfaceOperationalStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_instance_id"] = bindings.NewStringType() + fields["instance_runtime_id"] = bindings.NewStringType() + fields["interface_index"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_instance_id"] = "ServiceInstanceId" + fieldNameMap["instance_runtime_id"] = "InstanceRuntimeId" + fieldNameMap["interface_index"] = "InterfaceIndex" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["interface_index"] = bindings.NewStringType() + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service_instance_id"] = bindings.NewStringType() + paramsTypeMap["instance_runtime_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceInstanceId"] = bindings.NewStringType() + paramsTypeMap["instanceRuntimeId"] = bindings.NewStringType() + paramsTypeMap["interfaceIndex"] = bindings.NewStringType() + pathParams["instance_runtime_id"] = "instanceRuntimeId" + pathParams["service_instance_id"] = "serviceInstanceId" + pathParams["interface_index"] = "interfaceIndex" + pathParams["service_id"] = "serviceId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-instances/{serviceInstanceId}/instance-runtimes/{instanceRuntimeId}/interfaces/{interfaceIndex}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_profiles/NsgroupsClient.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_profiles/NsgroupsClient.go new file mode 100644 index 000000000..934c26de7 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_profiles/NsgroupsClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Nsgroups +// Used by client-side stubs. + +package service_profiles + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NsgroupsClient interface { + + // Returns list of NSGroups used in Service Insertion rules for a given Service Profile. + // + // @param serviceIdParam (required) + // @param serviceProfileIdParam (required) + // @return com.vmware.nsx.model.ServiceProfileNSGroups + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string, serviceProfileIdParam string) (model.ServiceProfileNSGroups, error) +} + +type nsgroupsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNsgroupsClient(connector client.Connector) *nsgroupsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.services.service_profiles.nsgroups") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nsgroupsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nsgroupsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nsgroupsClient) Get(serviceIdParam string, serviceProfileIdParam string) (model.ServiceProfileNSGroups, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nsgroupsGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceProfileId", serviceProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceProfileNSGroups + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nsgroupsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_profiles.nsgroups", "get", inputDataValue, executionContext) + var emptyOutput model.ServiceProfileNSGroups + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nsgroupsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceProfileNSGroups), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_profiles/NsgroupsTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_profiles/NsgroupsTypes.go new file mode 100644 index 000000000..afc53075d --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_profiles/NsgroupsTypes.go @@ -0,0 +1,76 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Nsgroups. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package service_profiles + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func nsgroupsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_profile_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_profile_id"] = "ServiceProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nsgroupsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceProfileNSGroupsBindingType) +} + +func nsgroupsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_profile_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_profile_id"] = "ServiceProfileId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service_profile_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceProfileId"] = bindings.NewStringType() + pathParams["service_profile_id"] = "serviceProfileId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-profiles/{serviceProfileId}/nsgroups", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_profiles/ServiceChainMappingsClient.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_profiles/ServiceChainMappingsClient.go new file mode 100644 index 000000000..767ec2004 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_profiles/ServiceChainMappingsClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ServiceChainMappings +// Used by client-side stubs. + +package service_profiles + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ServiceChainMappingsClient interface { + + // List all service chain mappings in the system for the given service profile. + // + // @param serviceIdParam (required) + // @param serviceProfileIdParam (required) + // @return com.vmware.nsx.model.ServiceChainMappingListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(serviceIdParam string, serviceProfileIdParam string) (model.ServiceChainMappingListResult, error) +} + +type serviceChainMappingsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewServiceChainMappingsClient(connector client.Connector) *serviceChainMappingsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.services.service_profiles.service_chain_mappings") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := serviceChainMappingsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *serviceChainMappingsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *serviceChainMappingsClient) List(serviceIdParam string, serviceProfileIdParam string) (model.ServiceChainMappingListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(serviceChainMappingsListInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("ServiceProfileId", serviceProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ServiceChainMappingListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := serviceChainMappingsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.service_profiles.service_chain_mappings", "list", inputDataValue, executionContext) + var emptyOutput model.ServiceChainMappingListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), serviceChainMappingsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ServiceChainMappingListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_profiles/ServiceChainMappingsTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_profiles/ServiceChainMappingsTypes.go new file mode 100644 index 000000000..437e6565b --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_profiles/ServiceChainMappingsTypes.go @@ -0,0 +1,76 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ServiceChainMappings. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package service_profiles + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func serviceChainMappingsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["service_profile_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_profile_id"] = "ServiceProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func serviceChainMappingsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ServiceChainMappingListResultBindingType) +} + +func serviceChainMappingsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["service_profile_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["service_profile_id"] = "ServiceProfileId" + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["service_profile_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["serviceProfileId"] = bindings.NewStringType() + pathParams["service_profile_id"] = "serviceProfileId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/service-profiles/{serviceProfileId}/service-chain-mappings", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/service_profiles/ServiceProfilesPackageTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/service_profiles/ServiceProfilesPackageTypes.go new file mode 100644 index 000000000..909d468d8 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/service_profiles/ServiceProfilesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.serviceinsertion.services.service_profiles. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package service_profiles diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/solution_configs/ExtendedSolutionConfigClient.go b/services/nsxt-mp/nsx/serviceinsertion/services/solution_configs/ExtendedSolutionConfigClient.go new file mode 100644 index 000000000..fbb88eafb --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/solution_configs/ExtendedSolutionConfigClient.go @@ -0,0 +1,224 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: ExtendedSolutionConfig +// Used by client-side stubs. + +package solution_configs + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ExtendedSolutionConfigClient interface { + + // Adds a extended solution config. Extended Solution Config are service level objects, used by the NXGI partner Service inside the SVM. + // + // @param serviceIdParam (required) + // @param solutionConfigIdParam (required) + // @param extendedSolutionConfigParam (required) + // @return com.vmware.nsx.model.ExtendedSolutionConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(serviceIdParam string, solutionConfigIdParam string, extendedSolutionConfigParam model.ExtendedSolutionConfig) (model.ExtendedSolutionConfig, error) + + // Deletes extended solution config information for a given solution config id. + // + // @param serviceIdParam (required) + // @param solutionConfigIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(serviceIdParam string, solutionConfigIdParam string) error + + // Returns extended solution config information for a given solution config id. + // + // @param serviceIdParam (required) + // @param solutionConfigIdParam (required) + // @return com.vmware.nsx.model.ExtendedSolutionConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string, solutionConfigIdParam string) (model.ExtendedSolutionConfig, error) + + // Updates a extended solution config. Extended Solution Config are service level objects, used by the NXGI partner Service inside the SVM. + // + // @param serviceIdParam (required) + // @param solutionConfigIdParam (required) + // @param extendedSolutionConfigParam (required) + // @return com.vmware.nsx.model.ExtendedSolutionConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(serviceIdParam string, solutionConfigIdParam string, extendedSolutionConfigParam model.ExtendedSolutionConfig) (model.ExtendedSolutionConfig, error) +} + +type extendedSolutionConfigClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewExtendedSolutionConfigClient(connector client.Connector) *extendedSolutionConfigClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.serviceinsertion.services.solution_configs.extended_solution_config") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + eIface := extendedSolutionConfigClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &eIface +} + +func (eIface *extendedSolutionConfigClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := eIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (eIface *extendedSolutionConfigClient) Create(serviceIdParam string, solutionConfigIdParam string, extendedSolutionConfigParam model.ExtendedSolutionConfig) (model.ExtendedSolutionConfig, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(extendedSolutionConfigCreateInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("SolutionConfigId", solutionConfigIdParam) + sv.AddStructField("ExtendedSolutionConfig", extendedSolutionConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ExtendedSolutionConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := extendedSolutionConfigCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.solution_configs.extended_solution_config", "create", inputDataValue, executionContext) + var emptyOutput model.ExtendedSolutionConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), extendedSolutionConfigCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ExtendedSolutionConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *extendedSolutionConfigClient) Delete(serviceIdParam string, solutionConfigIdParam string) error { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(extendedSolutionConfigDeleteInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("SolutionConfigId", solutionConfigIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := extendedSolutionConfigDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.solution_configs.extended_solution_config", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (eIface *extendedSolutionConfigClient) Get(serviceIdParam string, solutionConfigIdParam string) (model.ExtendedSolutionConfig, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(extendedSolutionConfigGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("SolutionConfigId", solutionConfigIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ExtendedSolutionConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := extendedSolutionConfigGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.solution_configs.extended_solution_config", "get", inputDataValue, executionContext) + var emptyOutput model.ExtendedSolutionConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), extendedSolutionConfigGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ExtendedSolutionConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (eIface *extendedSolutionConfigClient) Update(serviceIdParam string, solutionConfigIdParam string, extendedSolutionConfigParam model.ExtendedSolutionConfig) (model.ExtendedSolutionConfig, error) { + typeConverter := eIface.connector.TypeConverter() + executionContext := eIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(extendedSolutionConfigUpdateInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("SolutionConfigId", solutionConfigIdParam) + sv.AddStructField("ExtendedSolutionConfig", extendedSolutionConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ExtendedSolutionConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := extendedSolutionConfigUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + eIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := eIface.connector.GetApiProvider().Invoke("com.vmware.nsx.serviceinsertion.services.solution_configs.extended_solution_config", "update", inputDataValue, executionContext) + var emptyOutput model.ExtendedSolutionConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), extendedSolutionConfigUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ExtendedSolutionConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), eIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/solution_configs/ExtendedSolutionConfigTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/solution_configs/ExtendedSolutionConfigTypes.go new file mode 100644 index 000000000..4dd7904b1 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/solution_configs/ExtendedSolutionConfigTypes.go @@ -0,0 +1,257 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: ExtendedSolutionConfig. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package solution_configs + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func extendedSolutionConfigCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["solution_config_id"] = bindings.NewStringType() + fields["extended_solution_config"] = bindings.NewReferenceType(model.ExtendedSolutionConfigBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["solution_config_id"] = "SolutionConfigId" + fieldNameMap["extended_solution_config"] = "ExtendedSolutionConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func extendedSolutionConfigCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ExtendedSolutionConfigBindingType) +} + +func extendedSolutionConfigCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["solution_config_id"] = bindings.NewStringType() + fields["extended_solution_config"] = bindings.NewReferenceType(model.ExtendedSolutionConfigBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["solution_config_id"] = "SolutionConfigId" + fieldNameMap["extended_solution_config"] = "ExtendedSolutionConfig" + paramsTypeMap["solution_config_id"] = bindings.NewStringType() + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["extended_solution_config"] = bindings.NewReferenceType(model.ExtendedSolutionConfigBindingType) + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["solutionConfigId"] = bindings.NewStringType() + pathParams["solution_config_id"] = "solutionConfigId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "extended_solution_config", + "POST", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/solution-configs/{solutionConfigId}/extended-solution-config", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func extendedSolutionConfigDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["solution_config_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["solution_config_id"] = "SolutionConfigId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func extendedSolutionConfigDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func extendedSolutionConfigDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["solution_config_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["solution_config_id"] = "SolutionConfigId" + paramsTypeMap["solution_config_id"] = bindings.NewStringType() + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["solutionConfigId"] = bindings.NewStringType() + pathParams["solution_config_id"] = "solutionConfigId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/solution-configs/{solutionConfigId}/extended-solution-config", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func extendedSolutionConfigGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["solution_config_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["solution_config_id"] = "SolutionConfigId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func extendedSolutionConfigGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ExtendedSolutionConfigBindingType) +} + +func extendedSolutionConfigGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["solution_config_id"] = bindings.NewStringType() + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["solution_config_id"] = "SolutionConfigId" + paramsTypeMap["solution_config_id"] = bindings.NewStringType() + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["solutionConfigId"] = bindings.NewStringType() + pathParams["solution_config_id"] = "solutionConfigId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/solution-configs/{solutionConfigId}/extended-solution-config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func extendedSolutionConfigUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["solution_config_id"] = bindings.NewStringType() + fields["extended_solution_config"] = bindings.NewReferenceType(model.ExtendedSolutionConfigBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["solution_config_id"] = "SolutionConfigId" + fieldNameMap["extended_solution_config"] = "ExtendedSolutionConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func extendedSolutionConfigUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ExtendedSolutionConfigBindingType) +} + +func extendedSolutionConfigUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["solution_config_id"] = bindings.NewStringType() + fields["extended_solution_config"] = bindings.NewReferenceType(model.ExtendedSolutionConfigBindingType) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["solution_config_id"] = "SolutionConfigId" + fieldNameMap["extended_solution_config"] = "ExtendedSolutionConfig" + paramsTypeMap["solution_config_id"] = bindings.NewStringType() + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["extended_solution_config"] = bindings.NewReferenceType(model.ExtendedSolutionConfigBindingType) + paramsTypeMap["serviceId"] = bindings.NewStringType() + paramsTypeMap["solutionConfigId"] = bindings.NewStringType() + pathParams["solution_config_id"] = "solutionConfigId" + pathParams["service_id"] = "serviceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "extended_solution_config", + "PUT", + "/api/v1/serviceinsertion/services/nsxt-mp/{serviceId}/solution-configs/{solutionConfigId}/extended-solution-config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/serviceinsertion/services/solution_configs/SolutionConfigsPackageTypes.go b/services/nsxt-mp/nsx/serviceinsertion/services/solution_configs/SolutionConfigsPackageTypes.go new file mode 100644 index 000000000..4b7b98296 --- /dev/null +++ b/services/nsxt-mp/nsx/serviceinsertion/services/solution_configs/SolutionConfigsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.serviceinsertion.services.solution_configs. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package solution_configs diff --git a/services/nsxt-mp/nsx/sites/CompatibilityClient.go b/services/nsxt-mp/nsx/sites/CompatibilityClient.go new file mode 100644 index 000000000..bfd7e8fad --- /dev/null +++ b/services/nsxt-mp/nsx/sites/CompatibilityClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Compatibility +// Used by client-side stubs. + +package sites + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type CompatibilityClient interface { + + // Returns the version of this site and list of compatible versions + // @return com.vmware.nsx.model.SiteCompatibilityInfo + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.SiteCompatibilityInfo, error) +} + +type compatibilityClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewCompatibilityClient(connector client.Connector) *compatibilityClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.sites.compatibility") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := compatibilityClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *compatibilityClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *compatibilityClient) Get() (model.SiteCompatibilityInfo, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(compatibilityGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SiteCompatibilityInfo + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := compatibilityGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.sites.compatibility", "get", inputDataValue, executionContext) + var emptyOutput model.SiteCompatibilityInfo + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), compatibilityGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SiteCompatibilityInfo), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/sites/CompatibilityTypes.go b/services/nsxt-mp/nsx/sites/CompatibilityTypes.go new file mode 100644 index 000000000..701b6797a --- /dev/null +++ b/services/nsxt-mp/nsx/sites/CompatibilityTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Compatibility. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package sites + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func compatibilityGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func compatibilityGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SiteCompatibilityInfoBindingType) +} + +func compatibilityGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/sites/compatibility", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/sites/SelfClient.go b/services/nsxt-mp/nsx/sites/SelfClient.go new file mode 100644 index 000000000..b626f6f3d --- /dev/null +++ b/services/nsxt-mp/nsx/sites/SelfClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Self +// Used by client-side stubs. + +package sites + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SelfClient interface { + + // Get the local site configuration + // @return com.vmware.nsx.model.LocalSiteConfiguration + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.LocalSiteConfiguration, error) +} + +type selfClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSelfClient(connector client.Connector) *selfClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.sites.self") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := selfClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *selfClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *selfClient) Get() (model.LocalSiteConfiguration, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(selfGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.LocalSiteConfiguration + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := selfGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.sites.self", "get", inputDataValue, executionContext) + var emptyOutput model.LocalSiteConfiguration + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), selfGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.LocalSiteConfiguration), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/sites/SelfTypes.go b/services/nsxt-mp/nsx/sites/SelfTypes.go new file mode 100644 index 000000000..d6070ae51 --- /dev/null +++ b/services/nsxt-mp/nsx/sites/SelfTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Self. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package sites + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func selfGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func selfGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.LocalSiteConfigurationBindingType) +} + +func selfGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/sites/self", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/sites/SitesPackageTypes.go b/services/nsxt-mp/nsx/sites/SitesPackageTypes.go new file mode 100644 index 000000000..df88b19f6 --- /dev/null +++ b/services/nsxt-mp/nsx/sites/SitesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.sites. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package sites diff --git a/services/nsxt-mp/nsx/sites/StatusClient.go b/services/nsxt-mp/nsx/sites/StatusClient.go new file mode 100644 index 000000000..effbea30f --- /dev/null +++ b/services/nsxt-mp/nsx/sites/StatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package sites + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Get overall status of the federation, including stub status + // @return com.vmware.nsx.model.FederationStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.FederationStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.sites.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.FederationStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.FederationStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.sites.status", "get", inputDataValue, executionContext) + var emptyOutput model.FederationStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.FederationStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/sites/StatusTypes.go b/services/nsxt-mp/nsx/sites/StatusTypes.go new file mode 100644 index 000000000..aa887e8dc --- /dev/null +++ b/services/nsxt-mp/nsx/sites/StatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package sites + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.FederationStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/sites/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/sites/SwitchoverStatusClient.go b/services/nsxt-mp/nsx/sites/SwitchoverStatusClient.go new file mode 100644 index 000000000..6bfcbddf7 --- /dev/null +++ b/services/nsxt-mp/nsx/sites/SwitchoverStatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: SwitchoverStatus +// Used by client-side stubs. + +package sites + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SwitchoverStatusClient interface { + + // Get the switchover status + // @return com.vmware.nsx.model.SwitchoverStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.SwitchoverStatus, error) +} + +type switchoverStatusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSwitchoverStatusClient(connector client.Connector) *switchoverStatusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.sites.switchover_status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := switchoverStatusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *switchoverStatusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *switchoverStatusClient) Get() (model.SwitchoverStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(switchoverStatusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SwitchoverStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := switchoverStatusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.sites.switchover_status", "get", inputDataValue, executionContext) + var emptyOutput model.SwitchoverStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), switchoverStatusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SwitchoverStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/sites/SwitchoverStatusTypes.go b/services/nsxt-mp/nsx/sites/SwitchoverStatusTypes.go new file mode 100644 index 000000000..6ce19464d --- /dev/null +++ b/services/nsxt-mp/nsx/sites/SwitchoverStatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: SwitchoverStatus. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package sites + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func switchoverStatusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func switchoverStatusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SwitchoverStatusBindingType) +} + +func switchoverStatusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/sites/switchover-status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/sites/compatibility/CompatibilityPackageTypes.go b/services/nsxt-mp/nsx/sites/compatibility/CompatibilityPackageTypes.go new file mode 100644 index 000000000..c58c12584 --- /dev/null +++ b/services/nsxt-mp/nsx/sites/compatibility/CompatibilityPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.sites.compatibility. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package compatibility diff --git a/services/nsxt-mp/nsx/sites/compatibility/RemoteClient.go b/services/nsxt-mp/nsx/sites/compatibility/RemoteClient.go new file mode 100644 index 000000000..5ca3e5db4 --- /dev/null +++ b/services/nsxt-mp/nsx/sites/compatibility/RemoteClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Remote +// Used by client-side stubs. + +package compatibility + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RemoteClient interface { + + // Returns the version of this site and list of compatible versions for both local and remote site, also a boolean indicating whether the two are compatible, this value is true if one of the site version is in the compatibility list of the other site + // + // @param remoteSiteCredentialParam (required) + // @return com.vmware.nsx.model.RemoteSiteCompatibilityInfo + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(remoteSiteCredentialParam model.RemoteSiteCredential) (model.RemoteSiteCompatibilityInfo, error) +} + +type remoteClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRemoteClient(connector client.Connector) *remoteClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.sites.compatibility.remote") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := remoteClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *remoteClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *remoteClient) Get(remoteSiteCredentialParam model.RemoteSiteCredential) (model.RemoteSiteCompatibilityInfo, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(remoteGetInputType(), typeConverter) + sv.AddStructField("RemoteSiteCredential", remoteSiteCredentialParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.RemoteSiteCompatibilityInfo + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := remoteGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.sites.compatibility.remote", "get", inputDataValue, executionContext) + var emptyOutput model.RemoteSiteCompatibilityInfo + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), remoteGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.RemoteSiteCompatibilityInfo), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/sites/compatibility/RemoteTypes.go b/services/nsxt-mp/nsx/sites/compatibility/RemoteTypes.go new file mode 100644 index 000000000..305ab4c08 --- /dev/null +++ b/services/nsxt-mp/nsx/sites/compatibility/RemoteTypes.go @@ -0,0 +1,67 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Remote. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package compatibility + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func remoteGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["remote_site_credential"] = bindings.NewReferenceType(model.RemoteSiteCredentialBindingType) + fieldNameMap["remote_site_credential"] = "RemoteSiteCredential" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func remoteGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.RemoteSiteCompatibilityInfoBindingType) +} + +func remoteGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["remote_site_credential"] = bindings.NewReferenceType(model.RemoteSiteCredentialBindingType) + fieldNameMap["remote_site_credential"] = "RemoteSiteCredential" + paramsTypeMap["remote_site_credential"] = bindings.NewReferenceType(model.RemoteSiteCredentialBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "remote_site_credential", + "GET", + "/api/v1/sites/compatibility/remote", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/switching_profiles/SummaryClient.go b/services/nsxt-mp/nsx/switching_profiles/SummaryClient.go new file mode 100644 index 000000000..a8dd48787 --- /dev/null +++ b/services/nsxt-mp/nsx/switching_profiles/SummaryClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Summary +// Used by client-side stubs. + +package switching_profiles + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SummaryClient interface { + + // This api is now deprecated. Please use new api - GET policy/api/v1/infra/realized-state/status?intent_path={{intent-path}} + // + // @param switchingProfileIdParam (required) + // @return com.vmware.nsx.model.SwitchingProfileStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(switchingProfileIdParam string) (model.SwitchingProfileStatus, error) +} + +type summaryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSummaryClient(connector client.Connector) *summaryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.switching_profiles.summary") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := summaryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *summaryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *summaryClient) Get(switchingProfileIdParam string) (model.SwitchingProfileStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(summaryGetInputType(), typeConverter) + sv.AddStructField("SwitchingProfileId", switchingProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SwitchingProfileStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := summaryGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.switching_profiles.summary", "get", inputDataValue, executionContext) + var emptyOutput model.SwitchingProfileStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), summaryGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SwitchingProfileStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/switching_profiles/SummaryTypes.go b/services/nsxt-mp/nsx/switching_profiles/SummaryTypes.go new file mode 100644 index 000000000..be3e165e8 --- /dev/null +++ b/services/nsxt-mp/nsx/switching_profiles/SummaryTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Summary. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package switching_profiles + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func summaryGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["switching_profile_id"] = bindings.NewStringType() + fieldNameMap["switching_profile_id"] = "SwitchingProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func summaryGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SwitchingProfileStatusBindingType) +} + +func summaryGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["switching_profile_id"] = bindings.NewStringType() + fieldNameMap["switching_profile_id"] = "SwitchingProfileId" + paramsTypeMap["switching_profile_id"] = bindings.NewStringType() + paramsTypeMap["switchingProfileId"] = bindings.NewStringType() + pathParams["switching_profile_id"] = "switchingProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/switching-profiles/{switchingProfileId}/summary", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/switching_profiles/SwitchingProfilesPackageTypes.go b/services/nsxt-mp/nsx/switching_profiles/SwitchingProfilesPackageTypes.go new file mode 100644 index 000000000..99a1df896 --- /dev/null +++ b/services/nsxt-mp/nsx/switching_profiles/SwitchingProfilesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.switching_profiles. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package switching_profiles diff --git a/services/nsxt-mp/nsx/systemhealth/PluginsClient.go b/services/nsxt-mp/nsx/systemhealth/PluginsClient.go new file mode 100644 index 000000000..dce486722 --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/PluginsClient.go @@ -0,0 +1,220 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Plugins +// Used by client-side stubs. + +package systemhealth + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type PluginsClient interface { + + // Create a system health plugin. + // + // @param systemHealthPluginProfileParam (required) + // @return com.vmware.nsx.model.SystemHealthPluginProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(systemHealthPluginProfileParam model.SystemHealthPluginProfile) (model.SystemHealthPluginProfile, error) + + // Delete an existing system health plugin by ID. + // + // @param pluginIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(pluginIdParam string) error + + // Show the details of a system health plugin. + // + // @param pluginIdParam (required) + // @return com.vmware.nsx.model.SystemHealthPluginProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(pluginIdParam string) (model.SystemHealthPluginProfile, error) + + // Show all the system health plugins. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.SystemHealthPluginProfileList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SystemHealthPluginProfileList, error) +} + +type pluginsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewPluginsClient(connector client.Connector) *pluginsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.systemhealth.plugins") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + pIface := pluginsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &pIface +} + +func (pIface *pluginsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := pIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (pIface *pluginsClient) Create(systemHealthPluginProfileParam model.SystemHealthPluginProfile) (model.SystemHealthPluginProfile, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(pluginsCreateInputType(), typeConverter) + sv.AddStructField("SystemHealthPluginProfile", systemHealthPluginProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SystemHealthPluginProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := pluginsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.systemhealth.plugins", "create", inputDataValue, executionContext) + var emptyOutput model.SystemHealthPluginProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), pluginsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SystemHealthPluginProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *pluginsClient) Delete(pluginIdParam string) error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(pluginsDeleteInputType(), typeConverter) + sv.AddStructField("PluginId", pluginIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := pluginsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.systemhealth.plugins", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *pluginsClient) Get(pluginIdParam string) (model.SystemHealthPluginProfile, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(pluginsGetInputType(), typeConverter) + sv.AddStructField("PluginId", pluginIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SystemHealthPluginProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := pluginsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.systemhealth.plugins", "get", inputDataValue, executionContext) + var emptyOutput model.SystemHealthPluginProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), pluginsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SystemHealthPluginProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *pluginsClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.SystemHealthPluginProfileList, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(pluginsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SystemHealthPluginProfileList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := pluginsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.systemhealth.plugins", "list", inputDataValue, executionContext) + var emptyOutput model.SystemHealthPluginProfileList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), pluginsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SystemHealthPluginProfileList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/systemhealth/PluginsTypes.go b/services/nsxt-mp/nsx/systemhealth/PluginsTypes.go new file mode 100644 index 000000000..fbc8f2940 --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/PluginsTypes.go @@ -0,0 +1,240 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Plugins. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package systemhealth + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func pluginsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["system_health_plugin_profile"] = bindings.NewReferenceType(model.SystemHealthPluginProfileBindingType) + fieldNameMap["system_health_plugin_profile"] = "SystemHealthPluginProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func pluginsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SystemHealthPluginProfileBindingType) +} + +func pluginsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["system_health_plugin_profile"] = bindings.NewReferenceType(model.SystemHealthPluginProfileBindingType) + fieldNameMap["system_health_plugin_profile"] = "SystemHealthPluginProfile" + paramsTypeMap["system_health_plugin_profile"] = bindings.NewReferenceType(model.SystemHealthPluginProfileBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "system_health_plugin_profile", + "POST", + "/api/v1/systemhealth/plugins", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func pluginsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["plugin_id"] = bindings.NewStringType() + fieldNameMap["plugin_id"] = "PluginId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func pluginsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func pluginsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["plugin_id"] = bindings.NewStringType() + fieldNameMap["plugin_id"] = "PluginId" + paramsTypeMap["plugin_id"] = bindings.NewStringType() + paramsTypeMap["pluginId"] = bindings.NewStringType() + pathParams["plugin_id"] = "pluginId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/systemhealth/plugins/{pluginId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func pluginsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["plugin_id"] = bindings.NewStringType() + fieldNameMap["plugin_id"] = "PluginId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func pluginsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SystemHealthPluginProfileBindingType) +} + +func pluginsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["plugin_id"] = bindings.NewStringType() + fieldNameMap["plugin_id"] = "PluginId" + paramsTypeMap["plugin_id"] = bindings.NewStringType() + paramsTypeMap["pluginId"] = bindings.NewStringType() + pathParams["plugin_id"] = "pluginId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/systemhealth/plugins/{pluginId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func pluginsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func pluginsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SystemHealthPluginProfileListBindingType) +} + +func pluginsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/systemhealth/plugins", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/systemhealth/ProfilesClient.go b/services/nsxt-mp/nsx/systemhealth/ProfilesClient.go new file mode 100644 index 000000000..a118ae35d --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/ProfilesClient.go @@ -0,0 +1,254 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Profiles +// Used by client-side stubs. + +package systemhealth + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ProfilesClient interface { + + // Create a system health profile. + // + // @param systemHealthAgentProfileParam (required) + // @return com.vmware.nsx.model.SystemHealthAgentProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(systemHealthAgentProfileParam model.SystemHealthAgentProfile) (model.SystemHealthAgentProfile, error) + + // Delete an existing system health profile by ID. + // + // @param profileIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(profileIdParam string) error + + // Show the details of a system health profile. + // + // @param profileIdParam (required) + // @return com.vmware.nsx.model.SystemHealthAgentProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(profileIdParam string) (model.SystemHealthAgentProfile, error) + + // List all system health profiles. + // @return com.vmware.nsx.model.SystemHealthAgentProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.SystemHealthAgentProfileListResult, error) + + // Update a system health profile definition. + // + // @param profileIdParam (required) + // @param systemHealthAgentProfileParam (required) + // @return com.vmware.nsx.model.SystemHealthAgentProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(profileIdParam string, systemHealthAgentProfileParam model.SystemHealthAgentProfile) (model.SystemHealthAgentProfile, error) +} + +type profilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewProfilesClient(connector client.Connector) *profilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.systemhealth.profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + pIface := profilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &pIface +} + +func (pIface *profilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := pIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (pIface *profilesClient) Create(systemHealthAgentProfileParam model.SystemHealthAgentProfile) (model.SystemHealthAgentProfile, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(profilesCreateInputType(), typeConverter) + sv.AddStructField("SystemHealthAgentProfile", systemHealthAgentProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SystemHealthAgentProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := profilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.systemhealth.profiles", "create", inputDataValue, executionContext) + var emptyOutput model.SystemHealthAgentProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), profilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SystemHealthAgentProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *profilesClient) Delete(profileIdParam string) error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(profilesDeleteInputType(), typeConverter) + sv.AddStructField("ProfileId", profileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := profilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.systemhealth.profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *profilesClient) Get(profileIdParam string) (model.SystemHealthAgentProfile, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(profilesGetInputType(), typeConverter) + sv.AddStructField("ProfileId", profileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SystemHealthAgentProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := profilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.systemhealth.profiles", "get", inputDataValue, executionContext) + var emptyOutput model.SystemHealthAgentProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), profilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SystemHealthAgentProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *profilesClient) List() (model.SystemHealthAgentProfileListResult, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(profilesListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SystemHealthAgentProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := profilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.systemhealth.profiles", "list", inputDataValue, executionContext) + var emptyOutput model.SystemHealthAgentProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), profilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SystemHealthAgentProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *profilesClient) Update(profileIdParam string, systemHealthAgentProfileParam model.SystemHealthAgentProfile) (model.SystemHealthAgentProfile, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(profilesUpdateInputType(), typeConverter) + sv.AddStructField("ProfileId", profileIdParam) + sv.AddStructField("SystemHealthAgentProfile", systemHealthAgentProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SystemHealthAgentProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := profilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.systemhealth.profiles", "update", inputDataValue, executionContext) + var emptyOutput model.SystemHealthAgentProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), profilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SystemHealthAgentProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/systemhealth/ProfilesTypes.go b/services/nsxt-mp/nsx/systemhealth/ProfilesTypes.go new file mode 100644 index 000000000..49759a9f6 --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/ProfilesTypes.go @@ -0,0 +1,265 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Profiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package systemhealth + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func profilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["system_health_agent_profile"] = bindings.NewReferenceType(model.SystemHealthAgentProfileBindingType) + fieldNameMap["system_health_agent_profile"] = "SystemHealthAgentProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func profilesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SystemHealthAgentProfileBindingType) +} + +func profilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["system_health_agent_profile"] = bindings.NewReferenceType(model.SystemHealthAgentProfileBindingType) + fieldNameMap["system_health_agent_profile"] = "SystemHealthAgentProfile" + paramsTypeMap["system_health_agent_profile"] = bindings.NewReferenceType(model.SystemHealthAgentProfileBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "system_health_agent_profile", + "POST", + "/api/v1/systemhealth/profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func profilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["profile_id"] = bindings.NewStringType() + fieldNameMap["profile_id"] = "ProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func profilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func profilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["profile_id"] = bindings.NewStringType() + fieldNameMap["profile_id"] = "ProfileId" + paramsTypeMap["profile_id"] = bindings.NewStringType() + paramsTypeMap["profileId"] = bindings.NewStringType() + pathParams["profile_id"] = "profileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/systemhealth/profiles/{profileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func profilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["profile_id"] = bindings.NewStringType() + fieldNameMap["profile_id"] = "ProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func profilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SystemHealthAgentProfileBindingType) +} + +func profilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["profile_id"] = bindings.NewStringType() + fieldNameMap["profile_id"] = "ProfileId" + paramsTypeMap["profile_id"] = bindings.NewStringType() + paramsTypeMap["profileId"] = bindings.NewStringType() + pathParams["profile_id"] = "profileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/systemhealth/profiles/{profileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func profilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func profilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SystemHealthAgentProfileListResultBindingType) +} + +func profilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/systemhealth/profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func profilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["profile_id"] = bindings.NewStringType() + fields["system_health_agent_profile"] = bindings.NewReferenceType(model.SystemHealthAgentProfileBindingType) + fieldNameMap["profile_id"] = "ProfileId" + fieldNameMap["system_health_agent_profile"] = "SystemHealthAgentProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func profilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SystemHealthAgentProfileBindingType) +} + +func profilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["profile_id"] = bindings.NewStringType() + fields["system_health_agent_profile"] = bindings.NewReferenceType(model.SystemHealthAgentProfileBindingType) + fieldNameMap["profile_id"] = "ProfileId" + fieldNameMap["system_health_agent_profile"] = "SystemHealthAgentProfile" + paramsTypeMap["profile_id"] = bindings.NewStringType() + paramsTypeMap["system_health_agent_profile"] = bindings.NewReferenceType(model.SystemHealthAgentProfileBindingType) + paramsTypeMap["profileId"] = bindings.NewStringType() + pathParams["profile_id"] = "profileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "system_health_agent_profile", + "PUT", + "/api/v1/systemhealth/profiles/{profileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/systemhealth/SystemhealthPackageTypes.go b/services/nsxt-mp/nsx/systemhealth/SystemhealthPackageTypes.go new file mode 100644 index 000000000..9ed39bffc --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/SystemhealthPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.systemhealth. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package systemhealth diff --git a/services/nsxt-mp/nsx/systemhealth/appliances/latency/LatencyPackageTypes.go b/services/nsxt-mp/nsx/systemhealth/appliances/latency/LatencyPackageTypes.go new file mode 100644 index 000000000..474af6ff1 --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/appliances/latency/LatencyPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.systemhealth.appliances.latency. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package latency diff --git a/services/nsxt-mp/nsx/systemhealth/appliances/latency/StatusClient.go b/services/nsxt-mp/nsx/systemhealth/appliances/latency/StatusClient.go new file mode 100644 index 000000000..79dcd377f --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/appliances/latency/StatusClient.go @@ -0,0 +1,141 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package latency + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Show the details of process status in given appliance. + // + // @param applianceIdParam (required) + // @return com.vmware.nsx.model.ApplianceLatencyData + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(applianceIdParam string) (model.ApplianceLatencyData, error) + + // Show the details of latency status in all appliances. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.ApplianceLatencyListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ApplianceLatencyListResult, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.systemhealth.appliances.latency.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(applianceIdParam string) (model.ApplianceLatencyData, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("ApplianceId", applianceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ApplianceLatencyData + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.systemhealth.appliances.latency.status", "get", inputDataValue, executionContext) + var emptyOutput model.ApplianceLatencyData + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ApplianceLatencyData), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statusClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ApplianceLatencyListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ApplianceLatencyListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.systemhealth.appliances.latency.status", "list", inputDataValue, executionContext) + var emptyOutput model.ApplianceLatencyListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ApplianceLatencyListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/systemhealth/appliances/latency/StatusTypes.go b/services/nsxt-mp/nsx/systemhealth/appliances/latency/StatusTypes.go new file mode 100644 index 000000000..cc0b55a59 --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/appliances/latency/StatusTypes.go @@ -0,0 +1,142 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package latency + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["appliance_id"] = bindings.NewStringType() + fieldNameMap["appliance_id"] = "ApplianceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ApplianceLatencyDataBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["appliance_id"] = bindings.NewStringType() + fieldNameMap["appliance_id"] = "ApplianceId" + paramsTypeMap["appliance_id"] = bindings.NewStringType() + paramsTypeMap["applianceId"] = bindings.NewStringType() + pathParams["appliance_id"] = "applianceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/systemhealth/appliances/{applianceId}/latency/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statusListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ApplianceLatencyListResultBindingType) +} + +func statusListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/systemhealth/appliances/latency/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/systemhealth/appliances/process/ProcessPackageTypes.go b/services/nsxt-mp/nsx/systemhealth/appliances/process/ProcessPackageTypes.go new file mode 100644 index 000000000..59d644f46 --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/appliances/process/ProcessPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.systemhealth.appliances.process. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package process diff --git a/services/nsxt-mp/nsx/systemhealth/appliances/process/StatusClient.go b/services/nsxt-mp/nsx/systemhealth/appliances/process/StatusClient.go new file mode 100644 index 000000000..1b35c99e2 --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/appliances/process/StatusClient.go @@ -0,0 +1,141 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package process + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Show the details of process status in given appliance. The appliance id can be obtained by below APIs. 1. /api/v1/cluster/nodes 2. /api/v1/systemhealth/appliances/process/status + // + // @param applianceIdParam (required) + // @return com.vmware.nsx.model.ApplianceProcessData + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(applianceIdParam string) (model.ApplianceProcessData, error) + + // Show the details of process status in all appliances. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.ApplianceProcessListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ApplianceProcessListResult, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.systemhealth.appliances.process.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(applianceIdParam string) (model.ApplianceProcessData, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("ApplianceId", applianceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ApplianceProcessData + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.systemhealth.appliances.process.status", "get", inputDataValue, executionContext) + var emptyOutput model.ApplianceProcessData + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ApplianceProcessData), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statusClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ApplianceProcessListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ApplianceProcessListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.systemhealth.appliances.process.status", "list", inputDataValue, executionContext) + var emptyOutput model.ApplianceProcessListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ApplianceProcessListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/systemhealth/appliances/process/StatusTypes.go b/services/nsxt-mp/nsx/systemhealth/appliances/process/StatusTypes.go new file mode 100644 index 000000000..f4975d6ca --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/appliances/process/StatusTypes.go @@ -0,0 +1,142 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package process + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["appliance_id"] = bindings.NewStringType() + fieldNameMap["appliance_id"] = "ApplianceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ApplianceProcessDataBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["appliance_id"] = bindings.NewStringType() + fieldNameMap["appliance_id"] = "ApplianceId" + paramsTypeMap["appliance_id"] = bindings.NewStringType() + paramsTypeMap["applianceId"] = bindings.NewStringType() + pathParams["appliance_id"] = "applianceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/systemhealth/appliances/{applianceId}/process/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statusListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ApplianceProcessListResultBindingType) +} + +func statusListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/systemhealth/appliances/process/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/systemhealth/container_cluster/ncp/NcpPackageTypes.go b/services/nsxt-mp/nsx/systemhealth/container_cluster/ncp/NcpPackageTypes.go new file mode 100644 index 000000000..bc8bd333c --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/container_cluster/ncp/NcpPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.systemhealth.container_cluster.ncp. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ncp diff --git a/services/nsxt-mp/nsx/systemhealth/container_cluster/ncp/StatusClient.go b/services/nsxt-mp/nsx/systemhealth/container_cluster/ncp/StatusClient.go new file mode 100644 index 000000000..374deadc6 --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/container_cluster/ncp/StatusClient.go @@ -0,0 +1,222 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package ncp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Create container cluster status list + // + // @param containerClusterStatusParam (required) + // @return com.vmware.nsx.model.ContainerClusterStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(containerClusterStatusParam model.ContainerClusterStatus) (model.ContainerClusterStatus, error) + + // Create container cluster status list + // + // @param clusterIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(clusterIdParam string) error + + // Get all the container cluster status + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param statusParam Container status type (optional) + // @return com.vmware.nsx.model.ContainerClusterStatusList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, statusParam *string) (model.ContainerClusterStatusList, error) + + // Get the container cluster status by given id + // + // @param clusterIdParam (required) + // @return com.vmware.nsx.model.ContainerClusterSummary + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get0(clusterIdParam string) (model.ContainerClusterSummary, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.systemhealth.container_cluster.ncp.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "get_0": core.NewMethodIdentifier(interfaceIdentifier, "get_0"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Create(containerClusterStatusParam model.ContainerClusterStatus) (model.ContainerClusterStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusCreateInputType(), typeConverter) + sv.AddStructField("ContainerClusterStatus", containerClusterStatusParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ContainerClusterStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.systemhealth.container_cluster.ncp.status", "create", inputDataValue, executionContext) + var emptyOutput model.ContainerClusterStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ContainerClusterStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statusClient) Delete(clusterIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusDeleteInputType(), typeConverter) + sv.AddStructField("ClusterId", clusterIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.systemhealth.container_cluster.ncp.status", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *statusClient) Get(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, statusParam *string) (model.ContainerClusterStatusList, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Status", statusParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ContainerClusterStatusList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.systemhealth.container_cluster.ncp.status", "get", inputDataValue, executionContext) + var emptyOutput model.ContainerClusterStatusList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ContainerClusterStatusList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statusClient) Get0(clusterIdParam string) (model.ContainerClusterSummary, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGet0InputType(), typeConverter) + sv.AddStructField("ClusterId", clusterIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ContainerClusterSummary + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGet0RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.systemhealth.container_cluster.ncp.status", "get_0", inputDataValue, executionContext) + var emptyOutput model.ContainerClusterSummary + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGet0OutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ContainerClusterSummary), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/systemhealth/container_cluster/ncp/StatusTypes.go b/services/nsxt-mp/nsx/systemhealth/container_cluster/ncp/StatusTypes.go new file mode 100644 index 000000000..b34305df7 --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/container_cluster/ncp/StatusTypes.go @@ -0,0 +1,258 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ncp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``status`` of method Status#get. +const Status_GET_STATUS_UNKNOWN = "UNKNOWN" + +// Possible value for ``status`` of method Status#get. +const Status_GET_STATUS_HEALTHY = "HEALTHY" + +// Possible value for ``status`` of method Status#get. +const Status_GET_STATUS_DOWN = "DOWN" + +// Possible value for ``status`` of method Status#get. +const Status_GET_STATUS_DEGRADED = "DEGRADED" + +func statusCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["container_cluster_status"] = bindings.NewReferenceType(model.ContainerClusterStatusBindingType) + fieldNameMap["container_cluster_status"] = "ContainerClusterStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ContainerClusterStatusBindingType) +} + +func statusCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["container_cluster_status"] = bindings.NewReferenceType(model.ContainerClusterStatusBindingType) + fieldNameMap["container_cluster_status"] = "ContainerClusterStatus" + paramsTypeMap["container_cluster_status"] = bindings.NewReferenceType(model.ContainerClusterStatusBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "container_cluster_status", + "POST", + "/api/v1/systemhealth/container-cluster/ncp/status", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statusDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cluster_id"] = bindings.NewStringType() + fieldNameMap["cluster_id"] = "ClusterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func statusDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cluster_id"] = bindings.NewStringType() + fieldNameMap["cluster_id"] = "ClusterId" + paramsTypeMap["cluster_id"] = bindings.NewStringType() + paramsTypeMap["clusterId"] = bindings.NewStringType() + pathParams["cluster_id"] = "clusterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/systemhealth/container-cluster/{clusterId}/ncp/status", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ContainerClusterStatusListBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["status"] = "Status" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["status"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + queryParams["status"] = "status" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/systemhealth/container-cluster/ncp/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statusGet0InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cluster_id"] = bindings.NewStringType() + fieldNameMap["cluster_id"] = "ClusterId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGet0OutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ContainerClusterSummaryBindingType) +} + +func statusGet0RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cluster_id"] = bindings.NewStringType() + fieldNameMap["cluster_id"] = "ClusterId" + paramsTypeMap["cluster_id"] = bindings.NewStringType() + paramsTypeMap["clusterId"] = bindings.NewStringType() + pathParams["cluster_id"] = "clusterId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/systemhealth/container-cluster/{clusterId}/ncp/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/systemhealth/plugins/PluginsPackageTypes.go b/services/nsxt-mp/nsx/systemhealth/plugins/PluginsPackageTypes.go new file mode 100644 index 000000000..7cb4fadfe --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/plugins/PluginsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.systemhealth.plugins. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package plugins diff --git a/services/nsxt-mp/nsx/systemhealth/plugins/StatusClient.go b/services/nsxt-mp/nsx/systemhealth/plugins/StatusClient.go new file mode 100644 index 000000000..7867e0364 --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/plugins/StatusClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package plugins + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Show all the installed system health plugins on given node + // + // @param nodeIdParam (required) + // @return com.vmware.nsx.model.PluginStatusList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(nodeIdParam string) (model.PluginStatusList, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.systemhealth.plugins.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) List(nodeIdParam string) (model.PluginStatusList, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusListInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PluginStatusList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.systemhealth.plugins.status", "list", inputDataValue, executionContext) + var emptyOutput model.PluginStatusList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PluginStatusList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/systemhealth/plugins/StatusTypes.go b/services/nsxt-mp/nsx/systemhealth/plugins/StatusTypes.go new file mode 100644 index 000000000..0e6755ad3 --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/plugins/StatusTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package plugins + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PluginStatusListBindingType) +} + +func statusListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/systemhealth/plugins/status/{nodeId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/systemhealth/transport_nodes/container/agent/AgentPackageTypes.go b/services/nsxt-mp/nsx/systemhealth/transport_nodes/container/agent/AgentPackageTypes.go new file mode 100644 index 000000000..5cf839309 --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/transport_nodes/container/agent/AgentPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.systemhealth.transport_nodes.container.agent. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package agent diff --git a/services/nsxt-mp/nsx/systemhealth/transport_nodes/container/agent/StatusClient.go b/services/nsxt-mp/nsx/systemhealth/transport_nodes/container/agent/StatusClient.go new file mode 100644 index 000000000..1f7afc9ce --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/transport_nodes/container/agent/StatusClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package agent + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Get the containter status on given node + // + // @param nodeIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.TnNodeAgentStatusListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nodeIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.TnNodeAgentStatusListResult, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.systemhealth.transport_nodes.container.agent.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(nodeIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.TnNodeAgentStatusListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TnNodeAgentStatusListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.systemhealth.transport_nodes.container.agent.status", "get", inputDataValue, executionContext) + var emptyOutput model.TnNodeAgentStatusListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TnNodeAgentStatusListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/systemhealth/transport_nodes/container/agent/StatusTypes.go b/services/nsxt-mp/nsx/systemhealth/transport_nodes/container/agent/StatusTypes.go new file mode 100644 index 000000000..406c6694c --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/transport_nodes/container/agent/StatusTypes.go @@ -0,0 +1,99 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package agent + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TnNodeAgentStatusListResultBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/systemhealth/transport-nodes/{nodeId}/container/agent/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/systemhealth/transport_nodes/container/hyperbus/HyperbusPackageTypes.go b/services/nsxt-mp/nsx/systemhealth/transport_nodes/container/hyperbus/HyperbusPackageTypes.go new file mode 100644 index 000000000..454b00e2e --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/transport_nodes/container/hyperbus/HyperbusPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.systemhealth.transport_nodes.container.hyperbus. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package hyperbus diff --git a/services/nsxt-mp/nsx/systemhealth/transport_nodes/container/hyperbus/StatusClient.go b/services/nsxt-mp/nsx/systemhealth/transport_nodes/container/hyperbus/StatusClient.go new file mode 100644 index 000000000..977fb25ea --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/transport_nodes/container/hyperbus/StatusClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package hyperbus + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Get the containter hyperbus status on given node + // + // @param nodeIdParam (required) + // @return com.vmware.nsx.model.TnHyperbusStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nodeIdParam string) (model.TnHyperbusStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.systemhealth.transport_nodes.container.hyperbus.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(nodeIdParam string) (model.TnHyperbusStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TnHyperbusStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.systemhealth.transport_nodes.container.hyperbus.status", "get", inputDataValue, executionContext) + var emptyOutput model.TnHyperbusStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TnHyperbusStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/systemhealth/transport_nodes/container/hyperbus/StatusTypes.go b/services/nsxt-mp/nsx/systemhealth/transport_nodes/container/hyperbus/StatusTypes.go new file mode 100644 index 000000000..fc1b6e5a0 --- /dev/null +++ b/services/nsxt-mp/nsx/systemhealth/transport_nodes/container/hyperbus/StatusTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package hyperbus + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TnHyperbusStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/systemhealth/transport-nodes/{nodeId}/container/hyperbus/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/tasks/ResponseClient.go b/services/nsxt-mp/nsx/tasks/ResponseClient.go new file mode 100644 index 000000000..53120c221 --- /dev/null +++ b/services/nsxt-mp/nsx/tasks/ResponseClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Response +// Used by client-side stubs. + +package tasks + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ResponseClient interface { + + // Get the response of a task + // + // @param taskIdParam ID of task to read (required) + // @return DynamicStructure + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(taskIdParam string) (*data.StructValue, error) +} + +type responseClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewResponseClient(connector client.Connector) *responseClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.tasks.response") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := responseClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *responseClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *responseClient) Get(taskIdParam string) (*data.StructValue, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(responseGetInputType(), typeConverter) + sv.AddStructField("TaskId", taskIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := responseGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.tasks.response", "get", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), responseGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/tasks/ResponseTypes.go b/services/nsxt-mp/nsx/tasks/ResponseTypes.go new file mode 100644 index 000000000..ef9e6e947 --- /dev/null +++ b/services/nsxt-mp/nsx/tasks/ResponseTypes.go @@ -0,0 +1,68 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Response. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package tasks + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "reflect" +) + +func responseGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["task_id"] = bindings.NewStringType() + fieldNameMap["task_id"] = "TaskId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func responseGetOutputType() bindings.BindingType { + return bindings.NewDynamicStructType(nil, bindings.REST) +} + +func responseGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["task_id"] = bindings.NewStringType() + fieldNameMap["task_id"] = "TaskId" + paramsTypeMap["task_id"] = bindings.NewStringType() + paramsTypeMap["taskId"] = bindings.NewStringType() + pathParams["task_id"] = "taskId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/tasks/{taskId}/response", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/tasks/TasksPackageTypes.go b/services/nsxt-mp/nsx/tasks/TasksPackageTypes.go new file mode 100644 index 000000000..c7fe8222a --- /dev/null +++ b/services/nsxt-mp/nsx/tasks/TasksPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.tasks. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package tasks diff --git a/services/nsxt-mp/nsx/telemetry/AgreementClient.go b/services/nsxt-mp/nsx/telemetry/AgreementClient.go new file mode 100644 index 000000000..16b0e7d6d --- /dev/null +++ b/services/nsxt-mp/nsx/telemetry/AgreementClient.go @@ -0,0 +1,130 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Agreement +// Used by client-side stubs. + +package telemetry + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AgreementClient interface { + + // Returns telemetry agreement information. + // @return com.vmware.nsx.model.TelemetryAgreement + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.TelemetryAgreement, error) + + // Set telemetry agreement information. + // + // @param telemetryAgreementParam (required) + // @return com.vmware.nsx.model.TelemetryAgreement + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(telemetryAgreementParam model.TelemetryAgreement) (model.TelemetryAgreement, error) +} + +type agreementClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAgreementClient(connector client.Connector) *agreementClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.telemetry.agreement") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := agreementClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *agreementClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *agreementClient) Get() (model.TelemetryAgreement, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(agreementGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TelemetryAgreement + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := agreementGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.telemetry.agreement", "get", inputDataValue, executionContext) + var emptyOutput model.TelemetryAgreement + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), agreementGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TelemetryAgreement), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (aIface *agreementClient) Update(telemetryAgreementParam model.TelemetryAgreement) (model.TelemetryAgreement, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(agreementUpdateInputType(), typeConverter) + sv.AddStructField("TelemetryAgreement", telemetryAgreementParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TelemetryAgreement + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := agreementUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.telemetry.agreement", "update", inputDataValue, executionContext) + var emptyOutput model.TelemetryAgreement + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), agreementUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TelemetryAgreement), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/telemetry/AgreementTypes.go b/services/nsxt-mp/nsx/telemetry/AgreementTypes.go new file mode 100644 index 000000000..4ba53c3e3 --- /dev/null +++ b/services/nsxt-mp/nsx/telemetry/AgreementTypes.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Agreement. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package telemetry + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func agreementGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func agreementGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TelemetryAgreementBindingType) +} + +func agreementGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/telemetry/agreement", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func agreementUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["telemetry_agreement"] = bindings.NewReferenceType(model.TelemetryAgreementBindingType) + fieldNameMap["telemetry_agreement"] = "TelemetryAgreement" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func agreementUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TelemetryAgreementBindingType) +} + +func agreementUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["telemetry_agreement"] = bindings.NewReferenceType(model.TelemetryAgreementBindingType) + fieldNameMap["telemetry_agreement"] = "TelemetryAgreement" + paramsTypeMap["telemetry_agreement"] = bindings.NewReferenceType(model.TelemetryAgreementBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "telemetry_agreement", + "PUT", + "/api/v1/telemetry/agreement", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/telemetry/ConfigClient.go b/services/nsxt-mp/nsx/telemetry/ConfigClient.go new file mode 100644 index 000000000..26d6162fa --- /dev/null +++ b/services/nsxt-mp/nsx/telemetry/ConfigClient.go @@ -0,0 +1,130 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Config +// Used by client-side stubs. + +package telemetry + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ConfigClient interface { + + // Returns the telemetry configuration. + // @return com.vmware.nsx.model.TelemetryConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.TelemetryConfig, error) + + // Updates or creates the telemetry configuration, and returns the new configuration. + // + // @param telemetryConfigParam (required) + // @return com.vmware.nsx.model.TelemetryConfig + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(telemetryConfigParam model.TelemetryConfig) (model.TelemetryConfig, error) +} + +type configClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewConfigClient(connector client.Connector) *configClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.telemetry.config") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := configClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *configClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *configClient) Get() (model.TelemetryConfig, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(configGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TelemetryConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := configGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.telemetry.config", "get", inputDataValue, executionContext) + var emptyOutput model.TelemetryConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), configGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TelemetryConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *configClient) Update(telemetryConfigParam model.TelemetryConfig) (model.TelemetryConfig, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(configUpdateInputType(), typeConverter) + sv.AddStructField("TelemetryConfig", telemetryConfigParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TelemetryConfig + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := configUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.telemetry.config", "update", inputDataValue, executionContext) + var emptyOutput model.TelemetryConfig + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), configUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TelemetryConfig), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/telemetry/ConfigTypes.go b/services/nsxt-mp/nsx/telemetry/ConfigTypes.go new file mode 100644 index 000000000..629e9abe7 --- /dev/null +++ b/services/nsxt-mp/nsx/telemetry/ConfigTypes.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Config. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package telemetry + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func configGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func configGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TelemetryConfigBindingType) +} + +func configGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/telemetry/config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func configUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["telemetry_config"] = bindings.NewReferenceType(model.TelemetryConfigBindingType) + fieldNameMap["telemetry_config"] = "TelemetryConfig" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func configUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TelemetryConfigBindingType) +} + +func configUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["telemetry_config"] = bindings.NewReferenceType(model.TelemetryConfigBindingType) + fieldNameMap["telemetry_config"] = "TelemetryConfig" + paramsTypeMap["telemetry_config"] = bindings.NewReferenceType(model.TelemetryConfigBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "telemetry_config", + "PUT", + "/api/v1/telemetry/config", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/telemetry/TelemetryPackageTypes.go b/services/nsxt-mp/nsx/telemetry/TelemetryPackageTypes.go new file mode 100644 index 000000000..1828f8521 --- /dev/null +++ b/services/nsxt-mp/nsx/telemetry/TelemetryPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.telemetry. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package telemetry diff --git a/services/nsxt-mp/nsx/traceflows/ObservationsClient.go b/services/nsxt-mp/nsx/traceflows/ObservationsClient.go new file mode 100644 index 000000000..192d78d2f --- /dev/null +++ b/services/nsxt-mp/nsx/traceflows/ObservationsClient.go @@ -0,0 +1,108 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Observations +// Used by client-side stubs. + +package traceflows + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ObservationsClient interface { + + // Get observations for the Traceflow round + // + // @param traceflowIdParam (required) + // @param componentNameParam Observations having the given component name will be listed. (optional) + // @param componentTypeParam Observations having the given component type will be listed. (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param resourceTypeParam The type of observations that will be listed. (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param transportNodeNameParam Observations having the given transport node name will be listed. (optional) + // @return com.vmware.nsx.model.TraceflowObservationListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(traceflowIdParam string, componentNameParam *string, componentTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, resourceTypeParam *string, sortAscendingParam *bool, sortByParam *string, transportNodeNameParam *string) (model.TraceflowObservationListResult, error) +} + +type observationsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewObservationsClient(connector client.Connector) *observationsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.traceflows.observations") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + oIface := observationsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &oIface +} + +func (oIface *observationsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := oIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (oIface *observationsClient) List(traceflowIdParam string, componentNameParam *string, componentTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, resourceTypeParam *string, sortAscendingParam *bool, sortByParam *string, transportNodeNameParam *string) (model.TraceflowObservationListResult, error) { + typeConverter := oIface.connector.TypeConverter() + executionContext := oIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(observationsListInputType(), typeConverter) + sv.AddStructField("TraceflowId", traceflowIdParam) + sv.AddStructField("ComponentName", componentNameParam) + sv.AddStructField("ComponentType", componentTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("ResourceType", resourceTypeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("TransportNodeName", transportNodeNameParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TraceflowObservationListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := observationsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + oIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := oIface.connector.GetApiProvider().Invoke("com.vmware.nsx.traceflows.observations", "list", inputDataValue, executionContext) + var emptyOutput model.TraceflowObservationListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), observationsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TraceflowObservationListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), oIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/traceflows/ObservationsTypes.go b/services/nsxt-mp/nsx/traceflows/ObservationsTypes.go new file mode 100644 index 000000000..77f8c96cd --- /dev/null +++ b/services/nsxt-mp/nsx/traceflows/ObservationsTypes.go @@ -0,0 +1,222 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Observations. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package traceflows + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_PHYSICAL = "PHYSICAL" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_LR = "LR" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_LS = "LS" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_DFW = "DFW" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_BRIDGE = "BRIDGE" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_EDGE_TUNNEL = "EDGE_TUNNEL" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_EDGE_HOSTSWITCH = "EDGE_HOSTSWITCH" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_FW_BRIDGE = "FW_BRIDGE" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_EDGE_RTEP_TUNNEL = "EDGE_RTEP_TUNNEL" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_LOAD_BALANCER = "LOAD_BALANCER" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_NAT = "NAT" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_IPSEC = "IPSEC" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_SERVICE_INSERTION = "SERVICE_INSERTION" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_VMC = "VMC" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_SPOOFGUARD = "SPOOFGUARD" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_EDGE_FW = "EDGE_FW" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_DLB = "DLB" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_ANTREA_SPOOFGUARD = "ANTREA_SPOOFGUARD" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_ANTREA_LB = "ANTREA_LB" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_ANTREA_ROUTING = "ANTREA_ROUTING" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_ANTREA_DFW = "ANTREA_DFW" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_ANTREA_FORWARDING = "ANTREA_FORWARDING" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_HOST_SWITCH = "HOST_SWITCH" + +// Possible value for ``componentType`` of method Observations#list. +const Observations_LIST_COMPONENT_TYPE_UNKNOWN = "UNKNOWN" + +// Possible value for ``resourceType`` of method Observations#list. +const Observations_LIST_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDED = "TraceflowObservationForwarded" + +// Possible value for ``resourceType`` of method Observations#list. +const Observations_LIST_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPED = "TraceflowObservationDropped" + +// Possible value for ``resourceType`` of method Observations#list. +const Observations_LIST_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDELIVERED = "TraceflowObservationDelivered" + +// Possible value for ``resourceType`` of method Observations#list. +const Observations_LIST_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVED = "TraceflowObservationReceived" + +// Possible value for ``resourceType`` of method Observations#list. +const Observations_LIST_RESOURCE_TYPE_TRACEFLOWOBSERVATIONFORWARDEDLOGICAL = "TraceflowObservationForwardedLogical" + +// Possible value for ``resourceType`` of method Observations#list. +const Observations_LIST_RESOURCE_TYPE_TRACEFLOWOBSERVATIONDROPPEDLOGICAL = "TraceflowObservationDroppedLogical" + +// Possible value for ``resourceType`` of method Observations#list. +const Observations_LIST_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRECEIVEDLOGICAL = "TraceflowObservationReceivedLogical" + +// Possible value for ``resourceType`` of method Observations#list. +const Observations_LIST_RESOURCE_TYPE_TRACEFLOWOBSERVATIONREPLICATIONLOGICAL = "TraceflowObservationReplicationLogical" + +// Possible value for ``resourceType`` of method Observations#list. +const Observations_LIST_RESOURCE_TYPE_TRACEFLOWOBSERVATIONRELAYEDLOGICAL = "TraceflowObservationRelayedLogical" + +func observationsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["traceflow_id"] = bindings.NewStringType() + fields["component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_node_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["traceflow_id"] = "TraceflowId" + fieldNameMap["component_name"] = "ComponentName" + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["resource_type"] = "ResourceType" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["transport_node_name"] = "TransportNodeName" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func observationsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TraceflowObservationListResultBindingType) +} + +func observationsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["traceflow_id"] = bindings.NewStringType() + fields["component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["transport_node_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["traceflow_id"] = "TraceflowId" + fieldNameMap["component_name"] = "ComponentName" + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["resource_type"] = "ResourceType" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["transport_node_name"] = "TransportNodeName" + paramsTypeMap["resource_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["traceflow_id"] = bindings.NewStringType() + paramsTypeMap["component_name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["transport_node_name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["traceflowId"] = bindings.NewStringType() + pathParams["traceflow_id"] = "traceflowId" + queryParams["cursor"] = "cursor" + queryParams["component_type"] = "component_type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["component_name"] = "component_name" + queryParams["resource_type"] = "resource_type" + queryParams["sort_by"] = "sort_by" + queryParams["transport_node_name"] = "transport_node_name" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/traceflows/{traceflowId}/observations", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/traceflows/TraceflowsPackageTypes.go b/services/nsxt-mp/nsx/traceflows/TraceflowsPackageTypes.go new file mode 100644 index 000000000..ee6c30e68 --- /dev/null +++ b/services/nsxt-mp/nsx/traceflows/TraceflowsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.traceflows. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package traceflows diff --git a/services/nsxt-mp/nsx/transport_node_collections/StateClient.go b/services/nsxt-mp/nsx/transport_node_collections/StateClient.go new file mode 100644 index 000000000..bd6532b09 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_node_collections/StateClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: State +// Used by client-side stubs. + +package transport_node_collections + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StateClient interface { + + // Returns the state of transport node collection based on the states of transport nodes of the hosts which are part of compute collection. + // + // @param transportNodeCollectionIdParam (required) + // @return com.vmware.nsx.model.TransportNodeCollectionState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(transportNodeCollectionIdParam string) (model.TransportNodeCollectionState, error) +} + +type stateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStateClient(connector client.Connector) *stateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_node_collections.state") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := stateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *stateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *stateClient) Get(transportNodeCollectionIdParam string) (model.TransportNodeCollectionState, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(stateGetInputType(), typeConverter) + sv.AddStructField("TransportNodeCollectionId", transportNodeCollectionIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportNodeCollectionState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_node_collections.state", "get", inputDataValue, executionContext) + var emptyOutput model.TransportNodeCollectionState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportNodeCollectionState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/transport_node_collections/StateTypes.go b/services/nsxt-mp/nsx/transport_node_collections/StateTypes.go new file mode 100644 index 000000000..9144f999a --- /dev/null +++ b/services/nsxt-mp/nsx/transport_node_collections/StateTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: State. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package transport_node_collections + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func stateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_collection_id"] = bindings.NewStringType() + fieldNameMap["transport_node_collection_id"] = "TransportNodeCollectionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportNodeCollectionStateBindingType) +} + +func stateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_collection_id"] = bindings.NewStringType() + fieldNameMap["transport_node_collection_id"] = "TransportNodeCollectionId" + paramsTypeMap["transport_node_collection_id"] = bindings.NewStringType() + paramsTypeMap["transportNodeCollectionId"] = bindings.NewStringType() + pathParams["transport_node_collection_id"] = "transportNodeCollectionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-node-collections/{transportNodeCollectionId}/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/transport_node_collections/TransportNodeCollectionsPackageTypes.go b/services/nsxt-mp/nsx/transport_node_collections/TransportNodeCollectionsPackageTypes.go new file mode 100644 index 000000000..a4355efab --- /dev/null +++ b/services/nsxt-mp/nsx/transport_node_collections/TransportNodeCollectionsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.transport_node_collections. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package transport_node_collections diff --git a/services/nsxt-mp/nsx/transport_nodes/CapabilitiesClient.go b/services/nsxt-mp/nsx/transport_nodes/CapabilitiesClient.go new file mode 100644 index 000000000..8ac1abcc7 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/CapabilitiesClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Capabilities +// Used by client-side stubs. + +package transport_nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type CapabilitiesClient interface { + + // Returns information about capabilities of transport host node. Edge nodes do not have capabilities. + // + // @param transportNodeIdParam (required) + // @return com.vmware.nsx.model.NodeCapabilitiesResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(transportNodeIdParam string) (model.NodeCapabilitiesResult, error) +} + +type capabilitiesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewCapabilitiesClient(connector client.Connector) *capabilitiesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes.capabilities") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := capabilitiesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *capabilitiesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *capabilitiesClient) Get(transportNodeIdParam string) (model.NodeCapabilitiesResult, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(capabilitiesGetInputType(), typeConverter) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeCapabilitiesResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := capabilitiesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.capabilities", "get", inputDataValue, executionContext) + var emptyOutput model.NodeCapabilitiesResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), capabilitiesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeCapabilitiesResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/transport_nodes/CapabilitiesTypes.go b/services/nsxt-mp/nsx/transport_nodes/CapabilitiesTypes.go new file mode 100644 index 000000000..3bf462212 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/CapabilitiesTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Capabilities. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package transport_nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func capabilitiesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_id"] = bindings.NewStringType() + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func capabilitiesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeCapabilitiesResultBindingType) +} + +func capabilitiesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_id"] = bindings.NewStringType() + fieldNameMap["transport_node_id"] = "TransportNodeId" + paramsTypeMap["transport_node_id"] = bindings.NewStringType() + paramsTypeMap["transportNodeId"] = bindings.NewStringType() + pathParams["transport_node_id"] = "transportNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-nodes/{transportNodeId}/capabilities", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/transport_nodes/ModulesClient.go b/services/nsxt-mp/nsx/transport_nodes/ModulesClient.go new file mode 100644 index 000000000..1c7abcbe5 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/ModulesClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Modules +// Used by client-side stubs. + +package transport_nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ModulesClient interface { + + // Get the module details of a transport node This api is now deprecated. Please use new api - /infra/sites//enforcement-points//host-transport-nodes//modules + // + // @param nodeIdParam (required) + // @return com.vmware.nsx.model.SoftwareModuleResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nodeIdParam string) (model.SoftwareModuleResult, error) +} + +type modulesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewModulesClient(connector client.Connector) *modulesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes.modules") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + mIface := modulesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &mIface +} + +func (mIface *modulesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := mIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (mIface *modulesClient) Get(nodeIdParam string) (model.SoftwareModuleResult, error) { + typeConverter := mIface.connector.TypeConverter() + executionContext := mIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(modulesGetInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.SoftwareModuleResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := modulesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + mIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := mIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.modules", "get", inputDataValue, executionContext) + var emptyOutput model.SoftwareModuleResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), modulesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.SoftwareModuleResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), mIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/transport_nodes/ModulesTypes.go b/services/nsxt-mp/nsx/transport_nodes/ModulesTypes.go new file mode 100644 index 000000000..12ad3a20d --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/ModulesTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Modules. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package transport_nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func modulesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func modulesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.SoftwareModuleResultBindingType) +} + +func modulesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fieldNameMap["node_id"] = "NodeId" + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-nodes/{nodeId}/modules", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/transport_nodes/PnicBondStatusClient.go b/services/nsxt-mp/nsx/transport_nodes/PnicBondStatusClient.go new file mode 100644 index 000000000..b3fa963e4 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/PnicBondStatusClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: PnicBondStatus +// Used by client-side stubs. + +package transport_nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type PnicBondStatusClient interface { + + // Get high-level summary of a transport node + // + // @param nodeIdParam ID of transport node (required) + // @param statusParam pNic/bond status (optional) + // @return com.vmware.nsx.model.PnicBondStatusListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(nodeIdParam string, statusParam *string) (model.PnicBondStatusListResult, error) +} + +type pnicBondStatusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewPnicBondStatusClient(connector client.Connector) *pnicBondStatusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes.pnic_bond_status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + pIface := pnicBondStatusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &pIface +} + +func (pIface *pnicBondStatusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := pIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (pIface *pnicBondStatusClient) List(nodeIdParam string, statusParam *string) (model.PnicBondStatusListResult, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(pnicBondStatusListInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("Status", statusParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PnicBondStatusListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := pnicBondStatusListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.pnic_bond_status", "list", inputDataValue, executionContext) + var emptyOutput model.PnicBondStatusListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), pnicBondStatusListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PnicBondStatusListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/transport_nodes/PnicBondStatusTypes.go b/services/nsxt-mp/nsx/transport_nodes/PnicBondStatusTypes.go new file mode 100644 index 000000000..b3462b890 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/PnicBondStatusTypes.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: PnicBondStatus. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package transport_nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``status`` of method PnicBondStatus#list. +const PnicBondStatus_LIST_STATUS_UNKNOWN = "UNKNOWN" + +// Possible value for ``status`` of method PnicBondStatus#list. +const PnicBondStatus_LIST_STATUS_UP = "UP" + +// Possible value for ``status`` of method PnicBondStatus#list. +const PnicBondStatus_LIST_STATUS_DOWN = "DOWN" + +// Possible value for ``status`` of method PnicBondStatus#list. +const PnicBondStatus_LIST_STATUS_DEGRADED = "DEGRADED" + +func pnicBondStatusListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func pnicBondStatusListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PnicBondStatusListResultBindingType) +} + +func pnicBondStatusListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["status"] = "Status" + paramsTypeMap["status"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + queryParams["status"] = "status" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-nodes/{nodeId}/pnic-bond-status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/transport_nodes/RemoteTransportNodeStatusClient.go b/services/nsxt-mp/nsx/transport_nodes/RemoteTransportNodeStatusClient.go new file mode 100644 index 000000000..01663b1c0 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/RemoteTransportNodeStatusClient.go @@ -0,0 +1,106 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: RemoteTransportNodeStatus +// Used by client-side stubs. + +package transport_nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RemoteTransportNodeStatusClient interface { + + // Read status of all transport nodes with tunnel connections to transport node + // + // @param nodeIdParam ID of transport node (required) + // @param bfdDiagnosticCodeParam BFD diagnostic code of Tunnel (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param sourceParam Data source type. (optional) + // @param tunnelStatusParam Tunnel Status (optional) + // @return com.vmware.nsx.model.TransportNodeStatusListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(nodeIdParam string, bfdDiagnosticCodeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, sourceParam *string, tunnelStatusParam *string) (model.TransportNodeStatusListResult, error) +} + +type remoteTransportNodeStatusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRemoteTransportNodeStatusClient(connector client.Connector) *remoteTransportNodeStatusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes.remote_transport_node_status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := remoteTransportNodeStatusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *remoteTransportNodeStatusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *remoteTransportNodeStatusClient) List(nodeIdParam string, bfdDiagnosticCodeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, sourceParam *string, tunnelStatusParam *string) (model.TransportNodeStatusListResult, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(remoteTransportNodeStatusListInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("BfdDiagnosticCode", bfdDiagnosticCodeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Source", sourceParam) + sv.AddStructField("TunnelStatus", tunnelStatusParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportNodeStatusListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := remoteTransportNodeStatusListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.remote_transport_node_status", "list", inputDataValue, executionContext) + var emptyOutput model.TransportNodeStatusListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), remoteTransportNodeStatusListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportNodeStatusListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/transport_nodes/RemoteTransportNodeStatusTypes.go b/services/nsxt-mp/nsx/transport_nodes/RemoteTransportNodeStatusTypes.go new file mode 100644 index 000000000..c6d06a77f --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/RemoteTransportNodeStatusTypes.go @@ -0,0 +1,183 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: RemoteTransportNodeStatus. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package transport_nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``bfdDiagnosticCode`` of method RemoteTransportNodeStatus#list. +const RemoteTransportNodeStatus_LIST_BFD_DIAGNOSTIC_CODE_0 = "0" + +// Possible value for ``bfdDiagnosticCode`` of method RemoteTransportNodeStatus#list. +const RemoteTransportNodeStatus_LIST_BFD_DIAGNOSTIC_CODE_NO_DIAGNOSTIC = "NO_DIAGNOSTIC" + +// Possible value for ``bfdDiagnosticCode`` of method RemoteTransportNodeStatus#list. +const RemoteTransportNodeStatus_LIST_BFD_DIAGNOSTIC_CODE_1 = "1" + +// Possible value for ``bfdDiagnosticCode`` of method RemoteTransportNodeStatus#list. +const RemoteTransportNodeStatus_LIST_BFD_DIAGNOSTIC_CODE_CONTROL_DETECTION_TIME_EXPIRED = "CONTROL_DETECTION_TIME_EXPIRED" + +// Possible value for ``bfdDiagnosticCode`` of method RemoteTransportNodeStatus#list. +const RemoteTransportNodeStatus_LIST_BFD_DIAGNOSTIC_CODE_2 = "2" + +// Possible value for ``bfdDiagnosticCode`` of method RemoteTransportNodeStatus#list. +const RemoteTransportNodeStatus_LIST_BFD_DIAGNOSTIC_CODE_ECHO_FUNCTION_FAILED = "ECHO_FUNCTION_FAILED" + +// Possible value for ``bfdDiagnosticCode`` of method RemoteTransportNodeStatus#list. +const RemoteTransportNodeStatus_LIST_BFD_DIAGNOSTIC_CODE_3 = "3" + +// Possible value for ``bfdDiagnosticCode`` of method RemoteTransportNodeStatus#list. +const RemoteTransportNodeStatus_LIST_BFD_DIAGNOSTIC_CODE_NEIGHBOR_SIGNALED_SESSION_DOWN = "NEIGHBOR_SIGNALED_SESSION_DOWN" + +// Possible value for ``bfdDiagnosticCode`` of method RemoteTransportNodeStatus#list. +const RemoteTransportNodeStatus_LIST_BFD_DIAGNOSTIC_CODE_4 = "4" + +// Possible value for ``bfdDiagnosticCode`` of method RemoteTransportNodeStatus#list. +const RemoteTransportNodeStatus_LIST_BFD_DIAGNOSTIC_CODE_FORWARDING_PLANE_RESET = "FORWARDING_PLANE_RESET" + +// Possible value for ``bfdDiagnosticCode`` of method RemoteTransportNodeStatus#list. +const RemoteTransportNodeStatus_LIST_BFD_DIAGNOSTIC_CODE_5 = "5" + +// Possible value for ``bfdDiagnosticCode`` of method RemoteTransportNodeStatus#list. +const RemoteTransportNodeStatus_LIST_BFD_DIAGNOSTIC_CODE_PATH_DOWN = "PATH_DOWN" + +// Possible value for ``bfdDiagnosticCode`` of method RemoteTransportNodeStatus#list. +const RemoteTransportNodeStatus_LIST_BFD_DIAGNOSTIC_CODE_6 = "6" + +// Possible value for ``bfdDiagnosticCode`` of method RemoteTransportNodeStatus#list. +const RemoteTransportNodeStatus_LIST_BFD_DIAGNOSTIC_CODE_CONCATENATED_PATH_DOWN = "CONCATENATED_PATH_DOWN" + +// Possible value for ``bfdDiagnosticCode`` of method RemoteTransportNodeStatus#list. +const RemoteTransportNodeStatus_LIST_BFD_DIAGNOSTIC_CODE_7 = "7" + +// Possible value for ``bfdDiagnosticCode`` of method RemoteTransportNodeStatus#list. +const RemoteTransportNodeStatus_LIST_BFD_DIAGNOSTIC_CODE_ADMINISTRATIVELY_DOWN = "ADMINISTRATIVELY_DOWN" + +// Possible value for ``bfdDiagnosticCode`` of method RemoteTransportNodeStatus#list. +const RemoteTransportNodeStatus_LIST_BFD_DIAGNOSTIC_CODE_8 = "8" + +// Possible value for ``bfdDiagnosticCode`` of method RemoteTransportNodeStatus#list. +const RemoteTransportNodeStatus_LIST_BFD_DIAGNOSTIC_CODE_REVERSE_CONCATENATED_PATH_DOWN = "REVERSE_CONCATENATED_PATH_DOWN" + +// Possible value for ``source`` of method RemoteTransportNodeStatus#list. +const RemoteTransportNodeStatus_LIST_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method RemoteTransportNodeStatus#list. +const RemoteTransportNodeStatus_LIST_SOURCE_CACHED = "cached" + +// Possible value for ``tunnelStatus`` of method RemoteTransportNodeStatus#list. +const RemoteTransportNodeStatus_LIST_TUNNEL_STATUS_UP = "UP" + +// Possible value for ``tunnelStatus`` of method RemoteTransportNodeStatus#list. +const RemoteTransportNodeStatus_LIST_TUNNEL_STATUS_DOWN = "DOWN" + +func remoteTransportNodeStatusListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fields["bfd_diagnostic_code"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["tunnel_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["bfd_diagnostic_code"] = "BfdDiagnosticCode" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["tunnel_status"] = "TunnelStatus" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func remoteTransportNodeStatusListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportNodeStatusListResultBindingType) +} + +func remoteTransportNodeStatusListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fields["bfd_diagnostic_code"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["tunnel_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["bfd_diagnostic_code"] = "BfdDiagnosticCode" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["tunnel_status"] = "TunnelStatus" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["tunnel_status"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["bfd_diagnostic_code"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["tunnel_status"] = "tunnel_status" + queryParams["bfd_diagnostic_code"] = "bfd_diagnostic_code" + queryParams["sort_by"] = "sort_by" + queryParams["source"] = "source" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-nodes/{nodeId}/remote-transport-node-status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/transport_nodes/StateClient.go b/services/nsxt-mp/nsx/transport_nodes/StateClient.go new file mode 100644 index 000000000..f3b22f103 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/StateClient.go @@ -0,0 +1,137 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: State +// Used by client-side stubs. + +package transport_nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StateClient interface { + + // Returns information about the current state of the transport node configuration and information about the associated hostswitch. This api is now deprecated. Please use new api - /infra/sites//enforcement-points//host-transport-nodes//state + // + // @param transportNodeIdParam (required) + // @return com.vmware.nsx.model.TransportNodeState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(transportNodeIdParam string) (model.TransportNodeState, error) + + // Returns a list of transport node states that have realized state as provided as query parameter. This api will be deprecated in future. For Host, please use new api - /infra/sites//enforcement-points//host-transport-nodes/state + // + // @param mmStateParam maintenance mode state (optional) + // @param statusParam Realized state of transport nodes (optional) + // @param vtepIpParam Virtual tunnel endpoint ip address of transport node (optional) + // @return com.vmware.nsx.model.TransportNodeStateListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(mmStateParam *string, statusParam *string, vtepIpParam *string) (model.TransportNodeStateListResult, error) +} + +type stateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStateClient(connector client.Connector) *stateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes.state") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := stateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *stateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *stateClient) Get(transportNodeIdParam string) (model.TransportNodeState, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(stateGetInputType(), typeConverter) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportNodeState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.state", "get", inputDataValue, executionContext) + var emptyOutput model.TransportNodeState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportNodeState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *stateClient) List(mmStateParam *string, statusParam *string, vtepIpParam *string) (model.TransportNodeStateListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(stateListInputType(), typeConverter) + sv.AddStructField("MmState", mmStateParam) + sv.AddStructField("Status", statusParam) + sv.AddStructField("VtepIp", vtepIpParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportNodeStateListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.state", "list", inputDataValue, executionContext) + var emptyOutput model.TransportNodeStateListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportNodeStateListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/transport_nodes/StateTypes.go b/services/nsxt-mp/nsx/transport_nodes/StateTypes.go new file mode 100644 index 000000000..4b0692e0b --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/StateTypes.go @@ -0,0 +1,160 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: State. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package transport_nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``mmState`` of method State#list. +const State_LIST_MM_STATE_ENTERING = "ENTERING" + +// Possible value for ``mmState`` of method State#list. +const State_LIST_MM_STATE_ENABLED = "ENABLED" + +// Possible value for ``mmState`` of method State#list. +const State_LIST_MM_STATE_EXITING = "EXITING" + +// Possible value for ``mmState`` of method State#list. +const State_LIST_MM_STATE_DISABLED = "DISABLED" + +// Possible value for ``status`` of method State#list. +const State_LIST_STATUS_PENDING = "PENDING" + +// Possible value for ``status`` of method State#list. +const State_LIST_STATUS_IN_PROGRESS = "IN_PROGRESS" + +// Possible value for ``status`` of method State#list. +const State_LIST_STATUS_SUCCESS = "SUCCESS" + +// Possible value for ``status`` of method State#list. +const State_LIST_STATUS_PARTIAL_SUCCESS = "PARTIAL_SUCCESS" + +// Possible value for ``status`` of method State#list. +const State_LIST_STATUS_FAILED = "FAILED" + +// Possible value for ``status`` of method State#list. +const State_LIST_STATUS_ORPHANED = "ORPHANED" + +func stateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_id"] = bindings.NewStringType() + fieldNameMap["transport_node_id"] = "TransportNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportNodeStateBindingType) +} + +func stateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_id"] = bindings.NewStringType() + fieldNameMap["transport_node_id"] = "TransportNodeId" + paramsTypeMap["transport_node_id"] = bindings.NewStringType() + paramsTypeMap["transportNodeId"] = bindings.NewStringType() + pathParams["transport_node_id"] = "transportNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-nodes/{transportNodeId}/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func stateListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["mm_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["vtep_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mm_state"] = "MmState" + fieldNameMap["status"] = "Status" + fieldNameMap["vtep_ip"] = "VtepIp" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportNodeStateListResultBindingType) +} + +func stateListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["mm_state"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["vtep_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["mm_state"] = "MmState" + fieldNameMap["status"] = "Status" + fieldNameMap["vtep_ip"] = "VtepIp" + paramsTypeMap["vtep_ip"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["mm_state"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["status"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["vtep_ip"] = "vtep_ip" + queryParams["mm_state"] = "mm_state" + queryParams["status"] = "status" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-nodes/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/transport_nodes/StatusClient.go b/services/nsxt-mp/nsx/transport_nodes/StatusClient.go new file mode 100644 index 000000000..605451159 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/StatusClient.go @@ -0,0 +1,135 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package transport_nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Get high-level summary of all transport nodes. The service layer does not support source = realtime or cached. + // + // @param nodeTypeParam Transport node type (optional) + // @return com.vmware.nsx.model.HeatMapTransportZoneStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nodeTypeParam *string) (model.HeatMapTransportZoneStatus, error) + + // Read status of a transport node + // + // @param nodeIdParam ID of transport node (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.TransportNodeStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get0(nodeIdParam string, sourceParam *string) (model.TransportNodeStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "get_0": core.NewMethodIdentifier(interfaceIdentifier, "get_0"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(nodeTypeParam *string) (model.HeatMapTransportZoneStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("NodeType", nodeTypeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.HeatMapTransportZoneStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.status", "get", inputDataValue, executionContext) + var emptyOutput model.HeatMapTransportZoneStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.HeatMapTransportZoneStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statusClient) Get0(nodeIdParam string, sourceParam *string) (model.TransportNodeStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGet0InputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportNodeStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGet0RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.status", "get_0", inputDataValue, executionContext) + var emptyOutput model.TransportNodeStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGet0OutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportNodeStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/transport_nodes/StatusTypes.go b/services/nsxt-mp/nsx/transport_nodes/StatusTypes.go new file mode 100644 index 000000000..ab6a2a580 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/StatusTypes.go @@ -0,0 +1,136 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package transport_nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``nodeType`` of method Status#get. +const Status_GET_NODE_TYPE_HOST = "HOST" + +// Possible value for ``nodeType`` of method Status#get. +const Status_GET_NODE_TYPE_EDGE = "EDGE" + +// Possible value for ``source`` of method Status#get0. +const Status_GET_0_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Status#get0. +const Status_GET_0_SOURCE_CACHED = "cached" + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_type"] = "NodeType" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.HeatMapTransportZoneStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_type"] = "NodeType" + paramsTypeMap["node_type"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["node_type"] = "node_type" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-nodes/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statusGet0InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGet0OutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportNodeStatusBindingType) +} + +func statusGet0RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-nodes/{nodeId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/transport_nodes/TransportNodesPackageTypes.go b/services/nsxt-mp/nsx/transport_nodes/TransportNodesPackageTypes.go new file mode 100644 index 000000000..a44de61e6 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/TransportNodesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.transport_nodes. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package transport_nodes diff --git a/services/nsxt-mp/nsx/transport_nodes/TunnelsClient.go b/services/nsxt-mp/nsx/transport_nodes/TunnelsClient.go new file mode 100644 index 000000000..8f5b8ee4a --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/TunnelsClient.go @@ -0,0 +1,155 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Tunnels +// Used by client-side stubs. + +package transport_nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type TunnelsClient interface { + + // Tunnel properties + // + // @param nodeIdParam ID of transport node (required) + // @param tunnelNameParam Tunnel name (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.TunnelProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nodeIdParam string, tunnelNameParam string, sourceParam *string) (model.TunnelProperties, error) + + // List of tunnels + // + // @param nodeIdParam ID of transport node (required) + // @param bfdDiagnosticCodeParam BFD diagnostic code of Tunnel as defined in RFC 5880 (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param remoteNodeIdParam (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param sourceParam Data source type. (optional) + // @param statusParam Tunnel status (optional) + // @return com.vmware.nsx.model.TunnelList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(nodeIdParam string, bfdDiagnosticCodeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, remoteNodeIdParam *string, sortAscendingParam *bool, sortByParam *string, sourceParam *string, statusParam *string) (model.TunnelList, error) +} + +type tunnelsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewTunnelsClient(connector client.Connector) *tunnelsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes.tunnels") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + tIface := tunnelsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &tIface +} + +func (tIface *tunnelsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := tIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (tIface *tunnelsClient) Get(nodeIdParam string, tunnelNameParam string, sourceParam *string) (model.TunnelProperties, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(tunnelsGetInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("TunnelName", tunnelNameParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TunnelProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tunnelsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.tunnels", "get", inputDataValue, executionContext) + var emptyOutput model.TunnelProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), tunnelsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TunnelProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *tunnelsClient) List(nodeIdParam string, bfdDiagnosticCodeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, remoteNodeIdParam *string, sortAscendingParam *bool, sortByParam *string, sourceParam *string, statusParam *string) (model.TunnelList, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(tunnelsListInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("BfdDiagnosticCode", bfdDiagnosticCodeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("RemoteNodeId", remoteNodeIdParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Source", sourceParam) + sv.AddStructField("Status", statusParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TunnelList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tunnelsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.tunnels", "list", inputDataValue, executionContext) + var emptyOutput model.TunnelList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), tunnelsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TunnelList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/transport_nodes/TunnelsTypes.go b/services/nsxt-mp/nsx/transport_nodes/TunnelsTypes.go new file mode 100644 index 000000000..27eec2671 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/TunnelsTypes.go @@ -0,0 +1,258 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Tunnels. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package transport_nodes + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Tunnels#get. +const Tunnels_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Tunnels#get. +const Tunnels_GET_SOURCE_CACHED = "cached" + +// Possible value for ``bfdDiagnosticCode`` of method Tunnels#list. +const Tunnels_LIST_BFD_DIAGNOSTIC_CODE_0 = "0" + +// Possible value for ``bfdDiagnosticCode`` of method Tunnels#list. +const Tunnels_LIST_BFD_DIAGNOSTIC_CODE_NO_DIAGNOSTIC = "NO_DIAGNOSTIC" + +// Possible value for ``bfdDiagnosticCode`` of method Tunnels#list. +const Tunnels_LIST_BFD_DIAGNOSTIC_CODE_1 = "1" + +// Possible value for ``bfdDiagnosticCode`` of method Tunnels#list. +const Tunnels_LIST_BFD_DIAGNOSTIC_CODE_CONTROL_DETECTION_TIME_EXPIRED = "CONTROL_DETECTION_TIME_EXPIRED" + +// Possible value for ``bfdDiagnosticCode`` of method Tunnels#list. +const Tunnels_LIST_BFD_DIAGNOSTIC_CODE_2 = "2" + +// Possible value for ``bfdDiagnosticCode`` of method Tunnels#list. +const Tunnels_LIST_BFD_DIAGNOSTIC_CODE_ECHO_FUNCTION_FAILED = "ECHO_FUNCTION_FAILED" + +// Possible value for ``bfdDiagnosticCode`` of method Tunnels#list. +const Tunnels_LIST_BFD_DIAGNOSTIC_CODE_3 = "3" + +// Possible value for ``bfdDiagnosticCode`` of method Tunnels#list. +const Tunnels_LIST_BFD_DIAGNOSTIC_CODE_NEIGHBOR_SIGNALED_SESSION_DOWN = "NEIGHBOR_SIGNALED_SESSION_DOWN" + +// Possible value for ``bfdDiagnosticCode`` of method Tunnels#list. +const Tunnels_LIST_BFD_DIAGNOSTIC_CODE_4 = "4" + +// Possible value for ``bfdDiagnosticCode`` of method Tunnels#list. +const Tunnels_LIST_BFD_DIAGNOSTIC_CODE_FORWARDING_PLANE_RESET = "FORWARDING_PLANE_RESET" + +// Possible value for ``bfdDiagnosticCode`` of method Tunnels#list. +const Tunnels_LIST_BFD_DIAGNOSTIC_CODE_5 = "5" + +// Possible value for ``bfdDiagnosticCode`` of method Tunnels#list. +const Tunnels_LIST_BFD_DIAGNOSTIC_CODE_PATH_DOWN = "PATH_DOWN" + +// Possible value for ``bfdDiagnosticCode`` of method Tunnels#list. +const Tunnels_LIST_BFD_DIAGNOSTIC_CODE_6 = "6" + +// Possible value for ``bfdDiagnosticCode`` of method Tunnels#list. +const Tunnels_LIST_BFD_DIAGNOSTIC_CODE_CONCATENATED_PATH_DOWN = "CONCATENATED_PATH_DOWN" + +// Possible value for ``bfdDiagnosticCode`` of method Tunnels#list. +const Tunnels_LIST_BFD_DIAGNOSTIC_CODE_7 = "7" + +// Possible value for ``bfdDiagnosticCode`` of method Tunnels#list. +const Tunnels_LIST_BFD_DIAGNOSTIC_CODE_ADMINISTRATIVELY_DOWN = "ADMINISTRATIVELY_DOWN" + +// Possible value for ``bfdDiagnosticCode`` of method Tunnels#list. +const Tunnels_LIST_BFD_DIAGNOSTIC_CODE_8 = "8" + +// Possible value for ``bfdDiagnosticCode`` of method Tunnels#list. +const Tunnels_LIST_BFD_DIAGNOSTIC_CODE_REVERSE_CONCATENATED_PATH_DOWN = "REVERSE_CONCATENATED_PATH_DOWN" + +// Possible value for ``source`` of method Tunnels#list. +const Tunnels_LIST_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Tunnels#list. +const Tunnels_LIST_SOURCE_CACHED = "cached" + +// Possible value for ``status`` of method Tunnels#list. +const Tunnels_LIST_STATUS_UP = "UP" + +// Possible value for ``status`` of method Tunnels#list. +const Tunnels_LIST_STATUS_DOWN = "DOWN" + +func tunnelsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fields["tunnel_name"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["tunnel_name"] = "TunnelName" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tunnelsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TunnelPropertiesBindingType) +} + +func tunnelsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fields["tunnel_name"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["tunnel_name"] = "TunnelName" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["tunnel_name"] = bindings.NewStringType() + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + paramsTypeMap["tunnelName"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + pathParams["tunnel_name"] = "tunnelName" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-nodes/{nodeId}/tunnels/{tunnelName}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func tunnelsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fields["bfd_diagnostic_code"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["remote_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["bfd_diagnostic_code"] = "BfdDiagnosticCode" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["remote_node_id"] = "RemoteNodeId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tunnelsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TunnelListBindingType) +} + +func tunnelsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fields["bfd_diagnostic_code"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["remote_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["bfd_diagnostic_code"] = "BfdDiagnosticCode" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["remote_node_id"] = "RemoteNodeId" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["status"] = "Status" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["remote_node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["bfd_diagnostic_code"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["status"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["bfd_diagnostic_code"] = "bfd_diagnostic_code" + queryParams["sort_by"] = "sort_by" + queryParams["source"] = "source" + queryParams["page_size"] = "page_size" + queryParams["remote_node_id"] = "remote_node_id" + queryParams["status"] = "status" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-nodes/{nodeId}/tunnels", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/transport_nodes/inter_site/InterSitePackageTypes.go b/services/nsxt-mp/nsx/transport_nodes/inter_site/InterSitePackageTypes.go new file mode 100644 index 000000000..5651bf028 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/inter_site/InterSitePackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.transport_nodes.inter_site. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package inter_site diff --git a/services/nsxt-mp/nsx/transport_nodes/inter_site/StatisticsClient.go b/services/nsxt-mp/nsx/transport_nodes/inter_site/StatisticsClient.go new file mode 100644 index 000000000..55cbfc1f0 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/inter_site/StatisticsClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Statistics +// Used by client-side stubs. + +package inter_site + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatisticsClient interface { + + // Returns RTEP to RTEP tunnel port statistics of the given edge node. It always returns realtime response. + // + // @param edgeNodeIdParam (required) + // @return com.vmware.nsx.model.NodeInterSiteStatistics + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(edgeNodeIdParam string) (model.NodeInterSiteStatistics, error) +} + +type statisticsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatisticsClient(connector client.Connector) *statisticsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes.inter_site.statistics") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statisticsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statisticsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statisticsClient) Get(edgeNodeIdParam string) (model.NodeInterSiteStatistics, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statisticsGetInputType(), typeConverter) + sv.AddStructField("EdgeNodeId", edgeNodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeInterSiteStatistics + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statisticsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.inter_site.statistics", "get", inputDataValue, executionContext) + var emptyOutput model.NodeInterSiteStatistics + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statisticsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeInterSiteStatistics), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/transport_nodes/inter_site/StatisticsTypes.go b/services/nsxt-mp/nsx/transport_nodes/inter_site/StatisticsTypes.go new file mode 100644 index 000000000..79c5365fe --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/inter_site/StatisticsTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Statistics. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package inter_site + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statisticsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["edge_node_id"] = bindings.NewStringType() + fieldNameMap["edge_node_id"] = "EdgeNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statisticsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeInterSiteStatisticsBindingType) +} + +func statisticsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["edge_node_id"] = bindings.NewStringType() + fieldNameMap["edge_node_id"] = "EdgeNodeId" + paramsTypeMap["edge_node_id"] = bindings.NewStringType() + paramsTypeMap["edgeNodeId"] = bindings.NewStringType() + pathParams["edge_node_id"] = "edgeNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-nodes/{edgeNodeId}/inter-site/statistics", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/BgpPackageTypes.go b/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/BgpPackageTypes.go new file mode 100644 index 000000000..453648408 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/BgpPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.transport_nodes.inter_site.bgp. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package bgp diff --git a/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/NeighborsClient.go b/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/NeighborsClient.go new file mode 100644 index 000000000..23e24f833 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/NeighborsClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Neighbors +// Used by client-side stubs. + +package bgp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NeighborsClient interface { + + // Paginated list of BGP Neighbors on edge transport node. + // + // @param edgeNodeIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.BgpNeighborListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(edgeNodeIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.BgpNeighborListResult, error) +} + +type neighborsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNeighborsClient(connector client.Connector) *neighborsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes.inter_site.bgp.neighbors") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := neighborsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *neighborsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *neighborsClient) List(edgeNodeIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.BgpNeighborListResult, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(neighborsListInputType(), typeConverter) + sv.AddStructField("EdgeNodeId", edgeNodeIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BgpNeighborListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := neighborsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.inter_site.bgp.neighbors", "list", inputDataValue, executionContext) + var emptyOutput model.BgpNeighborListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), neighborsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BgpNeighborListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/NeighborsTypes.go b/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/NeighborsTypes.go new file mode 100644 index 000000000..3618ab74a --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/NeighborsTypes.go @@ -0,0 +1,99 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Neighbors. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package bgp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func neighborsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["edge_node_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_node_id"] = "EdgeNodeId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func neighborsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BgpNeighborListResultBindingType) +} + +func neighborsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["edge_node_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["edge_node_id"] = "EdgeNodeId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["edge_node_id"] = bindings.NewStringType() + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["edgeNodeId"] = bindings.NewStringType() + pathParams["edge_node_id"] = "edgeNodeId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-nodes/{edgeNodeId}/inter-site/bgp/neighbors", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/SummaryClient.go b/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/SummaryClient.go new file mode 100644 index 000000000..f01e7e651 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/SummaryClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Summary +// Used by client-side stubs. + +package bgp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SummaryClient interface { + + // Returns BGP summary for all configured neighbors in tunnel VRF on the given egde node. It always returns realtime response. + // + // @param edgeNodeIdParam (required) + // @return com.vmware.nsx.model.InterSiteBgpSummary + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(edgeNodeIdParam string) (model.InterSiteBgpSummary, error) +} + +type summaryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSummaryClient(connector client.Connector) *summaryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes.inter_site.bgp.summary") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := summaryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *summaryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *summaryClient) Get(edgeNodeIdParam string) (model.InterSiteBgpSummary, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(summaryGetInputType(), typeConverter) + sv.AddStructField("EdgeNodeId", edgeNodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.InterSiteBgpSummary + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := summaryGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.inter_site.bgp.summary", "get", inputDataValue, executionContext) + var emptyOutput model.InterSiteBgpSummary + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), summaryGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.InterSiteBgpSummary), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/SummaryTypes.go b/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/SummaryTypes.go new file mode 100644 index 000000000..b28fe4770 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/SummaryTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Summary. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package bgp + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func summaryGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["edge_node_id"] = bindings.NewStringType() + fieldNameMap["edge_node_id"] = "EdgeNodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func summaryGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.InterSiteBgpSummaryBindingType) +} + +func summaryGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["edge_node_id"] = bindings.NewStringType() + fieldNameMap["edge_node_id"] = "EdgeNodeId" + paramsTypeMap["edge_node_id"] = bindings.NewStringType() + paramsTypeMap["edgeNodeId"] = bindings.NewStringType() + pathParams["edge_node_id"] = "edgeNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-nodes/{edgeNodeId}/inter-site/bgp/summary", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/neighbors/AdvertisedRoutesClient.go b/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/neighbors/AdvertisedRoutesClient.go new file mode 100644 index 000000000..92115351d --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/neighbors/AdvertisedRoutesClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: AdvertisedRoutes +// Used by client-side stubs. + +package neighbors + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AdvertisedRoutesClient interface { + + // Returns routes advertised by BGP neighbor from the given edge transport node. It always returns realtime response. + // + // @param edgeNodeIdParam (required) + // @param neighborIdParam (required) + // @return com.vmware.nsx.model.BgpNeighborRouteDetails + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(edgeNodeIdParam string, neighborIdParam string) (model.BgpNeighborRouteDetails, error) +} + +type advertisedRoutesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAdvertisedRoutesClient(connector client.Connector) *advertisedRoutesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes.inter_site.bgp.neighbors.advertised_routes") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := advertisedRoutesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *advertisedRoutesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *advertisedRoutesClient) Get(edgeNodeIdParam string, neighborIdParam string) (model.BgpNeighborRouteDetails, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(advertisedRoutesGetInputType(), typeConverter) + sv.AddStructField("EdgeNodeId", edgeNodeIdParam) + sv.AddStructField("NeighborId", neighborIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BgpNeighborRouteDetails + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := advertisedRoutesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.inter_site.bgp.neighbors.advertised_routes", "get", inputDataValue, executionContext) + var emptyOutput model.BgpNeighborRouteDetails + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), advertisedRoutesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BgpNeighborRouteDetails), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/neighbors/AdvertisedRoutesTypes.go b/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/neighbors/AdvertisedRoutesTypes.go new file mode 100644 index 000000000..a9b9781a5 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/neighbors/AdvertisedRoutesTypes.go @@ -0,0 +1,76 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: AdvertisedRoutes. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package neighbors + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func advertisedRoutesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["edge_node_id"] = bindings.NewStringType() + fields["neighbor_id"] = bindings.NewStringType() + fieldNameMap["edge_node_id"] = "EdgeNodeId" + fieldNameMap["neighbor_id"] = "NeighborId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func advertisedRoutesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BgpNeighborRouteDetailsBindingType) +} + +func advertisedRoutesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["edge_node_id"] = bindings.NewStringType() + fields["neighbor_id"] = bindings.NewStringType() + fieldNameMap["edge_node_id"] = "EdgeNodeId" + fieldNameMap["neighbor_id"] = "NeighborId" + paramsTypeMap["neighbor_id"] = bindings.NewStringType() + paramsTypeMap["edge_node_id"] = bindings.NewStringType() + paramsTypeMap["edgeNodeId"] = bindings.NewStringType() + paramsTypeMap["neighborId"] = bindings.NewStringType() + pathParams["neighbor_id"] = "neighborId" + pathParams["edge_node_id"] = "edgeNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-nodes/{edgeNodeId}/inter-site/bgp/neighbors/{neighborId}/advertised-routes", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/neighbors/NeighborsPackageTypes.go b/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/neighbors/NeighborsPackageTypes.go new file mode 100644 index 000000000..578fb2aec --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/neighbors/NeighborsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.transport_nodes.inter_site.bgp.neighbors. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package neighbors diff --git a/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/neighbors/RoutesClient.go b/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/neighbors/RoutesClient.go new file mode 100644 index 000000000..d6f5895f0 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/neighbors/RoutesClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Routes +// Used by client-side stubs. + +package neighbors + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RoutesClient interface { + + // Returns routes learned by BGP neighbor from the given edge transport node. It always returns realtime response. + // + // @param edgeNodeIdParam (required) + // @param neighborIdParam (required) + // @return com.vmware.nsx.model.BgpNeighborRouteDetails + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(edgeNodeIdParam string, neighborIdParam string) (model.BgpNeighborRouteDetails, error) +} + +type routesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRoutesClient(connector client.Connector) *routesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes.inter_site.bgp.neighbors.routes") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := routesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *routesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *routesClient) Get(edgeNodeIdParam string, neighborIdParam string) (model.BgpNeighborRouteDetails, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(routesGetInputType(), typeConverter) + sv.AddStructField("EdgeNodeId", edgeNodeIdParam) + sv.AddStructField("NeighborId", neighborIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.BgpNeighborRouteDetails + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := routesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.inter_site.bgp.neighbors.routes", "get", inputDataValue, executionContext) + var emptyOutput model.BgpNeighborRouteDetails + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), routesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.BgpNeighborRouteDetails), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/neighbors/RoutesTypes.go b/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/neighbors/RoutesTypes.go new file mode 100644 index 000000000..196c03c9a --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/inter_site/bgp/neighbors/RoutesTypes.go @@ -0,0 +1,76 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Routes. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package neighbors + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func routesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["edge_node_id"] = bindings.NewStringType() + fields["neighbor_id"] = bindings.NewStringType() + fieldNameMap["edge_node_id"] = "EdgeNodeId" + fieldNameMap["neighbor_id"] = "NeighborId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func routesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.BgpNeighborRouteDetailsBindingType) +} + +func routesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["edge_node_id"] = bindings.NewStringType() + fields["neighbor_id"] = bindings.NewStringType() + fieldNameMap["edge_node_id"] = "EdgeNodeId" + fieldNameMap["neighbor_id"] = "NeighborId" + paramsTypeMap["neighbor_id"] = bindings.NewStringType() + paramsTypeMap["edge_node_id"] = bindings.NewStringType() + paramsTypeMap["edgeNodeId"] = bindings.NewStringType() + paramsTypeMap["neighborId"] = bindings.NewStringType() + pathParams["neighbor_id"] = "neighborId" + pathParams["edge_node_id"] = "edgeNodeId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-nodes/{edgeNodeId}/inter-site/bgp/neighbors/{neighborId}/routes", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/transport_nodes/network/InterfacesClient.go b/services/nsxt-mp/nsx/transport_nodes/network/InterfacesClient.go new file mode 100644 index 000000000..bfa1e484c --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/network/InterfacesClient.go @@ -0,0 +1,141 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Interfaces +// Used by client-side stubs. + +package network + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type InterfacesClient interface { + + // Returns detailed information about the specified interface. Interface information includes MTU, broadcast and host IP addresses, link and admin status, MAC address, network mask, and the IP configuration method (static or DHCP). + // + // @param transportNodeIdParam (required) + // @param interfaceIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.NodeInterfaceProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(transportNodeIdParam string, interfaceIdParam string, sourceParam *string) (model.NodeInterfaceProperties, error) + + // Returns the number of interfaces on the node and detailed information about each interface. Interface information includes MTU, broadcast and host IP addresses, link and admin status, MAC address, network mask, and the IP configuration method (static or DHCP). + // + // @param transportNodeIdParam (required) + // @param adminStatusParam Admin status of the interface (optional) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.NodeInterfacePropertiesListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(transportNodeIdParam string, adminStatusParam *string, sourceParam *string) (model.NodeInterfacePropertiesListResult, error) +} + +type interfacesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewInterfacesClient(connector client.Connector) *interfacesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes.network.interfaces") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := interfacesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *interfacesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *interfacesClient) Get(transportNodeIdParam string, interfaceIdParam string, sourceParam *string) (model.NodeInterfaceProperties, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(interfacesGetInputType(), typeConverter) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + sv.AddStructField("InterfaceId", interfaceIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeInterfaceProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := interfacesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.network.interfaces", "get", inputDataValue, executionContext) + var emptyOutput model.NodeInterfaceProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), interfacesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeInterfaceProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *interfacesClient) List(transportNodeIdParam string, adminStatusParam *string, sourceParam *string) (model.NodeInterfacePropertiesListResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(interfacesListInputType(), typeConverter) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + sv.AddStructField("AdminStatus", adminStatusParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeInterfacePropertiesListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := interfacesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.network.interfaces", "list", inputDataValue, executionContext) + var emptyOutput model.NodeInterfacePropertiesListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), interfacesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeInterfacePropertiesListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/transport_nodes/network/InterfacesTypes.go b/services/nsxt-mp/nsx/transport_nodes/network/InterfacesTypes.go new file mode 100644 index 000000000..031f1ef77 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/network/InterfacesTypes.go @@ -0,0 +1,162 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Interfaces. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package network + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Interfaces#get. +const Interfaces_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Interfaces#get. +const Interfaces_GET_SOURCE_CACHED = "cached" + +// Possible value for ``adminStatus`` of method Interfaces#list. +const Interfaces_LIST_ADMIN_STATUS_UP = "UP" + +// Possible value for ``adminStatus`` of method Interfaces#list. +const Interfaces_LIST_ADMIN_STATUS_DOWN = "DOWN" + +// Possible value for ``source`` of method Interfaces#list. +const Interfaces_LIST_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Interfaces#list. +const Interfaces_LIST_SOURCE_CACHED = "cached" + +func interfacesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_id"] = bindings.NewStringType() + fields["interface_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["interface_id"] = "InterfaceId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func interfacesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeInterfacePropertiesBindingType) +} + +func interfacesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_id"] = bindings.NewStringType() + fields["interface_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["interface_id"] = "InterfaceId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["interface_id"] = bindings.NewStringType() + paramsTypeMap["transport_node_id"] = bindings.NewStringType() + paramsTypeMap["transportNodeId"] = bindings.NewStringType() + paramsTypeMap["interfaceId"] = bindings.NewStringType() + pathParams["transport_node_id"] = "transportNodeId" + pathParams["interface_id"] = "interfaceId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-nodes/{transportNodeId}/network/interfaces/{interfaceId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func interfacesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_id"] = bindings.NewStringType() + fields["admin_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["admin_status"] = "AdminStatus" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func interfacesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeInterfacePropertiesListResultBindingType) +} + +func interfacesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_id"] = bindings.NewStringType() + fields["admin_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["admin_status"] = "AdminStatus" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["transport_node_id"] = bindings.NewStringType() + paramsTypeMap["admin_status"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["transportNodeId"] = bindings.NewStringType() + pathParams["transport_node_id"] = "transportNodeId" + queryParams["admin_status"] = "admin_status" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-nodes/{transportNodeId}/network/interfaces", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/transport_nodes/network/NetworkPackageTypes.go b/services/nsxt-mp/nsx/transport_nodes/network/NetworkPackageTypes.go new file mode 100644 index 000000000..88a47013f --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/network/NetworkPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.transport_nodes.network. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package network diff --git a/services/nsxt-mp/nsx/transport_nodes/network/interfaces/InterfacesPackageTypes.go b/services/nsxt-mp/nsx/transport_nodes/network/interfaces/InterfacesPackageTypes.go new file mode 100644 index 000000000..69f5ee454 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/network/interfaces/InterfacesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.transport_nodes.network.interfaces. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package interfaces diff --git a/services/nsxt-mp/nsx/transport_nodes/network/interfaces/StatsClient.go b/services/nsxt-mp/nsx/transport_nodes/network/interfaces/StatsClient.go new file mode 100644 index 000000000..0db17d980 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/network/interfaces/StatsClient.go @@ -0,0 +1,94 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Stats +// Used by client-side stubs. + +package interfaces + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatsClient interface { + + // On the specified interface, returns the number of received (rx), transmitted (tx), and dropped packets; the number of bytes and errors received and transmitted on the interface; and the number of detected collisions. + // + // @param transportNodeIdParam (required) + // @param interfaceIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.NodeInterfaceStatisticsProperties + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(transportNodeIdParam string, interfaceIdParam string, sourceParam *string) (model.NodeInterfaceStatisticsProperties, error) +} + +type statsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatsClient(connector client.Connector) *statsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes.network.interfaces.stats") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statsClient) Get(transportNodeIdParam string, interfaceIdParam string, sourceParam *string) (model.NodeInterfaceStatisticsProperties, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statsGetInputType(), typeConverter) + sv.AddStructField("TransportNodeId", transportNodeIdParam) + sv.AddStructField("InterfaceId", interfaceIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeInterfaceStatisticsProperties + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.network.interfaces.stats", "get", inputDataValue, executionContext) + var emptyOutput model.NodeInterfaceStatisticsProperties + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeInterfaceStatisticsProperties), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/transport_nodes/network/interfaces/StatsTypes.go b/services/nsxt-mp/nsx/transport_nodes/network/interfaces/StatsTypes.go new file mode 100644 index 000000000..22ec9dbc4 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/network/interfaces/StatsTypes.go @@ -0,0 +1,88 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Stats. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package interfaces + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Stats#get. +const Stats_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Stats#get. +const Stats_GET_SOURCE_CACHED = "cached" + +func statsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["transport_node_id"] = bindings.NewStringType() + fields["interface_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["interface_id"] = "InterfaceId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeInterfaceStatisticsPropertiesBindingType) +} + +func statsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["transport_node_id"] = bindings.NewStringType() + fields["interface_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["transport_node_id"] = "TransportNodeId" + fieldNameMap["interface_id"] = "InterfaceId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["interface_id"] = bindings.NewStringType() + paramsTypeMap["transport_node_id"] = bindings.NewStringType() + paramsTypeMap["transportNodeId"] = bindings.NewStringType() + paramsTypeMap["interfaceId"] = bindings.NewStringType() + pathParams["transport_node_id"] = "transportNodeId" + pathParams["interface_id"] = "interfaceId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-nodes/{transportNodeId}/network/interfaces/{interfaceId}/stats", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/transport_nodes/statistics/NatRulesClient.go b/services/nsxt-mp/nsx/transport_nodes/statistics/NatRulesClient.go new file mode 100644 index 000000000..8665a1360 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/statistics/NatRulesClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: NatRules +// Used by client-side stubs. + +package statistics + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NatRulesClient interface { + + // Returns the summation of statistics for all rules from all logical routers which are present on given transport node. Only cached statistics are supported. The query parameter \"source=realtime\" is not supported. + // + // @param nodeIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.NatStatisticsPerTransportNode + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(nodeIdParam string, sourceParam *string) (model.NatStatisticsPerTransportNode, error) +} + +type natRulesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNatRulesClient(connector client.Connector) *natRulesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_nodes.statistics.nat_rules") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := natRulesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *natRulesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *natRulesClient) Get(nodeIdParam string, sourceParam *string) (model.NatStatisticsPerTransportNode, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(natRulesGetInputType(), typeConverter) + sv.AddStructField("NodeId", nodeIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NatStatisticsPerTransportNode + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := natRulesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_nodes.statistics.nat_rules", "get", inputDataValue, executionContext) + var emptyOutput model.NatStatisticsPerTransportNode + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), natRulesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NatStatisticsPerTransportNode), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/transport_nodes/statistics/NatRulesTypes.go b/services/nsxt-mp/nsx/transport_nodes/statistics/NatRulesTypes.go new file mode 100644 index 000000000..d974bdf9c --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/statistics/NatRulesTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: NatRules. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package statistics + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method NatRules#get. +const NatRules_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method NatRules#get. +const NatRules_GET_SOURCE_CACHED = "cached" + +func natRulesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["node_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func natRulesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NatStatisticsPerTransportNodeBindingType) +} + +func natRulesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["node_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["node_id"] = "NodeId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["node_id"] = bindings.NewStringType() + paramsTypeMap["nodeId"] = bindings.NewStringType() + pathParams["node_id"] = "nodeId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-nodes/{nodeId}/statistics/nat-rules", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/transport_nodes/statistics/StatisticsPackageTypes.go b/services/nsxt-mp/nsx/transport_nodes/statistics/StatisticsPackageTypes.go new file mode 100644 index 000000000..023cfa7e7 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_nodes/statistics/StatisticsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.transport_nodes.statistics. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package statistics diff --git a/services/nsxt-mp/nsx/transport_zones/StatusClient.go b/services/nsxt-mp/nsx/transport_zones/StatusClient.go new file mode 100644 index 000000000..c4851cdac --- /dev/null +++ b/services/nsxt-mp/nsx/transport_zones/StatusClient.go @@ -0,0 +1,132 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package transport_zones + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Get high-level summary of a transport zone. The service layer does not support source = realtime or cached. + // @return com.vmware.nsx.model.HeatMapTransportNodesAggregateStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.HeatMapTransportNodesAggregateStatus, error) + + // Get high-level summary of a transport zone + // + // @param zoneIdParam ID of transport zone (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.HeatMapTransportZoneStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get0(zoneIdParam string, sourceParam *string) (model.HeatMapTransportZoneStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_zones.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "get_0": core.NewMethodIdentifier(interfaceIdentifier, "get_0"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get() (model.HeatMapTransportNodesAggregateStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.HeatMapTransportNodesAggregateStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_zones.status", "get", inputDataValue, executionContext) + var emptyOutput model.HeatMapTransportNodesAggregateStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.HeatMapTransportNodesAggregateStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statusClient) Get0(zoneIdParam string, sourceParam *string) (model.HeatMapTransportZoneStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGet0InputType(), typeConverter) + sv.AddStructField("ZoneId", zoneIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.HeatMapTransportZoneStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGet0RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_zones.status", "get_0", inputDataValue, executionContext) + var emptyOutput model.HeatMapTransportZoneStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGet0OutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.HeatMapTransportZoneStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/transport_zones/StatusTypes.go b/services/nsxt-mp/nsx/transport_zones/StatusTypes.go new file mode 100644 index 000000000..707255cbd --- /dev/null +++ b/services/nsxt-mp/nsx/transport_zones/StatusTypes.go @@ -0,0 +1,124 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package transport_zones + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Status#get0. +const Status_GET_0_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Status#get0. +const Status_GET_0_SOURCE_CACHED = "cached" + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.HeatMapTransportNodesAggregateStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-zones/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statusGet0InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["zone_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["zone_id"] = "ZoneId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGet0OutputType() bindings.BindingType { + return bindings.NewReferenceType(model.HeatMapTransportZoneStatusBindingType) +} + +func statusGet0RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["zone_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["zone_id"] = "ZoneId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["zone_id"] = bindings.NewStringType() + paramsTypeMap["zoneId"] = bindings.NewStringType() + pathParams["zone_id"] = "zoneId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-zones/{zoneId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/transport_zones/SummaryClient.go b/services/nsxt-mp/nsx/transport_zones/SummaryClient.go new file mode 100644 index 000000000..61b5152a8 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_zones/SummaryClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Summary +// Used by client-side stubs. + +package transport_zones + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SummaryClient interface { + + // Returns information about a specified transport zone, including the number of logical switches in the transport zone, number of logical spitch ports assigned to the transport zone, and number of transport nodes in the transport zone. + // + // @param zoneIdParam (required) + // @return com.vmware.nsx.model.TransportZoneStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(zoneIdParam string) (model.TransportZoneStatus, error) +} + +type summaryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSummaryClient(connector client.Connector) *summaryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_zones.summary") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := summaryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *summaryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *summaryClient) Get(zoneIdParam string) (model.TransportZoneStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(summaryGetInputType(), typeConverter) + sv.AddStructField("ZoneId", zoneIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportZoneStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := summaryGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_zones.summary", "get", inputDataValue, executionContext) + var emptyOutput model.TransportZoneStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), summaryGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportZoneStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/transport_zones/SummaryTypes.go b/services/nsxt-mp/nsx/transport_zones/SummaryTypes.go new file mode 100644 index 000000000..d098e848f --- /dev/null +++ b/services/nsxt-mp/nsx/transport_zones/SummaryTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Summary. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package transport_zones + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func summaryGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["zone_id"] = bindings.NewStringType() + fieldNameMap["zone_id"] = "ZoneId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func summaryGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportZoneStatusBindingType) +} + +func summaryGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["zone_id"] = bindings.NewStringType() + fieldNameMap["zone_id"] = "ZoneId" + paramsTypeMap["zone_id"] = bindings.NewStringType() + paramsTypeMap["zoneId"] = bindings.NewStringType() + pathParams["zone_id"] = "zoneId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-zones/{zoneId}/summary", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/transport_zones/TransportNodeStatusClient.go b/services/nsxt-mp/nsx/transport_zones/TransportNodeStatusClient.go new file mode 100644 index 000000000..a67b8435d --- /dev/null +++ b/services/nsxt-mp/nsx/transport_zones/TransportNodeStatusClient.go @@ -0,0 +1,159 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: TransportNodeStatus +// Used by client-side stubs. + +package transport_zones + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type TransportNodeStatusClient interface { + + // Read status of all the transport nodes + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param sourceParam Data source type. (optional) + // @param statusParam Transport node (optional) + // @return com.vmware.nsx.model.TransportNodeStatusListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Getall(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, sourceParam *string, statusParam *string) (model.TransportNodeStatusListResult, error) + + // Read status of transport nodes in a transport zone + // + // @param zoneIdParam ID of transport zone (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param sourceParam Data source type. (optional) + // @param statusParam Transport node (optional) + // @return com.vmware.nsx.model.TransportNodeStatusListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(zoneIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, sourceParam *string, statusParam *string) (model.TransportNodeStatusListResult, error) +} + +type transportNodeStatusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewTransportNodeStatusClient(connector client.Connector) *transportNodeStatusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.transport_zones.transport_node_status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "getall": core.NewMethodIdentifier(interfaceIdentifier, "getall"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + tIface := transportNodeStatusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &tIface +} + +func (tIface *transportNodeStatusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := tIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (tIface *transportNodeStatusClient) Getall(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, sourceParam *string, statusParam *string) (model.TransportNodeStatusListResult, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodeStatusGetallInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Source", sourceParam) + sv.AddStructField("Status", statusParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportNodeStatusListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodeStatusGetallRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_zones.transport_node_status", "getall", inputDataValue, executionContext) + var emptyOutput model.TransportNodeStatusListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportNodeStatusGetallOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportNodeStatusListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *transportNodeStatusClient) List(zoneIdParam string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, sourceParam *string, statusParam *string) (model.TransportNodeStatusListResult, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(transportNodeStatusListInputType(), typeConverter) + sv.AddStructField("ZoneId", zoneIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Source", sourceParam) + sv.AddStructField("Status", statusParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TransportNodeStatusListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := transportNodeStatusListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.transport_zones.transport_node_status", "list", inputDataValue, executionContext) + var emptyOutput model.TransportNodeStatusListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), transportNodeStatusListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TransportNodeStatusListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/transport_zones/TransportNodeStatusTypes.go b/services/nsxt-mp/nsx/transport_zones/TransportNodeStatusTypes.go new file mode 100644 index 000000000..5e9c52110 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_zones/TransportNodeStatusTypes.go @@ -0,0 +1,232 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: TransportNodeStatus. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package transport_zones + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method TransportNodeStatus#getall. +const TransportNodeStatus_GETALL_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method TransportNodeStatus#getall. +const TransportNodeStatus_GETALL_SOURCE_CACHED = "cached" + +// Possible value for ``status`` of method TransportNodeStatus#getall. +const TransportNodeStatus_GETALL_STATUS_UP = "UP" + +// Possible value for ``status`` of method TransportNodeStatus#getall. +const TransportNodeStatus_GETALL_STATUS_DOWN = "DOWN" + +// Possible value for ``status`` of method TransportNodeStatus#getall. +const TransportNodeStatus_GETALL_STATUS_DEGRADED = "DEGRADED" + +// Possible value for ``status`` of method TransportNodeStatus#getall. +const TransportNodeStatus_GETALL_STATUS_UNKNOWN = "UNKNOWN" + +// Possible value for ``source`` of method TransportNodeStatus#list. +const TransportNodeStatus_LIST_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method TransportNodeStatus#list. +const TransportNodeStatus_LIST_SOURCE_CACHED = "cached" + +// Possible value for ``status`` of method TransportNodeStatus#list. +const TransportNodeStatus_LIST_STATUS_UP = "UP" + +// Possible value for ``status`` of method TransportNodeStatus#list. +const TransportNodeStatus_LIST_STATUS_DOWN = "DOWN" + +// Possible value for ``status`` of method TransportNodeStatus#list. +const TransportNodeStatus_LIST_STATUS_DEGRADED = "DEGRADED" + +// Possible value for ``status`` of method TransportNodeStatus#list. +const TransportNodeStatus_LIST_STATUS_UNKNOWN = "UNKNOWN" + +func transportNodeStatusGetallInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodeStatusGetallOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportNodeStatusListResultBindingType) +} + +func transportNodeStatusGetallRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["status"] = "Status" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["status"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["source"] = "source" + queryParams["page_size"] = "page_size" + queryParams["status"] = "status" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-zones/transport-node-status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func transportNodeStatusListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["zone_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["zone_id"] = "ZoneId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["status"] = "Status" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func transportNodeStatusListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TransportNodeStatusListResultBindingType) +} + +func transportNodeStatusListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["zone_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["status"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["zone_id"] = "ZoneId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["source"] = "Source" + fieldNameMap["status"] = "Status" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["zone_id"] = bindings.NewStringType() + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["status"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["zoneId"] = bindings.NewStringType() + pathParams["zone_id"] = "zoneId" + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["source"] = "source" + queryParams["page_size"] = "page_size" + queryParams["status"] = "status" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/transport-zones/{zoneId}/transport-node-status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/transport_zones/TransportZonesPackageTypes.go b/services/nsxt-mp/nsx/transport_zones/TransportZonesPackageTypes.go new file mode 100644 index 000000000..c0e317561 --- /dev/null +++ b/services/nsxt-mp/nsx/transport_zones/TransportZonesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.transport_zones. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package transport_zones diff --git a/services/nsxt-mp/nsx/trust_management/CertificateProfileClient.go b/services/nsxt-mp/nsx/trust_management/CertificateProfileClient.go new file mode 100644 index 000000000..ea84d36ee --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/CertificateProfileClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: CertificateProfile +// Used by client-side stubs. + +package trust_management + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type CertificateProfileClient interface { + + // Get an available certificate profile. Note that not every service type has an active certificate profile. + // + // @param serviceTypeParam Unique Service Type of the Certificate Profile (required) + // @return com.vmware.nsx.model.CertificateProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceTypeParam string) (model.CertificateProfile, error) +} + +type certificateProfileClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewCertificateProfileClient(connector client.Connector) *certificateProfileClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.trust_management.certificate_profile") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := certificateProfileClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *certificateProfileClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *certificateProfileClient) Get(serviceTypeParam string) (model.CertificateProfile, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(certificateProfileGetInputType(), typeConverter) + sv.AddStructField("ServiceType", serviceTypeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CertificateProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := certificateProfileGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.certificate_profile", "get", inputDataValue, executionContext) + var emptyOutput model.CertificateProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), certificateProfileGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CertificateProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/trust_management/CertificateProfileTypes.go b/services/nsxt-mp/nsx/trust_management/CertificateProfileTypes.go new file mode 100644 index 000000000..7333ad87e --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/CertificateProfileTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: CertificateProfile. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package trust_management + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func certificateProfileGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_type"] = bindings.NewStringType() + fieldNameMap["service_type"] = "ServiceType" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func certificateProfileGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CertificateProfileBindingType) +} + +func certificateProfileGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_type"] = bindings.NewStringType() + fieldNameMap["service_type"] = "ServiceType" + paramsTypeMap["service_type"] = bindings.NewStringType() + paramsTypeMap["serviceType"] = bindings.NewStringType() + pathParams["service_type"] = "serviceType" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/trust-management/certificate-profile/{serviceType}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/trust_management/CertificateProfilesClient.go b/services/nsxt-mp/nsx/trust_management/CertificateProfilesClient.go new file mode 100644 index 000000000..97d3b6141 --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/CertificateProfilesClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: CertificateProfiles +// Used by client-side stubs. + +package trust_management + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type CertificateProfilesClient interface { + + // List the certificate profiles currently active on the NSX Manager. This list depends on the type of instance deployed and which certificates are currently managed through the certificate-profile manager. That list is expected to expand in future releases. + // @return com.vmware.nsx.model.CertificateProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.CertificateProfileListResult, error) +} + +type certificateProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewCertificateProfilesClient(connector client.Connector) *certificateProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.trust_management.certificate_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := certificateProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *certificateProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *certificateProfilesClient) List() (model.CertificateProfileListResult, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(certificateProfilesListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CertificateProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := certificateProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.certificate_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.CertificateProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), certificateProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CertificateProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/trust_management/CertificateProfilesTypes.go b/services/nsxt-mp/nsx/trust_management/CertificateProfilesTypes.go new file mode 100644 index 000000000..6ba640d17 --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/CertificateProfilesTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: CertificateProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package trust_management + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func certificateProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func certificateProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CertificateProfileListResultBindingType) +} + +func certificateProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/trust-management/certificate-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/trust_management/CertificatesClient.go b/services/nsxt-mp/nsx/trust_management/CertificatesClient.go new file mode 100644 index 000000000..1fc84cb1f --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/CertificatesClient.go @@ -0,0 +1,383 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Certificates +// Used by client-side stubs. + +package trust_management + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type CertificatesClient interface { + + // Look up the Certificate Profile matching the service-type and apply the certificate. When the Certificate Profile has cluster_certificate=false, the node_id parameter is required to designate the node where the certificate needs to be applied. + // + // @param certIdParam ID of certificate to apply (required) + // @param serviceTypeParam Supported service types, that are using certificates. (required) + // @param nodeIdParam Node Id (optional) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Applycertificate(certIdParam string, serviceTypeParam string, nodeIdParam *string) error + + // Removes the specified certificate. The private key associated with the certificate is also deleted. + // + // @param certIdParam ID of certificate to delete (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(certIdParam string) error + + // Returns information for the specified certificate ID, including the certificate's UUID; resource_type (for example, certificate_self_signed, certificate_ca, or certificate_signed); pem_encoded data; and history of the certificate (who created or modified it and when). For additional information, include the ?details=true modifier at the end of the request URI. + // + // @param certIdParam ID of certificate to read (required) + // @param detailsParam whether to expand the pem data and show all its details (optional, default to false) + // @return com.vmware.nsx.model.Certificate + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(certIdParam string, detailsParam *bool) (model.Certificate, error) + + // Adds a new private-public certificate or a chain of certificates (CAs) and, optionally, a private key that can be applied to one of the user-facing components (appliance management or edge). The certificate and the key should be stored in PEM format. If no private key is provided, the certificate is used as a client certificate in the trust store. A private key can be uploaded for a CA certificate only if the \"purpose\" parameter is set to \"signing-ca\". + // + // @param trustObjectDataParam (required) + // @return com.vmware.nsx.model.CertificateList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Importcertificate(trustObjectDataParam model.TrustObjectData) (model.CertificateList, error) + + // Returns all certificate information viewable by the user, including each certificate's UUID; resource_type (for example, certificate_self_signed, certificate_ca, or certificate_signed); pem_encoded data; and history of the certificate (who created or modified it and when). For additional information, include the ?details=true modifier at the end of the request URI. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param detailsParam whether to expand the pem data and show all its details (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param type_Param Type of certificate to return (optional) + // @return com.vmware.nsx.model.CertificateList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, detailsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, type_Param *string) (model.CertificateList, error) + + // Set a certificate that has been imported to be the Appliance Proxy certificate used for communicating with Appliance Proxies on other sites. + // + // @param setInterSiteAphCertificateRequestParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Setapplianceproxycertificateforintersitecommunication(setInterSiteAphCertificateRequestParam model.SetInterSiteAphCertificateRequest) error + + // Set a certificate that has been imported to be either the principal identity certificate for the local cluster with either GM or LM service type. Currently, the service type specified must match the current service type of the local cluster. + // + // @param setPrincipalIdentityCertificateForFederationRequestParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Setpicertificateforfederation(setPrincipalIdentityCertificateForFederationRequestParam model.SetPrincipalIdentityCertificateForFederationRequest) error + + // Checks whether certificate is valid. When the certificate contains a chain, the full chain is validated. The usage parameter can be SERVER (default) or CLIENT. This indicates whether the certificate needs to be validated as a server-auth or a client-auth certificate. + // + // @param certIdParam ID of certificate to validate (required) + // @param usageParam Usage Type of the Certificate, SERVER or CLIENT. Default is SERVER (optional) + // @return com.vmware.nsx.model.CertificateCheckingStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Validate(certIdParam string, usageParam *string) (model.CertificateCheckingStatus, error) +} + +type certificatesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewCertificatesClient(connector client.Connector) *certificatesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.trust_management.certificates") + methodIdentifiers := map[string]core.MethodIdentifier{ + "applycertificate": core.NewMethodIdentifier(interfaceIdentifier, "applycertificate"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "importcertificate": core.NewMethodIdentifier(interfaceIdentifier, "importcertificate"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "setapplianceproxycertificateforintersitecommunication": core.NewMethodIdentifier(interfaceIdentifier, "setapplianceproxycertificateforintersitecommunication"), + "setpicertificateforfederation": core.NewMethodIdentifier(interfaceIdentifier, "setpicertificateforfederation"), + "validate": core.NewMethodIdentifier(interfaceIdentifier, "validate"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := certificatesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *certificatesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *certificatesClient) Applycertificate(certIdParam string, serviceTypeParam string, nodeIdParam *string) error { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(certificatesApplycertificateInputType(), typeConverter) + sv.AddStructField("CertId", certIdParam) + sv.AddStructField("ServiceType", serviceTypeParam) + sv.AddStructField("NodeId", nodeIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := certificatesApplycertificateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.certificates", "applycertificate", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *certificatesClient) Delete(certIdParam string) error { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(certificatesDeleteInputType(), typeConverter) + sv.AddStructField("CertId", certIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := certificatesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.certificates", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *certificatesClient) Get(certIdParam string, detailsParam *bool) (model.Certificate, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(certificatesGetInputType(), typeConverter) + sv.AddStructField("CertId", certIdParam) + sv.AddStructField("Details", detailsParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Certificate + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := certificatesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.certificates", "get", inputDataValue, executionContext) + var emptyOutput model.Certificate + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), certificatesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Certificate), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *certificatesClient) Importcertificate(trustObjectDataParam model.TrustObjectData) (model.CertificateList, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(certificatesImportcertificateInputType(), typeConverter) + sv.AddStructField("TrustObjectData", trustObjectDataParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CertificateList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := certificatesImportcertificateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.certificates", "importcertificate", inputDataValue, executionContext) + var emptyOutput model.CertificateList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), certificatesImportcertificateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CertificateList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *certificatesClient) List(cursorParam *string, detailsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, type_Param *string) (model.CertificateList, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(certificatesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("Details", detailsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Type_", type_Param) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CertificateList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := certificatesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.certificates", "list", inputDataValue, executionContext) + var emptyOutput model.CertificateList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), certificatesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CertificateList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *certificatesClient) Setapplianceproxycertificateforintersitecommunication(setInterSiteAphCertificateRequestParam model.SetInterSiteAphCertificateRequest) error { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(certificatesSetapplianceproxycertificateforintersitecommunicationInputType(), typeConverter) + sv.AddStructField("SetInterSiteAphCertificateRequest", setInterSiteAphCertificateRequestParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := certificatesSetapplianceproxycertificateforintersitecommunicationRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.certificates", "setapplianceproxycertificateforintersitecommunication", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *certificatesClient) Setpicertificateforfederation(setPrincipalIdentityCertificateForFederationRequestParam model.SetPrincipalIdentityCertificateForFederationRequest) error { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(certificatesSetpicertificateforfederationInputType(), typeConverter) + sv.AddStructField("SetPrincipalIdentityCertificateForFederationRequest", setPrincipalIdentityCertificateForFederationRequestParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := certificatesSetpicertificateforfederationRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.certificates", "setpicertificateforfederation", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *certificatesClient) Validate(certIdParam string, usageParam *string) (model.CertificateCheckingStatus, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(certificatesValidateInputType(), typeConverter) + sv.AddStructField("CertId", certIdParam) + sv.AddStructField("Usage", usageParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CertificateCheckingStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := certificatesValidateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.certificates", "validate", inputDataValue, executionContext) + var emptyOutput model.CertificateCheckingStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), certificatesValidateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CertificateCheckingStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/trust_management/CertificatesTypes.go b/services/nsxt-mp/nsx/trust_management/CertificatesTypes.go new file mode 100644 index 000000000..95eb50757 --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/CertificatesTypes.go @@ -0,0 +1,520 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Certificates. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package trust_management + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``serviceType`` of method Certificates#applycertificate. +const Certificates_APPLYCERTIFICATE_SERVICE_TYPE_MGMT_CLUSTER = "MGMT_CLUSTER" + +// Possible value for ``serviceType`` of method Certificates#applycertificate. +const Certificates_APPLYCERTIFICATE_SERVICE_TYPE_MGMT_PLANE = "MGMT_PLANE" + +// Possible value for ``serviceType`` of method Certificates#applycertificate. +const Certificates_APPLYCERTIFICATE_SERVICE_TYPE_API = "API" + +// Possible value for ``serviceType`` of method Certificates#applycertificate. +const Certificates_APPLYCERTIFICATE_SERVICE_TYPE_NOTIFICATION_COLLECTOR = "NOTIFICATION_COLLECTOR" + +// Possible value for ``serviceType`` of method Certificates#applycertificate. +const Certificates_APPLYCERTIFICATE_SERVICE_TYPE_SYSLOG_SERVER = "SYSLOG_SERVER" + +// Possible value for ``serviceType`` of method Certificates#applycertificate. +const Certificates_APPLYCERTIFICATE_SERVICE_TYPE_RSYSLOG_CLIENT = "RSYSLOG_CLIENT" + +// Possible value for ``serviceType`` of method Certificates#applycertificate. +const Certificates_APPLYCERTIFICATE_SERVICE_TYPE_APH = "APH" + +// Possible value for ``serviceType`` of method Certificates#applycertificate. +const Certificates_APPLYCERTIFICATE_SERVICE_TYPE_GLOBAL_MANAGER = "GLOBAL_MANAGER" + +// Possible value for ``serviceType`` of method Certificates#applycertificate. +const Certificates_APPLYCERTIFICATE_SERVICE_TYPE_LOCAL_MANAGER = "LOCAL_MANAGER" + +// Possible value for ``serviceType`` of method Certificates#applycertificate. +const Certificates_APPLYCERTIFICATE_SERVICE_TYPE_CLIENT_AUTH = "CLIENT_AUTH" + +// Possible value for ``serviceType`` of method Certificates#applycertificate. +const Certificates_APPLYCERTIFICATE_SERVICE_TYPE_RMQ = "RMQ" + +// Possible value for ``serviceType`` of method Certificates#applycertificate. +const Certificates_APPLYCERTIFICATE_SERVICE_TYPE_K8S_MSG_CLIENT = "K8S_MSG_CLIENT" + +// Possible value for ``serviceType`` of method Certificates#applycertificate. +const Certificates_APPLYCERTIFICATE_SERVICE_TYPE_WEB_PROXY = "WEB_PROXY" + +// Possible value for ``type`` of method Certificates#list. +const Certificates_LIST_TYPE_CERTIFICATE = "cluster_api_certificate" + +// Possible value for ``usage`` of method Certificates#validate. +const Certificates_VALIDATE_USAGE_SERVER = "SERVER" + +// Possible value for ``usage`` of method Certificates#validate. +const Certificates_VALIDATE_USAGE_CLIENT = "CLIENT" + +func certificatesApplycertificateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cert_id"] = bindings.NewStringType() + fields["service_type"] = bindings.NewStringType() + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cert_id"] = "CertId" + fieldNameMap["service_type"] = "ServiceType" + fieldNameMap["node_id"] = "NodeId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func certificatesApplycertificateOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func certificatesApplycertificateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cert_id"] = bindings.NewStringType() + fields["service_type"] = bindings.NewStringType() + fields["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cert_id"] = "CertId" + fieldNameMap["service_type"] = "ServiceType" + fieldNameMap["node_id"] = "NodeId" + paramsTypeMap["cert_id"] = bindings.NewStringType() + paramsTypeMap["node_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_type"] = bindings.NewStringType() + paramsTypeMap["certId"] = bindings.NewStringType() + pathParams["cert_id"] = "certId" + queryParams["service_type"] = "service_type" + queryParams["node_id"] = "node_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=apply_certificate", + "", + "POST", + "/api/v1/trust-management/certificates/{certId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func certificatesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cert_id"] = bindings.NewStringType() + fieldNameMap["cert_id"] = "CertId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func certificatesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func certificatesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cert_id"] = bindings.NewStringType() + fieldNameMap["cert_id"] = "CertId" + paramsTypeMap["cert_id"] = bindings.NewStringType() + paramsTypeMap["certId"] = bindings.NewStringType() + pathParams["cert_id"] = "certId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/trust-management/certificates/{certId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func certificatesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cert_id"] = bindings.NewStringType() + fields["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["cert_id"] = "CertId" + fieldNameMap["details"] = "Details" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func certificatesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CertificateBindingType) +} + +func certificatesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cert_id"] = bindings.NewStringType() + fields["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["cert_id"] = "CertId" + fieldNameMap["details"] = "Details" + paramsTypeMap["cert_id"] = bindings.NewStringType() + paramsTypeMap["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["certId"] = bindings.NewStringType() + pathParams["cert_id"] = "certId" + queryParams["details"] = "details" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/trust-management/certificates/{certId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func certificatesImportcertificateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["trust_object_data"] = bindings.NewReferenceType(model.TrustObjectDataBindingType) + fieldNameMap["trust_object_data"] = "TrustObjectData" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func certificatesImportcertificateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CertificateListBindingType) +} + +func certificatesImportcertificateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["trust_object_data"] = bindings.NewReferenceType(model.TrustObjectDataBindingType) + fieldNameMap["trust_object_data"] = "TrustObjectData" + paramsTypeMap["trust_object_data"] = bindings.NewReferenceType(model.TrustObjectDataBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=import", + "trust_object_data", + "POST", + "/api/v1/trust-management/certificates", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func certificatesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["details"] = "Details" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func certificatesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CertificateListBindingType) +} + +func certificatesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["details"] = "Details" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["details"] = "details" + queryParams["sort_by"] = "sort_by" + queryParams["type"] = "type" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/trust-management/certificates", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func certificatesSetapplianceproxycertificateforintersitecommunicationInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["set_inter_site_aph_certificate_request"] = bindings.NewReferenceType(model.SetInterSiteAphCertificateRequestBindingType) + fieldNameMap["set_inter_site_aph_certificate_request"] = "SetInterSiteAphCertificateRequest" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func certificatesSetapplianceproxycertificateforintersitecommunicationOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func certificatesSetapplianceproxycertificateforintersitecommunicationRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["set_inter_site_aph_certificate_request"] = bindings.NewReferenceType(model.SetInterSiteAphCertificateRequestBindingType) + fieldNameMap["set_inter_site_aph_certificate_request"] = "SetInterSiteAphCertificateRequest" + paramsTypeMap["set_inter_site_aph_certificate_request"] = bindings.NewReferenceType(model.SetInterSiteAphCertificateRequestBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=set_appliance_proxy_certificate_for_inter_site_communication", + "set_inter_site_aph_certificate_request", + "POST", + "/api/v1/trust-management/certificates", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func certificatesSetpicertificateforfederationInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["set_principal_identity_certificate_for_federation_request"] = bindings.NewReferenceType(model.SetPrincipalIdentityCertificateForFederationRequestBindingType) + fieldNameMap["set_principal_identity_certificate_for_federation_request"] = "SetPrincipalIdentityCertificateForFederationRequest" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func certificatesSetpicertificateforfederationOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func certificatesSetpicertificateforfederationRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["set_principal_identity_certificate_for_federation_request"] = bindings.NewReferenceType(model.SetPrincipalIdentityCertificateForFederationRequestBindingType) + fieldNameMap["set_principal_identity_certificate_for_federation_request"] = "SetPrincipalIdentityCertificateForFederationRequest" + paramsTypeMap["set_principal_identity_certificate_for_federation_request"] = bindings.NewReferenceType(model.SetPrincipalIdentityCertificateForFederationRequestBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=set_pi_certificate_for_federation", + "set_principal_identity_certificate_for_federation_request", + "POST", + "/api/v1/trust-management/certificates", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func certificatesValidateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cert_id"] = bindings.NewStringType() + fields["usage"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cert_id"] = "CertId" + fieldNameMap["usage"] = "Usage" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func certificatesValidateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CertificateCheckingStatusBindingType) +} + +func certificatesValidateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cert_id"] = bindings.NewStringType() + fields["usage"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cert_id"] = "CertId" + fieldNameMap["usage"] = "Usage" + paramsTypeMap["usage"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cert_id"] = bindings.NewStringType() + paramsTypeMap["certId"] = bindings.NewStringType() + pathParams["cert_id"] = "certId" + queryParams["usage"] = "usage" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=validate", + "", + "GET", + "/api/v1/trust-management/certificates/{certId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/trust_management/CrlDistributionPointsClient.go b/services/nsxt-mp/nsx/trust_management/CrlDistributionPointsClient.go new file mode 100644 index 000000000..57394a90a --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/CrlDistributionPointsClient.go @@ -0,0 +1,265 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: CrlDistributionPoints +// Used by client-side stubs. + +package trust_management + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type CrlDistributionPointsClient interface { + + // Create an entity that will represent a Crl Distribution Point + // + // @param crlDistributionPointParam (required) + // @return com.vmware.nsx.model.CrlDistributionPoint + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(crlDistributionPointParam model.CrlDistributionPoint) (model.CrlDistributionPoint, error) + + // Delete a CrlDistributionPoint. It does not delete the actual CRL. + // + // @param crlDistributionPointIdParam Unique id of the CrlDistributionPoint to delete (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(crlDistributionPointIdParam string) error + + // Return the CrlDistributionPoint with + // + // @param crlDistributionPointIdParam (required) + // @return com.vmware.nsx.model.CrlDistributionPoint + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(crlDistributionPointIdParam string) (model.CrlDistributionPoint, error) + + // Return the list of CrlDistributionPoints + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.CrlDistributionPointList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.CrlDistributionPointList, error) + + // Update CrlDistributionPoint with This allows updating the ManagedResource fields. + // + // @param crlDistributionPointIdParam (required) + // @param crlDistributionPointParam (required) + // @return com.vmware.nsx.model.CrlDistributionPoint + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(crlDistributionPointIdParam string, crlDistributionPointParam model.CrlDistributionPoint) (model.CrlDistributionPoint, error) +} + +type crlDistributionPointsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewCrlDistributionPointsClient(connector client.Connector) *crlDistributionPointsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.trust_management.crl_distribution_points") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := crlDistributionPointsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *crlDistributionPointsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *crlDistributionPointsClient) Create(crlDistributionPointParam model.CrlDistributionPoint) (model.CrlDistributionPoint, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(crlDistributionPointsCreateInputType(), typeConverter) + sv.AddStructField("CrlDistributionPoint", crlDistributionPointParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CrlDistributionPoint + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := crlDistributionPointsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.crl_distribution_points", "create", inputDataValue, executionContext) + var emptyOutput model.CrlDistributionPoint + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), crlDistributionPointsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CrlDistributionPoint), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *crlDistributionPointsClient) Delete(crlDistributionPointIdParam string) error { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(crlDistributionPointsDeleteInputType(), typeConverter) + sv.AddStructField("CrlDistributionPointId", crlDistributionPointIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := crlDistributionPointsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.crl_distribution_points", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *crlDistributionPointsClient) Get(crlDistributionPointIdParam string) (model.CrlDistributionPoint, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(crlDistributionPointsGetInputType(), typeConverter) + sv.AddStructField("CrlDistributionPointId", crlDistributionPointIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CrlDistributionPoint + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := crlDistributionPointsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.crl_distribution_points", "get", inputDataValue, executionContext) + var emptyOutput model.CrlDistributionPoint + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), crlDistributionPointsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CrlDistributionPoint), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *crlDistributionPointsClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.CrlDistributionPointList, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(crlDistributionPointsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CrlDistributionPointList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := crlDistributionPointsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.crl_distribution_points", "list", inputDataValue, executionContext) + var emptyOutput model.CrlDistributionPointList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), crlDistributionPointsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CrlDistributionPointList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *crlDistributionPointsClient) Update(crlDistributionPointIdParam string, crlDistributionPointParam model.CrlDistributionPoint) (model.CrlDistributionPoint, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(crlDistributionPointsUpdateInputType(), typeConverter) + sv.AddStructField("CrlDistributionPointId", crlDistributionPointIdParam) + sv.AddStructField("CrlDistributionPoint", crlDistributionPointParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CrlDistributionPoint + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := crlDistributionPointsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.crl_distribution_points", "update", inputDataValue, executionContext) + var emptyOutput model.CrlDistributionPoint + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), crlDistributionPointsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CrlDistributionPoint), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/trust_management/CrlDistributionPointsTypes.go b/services/nsxt-mp/nsx/trust_management/CrlDistributionPointsTypes.go new file mode 100644 index 000000000..3862ee9be --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/CrlDistributionPointsTypes.go @@ -0,0 +1,295 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: CrlDistributionPoints. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package trust_management + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func crlDistributionPointsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["crl_distribution_point"] = bindings.NewReferenceType(model.CrlDistributionPointBindingType) + fieldNameMap["crl_distribution_point"] = "CrlDistributionPoint" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func crlDistributionPointsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CrlDistributionPointBindingType) +} + +func crlDistributionPointsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["crl_distribution_point"] = bindings.NewReferenceType(model.CrlDistributionPointBindingType) + fieldNameMap["crl_distribution_point"] = "CrlDistributionPoint" + paramsTypeMap["crl_distribution_point"] = bindings.NewReferenceType(model.CrlDistributionPointBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "crl_distribution_point", + "POST", + "/api/v1/trust-management/crl-distribution-points", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func crlDistributionPointsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["crl_distribution_point_id"] = bindings.NewStringType() + fieldNameMap["crl_distribution_point_id"] = "CrlDistributionPointId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func crlDistributionPointsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func crlDistributionPointsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["crl_distribution_point_id"] = bindings.NewStringType() + fieldNameMap["crl_distribution_point_id"] = "CrlDistributionPointId" + paramsTypeMap["crl_distribution_point_id"] = bindings.NewStringType() + paramsTypeMap["crlDistributionPointId"] = bindings.NewStringType() + pathParams["crl_distribution_point_id"] = "crlDistributionPointId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/trust-management/crl-distribution-points/{crlDistributionPointId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func crlDistributionPointsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["crl_distribution_point_id"] = bindings.NewStringType() + fieldNameMap["crl_distribution_point_id"] = "CrlDistributionPointId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func crlDistributionPointsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CrlDistributionPointBindingType) +} + +func crlDistributionPointsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["crl_distribution_point_id"] = bindings.NewStringType() + fieldNameMap["crl_distribution_point_id"] = "CrlDistributionPointId" + paramsTypeMap["crl_distribution_point_id"] = bindings.NewStringType() + paramsTypeMap["crlDistributionPointId"] = bindings.NewStringType() + pathParams["crl_distribution_point_id"] = "crlDistributionPointId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/trust-management/crl-distribution-points/{crlDistributionPointId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func crlDistributionPointsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func crlDistributionPointsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CrlDistributionPointListBindingType) +} + +func crlDistributionPointsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/trust-management/crl-distribution-points", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func crlDistributionPointsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["crl_distribution_point_id"] = bindings.NewStringType() + fields["crl_distribution_point"] = bindings.NewReferenceType(model.CrlDistributionPointBindingType) + fieldNameMap["crl_distribution_point_id"] = "CrlDistributionPointId" + fieldNameMap["crl_distribution_point"] = "CrlDistributionPoint" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func crlDistributionPointsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CrlDistributionPointBindingType) +} + +func crlDistributionPointsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["crl_distribution_point_id"] = bindings.NewStringType() + fields["crl_distribution_point"] = bindings.NewReferenceType(model.CrlDistributionPointBindingType) + fieldNameMap["crl_distribution_point_id"] = "CrlDistributionPointId" + fieldNameMap["crl_distribution_point"] = "CrlDistributionPoint" + paramsTypeMap["crl_distribution_point"] = bindings.NewReferenceType(model.CrlDistributionPointBindingType) + paramsTypeMap["crl_distribution_point_id"] = bindings.NewStringType() + paramsTypeMap["crlDistributionPointId"] = bindings.NewStringType() + pathParams["crl_distribution_point_id"] = "crlDistributionPointId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "crl_distribution_point", + "PUT", + "/api/v1/trust-management/crl-distribution-points/{crlDistributionPointId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/trust_management/CrlsClient.go b/services/nsxt-mp/nsx/trust_management/CrlsClient.go new file mode 100644 index 000000000..d65c68e57 --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/CrlsClient.go @@ -0,0 +1,271 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Crls +// Used by client-side stubs. + +package trust_management + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type CrlsClient interface { + + // Deletes an existing CRL. + // + // @param crlIdParam ID of CRL to delete (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(crlIdParam string) error + + // Returns information about the specified CRL. For additional information, include the ?details=true modifier at the end of the request URI. + // + // @param crlIdParam ID of CRL to read (required) + // @param detailsParam whether to expand the pem data and show all its details (optional, default to false) + // @return com.vmware.nsx.model.Crl + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(crlIdParam string, detailsParam *bool) (model.Crl, error) + + // Adds a new certificate revocation list (CRL). The CRL is used to verify the client certificate status against the revocation lists published by the CA. For this reason, the administrator needs to add the CRL in certificate repository as well. A CRL can be in the PEM X.509 format (crl_type=X509) or JSON OneCRL (crl_type=OneCRL). If crl_type is not specified, it is auto-detected based on the presence of fields pem_encoded or one_crl. + // + // @param crlObjectDataParam (required) + // @return com.vmware.nsx.model.CrlList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Importcrl(crlObjectDataParam model.CrlObjectData) (model.CrlList, error) + + // Returns information about all CRLs. For additional information, include the ?details=true modifier at the end of the request URI. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param detailsParam whether to expand the pem data and show all its details (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param type_Param Type of certificate to return (optional) + // @return com.vmware.nsx.model.CrlList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, detailsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, type_Param *string) (model.CrlList, error) + + // Updates an existing CRL. + // + // @param crlIdParam ID of CRL to update (required) + // @param crlParam (required) + // @return com.vmware.nsx.model.Crl + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(crlIdParam string, crlParam model.Crl) (model.Crl, error) +} + +type crlsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewCrlsClient(connector client.Connector) *crlsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.trust_management.crls") + methodIdentifiers := map[string]core.MethodIdentifier{ + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "importcrl": core.NewMethodIdentifier(interfaceIdentifier, "importcrl"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := crlsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *crlsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *crlsClient) Delete(crlIdParam string) error { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(crlsDeleteInputType(), typeConverter) + sv.AddStructField("CrlId", crlIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := crlsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.crls", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *crlsClient) Get(crlIdParam string, detailsParam *bool) (model.Crl, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(crlsGetInputType(), typeConverter) + sv.AddStructField("CrlId", crlIdParam) + sv.AddStructField("Details", detailsParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Crl + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := crlsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.crls", "get", inputDataValue, executionContext) + var emptyOutput model.Crl + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), crlsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Crl), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *crlsClient) Importcrl(crlObjectDataParam model.CrlObjectData) (model.CrlList, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(crlsImportcrlInputType(), typeConverter) + sv.AddStructField("CrlObjectData", crlObjectDataParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CrlList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := crlsImportcrlRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.crls", "importcrl", inputDataValue, executionContext) + var emptyOutput model.CrlList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), crlsImportcrlOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CrlList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *crlsClient) List(cursorParam *string, detailsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, type_Param *string) (model.CrlList, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(crlsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("Details", detailsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Type_", type_Param) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CrlList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := crlsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.crls", "list", inputDataValue, executionContext) + var emptyOutput model.CrlList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), crlsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CrlList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *crlsClient) Update(crlIdParam string, crlParam model.Crl) (model.Crl, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(crlsUpdateInputType(), typeConverter) + sv.AddStructField("CrlId", crlIdParam) + sv.AddStructField("Crl", crlParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Crl + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := crlsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.crls", "update", inputDataValue, executionContext) + var emptyOutput model.Crl + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), crlsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Crl), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/trust_management/CrlsTypes.go b/services/nsxt-mp/nsx/trust_management/CrlsTypes.go new file mode 100644 index 000000000..becc1165f --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/CrlsTypes.go @@ -0,0 +1,316 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Crls. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package trust_management + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``type`` of method Crls#list. +const Crls_LIST_TYPE_CERTIFICATE = "cluster_api_certificate" + +func crlsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["crl_id"] = bindings.NewStringType() + fieldNameMap["crl_id"] = "CrlId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func crlsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func crlsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["crl_id"] = bindings.NewStringType() + fieldNameMap["crl_id"] = "CrlId" + paramsTypeMap["crl_id"] = bindings.NewStringType() + paramsTypeMap["crlId"] = bindings.NewStringType() + pathParams["crl_id"] = "crlId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/trust-management/crls/{crlId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func crlsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["crl_id"] = bindings.NewStringType() + fields["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["crl_id"] = "CrlId" + fieldNameMap["details"] = "Details" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func crlsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CrlBindingType) +} + +func crlsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["crl_id"] = bindings.NewStringType() + fields["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["crl_id"] = "CrlId" + fieldNameMap["details"] = "Details" + paramsTypeMap["crl_id"] = bindings.NewStringType() + paramsTypeMap["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["crlId"] = bindings.NewStringType() + pathParams["crl_id"] = "crlId" + queryParams["details"] = "details" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/trust-management/crls/{crlId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func crlsImportcrlInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["crl_object_data"] = bindings.NewReferenceType(model.CrlObjectDataBindingType) + fieldNameMap["crl_object_data"] = "CrlObjectData" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func crlsImportcrlOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CrlListBindingType) +} + +func crlsImportcrlRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["crl_object_data"] = bindings.NewReferenceType(model.CrlObjectDataBindingType) + fieldNameMap["crl_object_data"] = "CrlObjectData" + paramsTypeMap["crl_object_data"] = bindings.NewReferenceType(model.CrlObjectDataBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=import", + "crl_object_data", + "POST", + "/api/v1/trust-management/crls", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func crlsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["details"] = "Details" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func crlsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CrlListBindingType) +} + +func crlsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["details"] = "Details" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["details"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["details"] = "details" + queryParams["sort_by"] = "sort_by" + queryParams["type"] = "type" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/trust-management/crls", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func crlsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["crl_id"] = bindings.NewStringType() + fields["crl"] = bindings.NewReferenceType(model.CrlBindingType) + fieldNameMap["crl_id"] = "CrlId" + fieldNameMap["crl"] = "Crl" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func crlsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CrlBindingType) +} + +func crlsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["crl_id"] = bindings.NewStringType() + fields["crl"] = bindings.NewReferenceType(model.CrlBindingType) + fieldNameMap["crl_id"] = "CrlId" + fieldNameMap["crl"] = "Crl" + paramsTypeMap["crl"] = bindings.NewReferenceType(model.CrlBindingType) + paramsTypeMap["crl_id"] = bindings.NewStringType() + paramsTypeMap["crlId"] = bindings.NewStringType() + pathParams["crl_id"] = "crlId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "crl", + "PUT", + "/api/v1/trust-management/crls/{crlId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/trust_management/CsrsClient.go b/services/nsxt-mp/nsx/trust_management/CsrsClient.go new file mode 100644 index 000000000..ecc361dd8 --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/CsrsClient.go @@ -0,0 +1,353 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Csrs +// Used by client-side stubs. + +package trust_management + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type CsrsClient interface { + + // Creates a new certificate signing request (CSR). A CSR is encrypted text that contains information about your organization (organization name, country, and so on) and your Web server's public key, which is a public certificate the is generated on the server that can be used to forward this request to a certificate authority (CA). A private key is also usually created at the same time as the CSR. + // + // @param csrParam (required) + // @return com.vmware.nsx.model.Csr + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(csrParam model.Csr) (model.Csr, error) + + // Removes a specified CSR. If a CSR is not used for verification, you can delete it. + // + // @param csrIdParam ID of CSR to delete (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(csrIdParam string) error + + // Returns information about the specified CSR. + // + // @param csrIdParam ID of CSR to read (required) + // @return com.vmware.nsx.model.Csr + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(csrIdParam string) (model.Csr, error) + + // Imports a certificate authority (CA)-signed certificate for a CSR. This action links the certificate to the private key created by the CSR. The pem_encoded string in the request body is the signed certificate provided by your CA in response to the CSR that you provide to them. After this operation you can delete the CSR. + // + // @param csrIdParam CSR this certificate is associated with (required) + // @param trustObjectDataParam (required) + // @return com.vmware.nsx.model.CertificateList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Importcsr(csrIdParam string, trustObjectDataParam model.TrustObjectData) (model.CertificateList, error) + + // Returns information about all of the CSRs that have been created. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.CsrList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.CsrList, error) + + // Self-signs the previously generated CSR. This action is similar to the import certificate action, but instead of using a public certificate signed by a CA, the self_sign POST action uses a certificate that is signed with NSX's own private key. For validity of non-CA certificates, if a value greater than 825 days is provided, it will be set to 825 days. No limit is set for CA certificates. + // + // @param csrIdParam CSR this certificate is associated with (required) + // @param daysValidParam Number of days the certificate will be valid, default 825 days (required) + // @return com.vmware.nsx.model.Certificate + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Selfsign(csrIdParam string, daysValidParam int64) (model.Certificate, error) + + // Creates a new self-signed certificate. A private key is also created at the same time. This is convenience call that will generate a CSR and then self-sign it. For validity of non-CA certificates, if a value greater than 825 days is provided, it will be set to 825 days. No limit is set for CA certificates. + // + // @param csrWithDaysValidParam (required) + // @return com.vmware.nsx.model.Certificate + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Selfsign0(csrWithDaysValidParam model.CsrWithDaysValid) (model.Certificate, error) +} + +type csrsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewCsrsClient(connector client.Connector) *csrsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.trust_management.csrs") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "importcsr": core.NewMethodIdentifier(interfaceIdentifier, "importcsr"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "selfsign": core.NewMethodIdentifier(interfaceIdentifier, "selfsign"), + "selfsign_0": core.NewMethodIdentifier(interfaceIdentifier, "selfsign_0"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := csrsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *csrsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *csrsClient) Create(csrParam model.Csr) (model.Csr, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(csrsCreateInputType(), typeConverter) + sv.AddStructField("Csr", csrParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Csr + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := csrsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.csrs", "create", inputDataValue, executionContext) + var emptyOutput model.Csr + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), csrsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Csr), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *csrsClient) Delete(csrIdParam string) error { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(csrsDeleteInputType(), typeConverter) + sv.AddStructField("CsrId", csrIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := csrsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.csrs", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (cIface *csrsClient) Get(csrIdParam string) (model.Csr, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(csrsGetInputType(), typeConverter) + sv.AddStructField("CsrId", csrIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Csr + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := csrsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.csrs", "get", inputDataValue, executionContext) + var emptyOutput model.Csr + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), csrsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Csr), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *csrsClient) Importcsr(csrIdParam string, trustObjectDataParam model.TrustObjectData) (model.CertificateList, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(csrsImportcsrInputType(), typeConverter) + sv.AddStructField("CsrId", csrIdParam) + sv.AddStructField("TrustObjectData", trustObjectDataParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CertificateList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := csrsImportcsrRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.csrs", "importcsr", inputDataValue, executionContext) + var emptyOutput model.CertificateList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), csrsImportcsrOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CertificateList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *csrsClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.CsrList, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(csrsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CsrList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := csrsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.csrs", "list", inputDataValue, executionContext) + var emptyOutput model.CsrList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), csrsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CsrList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *csrsClient) Selfsign(csrIdParam string, daysValidParam int64) (model.Certificate, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(csrsSelfsignInputType(), typeConverter) + sv.AddStructField("CsrId", csrIdParam) + sv.AddStructField("DaysValid", daysValidParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Certificate + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := csrsSelfsignRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.csrs", "selfsign", inputDataValue, executionContext) + var emptyOutput model.Certificate + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), csrsSelfsignOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Certificate), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (cIface *csrsClient) Selfsign0(csrWithDaysValidParam model.CsrWithDaysValid) (model.Certificate, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(csrsSelfsign0InputType(), typeConverter) + sv.AddStructField("CsrWithDaysValid", csrWithDaysValidParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Certificate + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := csrsSelfsign0RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.csrs", "selfsign_0", inputDataValue, executionContext) + var emptyOutput model.Certificate + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), csrsSelfsign0OutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Certificate), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/trust_management/CsrsExtendedClient.go b/services/nsxt-mp/nsx/trust_management/CsrsExtendedClient.go new file mode 100644 index 000000000..61287fcba --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/CsrsExtendedClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: CsrsExtended +// Used by client-side stubs. + +package trust_management + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type CsrsExtendedClient interface { + + // Creates a new certificate signing request (CSR) with selected extensions. A CSR is encrypted text that contains information about your organization (organization name, country, and so on), additional attributes as extensions, and your Web server's public key, which is a public certificate the is generated on the server that can be used to forward this request to a certificate authority (CA). A private key is also usually created at the same time as the CSR. + // + // @param csrExtParam (required) + // @return com.vmware.nsx.model.Csr + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(csrExtParam model.CsrExt) (model.Csr, error) +} + +type csrsExtendedClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewCsrsExtendedClient(connector client.Connector) *csrsExtendedClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.trust_management.csrs_extended") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := csrsExtendedClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *csrsExtendedClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *csrsExtendedClient) Create(csrExtParam model.CsrExt) (model.Csr, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(csrsExtendedCreateInputType(), typeConverter) + sv.AddStructField("CsrExt", csrExtParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.Csr + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := csrsExtendedCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.csrs_extended", "create", inputDataValue, executionContext) + var emptyOutput model.Csr + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), csrsExtendedCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.Csr), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/trust_management/CsrsExtendedTypes.go b/services/nsxt-mp/nsx/trust_management/CsrsExtendedTypes.go new file mode 100644 index 000000000..8098dc7a7 --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/CsrsExtendedTypes.go @@ -0,0 +1,67 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: CsrsExtended. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package trust_management + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func csrsExtendedCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["csr_ext"] = bindings.NewReferenceType(model.CsrExtBindingType) + fieldNameMap["csr_ext"] = "CsrExt" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func csrsExtendedCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CsrBindingType) +} + +func csrsExtendedCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["csr_ext"] = bindings.NewReferenceType(model.CsrExtBindingType) + fieldNameMap["csr_ext"] = "CsrExt" + paramsTypeMap["csr_ext"] = bindings.NewReferenceType(model.CsrExtBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "csr_ext", + "POST", + "/api/v1/trust-management/csrs-extended", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/trust_management/CsrsTypes.go b/services/nsxt-mp/nsx/trust_management/CsrsTypes.go new file mode 100644 index 000000000..c2bbbc4f7 --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/CsrsTypes.go @@ -0,0 +1,399 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Csrs. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package trust_management + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func csrsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["csr"] = bindings.NewReferenceType(model.CsrBindingType) + fieldNameMap["csr"] = "Csr" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func csrsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CsrBindingType) +} + +func csrsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["csr"] = bindings.NewReferenceType(model.CsrBindingType) + fieldNameMap["csr"] = "Csr" + paramsTypeMap["csr"] = bindings.NewReferenceType(model.CsrBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "csr", + "POST", + "/api/v1/trust-management/csrs", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func csrsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["csr_id"] = bindings.NewStringType() + fieldNameMap["csr_id"] = "CsrId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func csrsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func csrsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["csr_id"] = bindings.NewStringType() + fieldNameMap["csr_id"] = "CsrId" + paramsTypeMap["csr_id"] = bindings.NewStringType() + paramsTypeMap["csrId"] = bindings.NewStringType() + pathParams["csr_id"] = "csrId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/trust-management/csrs/{csrId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func csrsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["csr_id"] = bindings.NewStringType() + fieldNameMap["csr_id"] = "CsrId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func csrsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CsrBindingType) +} + +func csrsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["csr_id"] = bindings.NewStringType() + fieldNameMap["csr_id"] = "CsrId" + paramsTypeMap["csr_id"] = bindings.NewStringType() + paramsTypeMap["csrId"] = bindings.NewStringType() + pathParams["csr_id"] = "csrId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/trust-management/csrs/{csrId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func csrsImportcsrInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["csr_id"] = bindings.NewStringType() + fields["trust_object_data"] = bindings.NewReferenceType(model.TrustObjectDataBindingType) + fieldNameMap["csr_id"] = "CsrId" + fieldNameMap["trust_object_data"] = "TrustObjectData" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func csrsImportcsrOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CertificateListBindingType) +} + +func csrsImportcsrRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["csr_id"] = bindings.NewStringType() + fields["trust_object_data"] = bindings.NewReferenceType(model.TrustObjectDataBindingType) + fieldNameMap["csr_id"] = "CsrId" + fieldNameMap["trust_object_data"] = "TrustObjectData" + paramsTypeMap["csr_id"] = bindings.NewStringType() + paramsTypeMap["trust_object_data"] = bindings.NewReferenceType(model.TrustObjectDataBindingType) + paramsTypeMap["csrId"] = bindings.NewStringType() + pathParams["csr_id"] = "csrId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=import", + "trust_object_data", + "POST", + "/api/v1/trust-management/csrs/{csrId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func csrsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func csrsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CsrListBindingType) +} + +func csrsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/trust-management/csrs", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func csrsSelfsignInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["csr_id"] = bindings.NewStringType() + fields["days_valid"] = bindings.NewIntegerType() + fieldNameMap["csr_id"] = "CsrId" + fieldNameMap["days_valid"] = "DaysValid" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func csrsSelfsignOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CertificateBindingType) +} + +func csrsSelfsignRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["csr_id"] = bindings.NewStringType() + fields["days_valid"] = bindings.NewIntegerType() + fieldNameMap["csr_id"] = "CsrId" + fieldNameMap["days_valid"] = "DaysValid" + paramsTypeMap["csr_id"] = bindings.NewStringType() + paramsTypeMap["days_valid"] = bindings.NewIntegerType() + paramsTypeMap["csrId"] = bindings.NewStringType() + pathParams["csr_id"] = "csrId" + queryParams["days_valid"] = "days_valid" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=self_sign", + "", + "POST", + "/api/v1/trust-management/csrs/{csrId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func csrsSelfsign0InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["csr_with_days_valid"] = bindings.NewReferenceType(model.CsrWithDaysValidBindingType) + fieldNameMap["csr_with_days_valid"] = "CsrWithDaysValid" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func csrsSelfsign0OutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CertificateBindingType) +} + +func csrsSelfsign0RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["csr_with_days_valid"] = bindings.NewReferenceType(model.CsrWithDaysValidBindingType) + fieldNameMap["csr_with_days_valid"] = "CsrWithDaysValid" + paramsTypeMap["csr_with_days_valid"] = bindings.NewReferenceType(model.CsrWithDaysValidBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=self_sign", + "csr_with_days_valid", + "POST", + "/api/v1/trust-management/csrs", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/trust_management/OidcUrisClient.go b/services/nsxt-mp/nsx/trust_management/OidcUrisClient.go new file mode 100644 index 000000000..b77cb499d --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/OidcUrisClient.go @@ -0,0 +1,218 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: OidcUris +// Used by client-side stubs. + +package trust_management + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type OidcUrisClient interface { + + // This request also fetches the issuer and jwks_uri meta-data from the OIDC end-point and stores it. + // + // @param oidcEndPointParam (required) + // @return com.vmware.nsx.model.OidcEndPoint + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(oidcEndPointParam model.OidcEndPoint) (model.OidcEndPoint, error) + + // When ?refresh=true is added to the request, the meta-data is newly fetched from the OIDC end-point. + // + // @param idParam (required) + // @param refreshParam Refresh meta-data (optional, default to false) + // @return com.vmware.nsx.model.OidcEndPoint + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(idParam string, refreshParam *bool) (model.OidcEndPoint, error) + + // Return the list of OpenID Connect end-points. + // @return com.vmware.nsx.model.OidcEndPointListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.OidcEndPointListResult, error) + + // Update a OpenID Connect end-point's thumbprint used to connect to the oidc_uri through SSL + // + // @param updateOidcEndPointThumbprintRequestParam (required) + // @return com.vmware.nsx.model.OidcEndPoint + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Updatethumbprint(updateOidcEndPointThumbprintRequestParam model.UpdateOidcEndPointThumbprintRequest) (model.OidcEndPoint, error) +} + +type oidcUrisClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewOidcUrisClient(connector client.Connector) *oidcUrisClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.trust_management.oidc_uris") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "updatethumbprint": core.NewMethodIdentifier(interfaceIdentifier, "updatethumbprint"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + oIface := oidcUrisClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &oIface +} + +func (oIface *oidcUrisClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := oIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (oIface *oidcUrisClient) Create(oidcEndPointParam model.OidcEndPoint) (model.OidcEndPoint, error) { + typeConverter := oIface.connector.TypeConverter() + executionContext := oIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(oidcUrisCreateInputType(), typeConverter) + sv.AddStructField("OidcEndPoint", oidcEndPointParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.OidcEndPoint + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := oidcUrisCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + oIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := oIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.oidc_uris", "create", inputDataValue, executionContext) + var emptyOutput model.OidcEndPoint + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), oidcUrisCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.OidcEndPoint), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), oIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (oIface *oidcUrisClient) Get(idParam string, refreshParam *bool) (model.OidcEndPoint, error) { + typeConverter := oIface.connector.TypeConverter() + executionContext := oIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(oidcUrisGetInputType(), typeConverter) + sv.AddStructField("Id", idParam) + sv.AddStructField("Refresh", refreshParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.OidcEndPoint + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := oidcUrisGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + oIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := oIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.oidc_uris", "get", inputDataValue, executionContext) + var emptyOutput model.OidcEndPoint + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), oidcUrisGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.OidcEndPoint), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), oIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (oIface *oidcUrisClient) List() (model.OidcEndPointListResult, error) { + typeConverter := oIface.connector.TypeConverter() + executionContext := oIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(oidcUrisListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.OidcEndPointListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := oidcUrisListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + oIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := oIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.oidc_uris", "list", inputDataValue, executionContext) + var emptyOutput model.OidcEndPointListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), oidcUrisListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.OidcEndPointListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), oIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (oIface *oidcUrisClient) Updatethumbprint(updateOidcEndPointThumbprintRequestParam model.UpdateOidcEndPointThumbprintRequest) (model.OidcEndPoint, error) { + typeConverter := oIface.connector.TypeConverter() + executionContext := oIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(oidcUrisUpdatethumbprintInputType(), typeConverter) + sv.AddStructField("UpdateOidcEndPointThumbprintRequest", updateOidcEndPointThumbprintRequestParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.OidcEndPoint + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := oidcUrisUpdatethumbprintRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + oIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := oIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.oidc_uris", "updatethumbprint", inputDataValue, executionContext) + var emptyOutput model.OidcEndPoint + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), oidcUrisUpdatethumbprintOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.OidcEndPoint), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), oIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/trust_management/OidcUrisTypes.go b/services/nsxt-mp/nsx/trust_management/OidcUrisTypes.go new file mode 100644 index 000000000..8a9962e24 --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/OidcUrisTypes.go @@ -0,0 +1,214 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: OidcUris. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package trust_management + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func oidcUrisCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["oidc_end_point"] = bindings.NewReferenceType(model.OidcEndPointBindingType) + fieldNameMap["oidc_end_point"] = "OidcEndPoint" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func oidcUrisCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.OidcEndPointBindingType) +} + +func oidcUrisCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["oidc_end_point"] = bindings.NewReferenceType(model.OidcEndPointBindingType) + fieldNameMap["oidc_end_point"] = "OidcEndPoint" + paramsTypeMap["oidc_end_point"] = bindings.NewReferenceType(model.OidcEndPointBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "oidc_end_point", + "POST", + "/api/v1/trust-management/oidc-uris", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func oidcUrisGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["id"] = bindings.NewStringType() + fields["refresh"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["id"] = "Id" + fieldNameMap["refresh"] = "Refresh" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func oidcUrisGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.OidcEndPointBindingType) +} + +func oidcUrisGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["id"] = bindings.NewStringType() + fields["refresh"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["id"] = "Id" + fieldNameMap["refresh"] = "Refresh" + paramsTypeMap["refresh"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["id"] = bindings.NewStringType() + paramsTypeMap["id"] = bindings.NewStringType() + pathParams["id"] = "id" + queryParams["refresh"] = "refresh" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/trust-management/oidc-uris/{id}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func oidcUrisListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func oidcUrisListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.OidcEndPointListResultBindingType) +} + +func oidcUrisListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/trust-management/oidc-uris", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func oidcUrisUpdatethumbprintInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["update_oidc_end_point_thumbprint_request"] = bindings.NewReferenceType(model.UpdateOidcEndPointThumbprintRequestBindingType) + fieldNameMap["update_oidc_end_point_thumbprint_request"] = "UpdateOidcEndPointThumbprintRequest" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func oidcUrisUpdatethumbprintOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.OidcEndPointBindingType) +} + +func oidcUrisUpdatethumbprintRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["update_oidc_end_point_thumbprint_request"] = bindings.NewReferenceType(model.UpdateOidcEndPointThumbprintRequestBindingType) + fieldNameMap["update_oidc_end_point_thumbprint_request"] = "UpdateOidcEndPointThumbprintRequest" + paramsTypeMap["update_oidc_end_point_thumbprint_request"] = bindings.NewReferenceType(model.UpdateOidcEndPointThumbprintRequestBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=update_thumbprint", + "update_oidc_end_point_thumbprint_request", + "POST", + "/api/v1/trust-management/oidc-uris", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/trust_management/PrincipalIdentitiesClient.go b/services/nsxt-mp/nsx/trust_management/PrincipalIdentitiesClient.go new file mode 100644 index 000000000..0aacd7335 --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/PrincipalIdentitiesClient.go @@ -0,0 +1,252 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: PrincipalIdentities +// Used by client-side stubs. + +package trust_management + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type PrincipalIdentitiesClient interface { + + // Associates a principal's name with a certificate that is used to authenticate. The combination name and node_id needs to be unique across token-based and certificate-based principal identities. Deprecated, use POST /trust-management/principal-identities/with-certificate instead. + // + // @param principalIdentityParam (required) + // @return com.vmware.nsx.model.PrincipalIdentity + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(principalIdentityParam model.PrincipalIdentity) (model.PrincipalIdentity, error) + + // Delete a principal identity. It does not delete the certificate. + // + // @param principalIdentityIdParam Unique id of the principal identity to delete (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(principalIdentityIdParam string) error + + // Get a stored principal identity + // + // @param principalIdentityIdParam ID of the principal identity to get (required) + // @return com.vmware.nsx.model.PrincipalIdentity + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(principalIdentityIdParam string) (model.PrincipalIdentity, error) + + // Returns the list of principals registered with a certificate. + // @return com.vmware.nsx.model.PrincipalIdentityList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.PrincipalIdentityList, error) + + // Update a principal identity's certificate + // + // @param updatePrincipalIdentityCertificateRequestParam (required) + // @return com.vmware.nsx.model.PrincipalIdentity + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Updatecertificate(updatePrincipalIdentityCertificateRequestParam model.UpdatePrincipalIdentityCertificateRequest) (model.PrincipalIdentity, error) +} + +type principalIdentitiesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewPrincipalIdentitiesClient(connector client.Connector) *principalIdentitiesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.trust_management.principal_identities") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "updatecertificate": core.NewMethodIdentifier(interfaceIdentifier, "updatecertificate"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + pIface := principalIdentitiesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &pIface +} + +func (pIface *principalIdentitiesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := pIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (pIface *principalIdentitiesClient) Create(principalIdentityParam model.PrincipalIdentity) (model.PrincipalIdentity, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(principalIdentitiesCreateInputType(), typeConverter) + sv.AddStructField("PrincipalIdentity", principalIdentityParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PrincipalIdentity + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := principalIdentitiesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.principal_identities", "create", inputDataValue, executionContext) + var emptyOutput model.PrincipalIdentity + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), principalIdentitiesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PrincipalIdentity), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *principalIdentitiesClient) Delete(principalIdentityIdParam string) error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(principalIdentitiesDeleteInputType(), typeConverter) + sv.AddStructField("PrincipalIdentityId", principalIdentityIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := principalIdentitiesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.principal_identities", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *principalIdentitiesClient) Get(principalIdentityIdParam string) (model.PrincipalIdentity, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(principalIdentitiesGetInputType(), typeConverter) + sv.AddStructField("PrincipalIdentityId", principalIdentityIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PrincipalIdentity + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := principalIdentitiesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.principal_identities", "get", inputDataValue, executionContext) + var emptyOutput model.PrincipalIdentity + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), principalIdentitiesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PrincipalIdentity), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *principalIdentitiesClient) List() (model.PrincipalIdentityList, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(principalIdentitiesListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PrincipalIdentityList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := principalIdentitiesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.principal_identities", "list", inputDataValue, executionContext) + var emptyOutput model.PrincipalIdentityList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), principalIdentitiesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PrincipalIdentityList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *principalIdentitiesClient) Updatecertificate(updatePrincipalIdentityCertificateRequestParam model.UpdatePrincipalIdentityCertificateRequest) (model.PrincipalIdentity, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(principalIdentitiesUpdatecertificateInputType(), typeConverter) + sv.AddStructField("UpdatePrincipalIdentityCertificateRequest", updatePrincipalIdentityCertificateRequestParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PrincipalIdentity + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := principalIdentitiesUpdatecertificateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.principal_identities", "updatecertificate", inputDataValue, executionContext) + var emptyOutput model.PrincipalIdentity + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), principalIdentitiesUpdatecertificateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PrincipalIdentity), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/trust_management/PrincipalIdentitiesTypes.go b/services/nsxt-mp/nsx/trust_management/PrincipalIdentitiesTypes.go new file mode 100644 index 000000000..d852f1896 --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/PrincipalIdentitiesTypes.go @@ -0,0 +1,258 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: PrincipalIdentities. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package trust_management + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func principalIdentitiesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["principal_identity"] = bindings.NewReferenceType(model.PrincipalIdentityBindingType) + fieldNameMap["principal_identity"] = "PrincipalIdentity" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func principalIdentitiesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PrincipalIdentityBindingType) +} + +func principalIdentitiesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["principal_identity"] = bindings.NewReferenceType(model.PrincipalIdentityBindingType) + fieldNameMap["principal_identity"] = "PrincipalIdentity" + paramsTypeMap["principal_identity"] = bindings.NewReferenceType(model.PrincipalIdentityBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "principal_identity", + "POST", + "/api/v1/trust-management/principal-identities", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func principalIdentitiesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["principal_identity_id"] = bindings.NewStringType() + fieldNameMap["principal_identity_id"] = "PrincipalIdentityId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func principalIdentitiesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func principalIdentitiesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["principal_identity_id"] = bindings.NewStringType() + fieldNameMap["principal_identity_id"] = "PrincipalIdentityId" + paramsTypeMap["principal_identity_id"] = bindings.NewStringType() + paramsTypeMap["principalIdentityId"] = bindings.NewStringType() + pathParams["principal_identity_id"] = "principalIdentityId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/trust-management/principal-identities/{principalIdentityId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func principalIdentitiesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["principal_identity_id"] = bindings.NewStringType() + fieldNameMap["principal_identity_id"] = "PrincipalIdentityId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func principalIdentitiesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PrincipalIdentityBindingType) +} + +func principalIdentitiesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["principal_identity_id"] = bindings.NewStringType() + fieldNameMap["principal_identity_id"] = "PrincipalIdentityId" + paramsTypeMap["principal_identity_id"] = bindings.NewStringType() + paramsTypeMap["principalIdentityId"] = bindings.NewStringType() + pathParams["principal_identity_id"] = "principalIdentityId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/trust-management/principal-identities/{principalIdentityId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func principalIdentitiesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func principalIdentitiesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PrincipalIdentityListBindingType) +} + +func principalIdentitiesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/trust-management/principal-identities", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func principalIdentitiesUpdatecertificateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["update_principal_identity_certificate_request"] = bindings.NewReferenceType(model.UpdatePrincipalIdentityCertificateRequestBindingType) + fieldNameMap["update_principal_identity_certificate_request"] = "UpdatePrincipalIdentityCertificateRequest" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func principalIdentitiesUpdatecertificateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PrincipalIdentityBindingType) +} + +func principalIdentitiesUpdatecertificateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["update_principal_identity_certificate_request"] = bindings.NewReferenceType(model.UpdatePrincipalIdentityCertificateRequestBindingType) + fieldNameMap["update_principal_identity_certificate_request"] = "UpdatePrincipalIdentityCertificateRequest" + paramsTypeMap["update_principal_identity_certificate_request"] = bindings.NewReferenceType(model.UpdatePrincipalIdentityCertificateRequestBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=update_certificate", + "update_principal_identity_certificate_request", + "POST", + "/api/v1/trust-management/principal-identities", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/trust_management/TokenPrincipalIdentitiesClient.go b/services/nsxt-mp/nsx/trust_management/TokenPrincipalIdentitiesClient.go new file mode 100644 index 000000000..1382c5787 --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/TokenPrincipalIdentitiesClient.go @@ -0,0 +1,209 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: TokenPrincipalIdentities +// Used by client-side stubs. + +package trust_management + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type TokenPrincipalIdentitiesClient interface { + + // Register a principal identity that is going to be authenticated through a token. The combination name and node_id needs to be unique across token-based and certificate-based principal identities. + // + // @param tokenBasedPrincipalIdentityParam (required) + // @return com.vmware.nsx.model.TokenBasedPrincipalIdentity + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(tokenBasedPrincipalIdentityParam model.TokenBasedPrincipalIdentity) (model.TokenBasedPrincipalIdentity, error) + + // Delete a token-based principal identity. + // + // @param principalIdentityIdParam Unique id of the token-based principal identity to delete (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(principalIdentityIdParam string) error + + // Get a stored token-based principal identity + // + // @param principalIdentityIdParam ID of the principal identity to get (required) + // @return com.vmware.nsx.model.TokenBasedPrincipalIdentity + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(principalIdentityIdParam string) (model.TokenBasedPrincipalIdentity, error) + + // Return the list of token-based principal identities. | These don't have certificate or role information. + // @return com.vmware.nsx.model.TokenBasedPrincipalIdentityListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.TokenBasedPrincipalIdentityListResult, error) +} + +type tokenPrincipalIdentitiesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewTokenPrincipalIdentitiesClient(connector client.Connector) *tokenPrincipalIdentitiesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.trust_management.token_principal_identities") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + tIface := tokenPrincipalIdentitiesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &tIface +} + +func (tIface *tokenPrincipalIdentitiesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := tIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (tIface *tokenPrincipalIdentitiesClient) Create(tokenBasedPrincipalIdentityParam model.TokenBasedPrincipalIdentity) (model.TokenBasedPrincipalIdentity, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(tokenPrincipalIdentitiesCreateInputType(), typeConverter) + sv.AddStructField("TokenBasedPrincipalIdentity", tokenBasedPrincipalIdentityParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TokenBasedPrincipalIdentity + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tokenPrincipalIdentitiesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.token_principal_identities", "create", inputDataValue, executionContext) + var emptyOutput model.TokenBasedPrincipalIdentity + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), tokenPrincipalIdentitiesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TokenBasedPrincipalIdentity), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *tokenPrincipalIdentitiesClient) Delete(principalIdentityIdParam string) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(tokenPrincipalIdentitiesDeleteInputType(), typeConverter) + sv.AddStructField("PrincipalIdentityId", principalIdentityIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tokenPrincipalIdentitiesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.token_principal_identities", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *tokenPrincipalIdentitiesClient) Get(principalIdentityIdParam string) (model.TokenBasedPrincipalIdentity, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(tokenPrincipalIdentitiesGetInputType(), typeConverter) + sv.AddStructField("PrincipalIdentityId", principalIdentityIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TokenBasedPrincipalIdentity + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tokenPrincipalIdentitiesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.token_principal_identities", "get", inputDataValue, executionContext) + var emptyOutput model.TokenBasedPrincipalIdentity + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), tokenPrincipalIdentitiesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TokenBasedPrincipalIdentity), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *tokenPrincipalIdentitiesClient) List() (model.TokenBasedPrincipalIdentityListResult, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(tokenPrincipalIdentitiesListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.TokenBasedPrincipalIdentityListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tokenPrincipalIdentitiesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.token_principal_identities", "list", inputDataValue, executionContext) + var emptyOutput model.TokenBasedPrincipalIdentityListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), tokenPrincipalIdentitiesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.TokenBasedPrincipalIdentityListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/trust_management/TokenPrincipalIdentitiesTypes.go b/services/nsxt-mp/nsx/trust_management/TokenPrincipalIdentitiesTypes.go new file mode 100644 index 000000000..6d88328eb --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/TokenPrincipalIdentitiesTypes.go @@ -0,0 +1,210 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: TokenPrincipalIdentities. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package trust_management + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func tokenPrincipalIdentitiesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["token_based_principal_identity"] = bindings.NewReferenceType(model.TokenBasedPrincipalIdentityBindingType) + fieldNameMap["token_based_principal_identity"] = "TokenBasedPrincipalIdentity" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tokenPrincipalIdentitiesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TokenBasedPrincipalIdentityBindingType) +} + +func tokenPrincipalIdentitiesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["token_based_principal_identity"] = bindings.NewReferenceType(model.TokenBasedPrincipalIdentityBindingType) + fieldNameMap["token_based_principal_identity"] = "TokenBasedPrincipalIdentity" + paramsTypeMap["token_based_principal_identity"] = bindings.NewReferenceType(model.TokenBasedPrincipalIdentityBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "token_based_principal_identity", + "POST", + "/api/v1/trust-management/token-principal-identities", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func tokenPrincipalIdentitiesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["principal_identity_id"] = bindings.NewStringType() + fieldNameMap["principal_identity_id"] = "PrincipalIdentityId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tokenPrincipalIdentitiesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func tokenPrincipalIdentitiesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["principal_identity_id"] = bindings.NewStringType() + fieldNameMap["principal_identity_id"] = "PrincipalIdentityId" + paramsTypeMap["principal_identity_id"] = bindings.NewStringType() + paramsTypeMap["principalIdentityId"] = bindings.NewStringType() + pathParams["principal_identity_id"] = "principalIdentityId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/trust-management/token-principal-identities/{principalIdentityId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func tokenPrincipalIdentitiesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["principal_identity_id"] = bindings.NewStringType() + fieldNameMap["principal_identity_id"] = "PrincipalIdentityId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tokenPrincipalIdentitiesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TokenBasedPrincipalIdentityBindingType) +} + +func tokenPrincipalIdentitiesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["principal_identity_id"] = bindings.NewStringType() + fieldNameMap["principal_identity_id"] = "PrincipalIdentityId" + paramsTypeMap["principal_identity_id"] = bindings.NewStringType() + paramsTypeMap["principalIdentityId"] = bindings.NewStringType() + pathParams["principal_identity_id"] = "principalIdentityId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/trust-management/token-principal-identities/{principalIdentityId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func tokenPrincipalIdentitiesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tokenPrincipalIdentitiesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.TokenBasedPrincipalIdentityListResultBindingType) +} + +func tokenPrincipalIdentitiesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/trust-management/token-principal-identities", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/trust_management/TrustManagementPackageTypes.go b/services/nsxt-mp/nsx/trust_management/TrustManagementPackageTypes.go new file mode 100644 index 000000000..201ed0beb --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/TrustManagementPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.trust_management. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package trust_management diff --git a/services/nsxt-mp/nsx/trust_management/crl_distribution_points/CrlDistributionPointsPackageTypes.go b/services/nsxt-mp/nsx/trust_management/crl_distribution_points/CrlDistributionPointsPackageTypes.go new file mode 100644 index 000000000..31a15be7c --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/crl_distribution_points/CrlDistributionPointsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.trust_management.crl_distribution_points. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package crl_distribution_points diff --git a/services/nsxt-mp/nsx/trust_management/crl_distribution_points/StatusClient.go b/services/nsxt-mp/nsx/trust_management/crl_distribution_points/StatusClient.go new file mode 100644 index 000000000..47d26a6fa --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/crl_distribution_points/StatusClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package crl_distribution_points + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Return the status of the CrlDistributionPoint + // + // @param crlDistributionPointIdParam (required) + // @return com.vmware.nsx.model.CrlDistributionPointStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(crlDistributionPointIdParam string) (model.CrlDistributionPointStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.trust_management.crl_distribution_points.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(crlDistributionPointIdParam string) (model.CrlDistributionPointStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("CrlDistributionPointId", crlDistributionPointIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.CrlDistributionPointStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.crl_distribution_points.status", "get", inputDataValue, executionContext) + var emptyOutput model.CrlDistributionPointStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.CrlDistributionPointStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/trust_management/crl_distribution_points/StatusTypes.go b/services/nsxt-mp/nsx/trust_management/crl_distribution_points/StatusTypes.go new file mode 100644 index 000000000..59fadc6a1 --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/crl_distribution_points/StatusTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package crl_distribution_points + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["crl_distribution_point_id"] = bindings.NewStringType() + fieldNameMap["crl_distribution_point_id"] = "CrlDistributionPointId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.CrlDistributionPointStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["crl_distribution_point_id"] = bindings.NewStringType() + fieldNameMap["crl_distribution_point_id"] = "CrlDistributionPointId" + paramsTypeMap["crl_distribution_point_id"] = bindings.NewStringType() + paramsTypeMap["crlDistributionPointId"] = bindings.NewStringType() + pathParams["crl_distribution_point_id"] = "crlDistributionPointId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/trust-management/crl-distribution-points/{crlDistributionPointId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/trust_management/principal_identities/PrincipalIdentitiesPackageTypes.go b/services/nsxt-mp/nsx/trust_management/principal_identities/PrincipalIdentitiesPackageTypes.go new file mode 100644 index 000000000..134bd0bfd --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/principal_identities/PrincipalIdentitiesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.trust_management.principal_identities. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package principal_identities diff --git a/services/nsxt-mp/nsx/trust_management/principal_identities/WithCertificateClient.go b/services/nsxt-mp/nsx/trust_management/principal_identities/WithCertificateClient.go new file mode 100644 index 000000000..d89631342 --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/principal_identities/WithCertificateClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: WithCertificate +// Used by client-side stubs. + +package principal_identities + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type WithCertificateClient interface { + + // Create a principal identity with a new, unused, certificate. The combination name and node_id needs to be unique across token-based and certificate-based principal identities. + // + // @param principalIdentityWithCertificateParam (required) + // @return com.vmware.nsx.model.PrincipalIdentity + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(principalIdentityWithCertificateParam model.PrincipalIdentityWithCertificate) (model.PrincipalIdentity, error) +} + +type withCertificateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewWithCertificateClient(connector client.Connector) *withCertificateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.trust_management.principal_identities.with_certificate") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + wIface := withCertificateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &wIface +} + +func (wIface *withCertificateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := wIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (wIface *withCertificateClient) Create(principalIdentityWithCertificateParam model.PrincipalIdentityWithCertificate) (model.PrincipalIdentity, error) { + typeConverter := wIface.connector.TypeConverter() + executionContext := wIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(withCertificateCreateInputType(), typeConverter) + sv.AddStructField("PrincipalIdentityWithCertificate", principalIdentityWithCertificateParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.PrincipalIdentity + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := withCertificateCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + wIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := wIface.connector.GetApiProvider().Invoke("com.vmware.nsx.trust_management.principal_identities.with_certificate", "create", inputDataValue, executionContext) + var emptyOutput model.PrincipalIdentity + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), withCertificateCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.PrincipalIdentity), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), wIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/trust_management/principal_identities/WithCertificateTypes.go b/services/nsxt-mp/nsx/trust_management/principal_identities/WithCertificateTypes.go new file mode 100644 index 000000000..4347b8b40 --- /dev/null +++ b/services/nsxt-mp/nsx/trust_management/principal_identities/WithCertificateTypes.go @@ -0,0 +1,67 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: WithCertificate. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package principal_identities + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func withCertificateCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["principal_identity_with_certificate"] = bindings.NewReferenceType(model.PrincipalIdentityWithCertificateBindingType) + fieldNameMap["principal_identity_with_certificate"] = "PrincipalIdentityWithCertificate" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func withCertificateCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.PrincipalIdentityBindingType) +} + +func withCertificateCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["principal_identity_with_certificate"] = bindings.NewReferenceType(model.PrincipalIdentityWithCertificateBindingType) + fieldNameMap["principal_identity_with_certificate"] = "PrincipalIdentityWithCertificate" + paramsTypeMap["principal_identity_with_certificate"] = bindings.NewReferenceType(model.PrincipalIdentityWithCertificateBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "principal_identity_with_certificate", + "POST", + "/api/v1/trust-management/principal-identities/with-certificate", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/ui_views/UiViewsPackageTypes.go b/services/nsxt-mp/nsx/ui_views/UiViewsPackageTypes.go new file mode 100644 index 000000000..4d6e649f2 --- /dev/null +++ b/services/nsxt-mp/nsx/ui_views/UiViewsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.ui_views. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ui_views diff --git a/services/nsxt-mp/nsx/ui_views/WidgetconfigurationsClient.go b/services/nsxt-mp/nsx/ui_views/WidgetconfigurationsClient.go new file mode 100644 index 000000000..9391a88c7 --- /dev/null +++ b/services/nsxt-mp/nsx/ui_views/WidgetconfigurationsClient.go @@ -0,0 +1,275 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Widgetconfigurations +// Used by client-side stubs. + +package ui_views + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type WidgetconfigurationsClient interface { + + // Creates a new Widget Configuration and adds it to the specified view. Supported resource_types are LabelValueConfiguration, DonutConfiguration, GridConfiguration, StatsConfiguration, MultiWidgetConfiguration, GraphConfiguration and ContainerConfiguration. Note: Expressions should be given in a single line. If an expression spans multiple lines, then form the expression in a single line. For label-value pairs, expressions are evaluated as follows: a. First, render configurations are evaluated in their order of appearance in the widget config. The 'field' is evaluated at the end. b. Second, when render configuration is provided then the order of evaluation is 1. If expressions provided in 'condition' and 'display value' are well-formed and free of runtime-errors such as 'null pointers' and evaluates to 'true'; Then remaining render configurations are not evaluated, and the current render configuration's 'display value' is taken as the final value. 2. If expression provided in 'condition' of render configuration is false, then next render configuration is evaluated. 3. Finally, 'field' is evaluated only when every render configuration evaluates to false and no error occurs during steps 1 and 2 above. If an error occurs during evaluation of render configuration, then an error message is shown. The display value corresponding to that label is not shown and evaluation of the remaining render configurations continues to collect and show all the error messages (marked with the 'Label' for identification) as 'Error_Messages: {}'. If during evaluation of expressions for any label-value pair an error occurs, then it is marked with error. The errors are shown in the report, along with the label value pairs that are error-free. Important: For elements that take expressions, strings should be provided by escaping them with a back-slash. These elements are - condition, field, tooltip text and render_configuration's display_value. + // + // @param viewIdParam (required) + // @param widgetConfigurationParam (required) + // The parameter must contain all the properties defined in model.WidgetConfiguration. + // @return com.vmware.nsx.model.WidgetConfiguration + // The return value will contain all the properties defined in model.WidgetConfiguration. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(viewIdParam string, widgetConfigurationParam *data.StructValue) (*data.StructValue, error) + + // Detaches widget from a given view. If the widget is no longer part of any view, then it will be purged. + // + // @param viewIdParam (required) + // @param widgetconfigurationIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(viewIdParam string, widgetconfigurationIdParam string) error + + // If no query params are specified then all the Widget Configurations of the specified view are returned. + // + // @param viewIdParam (required) + // @param containerParam Id of the container (optional) + // @param widgetIdsParam Ids of the WidgetConfigurations (optional) + // @return com.vmware.nsx.model.WidgetConfigurationList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(viewIdParam string, containerParam *string, widgetIdsParam *string) (model.WidgetConfigurationList, error) + + // Returns Information about a specific Widget Configuration. + // + // @param viewIdParam (required) + // @param widgetconfigurationIdParam (required) + // @return com.vmware.nsx.model.WidgetConfiguration + // The return value will contain all the properties defined in model.WidgetConfiguration. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get0(viewIdParam string, widgetconfigurationIdParam string) (*data.StructValue, error) + + // Updates the widget at the given view. If the widget is referenced by other views, then the widget will be updated in all the views that it is part of. + // + // @param viewIdParam (required) + // @param widgetconfigurationIdParam (required) + // @param widgetConfigurationParam (required) + // The parameter must contain all the properties defined in model.WidgetConfiguration. + // @return com.vmware.nsx.model.WidgetConfiguration + // The return value will contain all the properties defined in model.WidgetConfiguration. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(viewIdParam string, widgetconfigurationIdParam string, widgetConfigurationParam *data.StructValue) (*data.StructValue, error) +} + +type widgetconfigurationsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewWidgetconfigurationsClient(connector client.Connector) *widgetconfigurationsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.ui_views.widgetconfigurations") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "get_0": core.NewMethodIdentifier(interfaceIdentifier, "get_0"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + wIface := widgetconfigurationsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &wIface +} + +func (wIface *widgetconfigurationsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := wIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (wIface *widgetconfigurationsClient) Create(viewIdParam string, widgetConfigurationParam *data.StructValue) (*data.StructValue, error) { + typeConverter := wIface.connector.TypeConverter() + executionContext := wIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(widgetconfigurationsCreateInputType(), typeConverter) + sv.AddStructField("ViewId", viewIdParam) + sv.AddStructField("WidgetConfiguration", widgetConfigurationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := widgetconfigurationsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + wIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := wIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ui_views.widgetconfigurations", "create", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), widgetconfigurationsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), wIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (wIface *widgetconfigurationsClient) Delete(viewIdParam string, widgetconfigurationIdParam string) error { + typeConverter := wIface.connector.TypeConverter() + executionContext := wIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(widgetconfigurationsDeleteInputType(), typeConverter) + sv.AddStructField("ViewId", viewIdParam) + sv.AddStructField("WidgetconfigurationId", widgetconfigurationIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := widgetconfigurationsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + wIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := wIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ui_views.widgetconfigurations", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), wIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (wIface *widgetconfigurationsClient) Get(viewIdParam string, containerParam *string, widgetIdsParam *string) (model.WidgetConfigurationList, error) { + typeConverter := wIface.connector.TypeConverter() + executionContext := wIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(widgetconfigurationsGetInputType(), typeConverter) + sv.AddStructField("ViewId", viewIdParam) + sv.AddStructField("Container", containerParam) + sv.AddStructField("WidgetIds", widgetIdsParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.WidgetConfigurationList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := widgetconfigurationsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + wIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := wIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ui_views.widgetconfigurations", "get", inputDataValue, executionContext) + var emptyOutput model.WidgetConfigurationList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), widgetconfigurationsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.WidgetConfigurationList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), wIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (wIface *widgetconfigurationsClient) Get0(viewIdParam string, widgetconfigurationIdParam string) (*data.StructValue, error) { + typeConverter := wIface.connector.TypeConverter() + executionContext := wIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(widgetconfigurationsGet0InputType(), typeConverter) + sv.AddStructField("ViewId", viewIdParam) + sv.AddStructField("WidgetconfigurationId", widgetconfigurationIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := widgetconfigurationsGet0RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + wIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := wIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ui_views.widgetconfigurations", "get_0", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), widgetconfigurationsGet0OutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), wIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (wIface *widgetconfigurationsClient) Update(viewIdParam string, widgetconfigurationIdParam string, widgetConfigurationParam *data.StructValue) (*data.StructValue, error) { + typeConverter := wIface.connector.TypeConverter() + executionContext := wIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(widgetconfigurationsUpdateInputType(), typeConverter) + sv.AddStructField("ViewId", viewIdParam) + sv.AddStructField("WidgetconfigurationId", widgetconfigurationIdParam) + sv.AddStructField("WidgetConfiguration", widgetConfigurationParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := widgetconfigurationsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + wIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := wIface.connector.GetApiProvider().Invoke("com.vmware.nsx.ui_views.widgetconfigurations", "update", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), widgetconfigurationsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), wIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/ui_views/WidgetconfigurationsTypes.go b/services/nsxt-mp/nsx/ui_views/WidgetconfigurationsTypes.go new file mode 100644 index 000000000..267b154b0 --- /dev/null +++ b/services/nsxt-mp/nsx/ui_views/WidgetconfigurationsTypes.go @@ -0,0 +1,312 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Widgetconfigurations. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ui_views + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func widgetconfigurationsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["view_id"] = bindings.NewStringType() + fields["widget_configuration"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.WidgetConfigurationBindingType)}, bindings.REST) + fieldNameMap["view_id"] = "ViewId" + fieldNameMap["widget_configuration"] = "WidgetConfiguration" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func widgetconfigurationsCreateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.WidgetConfigurationBindingType)}, bindings.REST) +} + +func widgetconfigurationsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["view_id"] = bindings.NewStringType() + fields["widget_configuration"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.WidgetConfigurationBindingType)}, bindings.REST) + fieldNameMap["view_id"] = "ViewId" + fieldNameMap["widget_configuration"] = "WidgetConfiguration" + paramsTypeMap["view_id"] = bindings.NewStringType() + paramsTypeMap["widget_configuration"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.WidgetConfigurationBindingType)}, bindings.REST) + paramsTypeMap["viewId"] = bindings.NewStringType() + pathParams["view_id"] = "viewId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "widget_configuration", + "POST", + "/api/v1/ui-views/{viewId}/widgetconfigurations", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func widgetconfigurationsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["view_id"] = bindings.NewStringType() + fields["widgetconfiguration_id"] = bindings.NewStringType() + fieldNameMap["view_id"] = "ViewId" + fieldNameMap["widgetconfiguration_id"] = "WidgetconfigurationId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func widgetconfigurationsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func widgetconfigurationsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["view_id"] = bindings.NewStringType() + fields["widgetconfiguration_id"] = bindings.NewStringType() + fieldNameMap["view_id"] = "ViewId" + fieldNameMap["widgetconfiguration_id"] = "WidgetconfigurationId" + paramsTypeMap["widgetconfiguration_id"] = bindings.NewStringType() + paramsTypeMap["view_id"] = bindings.NewStringType() + paramsTypeMap["viewId"] = bindings.NewStringType() + paramsTypeMap["widgetconfigurationId"] = bindings.NewStringType() + pathParams["view_id"] = "viewId" + pathParams["widgetconfiguration_id"] = "widgetconfigurationId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/ui-views/{viewId}/widgetconfigurations/{widgetconfigurationId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func widgetconfigurationsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["view_id"] = bindings.NewStringType() + fields["container"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["widget_ids"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["view_id"] = "ViewId" + fieldNameMap["container"] = "Container" + fieldNameMap["widget_ids"] = "WidgetIds" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func widgetconfigurationsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.WidgetConfigurationListBindingType) +} + +func widgetconfigurationsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["view_id"] = bindings.NewStringType() + fields["container"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["widget_ids"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["view_id"] = "ViewId" + fieldNameMap["container"] = "Container" + fieldNameMap["widget_ids"] = "WidgetIds" + paramsTypeMap["view_id"] = bindings.NewStringType() + paramsTypeMap["container"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["widget_ids"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["viewId"] = bindings.NewStringType() + pathParams["view_id"] = "viewId" + queryParams["container"] = "container" + queryParams["widget_ids"] = "widget_ids" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ui-views/{viewId}/widgetconfigurations", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func widgetconfigurationsGet0InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["view_id"] = bindings.NewStringType() + fields["widgetconfiguration_id"] = bindings.NewStringType() + fieldNameMap["view_id"] = "ViewId" + fieldNameMap["widgetconfiguration_id"] = "WidgetconfigurationId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func widgetconfigurationsGet0OutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.WidgetConfigurationBindingType)}, bindings.REST) +} + +func widgetconfigurationsGet0RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["view_id"] = bindings.NewStringType() + fields["widgetconfiguration_id"] = bindings.NewStringType() + fieldNameMap["view_id"] = "ViewId" + fieldNameMap["widgetconfiguration_id"] = "WidgetconfigurationId" + paramsTypeMap["widgetconfiguration_id"] = bindings.NewStringType() + paramsTypeMap["view_id"] = bindings.NewStringType() + paramsTypeMap["viewId"] = bindings.NewStringType() + paramsTypeMap["widgetconfigurationId"] = bindings.NewStringType() + pathParams["view_id"] = "viewId" + pathParams["widgetconfiguration_id"] = "widgetconfigurationId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/ui-views/{viewId}/widgetconfigurations/{widgetconfigurationId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func widgetconfigurationsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["view_id"] = bindings.NewStringType() + fields["widgetconfiguration_id"] = bindings.NewStringType() + fields["widget_configuration"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.WidgetConfigurationBindingType)}, bindings.REST) + fieldNameMap["view_id"] = "ViewId" + fieldNameMap["widgetconfiguration_id"] = "WidgetconfigurationId" + fieldNameMap["widget_configuration"] = "WidgetConfiguration" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func widgetconfigurationsUpdateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.WidgetConfigurationBindingType)}, bindings.REST) +} + +func widgetconfigurationsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["view_id"] = bindings.NewStringType() + fields["widgetconfiguration_id"] = bindings.NewStringType() + fields["widget_configuration"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.WidgetConfigurationBindingType)}, bindings.REST) + fieldNameMap["view_id"] = "ViewId" + fieldNameMap["widgetconfiguration_id"] = "WidgetconfigurationId" + fieldNameMap["widget_configuration"] = "WidgetConfiguration" + paramsTypeMap["widgetconfiguration_id"] = bindings.NewStringType() + paramsTypeMap["view_id"] = bindings.NewStringType() + paramsTypeMap["widget_configuration"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.WidgetConfigurationBindingType)}, bindings.REST) + paramsTypeMap["viewId"] = bindings.NewStringType() + paramsTypeMap["widgetconfigurationId"] = bindings.NewStringType() + pathParams["view_id"] = "viewId" + pathParams["widgetconfiguration_id"] = "widgetconfigurationId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "widget_configuration", + "PUT", + "/api/v1/ui-views/{viewId}/widgetconfigurations/{widgetconfigurationId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/BundlesClient.go b/services/nsxt-mp/nsx/upgrade/BundlesClient.go new file mode 100644 index 000000000..a71cb75bf --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/BundlesClient.go @@ -0,0 +1,170 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Bundles +// Used by client-side stubs. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type BundlesClient interface { + + // Cancel upload of upgrade bundle. This API works only when bundle upload is in-progress and will not work during post-processing of upgrade bundle. If bundle upload is in-progress, then the API call returns http OK response after cancelling the upload and deleting partially uploaded bundle. + // + // @param bundleIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Cancelupload(bundleIdParam string) error + + // Fetches the upgrade bundle from url. The call returns after fetch is initiated. Check status by periodically retrieving upgrade bundle upload status using GET /upgrade/bundles//upload-status. The upload is complete when the status is SUCCESS. + // + // @param upgradeBundleFetchRequestParam (required) + // @return com.vmware.nsx.model.UpgradeBundleId + // @throws Unauthenticated Unauthorized + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(upgradeBundleFetchRequestParam model.UpgradeBundleFetchRequest) (model.UpgradeBundleId, error) + + // Get uploaded upgrade bundle information + // + // @param bundleIdParam (required) + // @return com.vmware.nsx.model.UpgradeBundleInfo + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(bundleIdParam string) (model.UpgradeBundleInfo, error) +} + +type bundlesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewBundlesClient(connector client.Connector) *bundlesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.bundles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "cancelupload": core.NewMethodIdentifier(interfaceIdentifier, "cancelupload"), + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + bIface := bundlesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &bIface +} + +func (bIface *bundlesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := bIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (bIface *bundlesClient) Cancelupload(bundleIdParam string) error { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bundlesCanceluploadInputType(), typeConverter) + sv.AddStructField("BundleId", bundleIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bundlesCanceluploadRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.bundles", "cancelupload", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (bIface *bundlesClient) Create(upgradeBundleFetchRequestParam model.UpgradeBundleFetchRequest) (model.UpgradeBundleId, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bundlesCreateInputType(), typeConverter) + sv.AddStructField("UpgradeBundleFetchRequest", upgradeBundleFetchRequestParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeBundleId + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bundlesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.bundles", "create", inputDataValue, executionContext) + var emptyOutput model.UpgradeBundleId + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bundlesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeBundleId), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (bIface *bundlesClient) Get(bundleIdParam string) (model.UpgradeBundleInfo, error) { + typeConverter := bIface.connector.TypeConverter() + executionContext := bIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(bundlesGetInputType(), typeConverter) + sv.AddStructField("BundleId", bundleIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeBundleInfo + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := bundlesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + bIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := bIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.bundles", "get", inputDataValue, executionContext) + var emptyOutput model.UpgradeBundleInfo + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), bundlesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeBundleInfo), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), bIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/BundlesTypes.go b/services/nsxt-mp/nsx/upgrade/BundlesTypes.go new file mode 100644 index 000000000..02d715d8a --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/BundlesTypes.go @@ -0,0 +1,169 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Bundles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func bundlesCanceluploadInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bundle_id"] = bindings.NewStringType() + fieldNameMap["bundle_id"] = "BundleId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bundlesCanceluploadOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func bundlesCanceluploadRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["bundle_id"] = bindings.NewStringType() + fieldNameMap["bundle_id"] = "BundleId" + paramsTypeMap["bundle_id"] = bindings.NewStringType() + paramsTypeMap["bundleId"] = bindings.NewStringType() + pathParams["bundle_id"] = "bundleId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=cancel_upload", + "", + "POST", + "/api/v1/upgrade/bundles/{bundleId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func bundlesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["upgrade_bundle_fetch_request"] = bindings.NewReferenceType(model.UpgradeBundleFetchRequestBindingType) + fieldNameMap["upgrade_bundle_fetch_request"] = "UpgradeBundleFetchRequest" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bundlesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeBundleIdBindingType) +} + +func bundlesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["upgrade_bundle_fetch_request"] = bindings.NewReferenceType(model.UpgradeBundleFetchRequestBindingType) + fieldNameMap["upgrade_bundle_fetch_request"] = "UpgradeBundleFetchRequest" + paramsTypeMap["upgrade_bundle_fetch_request"] = bindings.NewReferenceType(model.UpgradeBundleFetchRequestBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"] = make(map[string]string) + errorHeaders["com.vmware.vapi.std.errors.unauthenticated"]["challenge"] = "WWW-Authenticate" + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "upgrade_bundle_fetch_request", + "POST", + "/api/v1/upgrade/bundles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.unauthenticated": 401, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func bundlesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bundle_id"] = bindings.NewStringType() + fieldNameMap["bundle_id"] = "BundleId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func bundlesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeBundleInfoBindingType) +} + +func bundlesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["bundle_id"] = bindings.NewStringType() + fieldNameMap["bundle_id"] = "BundleId" + paramsTypeMap["bundle_id"] = bindings.NewStringType() + paramsTypeMap["bundleId"] = bindings.NewStringType() + pathParams["bundle_id"] = "bundleId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/bundles/{bundleId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/FunctionalStateClient.go b/services/nsxt-mp/nsx/upgrade/FunctionalStateClient.go new file mode 100644 index 000000000..dcf235730 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/FunctionalStateClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: FunctionalState +// Used by client-side stubs. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type FunctionalStateClient interface { + + // Get the functional state of the upgrade coordinator. + // @return com.vmware.nsx.model.UcFunctionalState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.UcFunctionalState, error) +} + +type functionalStateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewFunctionalStateClient(connector client.Connector) *functionalStateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.functional_state") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + fIface := functionalStateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &fIface +} + +func (fIface *functionalStateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := fIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (fIface *functionalStateClient) Get() (model.UcFunctionalState, error) { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(functionalStateGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UcFunctionalState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := functionalStateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.functional_state", "get", inputDataValue, executionContext) + var emptyOutput model.UcFunctionalState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), functionalStateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UcFunctionalState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/FunctionalStateTypes.go b/services/nsxt-mp/nsx/upgrade/FunctionalStateTypes.go new file mode 100644 index 000000000..a66e195fc --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/FunctionalStateTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: FunctionalState. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func functionalStateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func functionalStateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UcFunctionalStateBindingType) +} + +func functionalStateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/functional-state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/HistoryClient.go b/services/nsxt-mp/nsx/upgrade/HistoryClient.go new file mode 100644 index 000000000..a7cc8accd --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/HistoryClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: History +// Used by client-side stubs. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type HistoryClient interface { + + // Get upgrade history + // @return com.vmware.nsx.model.UpgradeHistoryList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.UpgradeHistoryList, error) +} + +type historyClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewHistoryClient(connector client.Connector) *historyClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.history") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + hIface := historyClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &hIface +} + +func (hIface *historyClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := hIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (hIface *historyClient) List() (model.UpgradeHistoryList, error) { + typeConverter := hIface.connector.TypeConverter() + executionContext := hIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(historyListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeHistoryList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := historyListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + hIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := hIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.history", "list", inputDataValue, executionContext) + var emptyOutput model.UpgradeHistoryList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), historyListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeHistoryList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), hIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/HistoryTypes.go b/services/nsxt-mp/nsx/upgrade/HistoryTypes.go new file mode 100644 index 000000000..136f34c4c --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/HistoryTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: History. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func historyListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func historyListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeHistoryListBindingType) +} + +func historyListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/history", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/NodesClient.go b/services/nsxt-mp/nsx/upgrade/NodesClient.go new file mode 100644 index 000000000..fd242bf8a --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/NodesClient.go @@ -0,0 +1,102 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Nodes +// Used by client-side stubs. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NodesClient interface { + + // Get list of nodes. If request parameter component type is specified, then all nodes for that component will be returned. If request parameter component version is specified, then all nodes at that version will be returned. + // + // @param componentTypeParam Component type based on which nodes will be filtered (optional) + // @param componentVersionParam Component version based on which nodes will be filtered (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.NodeInfoListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(componentTypeParam *string, componentVersionParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.NodeInfoListResult, error) +} + +type nodesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNodesClient(connector client.Connector) *nodesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.nodes") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nodesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nodesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nodesClient) List(componentTypeParam *string, componentVersionParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.NodeInfoListResult, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodesListInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + sv.AddStructField("ComponentVersion", componentVersionParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeInfoListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.nodes", "list", inputDataValue, executionContext) + var emptyOutput model.NodeInfoListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nodesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeInfoListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/NodesSummaryClient.go b/services/nsxt-mp/nsx/upgrade/NodesSummaryClient.go new file mode 100644 index 000000000..1b5d882f4 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/NodesSummaryClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: NodesSummary +// Used by client-side stubs. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type NodesSummaryClient interface { + + // Get summary of nodes, which includes node count for each type and component version. + // @return com.vmware.nsx.model.NodeSummaryList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.NodeSummaryList, error) +} + +type nodesSummaryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewNodesSummaryClient(connector client.Connector) *nodesSummaryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.nodes_summary") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + nIface := nodesSummaryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &nIface +} + +func (nIface *nodesSummaryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := nIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (nIface *nodesSummaryClient) Get() (model.NodeSummaryList, error) { + typeConverter := nIface.connector.TypeConverter() + executionContext := nIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(nodesSummaryGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.NodeSummaryList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := nodesSummaryGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + nIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := nIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.nodes_summary", "get", inputDataValue, executionContext) + var emptyOutput model.NodeSummaryList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), nodesSummaryGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.NodeSummaryList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), nIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/NodesSummaryTypes.go b/services/nsxt-mp/nsx/upgrade/NodesSummaryTypes.go new file mode 100644 index 000000000..83c31d2a0 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/NodesSummaryTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: NodesSummary. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func nodesSummaryGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodesSummaryGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeSummaryListBindingType) +} + +func nodesSummaryGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/nodes-summary", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/NodesTypes.go b/services/nsxt-mp/nsx/upgrade/NodesTypes.go new file mode 100644 index 000000000..ec24c3f89 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/NodesTypes.go @@ -0,0 +1,104 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Nodes. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func nodesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["component_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["component_version"] = "ComponentVersion" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func nodesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.NodeInfoListResultBindingType) +} + +func nodesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["component_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["component_version"] = "ComponentVersion" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["component_version"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["component_type"] = "component_type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["component_version"] = "component_version" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/nodes", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/PlanClient.go b/services/nsxt-mp/nsx/upgrade/PlanClient.go new file mode 100644 index 000000000..f2302c7f7 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/PlanClient.go @@ -0,0 +1,262 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Plan +// Used by client-side stubs. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type PlanClient interface { + + // Continue the upgrade. Resumes the upgrade from the point where it was paused. + // + // @param componentTypeParam Component to upgrade. (optional) + // @param skipParam Skip to upgrade of next component. (optional, default to false) + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Continue_(componentTypeParam *string, skipParam *bool) error + + // Pause the upgrade. Upgrade will be paused after upgrade of all the nodes currently in progress is completed either successfully or with failure. User can make changes in the upgrade plan when the upgrade is paused. + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Pause() error + + // Reset the upgrade plan to default plan. User has an option to change the default plan. But if after making changes, user wants to go back to the default plan, this is the way to do so. + // + // @param componentTypeParam Component type (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Reset(componentTypeParam string) error + + // This will stage the upgrade bits so that upgrade can be driven from outside NSX upgrade-coordinator. If component type is not provided as a request parameter then upgrade staging will be performed on all the components. + // + // @param componentTypeParam Component type (optional) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Stageupgrade(componentTypeParam *string) error + + // Start the upgrade. Upgrade will start as per the upgrade plan. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Start() error + + // Upgrades, Resumes the upgrade of a selected set of units. + // + // @param upgradeUnitListParam (required) + // @throws ConcurrentChange Conflict + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Upgradeselectedunits(upgradeUnitListParam model.UpgradeUnitList) error +} + +type planClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewPlanClient(connector client.Connector) *planClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.plan") + methodIdentifiers := map[string]core.MethodIdentifier{ + "continue": core.NewMethodIdentifier(interfaceIdentifier, "continue"), + "pause": core.NewMethodIdentifier(interfaceIdentifier, "pause"), + "reset": core.NewMethodIdentifier(interfaceIdentifier, "reset"), + "stageupgrade": core.NewMethodIdentifier(interfaceIdentifier, "stageupgrade"), + "start": core.NewMethodIdentifier(interfaceIdentifier, "start"), + "upgradeselectedunits": core.NewMethodIdentifier(interfaceIdentifier, "upgradeselectedunits"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + pIface := planClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &pIface +} + +func (pIface *planClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := pIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (pIface *planClient) Continue_(componentTypeParam *string, skipParam *bool) error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(planContinue_InputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + sv.AddStructField("Skip", skipParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := planContinue_RestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.plan", "continue", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *planClient) Pause() error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(planPauseInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := planPauseRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.plan", "pause", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *planClient) Reset(componentTypeParam string) error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(planResetInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := planResetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.plan", "reset", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *planClient) Stageupgrade(componentTypeParam *string) error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(planStageupgradeInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := planStageupgradeRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.plan", "stageupgrade", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *planClient) Start() error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(planStartInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := planStartRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.plan", "start", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *planClient) Upgradeselectedunits(upgradeUnitListParam model.UpgradeUnitList) error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(planUpgradeselectedunitsInputType(), typeConverter) + sv.AddStructField("UpgradeUnitList", upgradeUnitListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := planUpgradeselectedunitsRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.plan", "upgradeselectedunits", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/PlanTypes.go b/services/nsxt-mp/nsx/upgrade/PlanTypes.go new file mode 100644 index 000000000..e433f99df --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/PlanTypes.go @@ -0,0 +1,306 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Plan. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func planContinue_InputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["skip"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["skip"] = "Skip" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func planContinue_OutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func planContinue_RestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["skip"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["skip"] = "Skip" + paramsTypeMap["skip"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["component_type"] = "component_type" + queryParams["skip"] = "skip" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=continue", + "", + "POST", + "/api/v1/upgrade/plan", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func planPauseInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func planPauseOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func planPauseRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=pause", + "", + "POST", + "/api/v1/upgrade/plan", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func planResetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewStringType() + fieldNameMap["component_type"] = "ComponentType" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func planResetOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func planResetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewStringType() + fieldNameMap["component_type"] = "ComponentType" + paramsTypeMap["component_type"] = bindings.NewStringType() + queryParams["component_type"] = "component_type" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=reset", + "", + "POST", + "/api/v1/upgrade/plan", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func planStageupgradeInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func planStageupgradeOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func planStageupgradeRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + paramsTypeMap["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["component_type"] = "component_type" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=stage-upgrade", + "", + "POST", + "/api/v1/upgrade/plan", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func planStartInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func planStartOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func planStartRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=start", + "", + "POST", + "/api/v1/upgrade/plan", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func planUpgradeselectedunitsInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["upgrade_unit_list"] = bindings.NewReferenceType(model.UpgradeUnitListBindingType) + fieldNameMap["upgrade_unit_list"] = "UpgradeUnitList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func planUpgradeselectedunitsOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func planUpgradeselectedunitsRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["upgrade_unit_list"] = bindings.NewReferenceType(model.UpgradeUnitListBindingType) + fieldNameMap["upgrade_unit_list"] = "UpgradeUnitList" + paramsTypeMap["upgrade_unit_list"] = bindings.NewReferenceType(model.UpgradeUnitListBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=upgrade_selected_units", + "upgrade_unit_list", + "POST", + "/api/v1/upgrade/plan", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.concurrent_change": 409, "com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/StatusSummaryClient.go b/services/nsxt-mp/nsx/upgrade/StatusSummaryClient.go new file mode 100644 index 000000000..28badff78 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/StatusSummaryClient.go @@ -0,0 +1,94 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: StatusSummary +// Used by client-side stubs. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusSummaryClient interface { + + // Get upgrade status summary + // + // @param componentTypeParam Component type based on which upgrade units to be filtered (optional) + // @param selectionStatusParam Flag to indicate whether to return status for only selected, only deselected or both type of upgrade units (optional, default to ALL) + // @param showHistoryParam Get upgrade activity for a given component (optional) + // @return com.vmware.nsx.model.UpgradeStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(componentTypeParam *string, selectionStatusParam *string, showHistoryParam *bool) (model.UpgradeStatus, error) +} + +type statusSummaryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusSummaryClient(connector client.Connector) *statusSummaryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.status_summary") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusSummaryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusSummaryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusSummaryClient) Get(componentTypeParam *string, selectionStatusParam *string, showHistoryParam *bool) (model.UpgradeStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusSummaryGetInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + sv.AddStructField("SelectionStatus", selectionStatusParam) + sv.AddStructField("ShowHistory", showHistoryParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusSummaryGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.status_summary", "get", inputDataValue, executionContext) + var emptyOutput model.UpgradeStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusSummaryGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/StatusSummaryTypes.go b/services/nsxt-mp/nsx/upgrade/StatusSummaryTypes.go new file mode 100644 index 000000000..93e17ac4c --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/StatusSummaryTypes.go @@ -0,0 +1,89 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: StatusSummary. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``selectionStatus`` of method StatusSummary#get. +const StatusSummary_GET_SELECTION_STATUS_SELECTED = "SELECTED" + +// Possible value for ``selectionStatus`` of method StatusSummary#get. +const StatusSummary_GET_SELECTION_STATUS_DESELECTED = "DESELECTED" + +// Possible value for ``selectionStatus`` of method StatusSummary#get. +const StatusSummary_GET_SELECTION_STATUS_ALL = "ALL" + +func statusSummaryGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["selection_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["show_history"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["selection_status"] = "SelectionStatus" + fieldNameMap["show_history"] = "ShowHistory" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusSummaryGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeStatusBindingType) +} + +func statusSummaryGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["selection_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["show_history"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["selection_status"] = "SelectionStatus" + fieldNameMap["show_history"] = "ShowHistory" + paramsTypeMap["selection_status"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["show_history"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["component_type"] = "component_type" + queryParams["selection_status"] = "selection_status" + queryParams["show_history"] = "show_history" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/status-summary", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/SummaryClient.go b/services/nsxt-mp/nsx/upgrade/SummaryClient.go new file mode 100644 index 000000000..6a806f5d6 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/SummaryClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Summary +// Used by client-side stubs. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SummaryClient interface { + + // Get upgrade summary + // @return com.vmware.nsx.model.UpgradeSummary + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.UpgradeSummary, error) +} + +type summaryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSummaryClient(connector client.Connector) *summaryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.summary") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := summaryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *summaryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *summaryClient) Get() (model.UpgradeSummary, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(summaryGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeSummary + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := summaryGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.summary", "get", inputDataValue, executionContext) + var emptyOutput model.UpgradeSummary + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), summaryGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeSummary), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/SummaryTypes.go b/services/nsxt-mp/nsx/upgrade/SummaryTypes.go new file mode 100644 index 000000000..4023b4cf2 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/SummaryTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Summary. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func summaryGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func summaryGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeSummaryBindingType) +} + +func summaryGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/summary", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/UcUpgradeStatusClient.go b/services/nsxt-mp/nsx/upgrade/UcUpgradeStatusClient.go new file mode 100644 index 000000000..2f29e7e52 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/UcUpgradeStatusClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: UcUpgradeStatus +// Used by client-side stubs. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UcUpgradeStatusClient interface { + + // Get upgrade-coordinator upgrade status + // @return com.vmware.nsx.model.UcUpgradeStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.UcUpgradeStatus, error) +} + +type ucUpgradeStatusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUcUpgradeStatusClient(connector client.Connector) *ucUpgradeStatusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.uc_upgrade_status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := ucUpgradeStatusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *ucUpgradeStatusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *ucUpgradeStatusClient) Get() (model.UcUpgradeStatus, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ucUpgradeStatusGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UcUpgradeStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ucUpgradeStatusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.uc_upgrade_status", "get", inputDataValue, executionContext) + var emptyOutput model.UcUpgradeStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ucUpgradeStatusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UcUpgradeStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/UcUpgradeStatusTypes.go b/services/nsxt-mp/nsx/upgrade/UcUpgradeStatusTypes.go new file mode 100644 index 000000000..1552a5109 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/UcUpgradeStatusTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: UcUpgradeStatus. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func ucUpgradeStatusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ucUpgradeStatusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UcUpgradeStatusBindingType) +} + +func ucUpgradeStatusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/uc-upgrade-status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/UpgradeChecksInfoClient.go b/services/nsxt-mp/nsx/upgrade/UpgradeChecksInfoClient.go new file mode 100644 index 000000000..062d5f939 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/UpgradeChecksInfoClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: UpgradeChecksInfo +// Used by client-side stubs. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UpgradeChecksInfoClient interface { + + // Returns information of pre-upgrade and post-upgrade checks. If request parameter component type is specified, then returns information about all pre-upgrade and post-upgrade for the component. Otherwise returns information of checks across all component types. + // + // @param componentTypeParam Component type based on which upgrade checks are to be filtered (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.ComponentUpgradeChecksInfoListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(componentTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ComponentUpgradeChecksInfoListResult, error) +} + +type upgradeChecksInfoClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUpgradeChecksInfoClient(connector client.Connector) *upgradeChecksInfoClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.upgrade_checks_info") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := upgradeChecksInfoClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *upgradeChecksInfoClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *upgradeChecksInfoClient) List(componentTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.ComponentUpgradeChecksInfoListResult, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(upgradeChecksInfoListInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.ComponentUpgradeChecksInfoListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := upgradeChecksInfoListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.upgrade_checks_info", "list", inputDataValue, executionContext) + var emptyOutput model.ComponentUpgradeChecksInfoListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), upgradeChecksInfoListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.ComponentUpgradeChecksInfoListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/UpgradeChecksInfoTypes.go b/services/nsxt-mp/nsx/upgrade/UpgradeChecksInfoTypes.go new file mode 100644 index 000000000..119ee2267 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/UpgradeChecksInfoTypes.go @@ -0,0 +1,98 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: UpgradeChecksInfo. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func upgradeChecksInfoListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func upgradeChecksInfoListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.ComponentUpgradeChecksInfoListResultBindingType) +} + +func upgradeChecksInfoListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["component_type"] = "component_type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/upgrade-checks-info", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/UpgradePackageTypes.go b/services/nsxt-mp/nsx/upgrade/UpgradePackageTypes.go new file mode 100644 index 000000000..3c054e10e --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/UpgradePackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.upgrade. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade diff --git a/services/nsxt-mp/nsx/upgrade/UpgradeUnitGroupsClient.go b/services/nsxt-mp/nsx/upgrade/UpgradeUnitGroupsClient.go new file mode 100644 index 000000000..9ae5ee1f2 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/UpgradeUnitGroupsClient.go @@ -0,0 +1,356 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: UpgradeUnitGroups +// Used by client-side stubs. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UpgradeUnitGroupsClient interface { + + // Add upgrade units to specified upgrade unit group. The upgrade units will be added at the end of the upgrade unit list. + // + // @param groupIdParam (required) + // @param upgradeUnitListParam (required) + // @return com.vmware.nsx.model.UpgradeUnitList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Addupgradeunits(groupIdParam string, upgradeUnitListParam model.UpgradeUnitList) (model.UpgradeUnitList, error) + + // Create a group of upgrade units. + // + // @param upgradeUnitGroupParam (required) + // @return com.vmware.nsx.model.UpgradeUnitGroup + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(upgradeUnitGroupParam model.UpgradeUnitGroup) (model.UpgradeUnitGroup, error) + + // Delete the specified group. NOTE - A group can be deleted only if it is empty. If user tries to delete a group containing one or more upgrade units, the operation will fail and an error will be returned. + // + // @param groupIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(groupIdParam string) error + + // Returns information about a specific upgrade unit group in the upgrade plan. If request parameter summary is set to true, then only count of upgrade units will be returned, upgrade units list will be empty. + // + // @param groupIdParam (required) + // @param summaryParam Flag indicating whether to return the summary (optional, default to false) + // @return com.vmware.nsx.model.UpgradeUnitGroup + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(groupIdParam string, summaryParam *bool) (model.UpgradeUnitGroup, error) + + // Return information of all upgrade unit groups in the upgrade plan. If request parameter summary is set to true, then only count of upgrade units will be returned, upgrade units list will be empty. If request parameter component type is specified, then all upgrade unit groups for that component will be returned. + // + // @param componentTypeParam Component type based on which upgrade unit groups to be filtered (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param summaryParam Flag indicating whether to return summary (optional, default to false) + // @param syncParam Synchronize before returning upgrade unit groups (optional, default to false) + // @return com.vmware.nsx.model.UpgradeUnitGroupListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(componentTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, summaryParam *bool, syncParam *bool) (model.UpgradeUnitGroupListResult, error) + + // Reorder an upgrade unit group by placing it before/after the specified upgrade unit group. + // + // @param groupIdParam (required) + // @param reorderRequestParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Reorder(groupIdParam string, reorderRequestParam model.ReorderRequest) error + + // Update the specified upgrade unit group. Removal of upgrade units from the group using this is not allowed. An error will be returned in that case. + // + // @param groupIdParam (required) + // @param upgradeUnitGroupParam (required) + // @return com.vmware.nsx.model.UpgradeUnitGroup + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(groupIdParam string, upgradeUnitGroupParam model.UpgradeUnitGroup) (model.UpgradeUnitGroup, error) +} + +type upgradeUnitGroupsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUpgradeUnitGroupsClient(connector client.Connector) *upgradeUnitGroupsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.upgrade_unit_groups") + methodIdentifiers := map[string]core.MethodIdentifier{ + "addupgradeunits": core.NewMethodIdentifier(interfaceIdentifier, "addupgradeunits"), + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "reorder": core.NewMethodIdentifier(interfaceIdentifier, "reorder"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := upgradeUnitGroupsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *upgradeUnitGroupsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *upgradeUnitGroupsClient) Addupgradeunits(groupIdParam string, upgradeUnitListParam model.UpgradeUnitList) (model.UpgradeUnitList, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(upgradeUnitGroupsAddupgradeunitsInputType(), typeConverter) + sv.AddStructField("GroupId", groupIdParam) + sv.AddStructField("UpgradeUnitList", upgradeUnitListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeUnitList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := upgradeUnitGroupsAddupgradeunitsRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.upgrade_unit_groups", "addupgradeunits", inputDataValue, executionContext) + var emptyOutput model.UpgradeUnitList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), upgradeUnitGroupsAddupgradeunitsOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeUnitList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (uIface *upgradeUnitGroupsClient) Create(upgradeUnitGroupParam model.UpgradeUnitGroup) (model.UpgradeUnitGroup, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(upgradeUnitGroupsCreateInputType(), typeConverter) + sv.AddStructField("UpgradeUnitGroup", upgradeUnitGroupParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeUnitGroup + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := upgradeUnitGroupsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.upgrade_unit_groups", "create", inputDataValue, executionContext) + var emptyOutput model.UpgradeUnitGroup + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), upgradeUnitGroupsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeUnitGroup), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (uIface *upgradeUnitGroupsClient) Delete(groupIdParam string) error { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(upgradeUnitGroupsDeleteInputType(), typeConverter) + sv.AddStructField("GroupId", groupIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := upgradeUnitGroupsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.upgrade_unit_groups", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (uIface *upgradeUnitGroupsClient) Get(groupIdParam string, summaryParam *bool) (model.UpgradeUnitGroup, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(upgradeUnitGroupsGetInputType(), typeConverter) + sv.AddStructField("GroupId", groupIdParam) + sv.AddStructField("Summary", summaryParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeUnitGroup + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := upgradeUnitGroupsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.upgrade_unit_groups", "get", inputDataValue, executionContext) + var emptyOutput model.UpgradeUnitGroup + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), upgradeUnitGroupsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeUnitGroup), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (uIface *upgradeUnitGroupsClient) List(componentTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, summaryParam *bool, syncParam *bool) (model.UpgradeUnitGroupListResult, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(upgradeUnitGroupsListInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Summary", summaryParam) + sv.AddStructField("Sync", syncParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeUnitGroupListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := upgradeUnitGroupsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.upgrade_unit_groups", "list", inputDataValue, executionContext) + var emptyOutput model.UpgradeUnitGroupListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), upgradeUnitGroupsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeUnitGroupListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (uIface *upgradeUnitGroupsClient) Reorder(groupIdParam string, reorderRequestParam model.ReorderRequest) error { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(upgradeUnitGroupsReorderInputType(), typeConverter) + sv.AddStructField("GroupId", groupIdParam) + sv.AddStructField("ReorderRequest", reorderRequestParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := upgradeUnitGroupsReorderRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.upgrade_unit_groups", "reorder", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (uIface *upgradeUnitGroupsClient) Update(groupIdParam string, upgradeUnitGroupParam model.UpgradeUnitGroup) (model.UpgradeUnitGroup, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(upgradeUnitGroupsUpdateInputType(), typeConverter) + sv.AddStructField("GroupId", groupIdParam) + sv.AddStructField("UpgradeUnitGroup", upgradeUnitGroupParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeUnitGroup + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := upgradeUnitGroupsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.upgrade_unit_groups", "update", inputDataValue, executionContext) + var emptyOutput model.UpgradeUnitGroup + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), upgradeUnitGroupsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeUnitGroup), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/UpgradeUnitGroupsStatusClient.go b/services/nsxt-mp/nsx/upgrade/UpgradeUnitGroupsStatusClient.go new file mode 100644 index 000000000..0ce560b01 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/UpgradeUnitGroupsStatusClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: UpgradeUnitGroupsStatus +// Used by client-side stubs. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UpgradeUnitGroupsStatusClient interface { + + // Get upgrade status for upgrade unit groups + // + // @param componentTypeParam Component type on which the action is performed or on which the results are filtered (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.UpgradeUnitGroupStatusListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Getall(componentTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.UpgradeUnitGroupStatusListResult, error) +} + +type upgradeUnitGroupsStatusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUpgradeUnitGroupsStatusClient(connector client.Connector) *upgradeUnitGroupsStatusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.upgrade_unit_groups_status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "getall": core.NewMethodIdentifier(interfaceIdentifier, "getall"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := upgradeUnitGroupsStatusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *upgradeUnitGroupsStatusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *upgradeUnitGroupsStatusClient) Getall(componentTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.UpgradeUnitGroupStatusListResult, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(upgradeUnitGroupsStatusGetallInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeUnitGroupStatusListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := upgradeUnitGroupsStatusGetallRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.upgrade_unit_groups_status", "getall", inputDataValue, executionContext) + var emptyOutput model.UpgradeUnitGroupStatusListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), upgradeUnitGroupsStatusGetallOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeUnitGroupStatusListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/UpgradeUnitGroupsStatusTypes.go b/services/nsxt-mp/nsx/upgrade/UpgradeUnitGroupsStatusTypes.go new file mode 100644 index 000000000..f80fe9030 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/UpgradeUnitGroupsStatusTypes.go @@ -0,0 +1,98 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: UpgradeUnitGroupsStatus. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func upgradeUnitGroupsStatusGetallInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func upgradeUnitGroupsStatusGetallOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeUnitGroupStatusListResultBindingType) +} + +func upgradeUnitGroupsStatusGetallRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["component_type"] = "component_type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/upgrade-unit-groups-status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/UpgradeUnitGroupsTypes.go b/services/nsxt-mp/nsx/upgrade/UpgradeUnitGroupsTypes.go new file mode 100644 index 000000000..fa105da34 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/UpgradeUnitGroupsTypes.go @@ -0,0 +1,429 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: UpgradeUnitGroups. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func upgradeUnitGroupsAddupgradeunitsInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["group_id"] = bindings.NewStringType() + fields["upgrade_unit_list"] = bindings.NewReferenceType(model.UpgradeUnitListBindingType) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["upgrade_unit_list"] = "UpgradeUnitList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func upgradeUnitGroupsAddupgradeunitsOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeUnitListBindingType) +} + +func upgradeUnitGroupsAddupgradeunitsRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["group_id"] = bindings.NewStringType() + fields["upgrade_unit_list"] = bindings.NewReferenceType(model.UpgradeUnitListBindingType) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["upgrade_unit_list"] = "UpgradeUnitList" + paramsTypeMap["upgrade_unit_list"] = bindings.NewReferenceType(model.UpgradeUnitListBindingType) + paramsTypeMap["group_id"] = bindings.NewStringType() + paramsTypeMap["groupId"] = bindings.NewStringType() + pathParams["group_id"] = "groupId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=add_upgrade_units", + "upgrade_unit_list", + "POST", + "/api/v1/upgrade/upgrade-unit-groups/{groupId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func upgradeUnitGroupsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["upgrade_unit_group"] = bindings.NewReferenceType(model.UpgradeUnitGroupBindingType) + fieldNameMap["upgrade_unit_group"] = "UpgradeUnitGroup" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func upgradeUnitGroupsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeUnitGroupBindingType) +} + +func upgradeUnitGroupsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["upgrade_unit_group"] = bindings.NewReferenceType(model.UpgradeUnitGroupBindingType) + fieldNameMap["upgrade_unit_group"] = "UpgradeUnitGroup" + paramsTypeMap["upgrade_unit_group"] = bindings.NewReferenceType(model.UpgradeUnitGroupBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "upgrade_unit_group", + "POST", + "/api/v1/upgrade/upgrade-unit-groups", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func upgradeUnitGroupsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["group_id"] = bindings.NewStringType() + fieldNameMap["group_id"] = "GroupId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func upgradeUnitGroupsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func upgradeUnitGroupsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["group_id"] = bindings.NewStringType() + fieldNameMap["group_id"] = "GroupId" + paramsTypeMap["group_id"] = bindings.NewStringType() + paramsTypeMap["groupId"] = bindings.NewStringType() + pathParams["group_id"] = "groupId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/upgrade/upgrade-unit-groups/{groupId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func upgradeUnitGroupsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["group_id"] = bindings.NewStringType() + fields["summary"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["summary"] = "Summary" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func upgradeUnitGroupsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeUnitGroupBindingType) +} + +func upgradeUnitGroupsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["group_id"] = bindings.NewStringType() + fields["summary"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["summary"] = "Summary" + paramsTypeMap["group_id"] = bindings.NewStringType() + paramsTypeMap["summary"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["groupId"] = bindings.NewStringType() + pathParams["group_id"] = "groupId" + queryParams["summary"] = "summary" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/upgrade-unit-groups/{groupId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func upgradeUnitGroupsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["summary"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sync"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["summary"] = "Summary" + fieldNameMap["sync"] = "Sync" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func upgradeUnitGroupsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeUnitGroupListResultBindingType) +} + +func upgradeUnitGroupsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["summary"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sync"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["summary"] = "Summary" + fieldNameMap["sync"] = "Sync" + paramsTypeMap["sync"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["summary"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["summary"] = "summary" + queryParams["component_type"] = "component_type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["sync"] = "sync" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/upgrade-unit-groups", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func upgradeUnitGroupsReorderInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["group_id"] = bindings.NewStringType() + fields["reorder_request"] = bindings.NewReferenceType(model.ReorderRequestBindingType) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["reorder_request"] = "ReorderRequest" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func upgradeUnitGroupsReorderOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func upgradeUnitGroupsReorderRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["group_id"] = bindings.NewStringType() + fields["reorder_request"] = bindings.NewReferenceType(model.ReorderRequestBindingType) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["reorder_request"] = "ReorderRequest" + paramsTypeMap["group_id"] = bindings.NewStringType() + paramsTypeMap["reorder_request"] = bindings.NewReferenceType(model.ReorderRequestBindingType) + paramsTypeMap["groupId"] = bindings.NewStringType() + pathParams["group_id"] = "groupId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=reorder", + "reorder_request", + "POST", + "/api/v1/upgrade/upgrade-unit-groups/{groupId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func upgradeUnitGroupsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["group_id"] = bindings.NewStringType() + fields["upgrade_unit_group"] = bindings.NewReferenceType(model.UpgradeUnitGroupBindingType) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["upgrade_unit_group"] = "UpgradeUnitGroup" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func upgradeUnitGroupsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeUnitGroupBindingType) +} + +func upgradeUnitGroupsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["group_id"] = bindings.NewStringType() + fields["upgrade_unit_group"] = bindings.NewReferenceType(model.UpgradeUnitGroupBindingType) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["upgrade_unit_group"] = "UpgradeUnitGroup" + paramsTypeMap["group_id"] = bindings.NewStringType() + paramsTypeMap["upgrade_unit_group"] = bindings.NewReferenceType(model.UpgradeUnitGroupBindingType) + paramsTypeMap["groupId"] = bindings.NewStringType() + pathParams["group_id"] = "groupId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "upgrade_unit_group", + "PUT", + "/api/v1/upgrade/upgrade-unit-groups/{groupId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/UpgradeUnitsClient.go b/services/nsxt-mp/nsx/upgrade/UpgradeUnitsClient.go new file mode 100644 index 000000000..70d3f9a49 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/UpgradeUnitsClient.go @@ -0,0 +1,153 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: UpgradeUnits +// Used by client-side stubs. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UpgradeUnitsClient interface { + + // Get a specific upgrade unit + // + // @param upgradeUnitIdParam (required) + // @return com.vmware.nsx.model.UpgradeUnit + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(upgradeUnitIdParam string) (model.UpgradeUnit, error) + + // Get upgrade units + // + // @param componentTypeParam Component type based on which upgrade units to be filtered (optional) + // @param currentVersionParam Current version of upgrade unit based on which upgrade units to be filtered (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param groupIdParam UUID of group based on which upgrade units to be filtered (optional) + // @param hasWarningsParam Flag to indicate whether to return only upgrade units with warnings (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param metadataParam Metadata about upgrade unit to filter on (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param upgradeUnitTypeParam Upgrade unit type based on which upgrade units to be filtered (optional) + // @return com.vmware.nsx.model.UpgradeUnitListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(componentTypeParam *string, currentVersionParam *string, cursorParam *string, groupIdParam *string, hasWarningsParam *bool, includedFieldsParam *string, metadataParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, upgradeUnitTypeParam *string) (model.UpgradeUnitListResult, error) +} + +type upgradeUnitsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUpgradeUnitsClient(connector client.Connector) *upgradeUnitsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.upgrade_units") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := upgradeUnitsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *upgradeUnitsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *upgradeUnitsClient) Get(upgradeUnitIdParam string) (model.UpgradeUnit, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(upgradeUnitsGetInputType(), typeConverter) + sv.AddStructField("UpgradeUnitId", upgradeUnitIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeUnit + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := upgradeUnitsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.upgrade_units", "get", inputDataValue, executionContext) + var emptyOutput model.UpgradeUnit + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), upgradeUnitsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeUnit), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (uIface *upgradeUnitsClient) List(componentTypeParam *string, currentVersionParam *string, cursorParam *string, groupIdParam *string, hasWarningsParam *bool, includedFieldsParam *string, metadataParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, upgradeUnitTypeParam *string) (model.UpgradeUnitListResult, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(upgradeUnitsListInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + sv.AddStructField("CurrentVersion", currentVersionParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("GroupId", groupIdParam) + sv.AddStructField("HasWarnings", hasWarningsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("Metadata", metadataParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("UpgradeUnitType", upgradeUnitTypeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeUnitListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := upgradeUnitsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.upgrade_units", "list", inputDataValue, executionContext) + var emptyOutput model.UpgradeUnitListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), upgradeUnitsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeUnitListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/UpgradeUnitsStatsClient.go b/services/nsxt-mp/nsx/upgrade/UpgradeUnitsStatsClient.go new file mode 100644 index 000000000..35d1623a4 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/UpgradeUnitsStatsClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: UpgradeUnitsStats +// Used by client-side stubs. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UpgradeUnitsStatsClient interface { + + // Get upgrade units stats + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param syncParam Synchronize before returning upgrade unit stats (optional, default to false) + // @return com.vmware.nsx.model.UpgradeUnitTypeStatsList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, syncParam *bool) (model.UpgradeUnitTypeStatsList, error) +} + +type upgradeUnitsStatsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUpgradeUnitsStatsClient(connector client.Connector) *upgradeUnitsStatsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.upgrade_units_stats") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := upgradeUnitsStatsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *upgradeUnitsStatsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *upgradeUnitsStatsClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, syncParam *bool) (model.UpgradeUnitTypeStatsList, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(upgradeUnitsStatsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Sync", syncParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeUnitTypeStatsList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := upgradeUnitsStatsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.upgrade_units_stats", "list", inputDataValue, executionContext) + var emptyOutput model.UpgradeUnitTypeStatsList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), upgradeUnitsStatsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeUnitTypeStatsList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/UpgradeUnitsStatsTypes.go b/services/nsxt-mp/nsx/upgrade/UpgradeUnitsStatsTypes.go new file mode 100644 index 000000000..ec429d701 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/UpgradeUnitsStatsTypes.go @@ -0,0 +1,98 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: UpgradeUnitsStats. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func upgradeUnitsStatsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sync"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["sync"] = "Sync" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func upgradeUnitsStatsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeUnitTypeStatsListBindingType) +} + +func upgradeUnitsStatsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sync"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["sync"] = "Sync" + paramsTypeMap["sync"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["sync"] = "sync" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/upgrade-units-stats", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/UpgradeUnitsTypes.go b/services/nsxt-mp/nsx/upgrade/UpgradeUnitsTypes.go new file mode 100644 index 000000000..4a797c2ad --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/UpgradeUnitsTypes.go @@ -0,0 +1,178 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: UpgradeUnits. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func upgradeUnitsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["upgrade_unit_id"] = bindings.NewStringType() + fieldNameMap["upgrade_unit_id"] = "UpgradeUnitId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func upgradeUnitsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeUnitBindingType) +} + +func upgradeUnitsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["upgrade_unit_id"] = bindings.NewStringType() + fieldNameMap["upgrade_unit_id"] = "UpgradeUnitId" + paramsTypeMap["upgrade_unit_id"] = bindings.NewStringType() + paramsTypeMap["upgradeUnitId"] = bindings.NewStringType() + pathParams["upgrade_unit_id"] = "upgradeUnitId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/upgrade-units/{upgradeUnitId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func upgradeUnitsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["current_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["has_warnings"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["metadata"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["upgrade_unit_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["current_version"] = "CurrentVersion" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["has_warnings"] = "HasWarnings" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["metadata"] = "Metadata" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["upgrade_unit_type"] = "UpgradeUnitType" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func upgradeUnitsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeUnitListResultBindingType) +} + +func upgradeUnitsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["current_version"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["has_warnings"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["metadata"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["upgrade_unit_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["current_version"] = "CurrentVersion" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["has_warnings"] = "HasWarnings" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["metadata"] = "Metadata" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["upgrade_unit_type"] = "UpgradeUnitType" + paramsTypeMap["has_warnings"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["metadata"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["upgrade_unit_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["current_version"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["component_type"] = "component_type" + queryParams["metadata"] = "metadata" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["group_id"] = "group_id" + queryParams["included_fields"] = "included_fields" + queryParams["current_version"] = "current_version" + queryParams["has_warnings"] = "has_warnings" + queryParams["sort_by"] = "sort_by" + queryParams["upgrade_unit_type"] = "upgrade_unit_type" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/upgrade-units", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/VersionWhitelistClient.go b/services/nsxt-mp/nsx/upgrade/VersionWhitelistClient.go new file mode 100644 index 000000000..6ff747f02 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/VersionWhitelistClient.go @@ -0,0 +1,168 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: VersionWhitelist +// Used by client-side stubs. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type VersionWhitelistClient interface { + + // Get whitelist of versions for a component. Component can include HOST, EDGE, CCP, MP + // + // @param componentTypeParam (required) + // @return com.vmware.nsx.model.AcceptableComponentVersion + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(componentTypeParam string) (model.AcceptableComponentVersion, error) + + // Get whitelist of versions for different components + // @return com.vmware.nsx.model.AcceptableComponentVersionList + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List() (model.AcceptableComponentVersionList, error) + + // Update the version whitelist for the specified component type (HOST, EDGE, CCP, MP). + // + // @param componentTypeParam (required) + // @param versionListParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(componentTypeParam string, versionListParam model.VersionList) error +} + +type versionWhitelistClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewVersionWhitelistClient(connector client.Connector) *versionWhitelistClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.version_whitelist") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + vIface := versionWhitelistClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &vIface +} + +func (vIface *versionWhitelistClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := vIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (vIface *versionWhitelistClient) Get(componentTypeParam string) (model.AcceptableComponentVersion, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(versionWhitelistGetInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.AcceptableComponentVersion + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := versionWhitelistGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.version_whitelist", "get", inputDataValue, executionContext) + var emptyOutput model.AcceptableComponentVersion + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), versionWhitelistGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.AcceptableComponentVersion), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (vIface *versionWhitelistClient) List() (model.AcceptableComponentVersionList, error) { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(versionWhitelistListInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.AcceptableComponentVersionList + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := versionWhitelistListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.version_whitelist", "list", inputDataValue, executionContext) + var emptyOutput model.AcceptableComponentVersionList + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), versionWhitelistListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.AcceptableComponentVersionList), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (vIface *versionWhitelistClient) Update(componentTypeParam string, versionListParam model.VersionList) error { + typeConverter := vIface.connector.TypeConverter() + executionContext := vIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(versionWhitelistUpdateInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + sv.AddStructField("VersionList", versionListParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := versionWhitelistUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + vIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := vIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.version_whitelist", "update", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), vIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/VersionWhitelistTypes.go b/services/nsxt-mp/nsx/upgrade/VersionWhitelistTypes.go new file mode 100644 index 000000000..cf42dff20 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/VersionWhitelistTypes.go @@ -0,0 +1,167 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: VersionWhitelist. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func versionWhitelistGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewStringType() + fieldNameMap["component_type"] = "ComponentType" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func versionWhitelistGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.AcceptableComponentVersionBindingType) +} + +func versionWhitelistGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewStringType() + fieldNameMap["component_type"] = "ComponentType" + paramsTypeMap["component_type"] = bindings.NewStringType() + paramsTypeMap["componentType"] = bindings.NewStringType() + pathParams["component_type"] = "componentType" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/version-whitelist/{componentType}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func versionWhitelistListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func versionWhitelistListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.AcceptableComponentVersionListBindingType) +} + +func versionWhitelistListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/version-whitelist", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func versionWhitelistUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewStringType() + fields["version_list"] = bindings.NewReferenceType(model.VersionListBindingType) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["version_list"] = "VersionList" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func versionWhitelistUpdateOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func versionWhitelistUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewStringType() + fields["version_list"] = bindings.NewReferenceType(model.VersionListBindingType) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["version_list"] = "VersionList" + paramsTypeMap["component_type"] = bindings.NewStringType() + paramsTypeMap["version_list"] = bindings.NewReferenceType(model.VersionListBindingType) + paramsTypeMap["componentType"] = bindings.NewStringType() + pathParams["component_type"] = "componentType" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "version_list", + "PUT", + "/api/v1/upgrade/version-whitelist/{componentType}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/bundles/BundlesPackageTypes.go b/services/nsxt-mp/nsx/upgrade/bundles/BundlesPackageTypes.go new file mode 100644 index 000000000..9a1d8c77b --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/bundles/BundlesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.upgrade.bundles. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package bundles diff --git a/services/nsxt-mp/nsx/upgrade/bundles/UploadStatusClient.go b/services/nsxt-mp/nsx/upgrade/bundles/UploadStatusClient.go new file mode 100644 index 000000000..64db00a2d --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/bundles/UploadStatusClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: UploadStatus +// Used by client-side stubs. + +package bundles + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UploadStatusClient interface { + + // Get uploaded upgrade bundle upload status + // + // @param bundleIdParam (required) + // @return com.vmware.nsx.model.UpgradeBundleUploadStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(bundleIdParam string) (model.UpgradeBundleUploadStatus, error) +} + +type uploadStatusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUploadStatusClient(connector client.Connector) *uploadStatusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.bundles.upload_status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := uploadStatusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *uploadStatusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *uploadStatusClient) Get(bundleIdParam string) (model.UpgradeBundleUploadStatus, error) { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(uploadStatusGetInputType(), typeConverter) + sv.AddStructField("BundleId", bundleIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeBundleUploadStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := uploadStatusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.bundles.upload_status", "get", inputDataValue, executionContext) + var emptyOutput model.UpgradeBundleUploadStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), uploadStatusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeBundleUploadStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/bundles/UploadStatusTypes.go b/services/nsxt-mp/nsx/upgrade/bundles/UploadStatusTypes.go new file mode 100644 index 000000000..dd63ebca1 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/bundles/UploadStatusTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: UploadStatus. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package bundles + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func uploadStatusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["bundle_id"] = bindings.NewStringType() + fieldNameMap["bundle_id"] = "BundleId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func uploadStatusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeBundleUploadStatusBindingType) +} + +func uploadStatusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["bundle_id"] = bindings.NewStringType() + fieldNameMap["bundle_id"] = "BundleId" + paramsTypeMap["bundle_id"] = bindings.NewStringType() + paramsTypeMap["bundleId"] = bindings.NewStringType() + pathParams["bundle_id"] = "bundleId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/bundles/{bundleId}/upload-status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/eula/AcceptClient.go b/services/nsxt-mp/nsx/upgrade/eula/AcceptClient.go new file mode 100644 index 000000000..a0946f341 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/eula/AcceptClient.go @@ -0,0 +1,79 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Accept +// Used by client-side stubs. + +package eula + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AcceptClient interface { + + // Accept end user license agreement + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create() error +} + +type acceptClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAcceptClient(connector client.Connector) *acceptClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.eula.accept") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := acceptClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *acceptClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *acceptClient) Create() error { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(acceptCreateInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := acceptCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.eula.accept", "create", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/eula/AcceptTypes.go b/services/nsxt-mp/nsx/upgrade/eula/AcceptTypes.go new file mode 100644 index 000000000..f401e587d --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/eula/AcceptTypes.go @@ -0,0 +1,61 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Accept. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package eula + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "reflect" +) + +func acceptCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func acceptCreateOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func acceptCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "POST", + "/api/v1/upgrade/eula/accept", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/eula/AcceptanceClient.go b/services/nsxt-mp/nsx/upgrade/eula/AcceptanceClient.go new file mode 100644 index 000000000..658bfa779 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/eula/AcceptanceClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Acceptance +// Used by client-side stubs. + +package eula + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AcceptanceClient interface { + + // Return the acceptance status of end user license agreement + // @return com.vmware.nsx.model.EULAAcceptance + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get() (model.EULAAcceptance, error) +} + +type acceptanceClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAcceptanceClient(connector client.Connector) *acceptanceClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.eula.acceptance") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := acceptanceClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *acceptanceClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *acceptanceClient) Get() (model.EULAAcceptance, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(acceptanceGetInputType(), typeConverter) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EULAAcceptance + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := acceptanceGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.eula.acceptance", "get", inputDataValue, executionContext) + var emptyOutput model.EULAAcceptance + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), acceptanceGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EULAAcceptance), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/eula/AcceptanceTypes.go b/services/nsxt-mp/nsx/upgrade/eula/AcceptanceTypes.go new file mode 100644 index 000000000..104ba1879 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/eula/AcceptanceTypes.go @@ -0,0 +1,62 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Acceptance. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package eula + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func acceptanceGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func acceptanceGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EULAAcceptanceBindingType) +} + +func acceptanceGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/eula/acceptance", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/eula/ContentClient.go b/services/nsxt-mp/nsx/upgrade/eula/ContentClient.go new file mode 100644 index 000000000..b1f5434a2 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/eula/ContentClient.go @@ -0,0 +1,100 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Content +// Used by client-side stubs. + +package eula + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ContentClient interface { + + // Return the content of end user license agreement in the specified format. By default, it's pure string without line break + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param valueFormatParam End User License Agreement content output format (optional) + // @return com.vmware.nsx.model.EULAContent + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, valueFormatParam *string) (model.EULAContent, error) +} + +type contentClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewContentClient(connector client.Connector) *contentClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.eula.content") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + cIface := contentClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &cIface +} + +func (cIface *contentClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := cIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (cIface *contentClient) Get(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, valueFormatParam *string) (model.EULAContent, error) { + typeConverter := cIface.connector.TypeConverter() + executionContext := cIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(contentGetInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("ValueFormat", valueFormatParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.EULAContent + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := contentGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + cIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := cIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.eula.content", "get", inputDataValue, executionContext) + var emptyOutput model.EULAContent + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), contentGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.EULAContent), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), cIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/eula/ContentTypes.go b/services/nsxt-mp/nsx/upgrade/eula/ContentTypes.go new file mode 100644 index 000000000..103dd72a1 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/eula/ContentTypes.go @@ -0,0 +1,98 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Content. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package eula + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func contentGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["value_format"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["value_format"] = "ValueFormat" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func contentGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.EULAContentBindingType) +} + +func contentGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["value_format"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["value_format"] = "ValueFormat" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["value_format"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["value_format"] = "value_format" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/eula/content", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/eula/EulaPackageTypes.go b/services/nsxt-mp/nsx/upgrade/eula/EulaPackageTypes.go new file mode 100644 index 000000000..a9c9ad948 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/eula/EulaPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.upgrade.eula. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package eula diff --git a/services/nsxt-mp/nsx/upgrade/plan/PlanPackageTypes.go b/services/nsxt-mp/nsx/upgrade/plan/PlanPackageTypes.go new file mode 100644 index 000000000..085cb1c0e --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/plan/PlanPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.upgrade.plan. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package plan diff --git a/services/nsxt-mp/nsx/upgrade/plan/SettingsClient.go b/services/nsxt-mp/nsx/upgrade/plan/SettingsClient.go new file mode 100644 index 000000000..1b5c953ef --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/plan/SettingsClient.go @@ -0,0 +1,135 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Settings +// Used by client-side stubs. + +package plan + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SettingsClient interface { + + // Get the upgrade plan settings for the component. + // + // @param componentTypeParam (required) + // @return com.vmware.nsx.model.UpgradePlanSettings + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(componentTypeParam string) (model.UpgradePlanSettings, error) + + // Update the upgrade plan settings for the component. + // + // @param componentTypeParam (required) + // @param upgradePlanSettingsParam (required) + // @return com.vmware.nsx.model.UpgradePlanSettings + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(componentTypeParam string, upgradePlanSettingsParam model.UpgradePlanSettings) (model.UpgradePlanSettings, error) +} + +type settingsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSettingsClient(connector client.Connector) *settingsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.plan.settings") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := settingsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *settingsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *settingsClient) Get(componentTypeParam string) (model.UpgradePlanSettings, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(settingsGetInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradePlanSettings + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := settingsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.plan.settings", "get", inputDataValue, executionContext) + var emptyOutput model.UpgradePlanSettings + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), settingsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradePlanSettings), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *settingsClient) Update(componentTypeParam string, upgradePlanSettingsParam model.UpgradePlanSettings) (model.UpgradePlanSettings, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(settingsUpdateInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + sv.AddStructField("UpgradePlanSettings", upgradePlanSettingsParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradePlanSettings + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := settingsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.plan.settings", "update", inputDataValue, executionContext) + var emptyOutput model.UpgradePlanSettings + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), settingsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradePlanSettings), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/plan/SettingsTypes.go b/services/nsxt-mp/nsx/upgrade/plan/SettingsTypes.go new file mode 100644 index 000000000..872895932 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/plan/SettingsTypes.go @@ -0,0 +1,124 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Settings. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package plan + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func settingsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewStringType() + fieldNameMap["component_type"] = "ComponentType" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func settingsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradePlanSettingsBindingType) +} + +func settingsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewStringType() + fieldNameMap["component_type"] = "ComponentType" + paramsTypeMap["component_type"] = bindings.NewStringType() + paramsTypeMap["componentType"] = bindings.NewStringType() + pathParams["component_type"] = "componentType" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/plan/{componentType}/settings", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func settingsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewStringType() + fields["upgrade_plan_settings"] = bindings.NewReferenceType(model.UpgradePlanSettingsBindingType) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["upgrade_plan_settings"] = "UpgradePlanSettings" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func settingsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradePlanSettingsBindingType) +} + +func settingsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewStringType() + fields["upgrade_plan_settings"] = bindings.NewReferenceType(model.UpgradePlanSettingsBindingType) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["upgrade_plan_settings"] = "UpgradePlanSettings" + paramsTypeMap["component_type"] = bindings.NewStringType() + paramsTypeMap["upgrade_plan_settings"] = bindings.NewReferenceType(model.UpgradePlanSettingsBindingType) + paramsTypeMap["componentType"] = bindings.NewStringType() + pathParams["component_type"] = "componentType" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "upgrade_plan_settings", + "PUT", + "/api/v1/upgrade/plan/{componentType}/settings", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/pre_upgrade_checks/FailuresClient.go b/services/nsxt-mp/nsx/upgrade/pre_upgrade_checks/FailuresClient.go new file mode 100644 index 000000000..f6c0d7993 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/pre_upgrade_checks/FailuresClient.go @@ -0,0 +1,106 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Failures +// Used by client-side stubs. + +package pre_upgrade_checks + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type FailuresClient interface { + + // Get failures resulting from the last execution of pre-upgrade checks. If the execution of checks is in progress, the response has the list of failures observed so far. + // + // @param componentTypeParam Component type (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param filterTextParam Filter text (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param originTypeParam Type of origin of failure (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param type_Param Status of the upgrade check (optional) + // @return com.vmware.nsx.model.UpgradeCheckFailureListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(componentTypeParam *string, cursorParam *string, filterTextParam *string, includedFieldsParam *string, originTypeParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, type_Param *string) (model.UpgradeCheckFailureListResult, error) +} + +type failuresClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewFailuresClient(connector client.Connector) *failuresClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.pre_upgrade_checks.failures") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + fIface := failuresClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &fIface +} + +func (fIface *failuresClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := fIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (fIface *failuresClient) List(componentTypeParam *string, cursorParam *string, filterTextParam *string, includedFieldsParam *string, originTypeParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, type_Param *string) (model.UpgradeCheckFailureListResult, error) { + typeConverter := fIface.connector.TypeConverter() + executionContext := fIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(failuresListInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("FilterText", filterTextParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("OriginType", originTypeParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Type_", type_Param) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeCheckFailureListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := failuresListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + fIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := fIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.pre_upgrade_checks.failures", "list", inputDataValue, executionContext) + var emptyOutput model.UpgradeCheckFailureListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), failuresListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeCheckFailureListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), fIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/pre_upgrade_checks/FailuresTypes.go b/services/nsxt-mp/nsx/upgrade/pre_upgrade_checks/FailuresTypes.go new file mode 100644 index 000000000..d5de8cb93 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/pre_upgrade_checks/FailuresTypes.go @@ -0,0 +1,128 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Failures. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package pre_upgrade_checks + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``originType`` of method Failures#list. +const Failures_LIST_ORIGIN_TYPE_COMPONENT = "COMPONENT" + +// Possible value for ``originType`` of method Failures#list. +const Failures_LIST_ORIGIN_TYPE_UPGRADE_UNIT = "UPGRADE_UNIT" + +// Possible value for ``type`` of method Failures#list. +const Failures_LIST_TYPE_FAILURE = "FAILURE" + +// Possible value for ``type`` of method Failures#list. +const Failures_LIST_TYPE_WARNING = "WARNING" + +func failuresListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["filter_text"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["origin_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["filter_text"] = "FilterText" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["origin_type"] = "OriginType" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func failuresListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeCheckFailureListResultBindingType) +} + +func failuresListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["filter_text"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["origin_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["type"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["filter_text"] = "FilterText" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["origin_type"] = "OriginType" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["type"] = "Type_" + paramsTypeMap["origin_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["filter_text"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["filter_text"] = "filter_text" + queryParams["component_type"] = "component_type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["type"] = "type" + queryParams["origin_type"] = "origin_type" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/pre-upgrade-checks/failures", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/pre_upgrade_checks/PreUpgradeChecksPackageTypes.go b/services/nsxt-mp/nsx/upgrade/pre_upgrade_checks/PreUpgradeChecksPackageTypes.go new file mode 100644 index 000000000..586b8da00 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/pre_upgrade_checks/PreUpgradeChecksPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.upgrade.pre_upgrade_checks. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package pre_upgrade_checks diff --git a/services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/AggregateInfoClient.go b/services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/AggregateInfoClient.go new file mode 100644 index 000000000..e906edffb --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/AggregateInfoClient.go @@ -0,0 +1,104 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: AggregateInfo +// Used by client-side stubs. + +package upgrade_unit_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AggregateInfoClient interface { + + // Return information of all upgrade unit groups in the upgrade plan. If request parameter summary is set to true, then only count of upgrade units will be returned, upgrade units list will be empty. If request parameter component type is specified, then all upgrade unit groups for that component will be returned. + // + // @param componentTypeParam Component type based on which upgrade unit groups to be filtered (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param summaryParam Flag indicating whether to return summary (optional, default to false) + // @param syncParam Synchronize before returning upgrade unit groups (optional, default to false) + // @return com.vmware.nsx.model.UpgradeUnitGroupAggregateInfoListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(componentTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, summaryParam *bool, syncParam *bool) (model.UpgradeUnitGroupAggregateInfoListResult, error) +} + +type aggregateInfoClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAggregateInfoClient(connector client.Connector) *aggregateInfoClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.upgrade_unit_groups.aggregate_info") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := aggregateInfoClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *aggregateInfoClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *aggregateInfoClient) List(componentTypeParam *string, cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string, summaryParam *bool, syncParam *bool) (model.UpgradeUnitGroupAggregateInfoListResult, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(aggregateInfoListInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("Summary", summaryParam) + sv.AddStructField("Sync", syncParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeUnitGroupAggregateInfoListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := aggregateInfoListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.upgrade_unit_groups.aggregate_info", "list", inputDataValue, executionContext) + var emptyOutput model.UpgradeUnitGroupAggregateInfoListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), aggregateInfoListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeUnitGroupAggregateInfoListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/AggregateInfoTypes.go b/services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/AggregateInfoTypes.go new file mode 100644 index 000000000..4a9ca15f6 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/AggregateInfoTypes.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: AggregateInfo. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade_unit_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func aggregateInfoListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["summary"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sync"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["summary"] = "Summary" + fieldNameMap["sync"] = "Sync" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func aggregateInfoListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeUnitGroupAggregateInfoListResultBindingType) +} + +func aggregateInfoListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["summary"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sync"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["summary"] = "Summary" + fieldNameMap["sync"] = "Sync" + paramsTypeMap["sync"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["summary"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["summary"] = "summary" + queryParams["component_type"] = "component_type" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["sync"] = "sync" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/upgrade-unit-groups/aggregate-info", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/StatusClient.go b/services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/StatusClient.go new file mode 100644 index 000000000..bb7e5ce31 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/StatusClient.go @@ -0,0 +1,102 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package upgrade_unit_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Get upgrade status for upgrade units in the specified group. User can specify whether to show only the upgrade units with errors. + // + // @param groupIdParam (required) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param hasErrorsParam Flag to indicate whether to return only upgrade units with errors (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.UpgradeUnitStatusListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(groupIdParam string, cursorParam *string, hasErrorsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.UpgradeUnitStatusListResult, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.upgrade_unit_groups.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) List(groupIdParam string, cursorParam *string, hasErrorsParam *bool, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.UpgradeUnitStatusListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusListInputType(), typeConverter) + sv.AddStructField("GroupId", groupIdParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("HasErrors", hasErrorsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeUnitStatusListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.upgrade_unit_groups.status", "list", inputDataValue, executionContext) + var emptyOutput model.UpgradeUnitStatusListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeUnitStatusListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/StatusTypes.go b/services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/StatusTypes.go new file mode 100644 index 000000000..63bf61020 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/StatusTypes.go @@ -0,0 +1,105 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade_unit_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func statusListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["has_errors"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["has_errors"] = "HasErrors" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeUnitStatusListResultBindingType) +} + +func statusListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["group_id"] = bindings.NewStringType() + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["has_errors"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["has_errors"] = "HasErrors" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["group_id"] = bindings.NewStringType() + paramsTypeMap["has_errors"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["groupId"] = bindings.NewStringType() + pathParams["group_id"] = "groupId" + queryParams["cursor"] = "cursor" + queryParams["has_errors"] = "has_errors" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/upgrade-unit-groups/{groupId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/UpgradeUnitClient.go b/services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/UpgradeUnitClient.go new file mode 100644 index 000000000..e158a64f9 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/UpgradeUnitClient.go @@ -0,0 +1,87 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: UpgradeUnit +// Used by client-side stubs. + +package upgrade_unit_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type UpgradeUnitClient interface { + + // Reorder an upgrade unit within the upgrade unit group by placing it before/after the specified upgrade unit + // + // @param groupIdParam (required) + // @param upgradeUnitIdParam (required) + // @param reorderRequestParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Reorder(groupIdParam string, upgradeUnitIdParam string, reorderRequestParam model.ReorderRequest) error +} + +type upgradeUnitClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewUpgradeUnitClient(connector client.Connector) *upgradeUnitClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.upgrade_unit_groups.upgrade_unit") + methodIdentifiers := map[string]core.MethodIdentifier{ + "reorder": core.NewMethodIdentifier(interfaceIdentifier, "reorder"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + uIface := upgradeUnitClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &uIface +} + +func (uIface *upgradeUnitClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := uIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (uIface *upgradeUnitClient) Reorder(groupIdParam string, upgradeUnitIdParam string, reorderRequestParam model.ReorderRequest) error { + typeConverter := uIface.connector.TypeConverter() + executionContext := uIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(upgradeUnitReorderInputType(), typeConverter) + sv.AddStructField("GroupId", groupIdParam) + sv.AddStructField("UpgradeUnitId", upgradeUnitIdParam) + sv.AddStructField("ReorderRequest", reorderRequestParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := upgradeUnitReorderRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + uIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := uIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.upgrade_unit_groups.upgrade_unit", "reorder", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), uIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/UpgradeUnitGroupsPackageTypes.go b/services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/UpgradeUnitGroupsPackageTypes.go new file mode 100644 index 000000000..210c5136e --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/UpgradeUnitGroupsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.upgrade.upgrade_unit_groups. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade_unit_groups diff --git a/services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/UpgradeUnitTypes.go b/services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/UpgradeUnitTypes.go new file mode 100644 index 000000000..fd6ae0250 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/upgrade_unit_groups/UpgradeUnitTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: UpgradeUnit. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade_unit_groups + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func upgradeUnitReorderInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["group_id"] = bindings.NewStringType() + fields["upgrade_unit_id"] = bindings.NewStringType() + fields["reorder_request"] = bindings.NewReferenceType(model.ReorderRequestBindingType) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["upgrade_unit_id"] = "UpgradeUnitId" + fieldNameMap["reorder_request"] = "ReorderRequest" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func upgradeUnitReorderOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func upgradeUnitReorderRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["group_id"] = bindings.NewStringType() + fields["upgrade_unit_id"] = bindings.NewStringType() + fields["reorder_request"] = bindings.NewReferenceType(model.ReorderRequestBindingType) + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["upgrade_unit_id"] = "UpgradeUnitId" + fieldNameMap["reorder_request"] = "ReorderRequest" + paramsTypeMap["group_id"] = bindings.NewStringType() + paramsTypeMap["upgrade_unit_id"] = bindings.NewStringType() + paramsTypeMap["reorder_request"] = bindings.NewReferenceType(model.ReorderRequestBindingType) + paramsTypeMap["groupId"] = bindings.NewStringType() + paramsTypeMap["upgradeUnitId"] = bindings.NewStringType() + pathParams["group_id"] = "groupId" + pathParams["upgrade_unit_id"] = "upgradeUnitId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=reorder", + "reorder_request", + "POST", + "/api/v1/upgrade/upgrade-unit-groups/{groupId}/upgrade-unit/{upgradeUnitId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/upgrade_units/AggregateInfoClient.go b/services/nsxt-mp/nsx/upgrade/upgrade_units/AggregateInfoClient.go new file mode 100644 index 000000000..f6cf29440 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/upgrade_units/AggregateInfoClient.go @@ -0,0 +1,110 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: AggregateInfo +// Used by client-side stubs. + +package upgrade_units + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type AggregateInfoClient interface { + + // Get upgrade units aggregate-info + // + // @param componentTypeParam Component type based on which upgrade units to be filtered (optional) + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param groupIdParam Identifier of group based on which upgrade units to be filtered (optional) + // @param hasErrorsParam Flag to indicate whether to return only upgrade units with errors (optional, default to false) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param metadataParam Metadata about upgrade unit to filter on (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param selectionStatusParam Flag to indicate whether to return only selected, only deselected or both type of upgrade units (optional, default to ALL) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @param upgradeUnitDisplayNameParam Display name of upgrade unit (optional) + // @return com.vmware.nsx.model.UpgradeUnitAggregateInfoListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(componentTypeParam *string, cursorParam *string, groupIdParam *string, hasErrorsParam *bool, includedFieldsParam *string, metadataParam *string, pageSizeParam *int64, selectionStatusParam *string, sortAscendingParam *bool, sortByParam *string, upgradeUnitDisplayNameParam *string) (model.UpgradeUnitAggregateInfoListResult, error) +} + +type aggregateInfoClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewAggregateInfoClient(connector client.Connector) *aggregateInfoClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.upgrade.upgrade_units.aggregate_info") + methodIdentifiers := map[string]core.MethodIdentifier{ + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + aIface := aggregateInfoClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &aIface +} + +func (aIface *aggregateInfoClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := aIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (aIface *aggregateInfoClient) List(componentTypeParam *string, cursorParam *string, groupIdParam *string, hasErrorsParam *bool, includedFieldsParam *string, metadataParam *string, pageSizeParam *int64, selectionStatusParam *string, sortAscendingParam *bool, sortByParam *string, upgradeUnitDisplayNameParam *string) (model.UpgradeUnitAggregateInfoListResult, error) { + typeConverter := aIface.connector.TypeConverter() + executionContext := aIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(aggregateInfoListInputType(), typeConverter) + sv.AddStructField("ComponentType", componentTypeParam) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("GroupId", groupIdParam) + sv.AddStructField("HasErrors", hasErrorsParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("Metadata", metadataParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SelectionStatus", selectionStatusParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + sv.AddStructField("UpgradeUnitDisplayName", upgradeUnitDisplayNameParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.UpgradeUnitAggregateInfoListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := aggregateInfoListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + aIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := aIface.connector.GetApiProvider().Invoke("com.vmware.nsx.upgrade.upgrade_units.aggregate_info", "list", inputDataValue, executionContext) + var emptyOutput model.UpgradeUnitAggregateInfoListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), aggregateInfoListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.UpgradeUnitAggregateInfoListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), aIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/upgrade/upgrade_units/AggregateInfoTypes.go b/services/nsxt-mp/nsx/upgrade/upgrade_units/AggregateInfoTypes.go new file mode 100644 index 000000000..79ff09200 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/upgrade_units/AggregateInfoTypes.go @@ -0,0 +1,137 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: AggregateInfo. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade_units + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``selectionStatus`` of method AggregateInfo#list. +const AggregateInfo_LIST_SELECTION_STATUS_SELECTED = "SELECTED" + +// Possible value for ``selectionStatus`` of method AggregateInfo#list. +const AggregateInfo_LIST_SELECTION_STATUS_DESELECTED = "DESELECTED" + +// Possible value for ``selectionStatus`` of method AggregateInfo#list. +const AggregateInfo_LIST_SELECTION_STATUS_ALL = "ALL" + +func aggregateInfoListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["has_errors"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["metadata"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["selection_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["upgrade_unit_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["has_errors"] = "HasErrors" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["metadata"] = "Metadata" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["selection_status"] = "SelectionStatus" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["upgrade_unit_display_name"] = "UpgradeUnitDisplayName" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func aggregateInfoListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.UpgradeUnitAggregateInfoListResultBindingType) +} + +func aggregateInfoListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["has_errors"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["metadata"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["selection_status"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["upgrade_unit_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["component_type"] = "ComponentType" + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["group_id"] = "GroupId" + fieldNameMap["has_errors"] = "HasErrors" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["metadata"] = "Metadata" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["selection_status"] = "SelectionStatus" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + fieldNameMap["upgrade_unit_display_name"] = "UpgradeUnitDisplayName" + paramsTypeMap["selection_status"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["has_errors"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["upgrade_unit_display_name"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["metadata"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["component_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["group_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["has_errors"] = "has_errors" + queryParams["component_type"] = "component_type" + queryParams["metadata"] = "metadata" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["group_id"] = "group_id" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["selection_status"] = "selection_status" + queryParams["upgrade_unit_display_name"] = "upgrade_unit_display_name" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/upgrade/upgrade-units/aggregate-info", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/upgrade/upgrade_units/UpgradeUnitsPackageTypes.go b/services/nsxt-mp/nsx/upgrade/upgrade_units/UpgradeUnitsPackageTypes.go new file mode 100644 index 000000000..64082ce57 --- /dev/null +++ b/services/nsxt-mp/nsx/upgrade/upgrade_units/UpgradeUnitsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.upgrade.upgrade_units. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package upgrade_units diff --git a/services/nsxt-mp/nsx/vpn/ipsec/DpdProfilesClient.go b/services/nsxt-mp/nsx/vpn/ipsec/DpdProfilesClient.go new file mode 100644 index 000000000..93db34979 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/DpdProfilesClient.go @@ -0,0 +1,267 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: DpdProfiles +// Used by client-side stubs. + +package ipsec + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type DpdProfilesClient interface { + + // Create dead peer detection (DPD) profile. Any change in profile affects all sessions consuming this profile. + // + // @param ipSecVPNDPDProfileParam (required) + // @return com.vmware.nsx.model.IPSecVPNDPDProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(ipSecVPNDPDProfileParam model.IPSecVPNDPDProfile) (model.IPSecVPNDPDProfile, error) + + // Delete dead peer detection (DPD) profile. + // + // @param ipsecVpnDpdProfileIdParam (required) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(ipsecVpnDpdProfileIdParam string, forceParam *bool) error + + // Get IPSec dead peer detection (DPD) profile. + // + // @param ipsecVpnDpdProfileIdParam (required) + // @return com.vmware.nsx.model.IPSecVPNDPDProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ipsecVpnDpdProfileIdParam string) (model.IPSecVPNDPDProfile, error) + + // Get paginated list of all dead peer detection (DPD) profiles. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.IPSecVPNDPDProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPSecVPNDPDProfileListResult, error) + + // Edit IPSec dead peer detection (DPD) profile. + // + // @param ipsecVpnDpdProfileIdParam (required) + // @param ipSecVPNDPDProfileParam (required) + // @return com.vmware.nsx.model.IPSecVPNDPDProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(ipsecVpnDpdProfileIdParam string, ipSecVPNDPDProfileParam model.IPSecVPNDPDProfile) (model.IPSecVPNDPDProfile, error) +} + +type dpdProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewDpdProfilesClient(connector client.Connector) *dpdProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.vpn.ipsec.dpd_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + dIface := dpdProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &dIface +} + +func (dIface *dpdProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := dIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (dIface *dpdProfilesClient) Create(ipSecVPNDPDProfileParam model.IPSecVPNDPDProfile) (model.IPSecVPNDPDProfile, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(dpdProfilesCreateInputType(), typeConverter) + sv.AddStructField("IpSecVPNDPDProfile", ipSecVPNDPDProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNDPDProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dpdProfilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.dpd_profiles", "create", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNDPDProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dpdProfilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNDPDProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *dpdProfilesClient) Delete(ipsecVpnDpdProfileIdParam string, forceParam *bool) error { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(dpdProfilesDeleteInputType(), typeConverter) + sv.AddStructField("IpsecVpnDpdProfileId", ipsecVpnDpdProfileIdParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dpdProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.dpd_profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (dIface *dpdProfilesClient) Get(ipsecVpnDpdProfileIdParam string) (model.IPSecVPNDPDProfile, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(dpdProfilesGetInputType(), typeConverter) + sv.AddStructField("IpsecVpnDpdProfileId", ipsecVpnDpdProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNDPDProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dpdProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.dpd_profiles", "get", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNDPDProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dpdProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNDPDProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *dpdProfilesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPSecVPNDPDProfileListResult, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(dpdProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNDPDProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dpdProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.dpd_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNDPDProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dpdProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNDPDProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (dIface *dpdProfilesClient) Update(ipsecVpnDpdProfileIdParam string, ipSecVPNDPDProfileParam model.IPSecVPNDPDProfile) (model.IPSecVPNDPDProfile, error) { + typeConverter := dIface.connector.TypeConverter() + executionContext := dIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(dpdProfilesUpdateInputType(), typeConverter) + sv.AddStructField("IpsecVpnDpdProfileId", ipsecVpnDpdProfileIdParam) + sv.AddStructField("IpSecVPNDPDProfile", ipSecVPNDPDProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNDPDProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := dpdProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + dIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := dIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.dpd_profiles", "update", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNDPDProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), dpdProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNDPDProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), dIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/vpn/ipsec/DpdProfilesTypes.go b/services/nsxt-mp/nsx/vpn/ipsec/DpdProfilesTypes.go new file mode 100644 index 000000000..8216227d2 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/DpdProfilesTypes.go @@ -0,0 +1,301 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: DpdProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ipsec + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func dpdProfilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_sec_VPNDPD_profile"] = bindings.NewReferenceType(model.IPSecVPNDPDProfileBindingType) + fieldNameMap["ip_sec_VPNDPD_profile"] = "IpSecVPNDPDProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dpdProfilesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNDPDProfileBindingType) +} + +func dpdProfilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ip_sec_VPNDPD_profile"] = bindings.NewReferenceType(model.IPSecVPNDPDProfileBindingType) + fieldNameMap["ip_sec_VPNDPD_profile"] = "IpSecVPNDPDProfile" + paramsTypeMap["ip_sec_VPNDPD_profile"] = bindings.NewReferenceType(model.IPSecVPNDPDProfileBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_sec_VPNDPD_profile", + "POST", + "/api/v1/vpn/ipsec/dpd-profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func dpdProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_dpd_profile_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ipsec_vpn_dpd_profile_id"] = "IpsecVpnDpdProfileId" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dpdProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func dpdProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_dpd_profile_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ipsec_vpn_dpd_profile_id"] = "IpsecVpnDpdProfileId" + fieldNameMap["force"] = "Force" + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["ipsec_vpn_dpd_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipsecVpnDpdProfileId"] = bindings.NewStringType() + pathParams["ipsec_vpn_dpd_profile_id"] = "ipsecVpnDpdProfileId" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/vpn/ipsec/dpd-profiles/{ipsecVpnDpdProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func dpdProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_dpd_profile_id"] = bindings.NewStringType() + fieldNameMap["ipsec_vpn_dpd_profile_id"] = "IpsecVpnDpdProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dpdProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNDPDProfileBindingType) +} + +func dpdProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_dpd_profile_id"] = bindings.NewStringType() + fieldNameMap["ipsec_vpn_dpd_profile_id"] = "IpsecVpnDpdProfileId" + paramsTypeMap["ipsec_vpn_dpd_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipsecVpnDpdProfileId"] = bindings.NewStringType() + pathParams["ipsec_vpn_dpd_profile_id"] = "ipsecVpnDpdProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/ipsec/dpd-profiles/{ipsecVpnDpdProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func dpdProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dpdProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNDPDProfileListResultBindingType) +} + +func dpdProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/ipsec/dpd-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func dpdProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_dpd_profile_id"] = bindings.NewStringType() + fields["ip_sec_VPNDPD_profile"] = bindings.NewReferenceType(model.IPSecVPNDPDProfileBindingType) + fieldNameMap["ipsec_vpn_dpd_profile_id"] = "IpsecVpnDpdProfileId" + fieldNameMap["ip_sec_VPNDPD_profile"] = "IpSecVPNDPDProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func dpdProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNDPDProfileBindingType) +} + +func dpdProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_dpd_profile_id"] = bindings.NewStringType() + fields["ip_sec_VPNDPD_profile"] = bindings.NewReferenceType(model.IPSecVPNDPDProfileBindingType) + fieldNameMap["ipsec_vpn_dpd_profile_id"] = "IpsecVpnDpdProfileId" + fieldNameMap["ip_sec_VPNDPD_profile"] = "IpSecVPNDPDProfile" + paramsTypeMap["ip_sec_VPNDPD_profile"] = bindings.NewReferenceType(model.IPSecVPNDPDProfileBindingType) + paramsTypeMap["ipsec_vpn_dpd_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipsecVpnDpdProfileId"] = bindings.NewStringType() + pathParams["ipsec_vpn_dpd_profile_id"] = "ipsecVpnDpdProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_sec_VPNDPD_profile", + "PUT", + "/api/v1/vpn/ipsec/dpd-profiles/{ipsecVpnDpdProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/vpn/ipsec/IkeProfilesClient.go b/services/nsxt-mp/nsx/vpn/ipsec/IkeProfilesClient.go new file mode 100644 index 000000000..2e9a4840d --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/IkeProfilesClient.go @@ -0,0 +1,267 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: IkeProfiles +// Used by client-side stubs. + +package ipsec + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type IkeProfilesClient interface { + + // Create custom internet key exchange (IKE) Profile. IKE Profile is a reusable profile that captures IKE and phase one negotiation parameters. System will be pre provisioned with system owned non editable default IKE profile and suggested set of profiles that can be used for peering with popular remote peers like AWS VPN. User can create custom profiles as needed. Any change in profile affects all sessions consuming this profile. + // + // @param ipSecVPNIKEProfileParam (required) + // @return com.vmware.nsx.model.IPSecVPNIKEProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(ipSecVPNIKEProfileParam model.IPSecVPNIKEProfile) (model.IPSecVPNIKEProfile, error) + + // Delete custom IKE Profile. Profile can not be deleted if profile has references to it. + // + // @param ipsecVpnIkeProfileIdParam (required) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(ipsecVpnIkeProfileIdParam string, forceParam *bool) error + + // Get custom IKE Profile, given the particular id. + // + // @param ipsecVpnIkeProfileIdParam (required) + // @return com.vmware.nsx.model.IPSecVPNIKEProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ipsecVpnIkeProfileIdParam string) (model.IPSecVPNIKEProfile, error) + + // Get paginated list of all IKE Profiles. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.IPSecVPNIKEProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPSecVPNIKEProfileListResult, error) + + // Edit custom IKE Profile. System owned profiles are non editable. + // + // @param ipsecVpnIkeProfileIdParam (required) + // @param ipSecVPNIKEProfileParam (required) + // @return com.vmware.nsx.model.IPSecVPNIKEProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(ipsecVpnIkeProfileIdParam string, ipSecVPNIKEProfileParam model.IPSecVPNIKEProfile) (model.IPSecVPNIKEProfile, error) +} + +type ikeProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewIkeProfilesClient(connector client.Connector) *ikeProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.vpn.ipsec.ike_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + iIface := ikeProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &iIface +} + +func (iIface *ikeProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := iIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (iIface *ikeProfilesClient) Create(ipSecVPNIKEProfileParam model.IPSecVPNIKEProfile) (model.IPSecVPNIKEProfile, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ikeProfilesCreateInputType(), typeConverter) + sv.AddStructField("IpSecVPNIKEProfile", ipSecVPNIKEProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNIKEProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ikeProfilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.ike_profiles", "create", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNIKEProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ikeProfilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNIKEProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ikeProfilesClient) Delete(ipsecVpnIkeProfileIdParam string, forceParam *bool) error { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ikeProfilesDeleteInputType(), typeConverter) + sv.AddStructField("IpsecVpnIkeProfileId", ipsecVpnIkeProfileIdParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ikeProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.ike_profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (iIface *ikeProfilesClient) Get(ipsecVpnIkeProfileIdParam string) (model.IPSecVPNIKEProfile, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ikeProfilesGetInputType(), typeConverter) + sv.AddStructField("IpsecVpnIkeProfileId", ipsecVpnIkeProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNIKEProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ikeProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.ike_profiles", "get", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNIKEProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ikeProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNIKEProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ikeProfilesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPSecVPNIKEProfileListResult, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ikeProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNIKEProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ikeProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.ike_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNIKEProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ikeProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNIKEProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (iIface *ikeProfilesClient) Update(ipsecVpnIkeProfileIdParam string, ipSecVPNIKEProfileParam model.IPSecVPNIKEProfile) (model.IPSecVPNIKEProfile, error) { + typeConverter := iIface.connector.TypeConverter() + executionContext := iIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(ikeProfilesUpdateInputType(), typeConverter) + sv.AddStructField("IpsecVpnIkeProfileId", ipsecVpnIkeProfileIdParam) + sv.AddStructField("IpSecVPNIKEProfile", ipSecVPNIKEProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNIKEProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := ikeProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + iIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := iIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.ike_profiles", "update", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNIKEProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), ikeProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNIKEProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), iIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/vpn/ipsec/IkeProfilesTypes.go b/services/nsxt-mp/nsx/vpn/ipsec/IkeProfilesTypes.go new file mode 100644 index 000000000..b77bd7bd3 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/IkeProfilesTypes.go @@ -0,0 +1,301 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: IkeProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ipsec + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func ikeProfilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_sec_VPNIKE_profile"] = bindings.NewReferenceType(model.IPSecVPNIKEProfileBindingType) + fieldNameMap["ip_sec_VPNIKE_profile"] = "IpSecVPNIKEProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ikeProfilesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNIKEProfileBindingType) +} + +func ikeProfilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ip_sec_VPNIKE_profile"] = bindings.NewReferenceType(model.IPSecVPNIKEProfileBindingType) + fieldNameMap["ip_sec_VPNIKE_profile"] = "IpSecVPNIKEProfile" + paramsTypeMap["ip_sec_VPNIKE_profile"] = bindings.NewReferenceType(model.IPSecVPNIKEProfileBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_sec_VPNIKE_profile", + "POST", + "/api/v1/vpn/ipsec/ike-profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ikeProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_ike_profile_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ipsec_vpn_ike_profile_id"] = "IpsecVpnIkeProfileId" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ikeProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func ikeProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_ike_profile_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ipsec_vpn_ike_profile_id"] = "IpsecVpnIkeProfileId" + fieldNameMap["force"] = "Force" + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["ipsec_vpn_ike_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipsecVpnIkeProfileId"] = bindings.NewStringType() + pathParams["ipsec_vpn_ike_profile_id"] = "ipsecVpnIkeProfileId" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/vpn/ipsec/ike-profiles/{ipsecVpnIkeProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ikeProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_ike_profile_id"] = bindings.NewStringType() + fieldNameMap["ipsec_vpn_ike_profile_id"] = "IpsecVpnIkeProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ikeProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNIKEProfileBindingType) +} + +func ikeProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_ike_profile_id"] = bindings.NewStringType() + fieldNameMap["ipsec_vpn_ike_profile_id"] = "IpsecVpnIkeProfileId" + paramsTypeMap["ipsec_vpn_ike_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipsecVpnIkeProfileId"] = bindings.NewStringType() + pathParams["ipsec_vpn_ike_profile_id"] = "ipsecVpnIkeProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/ipsec/ike-profiles/{ipsecVpnIkeProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ikeProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ikeProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNIKEProfileListResultBindingType) +} + +func ikeProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/ipsec/ike-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func ikeProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_ike_profile_id"] = bindings.NewStringType() + fields["ip_sec_VPNIKE_profile"] = bindings.NewReferenceType(model.IPSecVPNIKEProfileBindingType) + fieldNameMap["ipsec_vpn_ike_profile_id"] = "IpsecVpnIkeProfileId" + fieldNameMap["ip_sec_VPNIKE_profile"] = "IpSecVPNIKEProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func ikeProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNIKEProfileBindingType) +} + +func ikeProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_ike_profile_id"] = bindings.NewStringType() + fields["ip_sec_VPNIKE_profile"] = bindings.NewReferenceType(model.IPSecVPNIKEProfileBindingType) + fieldNameMap["ipsec_vpn_ike_profile_id"] = "IpsecVpnIkeProfileId" + fieldNameMap["ip_sec_VPNIKE_profile"] = "IpSecVPNIKEProfile" + paramsTypeMap["ip_sec_VPNIKE_profile"] = bindings.NewReferenceType(model.IPSecVPNIKEProfileBindingType) + paramsTypeMap["ipsec_vpn_ike_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipsecVpnIkeProfileId"] = bindings.NewStringType() + pathParams["ipsec_vpn_ike_profile_id"] = "ipsecVpnIkeProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_sec_VPNIKE_profile", + "PUT", + "/api/v1/vpn/ipsec/ike-profiles/{ipsecVpnIkeProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/vpn/ipsec/IpsecPackageTypes.go b/services/nsxt-mp/nsx/vpn/ipsec/IpsecPackageTypes.go new file mode 100644 index 000000000..302fe1141 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/IpsecPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.vpn.ipsec. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ipsec diff --git a/services/nsxt-mp/nsx/vpn/ipsec/LocalEndpointsClient.go b/services/nsxt-mp/nsx/vpn/ipsec/LocalEndpointsClient.go new file mode 100644 index 000000000..6346acdb7 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/LocalEndpointsClient.go @@ -0,0 +1,271 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: LocalEndpoints +// Used by client-side stubs. + +package ipsec + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type LocalEndpointsClient interface { + + // Create custom IPSec local endpoint. + // + // @param ipSecVPNLocalEndpointParam (required) + // @return com.vmware.nsx.model.IPSecVPNLocalEndpoint + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(ipSecVPNLocalEndpointParam model.IPSecVPNLocalEndpoint) (model.IPSecVPNLocalEndpoint, error) + + // Delete custom IPSec local endpoint. + // + // @param ipsecVpnLocalEndpointIdParam (required) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(ipsecVpnLocalEndpointIdParam string, forceParam *bool) error + + // Get custom IPSec local endpoint. + // + // @param ipsecVpnLocalEndpointIdParam (required) + // @return com.vmware.nsx.model.IPSecVPNLocalEndpoint + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ipsecVpnLocalEndpointIdParam string) (model.IPSecVPNLocalEndpoint, error) + + // Get paginated list of all local endpoints. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param ipsecVpnServiceIdParam Id of the IPSec VPN service (optional) + // @param logicalRouterIdParam Id of logical router (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.IPSecVPNLocalEndpointListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, ipsecVpnServiceIdParam *string, logicalRouterIdParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPSecVPNLocalEndpointListResult, error) + + // Edit custom IPSec local endpoint. + // + // @param ipsecVpnLocalEndpointIdParam (required) + // @param ipSecVPNLocalEndpointParam (required) + // @return com.vmware.nsx.model.IPSecVPNLocalEndpoint + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(ipsecVpnLocalEndpointIdParam string, ipSecVPNLocalEndpointParam model.IPSecVPNLocalEndpoint) (model.IPSecVPNLocalEndpoint, error) +} + +type localEndpointsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewLocalEndpointsClient(connector client.Connector) *localEndpointsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.vpn.ipsec.local_endpoints") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + lIface := localEndpointsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &lIface +} + +func (lIface *localEndpointsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := lIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (lIface *localEndpointsClient) Create(ipSecVPNLocalEndpointParam model.IPSecVPNLocalEndpoint) (model.IPSecVPNLocalEndpoint, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(localEndpointsCreateInputType(), typeConverter) + sv.AddStructField("IpSecVPNLocalEndpoint", ipSecVPNLocalEndpointParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNLocalEndpoint + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := localEndpointsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.local_endpoints", "create", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNLocalEndpoint + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), localEndpointsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNLocalEndpoint), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *localEndpointsClient) Delete(ipsecVpnLocalEndpointIdParam string, forceParam *bool) error { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(localEndpointsDeleteInputType(), typeConverter) + sv.AddStructField("IpsecVpnLocalEndpointId", ipsecVpnLocalEndpointIdParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := localEndpointsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.local_endpoints", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (lIface *localEndpointsClient) Get(ipsecVpnLocalEndpointIdParam string) (model.IPSecVPNLocalEndpoint, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(localEndpointsGetInputType(), typeConverter) + sv.AddStructField("IpsecVpnLocalEndpointId", ipsecVpnLocalEndpointIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNLocalEndpoint + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := localEndpointsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.local_endpoints", "get", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNLocalEndpoint + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), localEndpointsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNLocalEndpoint), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *localEndpointsClient) List(cursorParam *string, includedFieldsParam *string, ipsecVpnServiceIdParam *string, logicalRouterIdParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPSecVPNLocalEndpointListResult, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(localEndpointsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("IpsecVpnServiceId", ipsecVpnServiceIdParam) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNLocalEndpointListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := localEndpointsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.local_endpoints", "list", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNLocalEndpointListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), localEndpointsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNLocalEndpointListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (lIface *localEndpointsClient) Update(ipsecVpnLocalEndpointIdParam string, ipSecVPNLocalEndpointParam model.IPSecVPNLocalEndpoint) (model.IPSecVPNLocalEndpoint, error) { + typeConverter := lIface.connector.TypeConverter() + executionContext := lIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(localEndpointsUpdateInputType(), typeConverter) + sv.AddStructField("IpsecVpnLocalEndpointId", ipsecVpnLocalEndpointIdParam) + sv.AddStructField("IpSecVPNLocalEndpoint", ipSecVPNLocalEndpointParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNLocalEndpoint + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := localEndpointsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + lIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := lIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.local_endpoints", "update", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNLocalEndpoint + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), localEndpointsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNLocalEndpoint), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), lIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/vpn/ipsec/LocalEndpointsTypes.go b/services/nsxt-mp/nsx/vpn/ipsec/LocalEndpointsTypes.go new file mode 100644 index 000000000..8e24adb71 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/LocalEndpointsTypes.go @@ -0,0 +1,313 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: LocalEndpoints. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ipsec + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func localEndpointsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_sec_VPN_local_endpoint"] = bindings.NewReferenceType(model.IPSecVPNLocalEndpointBindingType) + fieldNameMap["ip_sec_VPN_local_endpoint"] = "IpSecVPNLocalEndpoint" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func localEndpointsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNLocalEndpointBindingType) +} + +func localEndpointsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ip_sec_VPN_local_endpoint"] = bindings.NewReferenceType(model.IPSecVPNLocalEndpointBindingType) + fieldNameMap["ip_sec_VPN_local_endpoint"] = "IpSecVPNLocalEndpoint" + paramsTypeMap["ip_sec_VPN_local_endpoint"] = bindings.NewReferenceType(model.IPSecVPNLocalEndpointBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_sec_VPN_local_endpoint", + "POST", + "/api/v1/vpn/ipsec/local-endpoints", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func localEndpointsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_local_endpoint_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ipsec_vpn_local_endpoint_id"] = "IpsecVpnLocalEndpointId" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func localEndpointsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func localEndpointsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_local_endpoint_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ipsec_vpn_local_endpoint_id"] = "IpsecVpnLocalEndpointId" + fieldNameMap["force"] = "Force" + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["ipsec_vpn_local_endpoint_id"] = bindings.NewStringType() + paramsTypeMap["ipsecVpnLocalEndpointId"] = bindings.NewStringType() + pathParams["ipsec_vpn_local_endpoint_id"] = "ipsecVpnLocalEndpointId" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/vpn/ipsec/local-endpoints/{ipsecVpnLocalEndpointId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func localEndpointsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_local_endpoint_id"] = bindings.NewStringType() + fieldNameMap["ipsec_vpn_local_endpoint_id"] = "IpsecVpnLocalEndpointId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func localEndpointsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNLocalEndpointBindingType) +} + +func localEndpointsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_local_endpoint_id"] = bindings.NewStringType() + fieldNameMap["ipsec_vpn_local_endpoint_id"] = "IpsecVpnLocalEndpointId" + paramsTypeMap["ipsec_vpn_local_endpoint_id"] = bindings.NewStringType() + paramsTypeMap["ipsecVpnLocalEndpointId"] = bindings.NewStringType() + pathParams["ipsec_vpn_local_endpoint_id"] = "ipsecVpnLocalEndpointId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/ipsec/local-endpoints/{ipsecVpnLocalEndpointId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func localEndpointsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["ipsec_vpn_service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["ipsec_vpn_service_id"] = "IpsecVpnServiceId" + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func localEndpointsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNLocalEndpointListResultBindingType) +} + +func localEndpointsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["ipsec_vpn_service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["ipsec_vpn_service_id"] = "IpsecVpnServiceId" + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["ipsec_vpn_service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["logical_router_id"] = "logical_router_id" + queryParams["ipsec_vpn_service_id"] = "ipsec_vpn_service_id" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/ipsec/local-endpoints", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func localEndpointsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_local_endpoint_id"] = bindings.NewStringType() + fields["ip_sec_VPN_local_endpoint"] = bindings.NewReferenceType(model.IPSecVPNLocalEndpointBindingType) + fieldNameMap["ipsec_vpn_local_endpoint_id"] = "IpsecVpnLocalEndpointId" + fieldNameMap["ip_sec_VPN_local_endpoint"] = "IpSecVPNLocalEndpoint" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func localEndpointsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNLocalEndpointBindingType) +} + +func localEndpointsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_local_endpoint_id"] = bindings.NewStringType() + fields["ip_sec_VPN_local_endpoint"] = bindings.NewReferenceType(model.IPSecVPNLocalEndpointBindingType) + fieldNameMap["ipsec_vpn_local_endpoint_id"] = "IpsecVpnLocalEndpointId" + fieldNameMap["ip_sec_VPN_local_endpoint"] = "IpSecVPNLocalEndpoint" + paramsTypeMap["ip_sec_VPN_local_endpoint"] = bindings.NewReferenceType(model.IPSecVPNLocalEndpointBindingType) + paramsTypeMap["ipsec_vpn_local_endpoint_id"] = bindings.NewStringType() + paramsTypeMap["ipsecVpnLocalEndpointId"] = bindings.NewStringType() + pathParams["ipsec_vpn_local_endpoint_id"] = "ipsecVpnLocalEndpointId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_sec_VPN_local_endpoint", + "PUT", + "/api/v1/vpn/ipsec/local-endpoints/{ipsecVpnLocalEndpointId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/vpn/ipsec/PeerEndpointsClient.go b/services/nsxt-mp/nsx/vpn/ipsec/PeerEndpointsClient.go new file mode 100644 index 000000000..4c4ccdc6b --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/PeerEndpointsClient.go @@ -0,0 +1,310 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: PeerEndpoints +// Used by client-side stubs. + +package ipsec + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type PeerEndpointsClient interface { + + // Create custom IPSec peer endpoint. + // + // @param ipSecVPNPeerEndpointParam (required) + // @return com.vmware.nsx.model.IPSecVPNPeerEndpoint + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(ipSecVPNPeerEndpointParam model.IPSecVPNPeerEndpoint) (model.IPSecVPNPeerEndpoint, error) + + // Delete custom IPSec VPN peer endpoint. All references are strong references and dependent peer endpoints can not be deleted if being referenced. + // + // @param ipsecVpnPeerEndpointIdParam (required) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(ipsecVpnPeerEndpointIdParam string, forceParam *bool) error + + // Get custom IPSec VPN peer endpoint. + // + // @param ipsecVpnPeerEndpointIdParam (required) + // @return com.vmware.nsx.model.IPSecVPNPeerEndpoint + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ipsecVpnPeerEndpointIdParam string) (model.IPSecVPNPeerEndpoint, error) + + // Get paginated list of all peer endpoint. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.IPSecVPNPeerEndpointListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPSecVPNPeerEndpointListResult, error) + + // Get custom IPSec VPN peer endpoint with PSK. + // + // @param ipsecVpnPeerEndpointIdParam (required) + // @return com.vmware.nsx.model.IPSecVPNPeerEndpoint + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Showsensitivedata(ipsecVpnPeerEndpointIdParam string) (model.IPSecVPNPeerEndpoint, error) + + // Edit custom IPSec peer endpoint. System owned endpoints are non editable. + // + // @param ipsecVpnPeerEndpointIdParam (required) + // @param ipSecVPNPeerEndpointParam (required) + // @return com.vmware.nsx.model.IPSecVPNPeerEndpoint + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(ipsecVpnPeerEndpointIdParam string, ipSecVPNPeerEndpointParam model.IPSecVPNPeerEndpoint) (model.IPSecVPNPeerEndpoint, error) +} + +type peerEndpointsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewPeerEndpointsClient(connector client.Connector) *peerEndpointsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.vpn.ipsec.peer_endpoints") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "showsensitivedata": core.NewMethodIdentifier(interfaceIdentifier, "showsensitivedata"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + pIface := peerEndpointsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &pIface +} + +func (pIface *peerEndpointsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := pIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (pIface *peerEndpointsClient) Create(ipSecVPNPeerEndpointParam model.IPSecVPNPeerEndpoint) (model.IPSecVPNPeerEndpoint, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(peerEndpointsCreateInputType(), typeConverter) + sv.AddStructField("IpSecVPNPeerEndpoint", ipSecVPNPeerEndpointParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNPeerEndpoint + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := peerEndpointsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.peer_endpoints", "create", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNPeerEndpoint + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), peerEndpointsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNPeerEndpoint), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *peerEndpointsClient) Delete(ipsecVpnPeerEndpointIdParam string, forceParam *bool) error { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(peerEndpointsDeleteInputType(), typeConverter) + sv.AddStructField("IpsecVpnPeerEndpointId", ipsecVpnPeerEndpointIdParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := peerEndpointsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.peer_endpoints", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (pIface *peerEndpointsClient) Get(ipsecVpnPeerEndpointIdParam string) (model.IPSecVPNPeerEndpoint, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(peerEndpointsGetInputType(), typeConverter) + sv.AddStructField("IpsecVpnPeerEndpointId", ipsecVpnPeerEndpointIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNPeerEndpoint + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := peerEndpointsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.peer_endpoints", "get", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNPeerEndpoint + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), peerEndpointsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNPeerEndpoint), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *peerEndpointsClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPSecVPNPeerEndpointListResult, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(peerEndpointsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNPeerEndpointListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := peerEndpointsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.peer_endpoints", "list", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNPeerEndpointListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), peerEndpointsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNPeerEndpointListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *peerEndpointsClient) Showsensitivedata(ipsecVpnPeerEndpointIdParam string) (model.IPSecVPNPeerEndpoint, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(peerEndpointsShowsensitivedataInputType(), typeConverter) + sv.AddStructField("IpsecVpnPeerEndpointId", ipsecVpnPeerEndpointIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNPeerEndpoint + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := peerEndpointsShowsensitivedataRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.peer_endpoints", "showsensitivedata", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNPeerEndpoint + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), peerEndpointsShowsensitivedataOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNPeerEndpoint), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (pIface *peerEndpointsClient) Update(ipsecVpnPeerEndpointIdParam string, ipSecVPNPeerEndpointParam model.IPSecVPNPeerEndpoint) (model.IPSecVPNPeerEndpoint, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(peerEndpointsUpdateInputType(), typeConverter) + sv.AddStructField("IpsecVpnPeerEndpointId", ipsecVpnPeerEndpointIdParam) + sv.AddStructField("IpSecVPNPeerEndpoint", ipSecVPNPeerEndpointParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNPeerEndpoint + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := peerEndpointsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.peer_endpoints", "update", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNPeerEndpoint + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), peerEndpointsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNPeerEndpoint), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/vpn/ipsec/PeerEndpointsTypes.go b/services/nsxt-mp/nsx/vpn/ipsec/PeerEndpointsTypes.go new file mode 100644 index 000000000..70296c978 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/PeerEndpointsTypes.go @@ -0,0 +1,351 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: PeerEndpoints. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ipsec + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func peerEndpointsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_sec_VPN_peer_endpoint"] = bindings.NewReferenceType(model.IPSecVPNPeerEndpointBindingType) + fieldNameMap["ip_sec_VPN_peer_endpoint"] = "IpSecVPNPeerEndpoint" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func peerEndpointsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNPeerEndpointBindingType) +} + +func peerEndpointsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ip_sec_VPN_peer_endpoint"] = bindings.NewReferenceType(model.IPSecVPNPeerEndpointBindingType) + fieldNameMap["ip_sec_VPN_peer_endpoint"] = "IpSecVPNPeerEndpoint" + paramsTypeMap["ip_sec_VPN_peer_endpoint"] = bindings.NewReferenceType(model.IPSecVPNPeerEndpointBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_sec_VPN_peer_endpoint", + "POST", + "/api/v1/vpn/ipsec/peer-endpoints", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func peerEndpointsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_peer_endpoint_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ipsec_vpn_peer_endpoint_id"] = "IpsecVpnPeerEndpointId" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func peerEndpointsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func peerEndpointsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_peer_endpoint_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ipsec_vpn_peer_endpoint_id"] = "IpsecVpnPeerEndpointId" + fieldNameMap["force"] = "Force" + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["ipsec_vpn_peer_endpoint_id"] = bindings.NewStringType() + paramsTypeMap["ipsecVpnPeerEndpointId"] = bindings.NewStringType() + pathParams["ipsec_vpn_peer_endpoint_id"] = "ipsecVpnPeerEndpointId" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/vpn/ipsec/peer-endpoints/{ipsecVpnPeerEndpointId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func peerEndpointsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_peer_endpoint_id"] = bindings.NewStringType() + fieldNameMap["ipsec_vpn_peer_endpoint_id"] = "IpsecVpnPeerEndpointId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func peerEndpointsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNPeerEndpointBindingType) +} + +func peerEndpointsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_peer_endpoint_id"] = bindings.NewStringType() + fieldNameMap["ipsec_vpn_peer_endpoint_id"] = "IpsecVpnPeerEndpointId" + paramsTypeMap["ipsec_vpn_peer_endpoint_id"] = bindings.NewStringType() + paramsTypeMap["ipsecVpnPeerEndpointId"] = bindings.NewStringType() + pathParams["ipsec_vpn_peer_endpoint_id"] = "ipsecVpnPeerEndpointId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/ipsec/peer-endpoints/{ipsecVpnPeerEndpointId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func peerEndpointsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func peerEndpointsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNPeerEndpointListResultBindingType) +} + +func peerEndpointsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/ipsec/peer-endpoints", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func peerEndpointsShowsensitivedataInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_peer_endpoint_id"] = bindings.NewStringType() + fieldNameMap["ipsec_vpn_peer_endpoint_id"] = "IpsecVpnPeerEndpointId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func peerEndpointsShowsensitivedataOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNPeerEndpointBindingType) +} + +func peerEndpointsShowsensitivedataRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_peer_endpoint_id"] = bindings.NewStringType() + fieldNameMap["ipsec_vpn_peer_endpoint_id"] = "IpsecVpnPeerEndpointId" + paramsTypeMap["ipsec_vpn_peer_endpoint_id"] = bindings.NewStringType() + paramsTypeMap["ipsecVpnPeerEndpointId"] = bindings.NewStringType() + pathParams["ipsec_vpn_peer_endpoint_id"] = "ipsecVpnPeerEndpointId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=show-sensitive-data", + "", + "GET", + "/api/v1/vpn/ipsec/peer-endpoints/{ipsecVpnPeerEndpointId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func peerEndpointsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_peer_endpoint_id"] = bindings.NewStringType() + fields["ip_sec_VPN_peer_endpoint"] = bindings.NewReferenceType(model.IPSecVPNPeerEndpointBindingType) + fieldNameMap["ipsec_vpn_peer_endpoint_id"] = "IpsecVpnPeerEndpointId" + fieldNameMap["ip_sec_VPN_peer_endpoint"] = "IpSecVPNPeerEndpoint" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func peerEndpointsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNPeerEndpointBindingType) +} + +func peerEndpointsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_peer_endpoint_id"] = bindings.NewStringType() + fields["ip_sec_VPN_peer_endpoint"] = bindings.NewReferenceType(model.IPSecVPNPeerEndpointBindingType) + fieldNameMap["ipsec_vpn_peer_endpoint_id"] = "IpsecVpnPeerEndpointId" + fieldNameMap["ip_sec_VPN_peer_endpoint"] = "IpSecVPNPeerEndpoint" + paramsTypeMap["ip_sec_VPN_peer_endpoint"] = bindings.NewReferenceType(model.IPSecVPNPeerEndpointBindingType) + paramsTypeMap["ipsec_vpn_peer_endpoint_id"] = bindings.NewStringType() + paramsTypeMap["ipsecVpnPeerEndpointId"] = bindings.NewStringType() + pathParams["ipsec_vpn_peer_endpoint_id"] = "ipsecVpnPeerEndpointId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_sec_VPN_peer_endpoint", + "PUT", + "/api/v1/vpn/ipsec/peer-endpoints/{ipsecVpnPeerEndpointId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/vpn/ipsec/ServicesClient.go b/services/nsxt-mp/nsx/vpn/ipsec/ServicesClient.go new file mode 100644 index 000000000..e2cfb7390 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/ServicesClient.go @@ -0,0 +1,267 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Services +// Used by client-side stubs. + +package ipsec + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ServicesClient interface { + + // Create VPN service for given logical router. + // + // @param ipSecVPNServiceParam (required) + // @return com.vmware.nsx.model.IPSecVPNService + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(ipSecVPNServiceParam model.IPSecVPNService) (model.IPSecVPNService, error) + + // Delete IPSec VPN service for given router. + // + // @param ipsecVpnServiceIdParam (required) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(ipsecVpnServiceIdParam string, forceParam *bool) error + + // Get IPSec VPN service for given logical router. + // + // @param ipsecVpnServiceIdParam (required) + // @return com.vmware.nsx.model.IPSecVPNService + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ipsecVpnServiceIdParam string) (model.IPSecVPNService, error) + + // Get paginated list of all IPSec VPN services. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.IPSecVPNServiceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPSecVPNServiceListResult, error) + + // Edit IPSec VPN service for given logical router. + // + // @param ipsecVpnServiceIdParam (required) + // @param ipSecVPNServiceParam (required) + // @return com.vmware.nsx.model.IPSecVPNService + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(ipsecVpnServiceIdParam string, ipSecVPNServiceParam model.IPSecVPNService) (model.IPSecVPNService, error) +} + +type servicesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewServicesClient(connector client.Connector) *servicesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.vpn.ipsec.services") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := servicesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *servicesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *servicesClient) Create(ipSecVPNServiceParam model.IPSecVPNService) (model.IPSecVPNService, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(servicesCreateInputType(), typeConverter) + sv.AddStructField("IpSecVPNService", ipSecVPNServiceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNService + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.services", "create", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNService + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), servicesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNService), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *servicesClient) Delete(ipsecVpnServiceIdParam string, forceParam *bool) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(servicesDeleteInputType(), typeConverter) + sv.AddStructField("IpsecVpnServiceId", ipsecVpnServiceIdParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.services", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *servicesClient) Get(ipsecVpnServiceIdParam string) (model.IPSecVPNService, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(servicesGetInputType(), typeConverter) + sv.AddStructField("IpsecVpnServiceId", ipsecVpnServiceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNService + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.services", "get", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNService + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), servicesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNService), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *servicesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPSecVPNServiceListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(servicesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNServiceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.services", "list", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNServiceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), servicesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNServiceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *servicesClient) Update(ipsecVpnServiceIdParam string, ipSecVPNServiceParam model.IPSecVPNService) (model.IPSecVPNService, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(servicesUpdateInputType(), typeConverter) + sv.AddStructField("IpsecVpnServiceId", ipsecVpnServiceIdParam) + sv.AddStructField("IpSecVPNService", ipSecVPNServiceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNService + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.services", "update", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNService + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), servicesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNService), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/vpn/ipsec/ServicesTypes.go b/services/nsxt-mp/nsx/vpn/ipsec/ServicesTypes.go new file mode 100644 index 000000000..ec75c6428 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/ServicesTypes.go @@ -0,0 +1,301 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Services. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ipsec + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func servicesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_sec_VPN_service"] = bindings.NewReferenceType(model.IPSecVPNServiceBindingType) + fieldNameMap["ip_sec_VPN_service"] = "IpSecVPNService" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNServiceBindingType) +} + +func servicesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ip_sec_VPN_service"] = bindings.NewReferenceType(model.IPSecVPNServiceBindingType) + fieldNameMap["ip_sec_VPN_service"] = "IpSecVPNService" + paramsTypeMap["ip_sec_VPN_service"] = bindings.NewReferenceType(model.IPSecVPNServiceBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_sec_VPN_service", + "POST", + "/api/v1/vpn/ipsec/services/nsxt-mp", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func servicesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_service_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ipsec_vpn_service_id"] = "IpsecVpnServiceId" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func servicesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_service_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ipsec_vpn_service_id"] = "IpsecVpnServiceId" + fieldNameMap["force"] = "Force" + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["ipsec_vpn_service_id"] = bindings.NewStringType() + paramsTypeMap["ipsecVpnServiceId"] = bindings.NewStringType() + pathParams["ipsec_vpn_service_id"] = "ipsecVpnServiceId" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/vpn/ipsec/services/nsxt-mp/{ipsecVpnServiceId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func servicesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_service_id"] = bindings.NewStringType() + fieldNameMap["ipsec_vpn_service_id"] = "IpsecVpnServiceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNServiceBindingType) +} + +func servicesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_service_id"] = bindings.NewStringType() + fieldNameMap["ipsec_vpn_service_id"] = "IpsecVpnServiceId" + paramsTypeMap["ipsec_vpn_service_id"] = bindings.NewStringType() + paramsTypeMap["ipsecVpnServiceId"] = bindings.NewStringType() + pathParams["ipsec_vpn_service_id"] = "ipsecVpnServiceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/ipsec/services/nsxt-mp/{ipsecVpnServiceId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func servicesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNServiceListResultBindingType) +} + +func servicesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/ipsec/services/nsxt-mp", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func servicesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_service_id"] = bindings.NewStringType() + fields["ip_sec_VPN_service"] = bindings.NewReferenceType(model.IPSecVPNServiceBindingType) + fieldNameMap["ipsec_vpn_service_id"] = "IpsecVpnServiceId" + fieldNameMap["ip_sec_VPN_service"] = "IpSecVPNService" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNServiceBindingType) +} + +func servicesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_service_id"] = bindings.NewStringType() + fields["ip_sec_VPN_service"] = bindings.NewReferenceType(model.IPSecVPNServiceBindingType) + fieldNameMap["ipsec_vpn_service_id"] = "IpsecVpnServiceId" + fieldNameMap["ip_sec_VPN_service"] = "IpSecVPNService" + paramsTypeMap["ipsec_vpn_service_id"] = bindings.NewStringType() + paramsTypeMap["ip_sec_VPN_service"] = bindings.NewReferenceType(model.IPSecVPNServiceBindingType) + paramsTypeMap["ipsecVpnServiceId"] = bindings.NewStringType() + pathParams["ipsec_vpn_service_id"] = "ipsecVpnServiceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_sec_VPN_service", + "PUT", + "/api/v1/vpn/ipsec/services/nsxt-mp/{ipsecVpnServiceId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/vpn/ipsec/SessionsClient.go b/services/nsxt-mp/nsx/vpn/ipsec/SessionsClient.go new file mode 100644 index 000000000..fa525eff1 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/SessionsClient.go @@ -0,0 +1,279 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Sessions +// Used by client-side stubs. + +package ipsec + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SessionsClient interface { + + // Create new VPN session. + // + // @param ipSecVPNSessionParam (required) + // The parameter must contain all the properties defined in model.IPSecVPNSession. + // @return com.vmware.nsx.model.IPSecVPNSession + // The return value will contain all the properties defined in model.IPSecVPNSession. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(ipSecVPNSessionParam *data.StructValue) (*data.StructValue, error) + + // Delete IPSec VPN session. + // + // @param ipsecVpnSessionIdParam (required) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(ipsecVpnSessionIdParam string, forceParam *bool) error + + // Fetch IPSec VPN session. + // + // @param ipsecVpnSessionIdParam (required) + // @return com.vmware.nsx.model.IPSecVPNSession + // The return value will contain all the properties defined in model.IPSecVPNSession. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ipsecVpnSessionIdParam string) (*data.StructValue, error) + + // Get paginated list of all IPSec VPN sessions. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param ipsecVpnServiceIdParam Id of the IPSec VPN service (optional) + // @param logicalRouterIdParam Id of logical router (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sessionTypeParam Resource types of IPsec VPN session (optional) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.IPSecVPNSessionListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, ipsecVpnServiceIdParam *string, logicalRouterIdParam *string, pageSizeParam *int64, sessionTypeParam *string, sortAscendingParam *bool, sortByParam *string) (model.IPSecVPNSessionListResult, error) + + // Edit IPSec VPN session. + // + // @param ipsecVpnSessionIdParam (required) + // @param ipSecVPNSessionParam (required) + // The parameter must contain all the properties defined in model.IPSecVPNSession. + // @return com.vmware.nsx.model.IPSecVPNSession + // The return value will contain all the properties defined in model.IPSecVPNSession. + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(ipsecVpnSessionIdParam string, ipSecVPNSessionParam *data.StructValue) (*data.StructValue, error) +} + +type sessionsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSessionsClient(connector client.Connector) *sessionsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.vpn.ipsec.sessions") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := sessionsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *sessionsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *sessionsClient) Create(ipSecVPNSessionParam *data.StructValue) (*data.StructValue, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sessionsCreateInputType(), typeConverter) + sv.AddStructField("IpSecVPNSession", ipSecVPNSessionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.sessions", "create", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sessionsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sessionsClient) Delete(ipsecVpnSessionIdParam string, forceParam *bool) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sessionsDeleteInputType(), typeConverter) + sv.AddStructField("IpsecVpnSessionId", ipsecVpnSessionIdParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.sessions", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *sessionsClient) Get(ipsecVpnSessionIdParam string) (*data.StructValue, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sessionsGetInputType(), typeConverter) + sv.AddStructField("IpsecVpnSessionId", ipsecVpnSessionIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.sessions", "get", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sessionsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sessionsClient) List(cursorParam *string, includedFieldsParam *string, ipsecVpnServiceIdParam *string, logicalRouterIdParam *string, pageSizeParam *int64, sessionTypeParam *string, sortAscendingParam *bool, sortByParam *string) (model.IPSecVPNSessionListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sessionsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("IpsecVpnServiceId", ipsecVpnServiceIdParam) + sv.AddStructField("LogicalRouterId", logicalRouterIdParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SessionType", sessionTypeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNSessionListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.sessions", "list", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNSessionListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sessionsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNSessionListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sessionsClient) Update(ipsecVpnSessionIdParam string, ipSecVPNSessionParam *data.StructValue) (*data.StructValue, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sessionsUpdateInputType(), typeConverter) + sv.AddStructField("IpsecVpnSessionId", ipsecVpnSessionIdParam) + sv.AddStructField("IpSecVPNSession", ipSecVPNSessionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput *data.StructValue + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.sessions", "update", inputDataValue, executionContext) + var emptyOutput *data.StructValue + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sessionsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(*data.StructValue), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/vpn/ipsec/SessionsTypes.go b/services/nsxt-mp/nsx/vpn/ipsec/SessionsTypes.go new file mode 100644 index 000000000..ff85fd600 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/SessionsTypes.go @@ -0,0 +1,325 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Sessions. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ipsec + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``sessionType`` of method Sessions#list. +const Sessions_LIST_SESSION_TYPE_POLICYBASEDIPSECVPNSESSION = "PolicyBasedIPSecVPNSession" + +// Possible value for ``sessionType`` of method Sessions#list. +const Sessions_LIST_SESSION_TYPE_ROUTEBASEDIPSECVPNSESSION = "RouteBasedIPSecVPNSession" + +func sessionsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_sec_VPN_session"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IPSecVPNSessionBindingType)}, bindings.REST) + fieldNameMap["ip_sec_VPN_session"] = "IpSecVPNSession" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionsCreateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IPSecVPNSessionBindingType)}, bindings.REST) +} + +func sessionsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ip_sec_VPN_session"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IPSecVPNSessionBindingType)}, bindings.REST) + fieldNameMap["ip_sec_VPN_session"] = "IpSecVPNSession" + paramsTypeMap["ip_sec_VPN_session"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IPSecVPNSessionBindingType)}, bindings.REST) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_sec_VPN_session", + "POST", + "/api/v1/vpn/ipsec/sessions", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sessionsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_session_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ipsec_vpn_session_id"] = "IpsecVpnSessionId" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func sessionsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_session_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ipsec_vpn_session_id"] = "IpsecVpnSessionId" + fieldNameMap["force"] = "Force" + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["ipsec_vpn_session_id"] = bindings.NewStringType() + paramsTypeMap["ipsecVpnSessionId"] = bindings.NewStringType() + pathParams["ipsec_vpn_session_id"] = "ipsecVpnSessionId" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/vpn/ipsec/sessions/{ipsecVpnSessionId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sessionsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_session_id"] = bindings.NewStringType() + fieldNameMap["ipsec_vpn_session_id"] = "IpsecVpnSessionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionsGetOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IPSecVPNSessionBindingType)}, bindings.REST) +} + +func sessionsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_session_id"] = bindings.NewStringType() + fieldNameMap["ipsec_vpn_session_id"] = "IpsecVpnSessionId" + paramsTypeMap["ipsec_vpn_session_id"] = bindings.NewStringType() + paramsTypeMap["ipsecVpnSessionId"] = bindings.NewStringType() + pathParams["ipsec_vpn_session_id"] = "ipsecVpnSessionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/ipsec/sessions/{ipsecVpnSessionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sessionsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["ipsec_vpn_service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["session_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["ipsec_vpn_service_id"] = "IpsecVpnServiceId" + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["session_type"] = "SessionType" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNSessionListResultBindingType) +} + +func sessionsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["ipsec_vpn_service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["session_type"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["ipsec_vpn_service_id"] = "IpsecVpnServiceId" + fieldNameMap["logical_router_id"] = "LogicalRouterId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["session_type"] = "SessionType" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["session_type"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["ipsec_vpn_service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["logical_router_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["logical_router_id"] = "logical_router_id" + queryParams["ipsec_vpn_service_id"] = "ipsec_vpn_service_id" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["session_type"] = "session_type" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/ipsec/sessions", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sessionsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_session_id"] = bindings.NewStringType() + fields["ip_sec_VPN_session"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IPSecVPNSessionBindingType)}, bindings.REST) + fieldNameMap["ipsec_vpn_session_id"] = "IpsecVpnSessionId" + fieldNameMap["ip_sec_VPN_session"] = "IpSecVPNSession" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionsUpdateOutputType() bindings.BindingType { + return bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IPSecVPNSessionBindingType)}, bindings.REST) +} + +func sessionsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_session_id"] = bindings.NewStringType() + fields["ip_sec_VPN_session"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IPSecVPNSessionBindingType)}, bindings.REST) + fieldNameMap["ipsec_vpn_session_id"] = "IpsecVpnSessionId" + fieldNameMap["ip_sec_VPN_session"] = "IpSecVPNSession" + paramsTypeMap["ip_sec_VPN_session"] = bindings.NewDynamicStructType([]bindings.ReferenceType{bindings.NewReferenceType(model.IPSecVPNSessionBindingType)}, bindings.REST) + paramsTypeMap["ipsec_vpn_session_id"] = bindings.NewStringType() + paramsTypeMap["ipsecVpnSessionId"] = bindings.NewStringType() + pathParams["ipsec_vpn_session_id"] = "ipsecVpnSessionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_sec_VPN_session", + "PUT", + "/api/v1/vpn/ipsec/sessions/{ipsecVpnSessionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/vpn/ipsec/TunnelProfilesClient.go b/services/nsxt-mp/nsx/vpn/ipsec/TunnelProfilesClient.go new file mode 100644 index 000000000..143e101e6 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/TunnelProfilesClient.go @@ -0,0 +1,267 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: TunnelProfiles +// Used by client-side stubs. + +package ipsec + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type TunnelProfilesClient interface { + + // Create custom IPSec tunnel profile. IPSec tunnel profile is a reusable profile that captures phase two negotiation parameters and tunnel properties. System will be provisioned with system owned non editable default IPSec tunnel profile. Any change in profile affects all sessions consuming this profile. + // + // @param ipSecVPNTunnelProfileParam (required) + // @return com.vmware.nsx.model.IPSecVPNTunnelProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(ipSecVPNTunnelProfileParam model.IPSecVPNTunnelProfile) (model.IPSecVPNTunnelProfile, error) + + // Delete custom IPSec Tunnel Profile. + // + // @param ipsecVpnTunnelProfileIdParam (required) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(ipsecVpnTunnelProfileIdParam string, forceParam *bool) error + + // Get custom IPSec Tunnel Profile. + // + // @param ipsecVpnTunnelProfileIdParam (required) + // @return com.vmware.nsx.model.IPSecVPNTunnelProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ipsecVpnTunnelProfileIdParam string) (model.IPSecVPNTunnelProfile, error) + + // Get paginated list of all IPSecTunnelProfiles. + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.IPSecVPNTunnelProfileListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPSecVPNTunnelProfileListResult, error) + + // Edit custom IPSec Tunnel Profile. System owned profiles are non editable. + // + // @param ipsecVpnTunnelProfileIdParam (required) + // @param ipSecVPNTunnelProfileParam (required) + // @return com.vmware.nsx.model.IPSecVPNTunnelProfile + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(ipsecVpnTunnelProfileIdParam string, ipSecVPNTunnelProfileParam model.IPSecVPNTunnelProfile) (model.IPSecVPNTunnelProfile, error) +} + +type tunnelProfilesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewTunnelProfilesClient(connector client.Connector) *tunnelProfilesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.vpn.ipsec.tunnel_profiles") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + tIface := tunnelProfilesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &tIface +} + +func (tIface *tunnelProfilesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := tIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (tIface *tunnelProfilesClient) Create(ipSecVPNTunnelProfileParam model.IPSecVPNTunnelProfile) (model.IPSecVPNTunnelProfile, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(tunnelProfilesCreateInputType(), typeConverter) + sv.AddStructField("IpSecVPNTunnelProfile", ipSecVPNTunnelProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNTunnelProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tunnelProfilesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.tunnel_profiles", "create", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNTunnelProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), tunnelProfilesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNTunnelProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *tunnelProfilesClient) Delete(ipsecVpnTunnelProfileIdParam string, forceParam *bool) error { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(tunnelProfilesDeleteInputType(), typeConverter) + sv.AddStructField("IpsecVpnTunnelProfileId", ipsecVpnTunnelProfileIdParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tunnelProfilesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.tunnel_profiles", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (tIface *tunnelProfilesClient) Get(ipsecVpnTunnelProfileIdParam string) (model.IPSecVPNTunnelProfile, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(tunnelProfilesGetInputType(), typeConverter) + sv.AddStructField("IpsecVpnTunnelProfileId", ipsecVpnTunnelProfileIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNTunnelProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tunnelProfilesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.tunnel_profiles", "get", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNTunnelProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), tunnelProfilesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNTunnelProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *tunnelProfilesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.IPSecVPNTunnelProfileListResult, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(tunnelProfilesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNTunnelProfileListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tunnelProfilesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.tunnel_profiles", "list", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNTunnelProfileListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), tunnelProfilesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNTunnelProfileListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (tIface *tunnelProfilesClient) Update(ipsecVpnTunnelProfileIdParam string, ipSecVPNTunnelProfileParam model.IPSecVPNTunnelProfile) (model.IPSecVPNTunnelProfile, error) { + typeConverter := tIface.connector.TypeConverter() + executionContext := tIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(tunnelProfilesUpdateInputType(), typeConverter) + sv.AddStructField("IpsecVpnTunnelProfileId", ipsecVpnTunnelProfileIdParam) + sv.AddStructField("IpSecVPNTunnelProfile", ipSecVPNTunnelProfileParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNTunnelProfile + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := tunnelProfilesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + tIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := tIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.tunnel_profiles", "update", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNTunnelProfile + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), tunnelProfilesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNTunnelProfile), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), tIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/vpn/ipsec/TunnelProfilesTypes.go b/services/nsxt-mp/nsx/vpn/ipsec/TunnelProfilesTypes.go new file mode 100644 index 000000000..87e836dbb --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/TunnelProfilesTypes.go @@ -0,0 +1,301 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: TunnelProfiles. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package ipsec + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func tunnelProfilesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ip_sec_VPN_tunnel_profile"] = bindings.NewReferenceType(model.IPSecVPNTunnelProfileBindingType) + fieldNameMap["ip_sec_VPN_tunnel_profile"] = "IpSecVPNTunnelProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tunnelProfilesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNTunnelProfileBindingType) +} + +func tunnelProfilesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ip_sec_VPN_tunnel_profile"] = bindings.NewReferenceType(model.IPSecVPNTunnelProfileBindingType) + fieldNameMap["ip_sec_VPN_tunnel_profile"] = "IpSecVPNTunnelProfile" + paramsTypeMap["ip_sec_VPN_tunnel_profile"] = bindings.NewReferenceType(model.IPSecVPNTunnelProfileBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_sec_VPN_tunnel_profile", + "POST", + "/api/v1/vpn/ipsec/tunnel-profiles", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func tunnelProfilesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_tunnel_profile_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ipsec_vpn_tunnel_profile_id"] = "IpsecVpnTunnelProfileId" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tunnelProfilesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func tunnelProfilesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_tunnel_profile_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["ipsec_vpn_tunnel_profile_id"] = "IpsecVpnTunnelProfileId" + fieldNameMap["force"] = "Force" + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["ipsec_vpn_tunnel_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipsecVpnTunnelProfileId"] = bindings.NewStringType() + pathParams["ipsec_vpn_tunnel_profile_id"] = "ipsecVpnTunnelProfileId" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/vpn/ipsec/tunnel-profiles/{ipsecVpnTunnelProfileId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func tunnelProfilesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_tunnel_profile_id"] = bindings.NewStringType() + fieldNameMap["ipsec_vpn_tunnel_profile_id"] = "IpsecVpnTunnelProfileId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tunnelProfilesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNTunnelProfileBindingType) +} + +func tunnelProfilesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_tunnel_profile_id"] = bindings.NewStringType() + fieldNameMap["ipsec_vpn_tunnel_profile_id"] = "IpsecVpnTunnelProfileId" + paramsTypeMap["ipsec_vpn_tunnel_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipsecVpnTunnelProfileId"] = bindings.NewStringType() + pathParams["ipsec_vpn_tunnel_profile_id"] = "ipsecVpnTunnelProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/ipsec/tunnel-profiles/{ipsecVpnTunnelProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func tunnelProfilesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tunnelProfilesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNTunnelProfileListResultBindingType) +} + +func tunnelProfilesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/ipsec/tunnel-profiles", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func tunnelProfilesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_tunnel_profile_id"] = bindings.NewStringType() + fields["ip_sec_VPN_tunnel_profile"] = bindings.NewReferenceType(model.IPSecVPNTunnelProfileBindingType) + fieldNameMap["ipsec_vpn_tunnel_profile_id"] = "IpsecVpnTunnelProfileId" + fieldNameMap["ip_sec_VPN_tunnel_profile"] = "IpSecVPNTunnelProfile" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func tunnelProfilesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNTunnelProfileBindingType) +} + +func tunnelProfilesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_tunnel_profile_id"] = bindings.NewStringType() + fields["ip_sec_VPN_tunnel_profile"] = bindings.NewReferenceType(model.IPSecVPNTunnelProfileBindingType) + fieldNameMap["ipsec_vpn_tunnel_profile_id"] = "IpsecVpnTunnelProfileId" + fieldNameMap["ip_sec_VPN_tunnel_profile"] = "IpSecVPNTunnelProfile" + paramsTypeMap["ip_sec_VPN_tunnel_profile"] = bindings.NewReferenceType(model.IPSecVPNTunnelProfileBindingType) + paramsTypeMap["ipsec_vpn_tunnel_profile_id"] = bindings.NewStringType() + paramsTypeMap["ipsecVpnTunnelProfileId"] = bindings.NewStringType() + pathParams["ipsec_vpn_tunnel_profile_id"] = "ipsecVpnTunnelProfileId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "ip_sec_VPN_tunnel_profile", + "PUT", + "/api/v1/vpn/ipsec/tunnel-profiles/{ipsecVpnTunnelProfileId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/vpn/ipsec/sessions/SessionsPackageTypes.go b/services/nsxt-mp/nsx/vpn/ipsec/sessions/SessionsPackageTypes.go new file mode 100644 index 000000000..e2b31709e --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/sessions/SessionsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.vpn.ipsec.sessions. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package sessions diff --git a/services/nsxt-mp/nsx/vpn/ipsec/sessions/StateClient.go b/services/nsxt-mp/nsx/vpn/ipsec/sessions/StateClient.go new file mode 100644 index 000000000..353f3361d --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/sessions/StateClient.go @@ -0,0 +1,94 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: State +// Used by client-side stubs. + +package sessions + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StateClient interface { + + // Return realized state information of a ipsec vpn session. Any configuration update that affects the ipsec vpn session can use this API to get its realized state by passing a request_id returned by the configuration change operation. e.g. Update configuration of ipsec vpn session, service, endpoints, profiles, etc. It will return a service disabled error, if the ipsec vpn service associated with the session is disabled. + // + // @param ipsecVpnSessionIdParam (required) + // @param barrierIdParam (optional) + // @param requestIdParam Realization request ID (optional) + // @return com.vmware.nsx.model.IPSecVPNSessionState + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(ipsecVpnSessionIdParam string, barrierIdParam *int64, requestIdParam *string) (model.IPSecVPNSessionState, error) +} + +type stateClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStateClient(connector client.Connector) *stateClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.vpn.ipsec.sessions.state") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := stateClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *stateClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *stateClient) Get(ipsecVpnSessionIdParam string, barrierIdParam *int64, requestIdParam *string) (model.IPSecVPNSessionState, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(stateGetInputType(), typeConverter) + sv.AddStructField("IpsecVpnSessionId", ipsecVpnSessionIdParam) + sv.AddStructField("BarrierId", barrierIdParam) + sv.AddStructField("RequestId", requestIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNSessionState + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := stateGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.sessions.state", "get", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNSessionState + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), stateGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNSessionState), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/vpn/ipsec/sessions/StateTypes.go b/services/nsxt-mp/nsx/vpn/ipsec/sessions/StateTypes.go new file mode 100644 index 000000000..aaa82f7b6 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/sessions/StateTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: State. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package sessions + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func stateGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["ipsec_vpn_session_id"] = bindings.NewStringType() + fields["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ipsec_vpn_session_id"] = "IpsecVpnSessionId" + fieldNameMap["barrier_id"] = "BarrierId" + fieldNameMap["request_id"] = "RequestId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func stateGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNSessionStateBindingType) +} + +func stateGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["ipsec_vpn_session_id"] = bindings.NewStringType() + fields["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["ipsec_vpn_session_id"] = "IpsecVpnSessionId" + fieldNameMap["barrier_id"] = "BarrierId" + fieldNameMap["request_id"] = "RequestId" + paramsTypeMap["barrier_id"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["request_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["ipsec_vpn_session_id"] = bindings.NewStringType() + paramsTypeMap["ipsecVpnSessionId"] = bindings.NewStringType() + pathParams["ipsec_vpn_session_id"] = "ipsecVpnSessionId" + queryParams["barrier_id"] = "barrier_id" + queryParams["request_id"] = "request_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/ipsec/sessions/{ipsecVpnSessionId}/state", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/vpn/ipsec/sessions/StatisticsClient.go b/services/nsxt-mp/nsx/vpn/ipsec/sessions/StatisticsClient.go new file mode 100644 index 000000000..38dab0571 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/sessions/StatisticsClient.go @@ -0,0 +1,128 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Statistics +// Used by client-side stubs. + +package sessions + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatisticsClient interface { + + // Get statistics of a vpn session across all tunnels and IKE session. Query parameter \"source=realtime\" is the only supported source. + // + // @param sessionIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.IPSecVPNSessionStatistics + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(sessionIdParam string, sourceParam *string) (model.IPSecVPNSessionStatistics, error) + + // Reset the statistics of the given VPN session. + // + // @param sessionIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Reset(sessionIdParam string) error +} + +type statisticsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatisticsClient(connector client.Connector) *statisticsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.vpn.ipsec.sessions.statistics") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "reset": core.NewMethodIdentifier(interfaceIdentifier, "reset"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statisticsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statisticsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statisticsClient) Get(sessionIdParam string, sourceParam *string) (model.IPSecVPNSessionStatistics, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statisticsGetInputType(), typeConverter) + sv.AddStructField("SessionId", sessionIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNSessionStatistics + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statisticsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.sessions.statistics", "get", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNSessionStatistics + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statisticsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNSessionStatistics), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *statisticsClient) Reset(sessionIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statisticsResetInputType(), typeConverter) + sv.AddStructField("SessionId", sessionIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statisticsResetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.sessions.statistics", "reset", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/vpn/ipsec/sessions/StatisticsTypes.go b/services/nsxt-mp/nsx/vpn/ipsec/sessions/StatisticsTypes.go new file mode 100644 index 000000000..56a2feab9 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/sessions/StatisticsTypes.go @@ -0,0 +1,131 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Statistics. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package sessions + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Statistics#get. +const Statistics_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Statistics#get. +const Statistics_GET_SOURCE_CACHED = "cached" + +func statisticsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["session_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["session_id"] = "SessionId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statisticsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNSessionStatisticsBindingType) +} + +func statisticsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["session_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["session_id"] = "SessionId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["session_id"] = bindings.NewStringType() + paramsTypeMap["sessionId"] = bindings.NewStringType() + pathParams["session_id"] = "sessionId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/ipsec/sessions/{sessionId}/statistics", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func statisticsResetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["session_id"] = bindings.NewStringType() + fieldNameMap["session_id"] = "SessionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statisticsResetOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func statisticsResetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["session_id"] = bindings.NewStringType() + fieldNameMap["session_id"] = "SessionId" + paramsTypeMap["session_id"] = bindings.NewStringType() + paramsTypeMap["sessionId"] = bindings.NewStringType() + pathParams["session_id"] = "sessionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "action=reset", + "", + "POST", + "/api/v1/vpn/ipsec/sessions/{sessionId}/statistics", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/vpn/ipsec/sessions/StatusClient.go b/services/nsxt-mp/nsx/vpn/ipsec/sessions/StatusClient.go new file mode 100644 index 000000000..d524ffe19 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/sessions/StatusClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package sessions + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // List status of IPSec session. Query parameter source supports both realtime and cached mode. + // + // @param sessionIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.IPSecVPNSessionStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(sessionIdParam string, sourceParam *string) (model.IPSecVPNSessionStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.vpn.ipsec.sessions.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(sessionIdParam string, sourceParam *string) (model.IPSecVPNSessionStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("SessionId", sessionIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNSessionStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.sessions.status", "get", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNSessionStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNSessionStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/vpn/ipsec/sessions/StatusTypes.go b/services/nsxt-mp/nsx/vpn/ipsec/sessions/StatusTypes.go new file mode 100644 index 000000000..4f30b668c --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/sessions/StatusTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package sessions + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_CACHED = "cached" + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["session_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["session_id"] = "SessionId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNSessionStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["session_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["session_id"] = "SessionId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["session_id"] = bindings.NewStringType() + paramsTypeMap["sessionId"] = bindings.NewStringType() + pathParams["session_id"] = "sessionId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/ipsec/sessions/{sessionId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/vpn/ipsec/sessions/SummaryClient.go b/services/nsxt-mp/nsx/vpn/ipsec/sessions/SummaryClient.go new file mode 100644 index 000000000..2e3ed71fc --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/sessions/SummaryClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Summary +// Used by client-side stubs. + +package sessions + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SummaryClient interface { + + // VPN session summary gets summary per vpn sessions and IKE session. Query parameter source supports only cached mode. + // + // @param siteIdParam Peer site id (optional) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.IPSecVPNSessionSummary + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(siteIdParam *string, sourceParam *string) (model.IPSecVPNSessionSummary, error) +} + +type summaryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSummaryClient(connector client.Connector) *summaryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.vpn.ipsec.sessions.summary") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := summaryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *summaryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *summaryClient) Get(siteIdParam *string, sourceParam *string) (model.IPSecVPNSessionSummary, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(summaryGetInputType(), typeConverter) + sv.AddStructField("SiteId", siteIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNSessionSummary + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := summaryGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.ipsec.sessions.summary", "get", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNSessionSummary + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), summaryGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNSessionSummary), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/vpn/ipsec/sessions/SummaryTypes.go b/services/nsxt-mp/nsx/vpn/ipsec/sessions/SummaryTypes.go new file mode 100644 index 000000000..6cd7c232c --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/ipsec/sessions/SummaryTypes.go @@ -0,0 +1,80 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Summary. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package sessions + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Summary#get. +const Summary_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Summary#get. +const Summary_GET_SOURCE_CACHED = "cached" + +func summaryGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_id"] = "SiteId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func summaryGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNSessionSummaryBindingType) +} + +func summaryGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["site_id"] = "SiteId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["site_id"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["site_id"] = "site_id" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/ipsec/sessions/summary", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/vpn/l2vpn/L2vpnPackageTypes.go b/services/nsxt-mp/nsx/vpn/l2vpn/L2vpnPackageTypes.go new file mode 100644 index 000000000..811794b9d --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/l2vpn/L2vpnPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.vpn.l2vpn. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package l2vpn diff --git a/services/nsxt-mp/nsx/vpn/l2vpn/ServicesClient.go b/services/nsxt-mp/nsx/vpn/l2vpn/ServicesClient.go new file mode 100644 index 000000000..9f28eb7e9 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/l2vpn/ServicesClient.go @@ -0,0 +1,267 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Services +// Used by client-side stubs. + +package l2vpn + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type ServicesClient interface { + + // Create L2VPN service for a given logical router + // + // @param l2VpnServiceParam (required) + // @return com.vmware.nsx.model.L2VpnService + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(l2VpnServiceParam model.L2VpnService) (model.L2VpnService, error) + + // Delete a specific L2VPN service. If there are any L2VpnSessions on this L2VpnService, those needs to be deleted first. + // + // @param l2vpnServiceIdParam (required) + // @param forceParam Force delete the resource even if it is being used somewhere (optional, default to false) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(l2vpnServiceIdParam string, forceParam *bool) error + + // Get a specific L2VPN service + // + // @param l2vpnServiceIdParam (required) + // @return com.vmware.nsx.model.L2VpnService + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(l2vpnServiceIdParam string) (model.L2VpnService, error) + + // Get paginated list of all L2VPN services + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.L2VpnServiceListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.L2VpnServiceListResult, error) + + // Edit a specific L2VPN service + // + // @param l2vpnServiceIdParam (required) + // @param l2VpnServiceParam (required) + // @return com.vmware.nsx.model.L2VpnService + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(l2vpnServiceIdParam string, l2VpnServiceParam model.L2VpnService) (model.L2VpnService, error) +} + +type servicesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewServicesClient(connector client.Connector) *servicesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.vpn.l2vpn.services") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := servicesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *servicesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *servicesClient) Create(l2VpnServiceParam model.L2VpnService) (model.L2VpnService, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(servicesCreateInputType(), typeConverter) + sv.AddStructField("L2VpnService", l2VpnServiceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.L2VpnService + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.l2vpn.services", "create", inputDataValue, executionContext) + var emptyOutput model.L2VpnService + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), servicesCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.L2VpnService), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *servicesClient) Delete(l2vpnServiceIdParam string, forceParam *bool) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(servicesDeleteInputType(), typeConverter) + sv.AddStructField("L2vpnServiceId", l2vpnServiceIdParam) + sv.AddStructField("Force", forceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.l2vpn.services", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *servicesClient) Get(l2vpnServiceIdParam string) (model.L2VpnService, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(servicesGetInputType(), typeConverter) + sv.AddStructField("L2vpnServiceId", l2vpnServiceIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.L2VpnService + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.l2vpn.services", "get", inputDataValue, executionContext) + var emptyOutput model.L2VpnService + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), servicesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.L2VpnService), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *servicesClient) List(cursorParam *string, includedFieldsParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.L2VpnServiceListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(servicesListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.L2VpnServiceListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.l2vpn.services", "list", inputDataValue, executionContext) + var emptyOutput model.L2VpnServiceListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), servicesListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.L2VpnServiceListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *servicesClient) Update(l2vpnServiceIdParam string, l2VpnServiceParam model.L2VpnService) (model.L2VpnService, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(servicesUpdateInputType(), typeConverter) + sv.AddStructField("L2vpnServiceId", l2vpnServiceIdParam) + sv.AddStructField("L2VpnService", l2VpnServiceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.L2VpnService + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := servicesUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.l2vpn.services", "update", inputDataValue, executionContext) + var emptyOutput model.L2VpnService + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), servicesUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.L2VpnService), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/vpn/l2vpn/ServicesTypes.go b/services/nsxt-mp/nsx/vpn/l2vpn/ServicesTypes.go new file mode 100644 index 000000000..a64153dba --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/l2vpn/ServicesTypes.go @@ -0,0 +1,301 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Services. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package l2vpn + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func servicesCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["l2_vpn_service"] = bindings.NewReferenceType(model.L2VpnServiceBindingType) + fieldNameMap["l2_vpn_service"] = "L2VpnService" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.L2VpnServiceBindingType) +} + +func servicesCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["l2_vpn_service"] = bindings.NewReferenceType(model.L2VpnServiceBindingType) + fieldNameMap["l2_vpn_service"] = "L2VpnService" + paramsTypeMap["l2_vpn_service"] = bindings.NewReferenceType(model.L2VpnServiceBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "l2_vpn_service", + "POST", + "/api/v1/vpn/l2vpn/services/nsxt-mp", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func servicesDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["l2vpn_service_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["l2vpn_service_id"] = "L2vpnServiceId" + fieldNameMap["force"] = "Force" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func servicesDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["l2vpn_service_id"] = bindings.NewStringType() + fields["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fieldNameMap["l2vpn_service_id"] = "L2vpnServiceId" + fieldNameMap["force"] = "Force" + paramsTypeMap["l2vpn_service_id"] = bindings.NewStringType() + paramsTypeMap["force"] = bindings.NewOptionalType(bindings.NewBooleanType()) + paramsTypeMap["l2vpnServiceId"] = bindings.NewStringType() + pathParams["l2vpn_service_id"] = "l2vpnServiceId" + queryParams["force"] = "force" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/vpn/l2vpn/services/nsxt-mp/{l2vpnServiceId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func servicesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["l2vpn_service_id"] = bindings.NewStringType() + fieldNameMap["l2vpn_service_id"] = "L2vpnServiceId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.L2VpnServiceBindingType) +} + +func servicesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["l2vpn_service_id"] = bindings.NewStringType() + fieldNameMap["l2vpn_service_id"] = "L2vpnServiceId" + paramsTypeMap["l2vpn_service_id"] = bindings.NewStringType() + paramsTypeMap["l2vpnServiceId"] = bindings.NewStringType() + pathParams["l2vpn_service_id"] = "l2vpnServiceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/l2vpn/services/nsxt-mp/{l2vpnServiceId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func servicesListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.L2VpnServiceListResultBindingType) +} + +func servicesListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/l2vpn/services/nsxt-mp", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func servicesUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["l2vpn_service_id"] = bindings.NewStringType() + fields["l2_vpn_service"] = bindings.NewReferenceType(model.L2VpnServiceBindingType) + fieldNameMap["l2vpn_service_id"] = "L2vpnServiceId" + fieldNameMap["l2_vpn_service"] = "L2VpnService" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func servicesUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.L2VpnServiceBindingType) +} + +func servicesUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["l2vpn_service_id"] = bindings.NewStringType() + fields["l2_vpn_service"] = bindings.NewReferenceType(model.L2VpnServiceBindingType) + fieldNameMap["l2vpn_service_id"] = "L2vpnServiceId" + fieldNameMap["l2_vpn_service"] = "L2VpnService" + paramsTypeMap["l2vpn_service_id"] = bindings.NewStringType() + paramsTypeMap["l2_vpn_service"] = bindings.NewReferenceType(model.L2VpnServiceBindingType) + paramsTypeMap["l2vpnServiceId"] = bindings.NewStringType() + pathParams["l2vpn_service_id"] = "l2vpnServiceId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "l2_vpn_service", + "PUT", + "/api/v1/vpn/l2vpn/services/nsxt-mp/{l2vpnServiceId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/vpn/l2vpn/SessionsClient.go b/services/nsxt-mp/nsx/vpn/l2vpn/SessionsClient.go new file mode 100644 index 000000000..567470a8d --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/l2vpn/SessionsClient.go @@ -0,0 +1,267 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Sessions +// Used by client-side stubs. + +package l2vpn + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SessionsClient interface { + + // Create L2VPN session and bind to a L2VPNService + // + // @param l2VpnSessionParam (required) + // @return com.vmware.nsx.model.L2VpnSession + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Create(l2VpnSessionParam model.L2VpnSession) (model.L2VpnSession, error) + + // Delete a specific L2VPN session. If there are any logical switch ports attached to it, those needs to be deleted first. + // + // @param l2vpnSessionIdParam (required) + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Delete(l2vpnSessionIdParam string) error + + // Get a specific L2VPN session + // + // @param l2vpnSessionIdParam (required) + // @return com.vmware.nsx.model.L2VpnSession + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(l2vpnSessionIdParam string) (model.L2VpnSession, error) + + // Get paginated list of all L2VPN sessions + // + // @param cursorParam Opaque cursor to be used for getting next page of records (supplied by current result page) (optional) + // @param includedFieldsParam Comma separated list of fields that should be included in query result (optional) + // @param l2vpnServiceIdParam Id of the L2Vpn Service (optional) + // @param pageSizeParam Maximum number of results to return in this page (server may return fewer) (optional, default to 1000) + // @param sortAscendingParam (optional) + // @param sortByParam Field by which records are sorted (optional) + // @return com.vmware.nsx.model.L2VpnSessionListResult + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + List(cursorParam *string, includedFieldsParam *string, l2vpnServiceIdParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.L2VpnSessionListResult, error) + + // Edit a specific L2VPN session + // + // @param l2vpnSessionIdParam (required) + // @param l2VpnSessionParam (required) + // @return com.vmware.nsx.model.L2VpnSession + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Update(l2vpnSessionIdParam string, l2VpnSessionParam model.L2VpnSession) (model.L2VpnSession, error) +} + +type sessionsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSessionsClient(connector client.Connector) *sessionsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.vpn.l2vpn.sessions") + methodIdentifiers := map[string]core.MethodIdentifier{ + "create": core.NewMethodIdentifier(interfaceIdentifier, "create"), + "delete": core.NewMethodIdentifier(interfaceIdentifier, "delete"), + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + "list": core.NewMethodIdentifier(interfaceIdentifier, "list"), + "update": core.NewMethodIdentifier(interfaceIdentifier, "update"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := sessionsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *sessionsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *sessionsClient) Create(l2VpnSessionParam model.L2VpnSession) (model.L2VpnSession, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sessionsCreateInputType(), typeConverter) + sv.AddStructField("L2VpnSession", l2VpnSessionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.L2VpnSession + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionsCreateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.l2vpn.sessions", "create", inputDataValue, executionContext) + var emptyOutput model.L2VpnSession + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sessionsCreateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.L2VpnSession), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sessionsClient) Delete(l2vpnSessionIdParam string) error { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sessionsDeleteInputType(), typeConverter) + sv.AddStructField("L2vpnSessionId", l2vpnSessionIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + return bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionsDeleteRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.l2vpn.sessions", "delete", inputDataValue, executionContext) + if methodResult.IsSuccess() { + return nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return bindings.VAPIerrorsToError(errorInError) + } + return methodError.(error) + } +} + +func (sIface *sessionsClient) Get(l2vpnSessionIdParam string) (model.L2VpnSession, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sessionsGetInputType(), typeConverter) + sv.AddStructField("L2vpnSessionId", l2vpnSessionIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.L2VpnSession + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.l2vpn.sessions", "get", inputDataValue, executionContext) + var emptyOutput model.L2VpnSession + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sessionsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.L2VpnSession), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sessionsClient) List(cursorParam *string, includedFieldsParam *string, l2vpnServiceIdParam *string, pageSizeParam *int64, sortAscendingParam *bool, sortByParam *string) (model.L2VpnSessionListResult, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sessionsListInputType(), typeConverter) + sv.AddStructField("Cursor", cursorParam) + sv.AddStructField("IncludedFields", includedFieldsParam) + sv.AddStructField("L2vpnServiceId", l2vpnServiceIdParam) + sv.AddStructField("PageSize", pageSizeParam) + sv.AddStructField("SortAscending", sortAscendingParam) + sv.AddStructField("SortBy", sortByParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.L2VpnSessionListResult + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionsListRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.l2vpn.sessions", "list", inputDataValue, executionContext) + var emptyOutput model.L2VpnSessionListResult + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sessionsListOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.L2VpnSessionListResult), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} + +func (sIface *sessionsClient) Update(l2vpnSessionIdParam string, l2VpnSessionParam model.L2VpnSession) (model.L2VpnSession, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(sessionsUpdateInputType(), typeConverter) + sv.AddStructField("L2vpnSessionId", l2vpnSessionIdParam) + sv.AddStructField("L2VpnSession", l2VpnSessionParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.L2VpnSession + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := sessionsUpdateRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.l2vpn.sessions", "update", inputDataValue, executionContext) + var emptyOutput model.L2VpnSession + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), sessionsUpdateOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.L2VpnSession), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/vpn/l2vpn/SessionsTypes.go b/services/nsxt-mp/nsx/vpn/l2vpn/SessionsTypes.go new file mode 100644 index 000000000..1dc69a20a --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/l2vpn/SessionsTypes.go @@ -0,0 +1,301 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Sessions. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package l2vpn + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func sessionsCreateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["l2_vpn_session"] = bindings.NewReferenceType(model.L2VpnSessionBindingType) + fieldNameMap["l2_vpn_session"] = "L2VpnSession" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionsCreateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.L2VpnSessionBindingType) +} + +func sessionsCreateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["l2_vpn_session"] = bindings.NewReferenceType(model.L2VpnSessionBindingType) + fieldNameMap["l2_vpn_session"] = "L2VpnSession" + paramsTypeMap["l2_vpn_session"] = bindings.NewReferenceType(model.L2VpnSessionBindingType) + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "l2_vpn_session", + "POST", + "/api/v1/vpn/l2vpn/sessions", + "", + resultHeaders, + 201, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sessionsDeleteInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["l2vpn_session_id"] = bindings.NewStringType() + fieldNameMap["l2vpn_session_id"] = "L2vpnSessionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionsDeleteOutputType() bindings.BindingType { + return bindings.NewVoidType() +} + +func sessionsDeleteRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["l2vpn_session_id"] = bindings.NewStringType() + fieldNameMap["l2vpn_session_id"] = "L2vpnSessionId" + paramsTypeMap["l2vpn_session_id"] = bindings.NewStringType() + paramsTypeMap["l2vpnSessionId"] = bindings.NewStringType() + pathParams["l2vpn_session_id"] = "l2vpnSessionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "DELETE", + "/api/v1/vpn/l2vpn/sessions/{l2vpnSessionId}", + "", + resultHeaders, + 204, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sessionsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["l2vpn_session_id"] = bindings.NewStringType() + fieldNameMap["l2vpn_session_id"] = "L2vpnSessionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.L2VpnSessionBindingType) +} + +func sessionsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["l2vpn_session_id"] = bindings.NewStringType() + fieldNameMap["l2vpn_session_id"] = "L2vpnSessionId" + paramsTypeMap["l2vpn_session_id"] = bindings.NewStringType() + paramsTypeMap["l2vpnSessionId"] = bindings.NewStringType() + pathParams["l2vpn_session_id"] = "l2vpnSessionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/l2vpn/sessions/{l2vpnSessionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sessionsListInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["l2vpn_service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["l2vpn_service_id"] = "L2vpnServiceId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionsListOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.L2VpnSessionListResultBindingType) +} + +func sessionsListRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["l2vpn_service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fields["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + fields["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + fields["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["cursor"] = "Cursor" + fieldNameMap["included_fields"] = "IncludedFields" + fieldNameMap["l2vpn_service_id"] = "L2vpnServiceId" + fieldNameMap["page_size"] = "PageSize" + fieldNameMap["sort_ascending"] = "SortAscending" + fieldNameMap["sort_by"] = "SortBy" + paramsTypeMap["included_fields"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["page_size"] = bindings.NewOptionalType(bindings.NewIntegerType()) + paramsTypeMap["l2vpn_service_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["cursor"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_by"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["sort_ascending"] = bindings.NewOptionalType(bindings.NewBooleanType()) + queryParams["cursor"] = "cursor" + queryParams["l2vpn_service_id"] = "l2vpn_service_id" + queryParams["sort_ascending"] = "sort_ascending" + queryParams["included_fields"] = "included_fields" + queryParams["sort_by"] = "sort_by" + queryParams["page_size"] = "page_size" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/l2vpn/sessions", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} + +func sessionsUpdateInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["l2vpn_session_id"] = bindings.NewStringType() + fields["l2_vpn_session"] = bindings.NewReferenceType(model.L2VpnSessionBindingType) + fieldNameMap["l2vpn_session_id"] = "L2vpnSessionId" + fieldNameMap["l2_vpn_session"] = "L2VpnSession" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func sessionsUpdateOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.L2VpnSessionBindingType) +} + +func sessionsUpdateRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["l2vpn_session_id"] = bindings.NewStringType() + fields["l2_vpn_session"] = bindings.NewReferenceType(model.L2VpnSessionBindingType) + fieldNameMap["l2vpn_session_id"] = "L2vpnSessionId" + fieldNameMap["l2_vpn_session"] = "L2VpnSession" + paramsTypeMap["l2vpn_session_id"] = bindings.NewStringType() + paramsTypeMap["l2_vpn_session"] = bindings.NewReferenceType(model.L2VpnSessionBindingType) + paramsTypeMap["l2vpnSessionId"] = bindings.NewStringType() + pathParams["l2vpn_session_id"] = "l2vpnSessionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "l2_vpn_session", + "PUT", + "/api/v1/vpn/l2vpn/sessions/{l2vpnSessionId}", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/vpn/l2vpn/sessions/PeerCodesClient.go b/services/nsxt-mp/nsx/vpn/l2vpn/sessions/PeerCodesClient.go new file mode 100644 index 000000000..a9c912aa9 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/l2vpn/sessions/PeerCodesClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: PeerCodes +// Used by client-side stubs. + +package sessions + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type PeerCodesClient interface { + + // Get peer codes for the L2VPN session to program the remote side of the tunnel. + // + // @param l2vpnSessionIdParam (required) + // @return com.vmware.nsx.model.L2VpnSessionPeerCodes + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(l2vpnSessionIdParam string) (model.L2VpnSessionPeerCodes, error) +} + +type peerCodesClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewPeerCodesClient(connector client.Connector) *peerCodesClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.vpn.l2vpn.sessions.peer_codes") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + pIface := peerCodesClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &pIface +} + +func (pIface *peerCodesClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := pIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (pIface *peerCodesClient) Get(l2vpnSessionIdParam string) (model.L2VpnSessionPeerCodes, error) { + typeConverter := pIface.connector.TypeConverter() + executionContext := pIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(peerCodesGetInputType(), typeConverter) + sv.AddStructField("L2vpnSessionId", l2vpnSessionIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.L2VpnSessionPeerCodes + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := peerCodesGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + pIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := pIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.l2vpn.sessions.peer_codes", "get", inputDataValue, executionContext) + var emptyOutput model.L2VpnSessionPeerCodes + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), peerCodesGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.L2VpnSessionPeerCodes), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), pIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/vpn/l2vpn/sessions/PeerCodesTypes.go b/services/nsxt-mp/nsx/vpn/l2vpn/sessions/PeerCodesTypes.go new file mode 100644 index 000000000..c9d44018b --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/l2vpn/sessions/PeerCodesTypes.go @@ -0,0 +1,69 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: PeerCodes. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package sessions + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func peerCodesGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["l2vpn_session_id"] = bindings.NewStringType() + fieldNameMap["l2vpn_session_id"] = "L2vpnSessionId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func peerCodesGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.L2VpnSessionPeerCodesBindingType) +} + +func peerCodesGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["l2vpn_session_id"] = bindings.NewStringType() + fieldNameMap["l2vpn_session_id"] = "L2vpnSessionId" + paramsTypeMap["l2vpn_session_id"] = bindings.NewStringType() + paramsTypeMap["l2vpnSessionId"] = bindings.NewStringType() + pathParams["l2vpn_session_id"] = "l2vpnSessionId" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/l2vpn/sessions/{l2vpnSessionId}/peer-codes", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/vpn/l2vpn/sessions/RemoteMacClient.go b/services/nsxt-mp/nsx/vpn/l2vpn/sessions/RemoteMacClient.go new file mode 100644 index 000000000..0873555b7 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/l2vpn/sessions/RemoteMacClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: RemoteMac +// Used by client-side stubs. + +package sessions + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type RemoteMacClient interface { + + // Get L2VPN session remote mac for logical switch. + // + // @param sessionIdParam (required) + // @param logicalSwitchIdParam logical switch identifier (optional) + // @return com.vmware.nsx.model.L2VPNSessionRemoteMacs + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(sessionIdParam string, logicalSwitchIdParam *string) (model.L2VPNSessionRemoteMacs, error) +} + +type remoteMacClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewRemoteMacClient(connector client.Connector) *remoteMacClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.vpn.l2vpn.sessions.remote_mac") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + rIface := remoteMacClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &rIface +} + +func (rIface *remoteMacClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := rIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (rIface *remoteMacClient) Get(sessionIdParam string, logicalSwitchIdParam *string) (model.L2VPNSessionRemoteMacs, error) { + typeConverter := rIface.connector.TypeConverter() + executionContext := rIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(remoteMacGetInputType(), typeConverter) + sv.AddStructField("SessionId", sessionIdParam) + sv.AddStructField("LogicalSwitchId", logicalSwitchIdParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.L2VPNSessionRemoteMacs + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := remoteMacGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + rIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := rIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.l2vpn.sessions.remote_mac", "get", inputDataValue, executionContext) + var emptyOutput model.L2VPNSessionRemoteMacs + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), remoteMacGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.L2VPNSessionRemoteMacs), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), rIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/vpn/l2vpn/sessions/RemoteMacTypes.go b/services/nsxt-mp/nsx/vpn/l2vpn/sessions/RemoteMacTypes.go new file mode 100644 index 000000000..23a37f1ae --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/l2vpn/sessions/RemoteMacTypes.go @@ -0,0 +1,75 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: RemoteMac. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package sessions + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +func remoteMacGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["session_id"] = bindings.NewStringType() + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["session_id"] = "SessionId" + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func remoteMacGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.L2VPNSessionRemoteMacsBindingType) +} + +func remoteMacGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["session_id"] = bindings.NewStringType() + fields["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["session_id"] = "SessionId" + fieldNameMap["logical_switch_id"] = "LogicalSwitchId" + paramsTypeMap["logical_switch_id"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["session_id"] = bindings.NewStringType() + paramsTypeMap["sessionId"] = bindings.NewStringType() + pathParams["session_id"] = "sessionId" + queryParams["logical_switch_id"] = "logical_switch_id" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/l2vpn/sessions/{sessionId}/remote-mac", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/vpn/l2vpn/sessions/SessionsPackageTypes.go b/services/nsxt-mp/nsx/vpn/l2vpn/sessions/SessionsPackageTypes.go new file mode 100644 index 000000000..c4dccae67 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/l2vpn/sessions/SessionsPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.vpn.l2vpn.sessions. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package sessions diff --git a/services/nsxt-mp/nsx/vpn/l2vpn/sessions/StatisticsClient.go b/services/nsxt-mp/nsx/vpn/l2vpn/sessions/StatisticsClient.go new file mode 100644 index 000000000..cf86ebce9 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/l2vpn/sessions/StatisticsClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Statistics +// Used by client-side stubs. + +package sessions + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatisticsClient interface { + + // Get statistics of a L2VPN session. Query parameter source=realtime is the only supported source. + // + // @param sessionIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.L2VPNSessionStatistics + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(sessionIdParam string, sourceParam *string) (model.L2VPNSessionStatistics, error) +} + +type statisticsClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatisticsClient(connector client.Connector) *statisticsClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.vpn.l2vpn.sessions.statistics") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statisticsClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statisticsClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statisticsClient) Get(sessionIdParam string, sourceParam *string) (model.L2VPNSessionStatistics, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statisticsGetInputType(), typeConverter) + sv.AddStructField("SessionId", sessionIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.L2VPNSessionStatistics + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statisticsGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.l2vpn.sessions.statistics", "get", inputDataValue, executionContext) + var emptyOutput model.L2VPNSessionStatistics + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statisticsGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.L2VPNSessionStatistics), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/vpn/l2vpn/sessions/StatisticsTypes.go b/services/nsxt-mp/nsx/vpn/l2vpn/sessions/StatisticsTypes.go new file mode 100644 index 000000000..feb81883c --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/l2vpn/sessions/StatisticsTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Statistics. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package sessions + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Statistics#get. +const Statistics_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Statistics#get. +const Statistics_GET_SOURCE_CACHED = "cached" + +func statisticsGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["session_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["session_id"] = "SessionId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statisticsGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.L2VPNSessionStatisticsBindingType) +} + +func statisticsGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["session_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["session_id"] = "SessionId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["session_id"] = bindings.NewStringType() + paramsTypeMap["sessionId"] = bindings.NewStringType() + pathParams["session_id"] = "sessionId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/l2vpn/sessions/{sessionId}/statistics", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/vpn/l2vpn/sessions/StatusClient.go b/services/nsxt-mp/nsx/vpn/l2vpn/sessions/StatusClient.go new file mode 100644 index 000000000..3f2ca21cc --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/l2vpn/sessions/StatusClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Status +// Used by client-side stubs. + +package sessions + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type StatusClient interface { + + // Aggregated status of L2VPN session. Query parameter source=realtime|cached is supported. + // + // @param sessionIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.L2VPNSessionStatus + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(sessionIdParam string, sourceParam *string) (model.L2VPNSessionStatus, error) +} + +type statusClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewStatusClient(connector client.Connector) *statusClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.vpn.l2vpn.sessions.status") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := statusClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *statusClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *statusClient) Get(sessionIdParam string, sourceParam *string) (model.L2VPNSessionStatus, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(statusGetInputType(), typeConverter) + sv.AddStructField("SessionId", sessionIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.L2VPNSessionStatus + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := statusGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.l2vpn.sessions.status", "get", inputDataValue, executionContext) + var emptyOutput model.L2VPNSessionStatus + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), statusGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.L2VPNSessionStatus), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/vpn/l2vpn/sessions/StatusTypes.go b/services/nsxt-mp/nsx/vpn/l2vpn/sessions/StatusTypes.go new file mode 100644 index 000000000..a052c604c --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/l2vpn/sessions/StatusTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Status. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package sessions + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Status#get. +const Status_GET_SOURCE_CACHED = "cached" + +func statusGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["session_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["session_id"] = "SessionId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func statusGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.L2VPNSessionStatusBindingType) +} + +func statusGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["session_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["session_id"] = "SessionId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["session_id"] = bindings.NewStringType() + paramsTypeMap["sessionId"] = bindings.NewStringType() + pathParams["session_id"] = "sessionId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/l2vpn/sessions/{sessionId}/status", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/vpn/l2vpn/sessions/SummaryClient.go b/services/nsxt-mp/nsx/vpn/l2vpn/sessions/SummaryClient.go new file mode 100644 index 000000000..13b79d449 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/l2vpn/sessions/SummaryClient.go @@ -0,0 +1,90 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Summary +// Used by client-side stubs. + +package sessions + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SummaryClient interface { + + // Load all the existing L2VPN sessions and return the status summary of all L2VPN sessions. Query parameter source supports only cached mode. + // + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.L2VPNSessionSummary + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(sourceParam *string) (model.L2VPNSessionSummary, error) +} + +type summaryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSummaryClient(connector client.Connector) *summaryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.vpn.l2vpn.sessions.summary") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := summaryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *summaryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *summaryClient) Get(sourceParam *string) (model.L2VPNSessionSummary, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(summaryGetInputType(), typeConverter) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.L2VPNSessionSummary + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := summaryGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.l2vpn.sessions.summary", "get", inputDataValue, executionContext) + var emptyOutput model.L2VPNSessionSummary + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), summaryGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.L2VPNSessionSummary), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/vpn/l2vpn/sessions/SummaryTypes.go b/services/nsxt-mp/nsx/vpn/l2vpn/sessions/SummaryTypes.go new file mode 100644 index 000000000..31ac800a6 --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/l2vpn/sessions/SummaryTypes.go @@ -0,0 +1,74 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Summary. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package sessions + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Summary#get. +const Summary_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Summary#get. +const Summary_GET_SOURCE_CACHED = "cached" + +func summaryGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func summaryGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.L2VPNSessionSummaryBindingType) +} + +func summaryGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/l2vpn/sessions/summary", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +} diff --git a/services/nsxt-mp/nsx/vpn/services/ServicesPackageTypes.go b/services/nsxt-mp/nsx/vpn/services/ServicesPackageTypes.go new file mode 100644 index 000000000..adb52244e --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/services/ServicesPackageTypes.go @@ -0,0 +1,11 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for package: com.vmware.nsx.vpn.services. +// Includes binding types of a top level structures and enumerations. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services diff --git a/services/nsxt-mp/nsx/vpn/services/SummaryClient.go b/services/nsxt-mp/nsx/vpn/services/SummaryClient.go new file mode 100644 index 000000000..3d54b56af --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/services/SummaryClient.go @@ -0,0 +1,92 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Interface file for service: Summary +// Used by client-side stubs. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/lib/vapi/std/errors" + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/core" + "github.com/vmware/vsphere-automation-sdk-go/runtime/lib" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol/client" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" +) + +const _ = core.SupportedByRuntimeVersion1 + +type SummaryClient interface { + + // Cumulative statistics for one IKE service instance. Query parameter source supports only cached mode. + // + // @param serviceIdParam (required) + // @param sourceParam Data source type. (optional) + // @return com.vmware.nsx.model.IPSecVPNIKEServiceSummary + // @throws InvalidRequest Bad Request, Precondition Failed + // @throws Unauthorized Forbidden + // @throws ServiceUnavailable Service Unavailable + // @throws InternalServerError Internal Server Error + // @throws NotFound Not Found + Get(serviceIdParam string, sourceParam *string) (model.IPSecVPNIKEServiceSummary, error) +} + +type summaryClient struct { + connector client.Connector + interfaceDefinition core.InterfaceDefinition + errorsBindingMap map[string]bindings.BindingType +} + +func NewSummaryClient(connector client.Connector) *summaryClient { + interfaceIdentifier := core.NewInterfaceIdentifier("com.vmware.nsx.vpn.services.summary") + methodIdentifiers := map[string]core.MethodIdentifier{ + "get": core.NewMethodIdentifier(interfaceIdentifier, "get"), + } + interfaceDefinition := core.NewInterfaceDefinition(interfaceIdentifier, methodIdentifiers) + errorsBindingMap := make(map[string]bindings.BindingType) + + sIface := summaryClient{interfaceDefinition: interfaceDefinition, errorsBindingMap: errorsBindingMap, connector: connector} + return &sIface +} + +func (sIface *summaryClient) GetErrorBindingType(errorName string) bindings.BindingType { + if entry, ok := sIface.errorsBindingMap[errorName]; ok { + return entry + } + return errors.ERROR_BINDINGS_MAP[errorName] +} + +func (sIface *summaryClient) Get(serviceIdParam string, sourceParam *string) (model.IPSecVPNIKEServiceSummary, error) { + typeConverter := sIface.connector.TypeConverter() + executionContext := sIface.connector.NewExecutionContext() + sv := bindings.NewStructValueBuilder(summaryGetInputType(), typeConverter) + sv.AddStructField("ServiceId", serviceIdParam) + sv.AddStructField("Source", sourceParam) + inputDataValue, inputError := sv.GetStructValue() + if inputError != nil { + var emptyOutput model.IPSecVPNIKEServiceSummary + return emptyOutput, bindings.VAPIerrorsToError(inputError) + } + operationRestMetaData := summaryGetRestMetadata() + connectionMetadata := map[string]interface{}{lib.REST_METADATA: operationRestMetaData} + connectionMetadata["isStreamingResponse"] = false + sIface.connector.SetConnectionMetadata(connectionMetadata) + methodResult := sIface.connector.GetApiProvider().Invoke("com.vmware.nsx.vpn.services.summary", "get", inputDataValue, executionContext) + var emptyOutput model.IPSecVPNIKEServiceSummary + if methodResult.IsSuccess() { + output, errorInOutput := typeConverter.ConvertToGolang(methodResult.Output(), summaryGetOutputType()) + if errorInOutput != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInOutput) + } + return output.(model.IPSecVPNIKEServiceSummary), nil + } else { + methodError, errorInError := typeConverter.ConvertToGolang(methodResult.Error(), sIface.GetErrorBindingType(methodResult.Error().Name())) + if errorInError != nil { + return emptyOutput, bindings.VAPIerrorsToError(errorInError) + } + return emptyOutput, methodError.(error) + } +} diff --git a/services/nsxt-mp/nsx/vpn/services/SummaryTypes.go b/services/nsxt-mp/nsx/vpn/services/SummaryTypes.go new file mode 100644 index 000000000..a5532b4cc --- /dev/null +++ b/services/nsxt-mp/nsx/vpn/services/SummaryTypes.go @@ -0,0 +1,81 @@ +// Copyright © 2019-2021 VMware, Inc. All Rights Reserved. +// SPDX-License-Identifier: BSD-2-Clause + +// Auto generated code. DO NOT EDIT. + +// Data type definitions file for service: Summary. +// Includes binding types of a structures and enumerations defined in the service. +// Shared by client-side stubs and server-side skeletons to ensure type +// compatibility. + +package services + +import ( + "github.com/vmware/vsphere-automation-sdk-go/runtime/bindings" + "github.com/vmware/vsphere-automation-sdk-go/runtime/data" + "github.com/vmware/vsphere-automation-sdk-go/runtime/protocol" + "github.com/vmware/vsphere-automation-sdk-go/services/nsxt-mp/nsx/model" + "reflect" +) + +// Possible value for ``source`` of method Summary#get. +const Summary_GET_SOURCE_REALTIME = "realtime" + +// Possible value for ``source`` of method Summary#get. +const Summary_GET_SOURCE_CACHED = "cached" + +func summaryGetInputType() bindings.StructType { + fields := make(map[string]bindings.BindingType) + fieldNameMap := make(map[string]string) + fields["service_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["source"] = "Source" + var validators = []bindings.Validator{} + return bindings.NewStructType("operation-input", fields, reflect.TypeOf(data.StructValue{}), fieldNameMap, validators) +} + +func summaryGetOutputType() bindings.BindingType { + return bindings.NewReferenceType(model.IPSecVPNIKEServiceSummaryBindingType) +} + +func summaryGetRestMetadata() protocol.OperationRestMetadata { + fields := map[string]bindings.BindingType{} + fieldNameMap := map[string]string{} + paramsTypeMap := map[string]bindings.BindingType{} + pathParams := map[string]string{} + queryParams := map[string]string{} + headerParams := map[string]string{} + dispatchHeaderParams := map[string]string{} + bodyFieldsMap := map[string]string{} + fields["service_id"] = bindings.NewStringType() + fields["source"] = bindings.NewOptionalType(bindings.NewStringType()) + fieldNameMap["service_id"] = "ServiceId" + fieldNameMap["source"] = "Source" + paramsTypeMap["source"] = bindings.NewOptionalType(bindings.NewStringType()) + paramsTypeMap["service_id"] = bindings.NewStringType() + paramsTypeMap["serviceId"] = bindings.NewStringType() + pathParams["service_id"] = "serviceId" + queryParams["source"] = "source" + resultHeaders := map[string]string{} + errorHeaders := map[string]map[string]string{} + return protocol.NewOperationRestMetadata( + fields, + fieldNameMap, + paramsTypeMap, + pathParams, + queryParams, + headerParams, + dispatchHeaderParams, + bodyFieldsMap, + "", + "", + "GET", + "/api/v1/vpn/services/nsxt-mp/{serviceId}/summary", + "", + resultHeaders, + 200, + "", + errorHeaders, + map[string]int{"com.vmware.vapi.std.errors.invalid_request": 400, "com.vmware.vapi.std.errors.unauthorized": 403, "com.vmware.vapi.std.errors.service_unavailable": 503, "com.vmware.vapi.std.errors.internal_server_error": 500, "com.vmware.vapi.std.errors.not_found": 404}) +}